diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 59cc1a5..133c002 100644 Binary files a/app/HGProductionTool/ProductionTool_zh_CN.qm and b/app/HGProductionTool/ProductionTool_zh_CN.qm differ diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index 63b6fa1..514a41a 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -509,17 +509,17 @@ - + NO - + OK 确定 - + Cancel 取消 @@ -1649,65 +1649,75 @@ 用户 - + + menu_about + 信息 + + + act_newDevice 新建项目 - + act_manage 账户管理 - + act_changePwd 修改密码 - + act_export 导出 - + act_logOut 登出 - + Ctrl+Q - + act_close 退出 - + act_upload 上传配置文件 - + act_refreshDevice 刷新设备列表 - + act_openLog 查看日志 - + Ctrl+L - + act_setLogPath + + + act_about + 关于... + Account login elsewhere 账户在其他地方登录 @@ -1726,40 +1736,55 @@ - - - - + + + + tips 提示 - + production tool-burn station 华高生产工具-烧录工位 - + production tool-init test station 华高生产工具-初检工位 - + production tool-image test station 华高生产工具-图像测试工位 - + production tool-pressure test station 华高生产工具-压力测试工位 - - + + Is testing, do not close! 测试中,请勿关闭! + + + about %1 + 关于 %1 + + + + Production tool + 华高生产工具 + + + + <p>DriverVer: %1</p> + <p>版本号: %1</p> + warning 警告 @@ -1778,8 +1803,8 @@ 取消 - - + + cannot create more table 不能创建更多项目 diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index 4c044c8..4a243ce 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -3,6 +3,7 @@ #include #include #include "base/HGBase.h" +#include "huagao/brand.h" #include "HGUIGlobal.h" #include "app_cfg.h" #include "dialog_login.h" @@ -741,3 +742,69 @@ void MainWindow::on_act_openLog_triggered() QString strFilePath = "file:///" + pathDir; QDesktopServices::openUrl(QUrl(strFilePath)); } + +static bool isLeap(int year) +{ + if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) + return true; + return false; +} + +static int getDays(int year, int month) +{ + if (2 == month) + { + if (isLeap(year)) + return 29; + else + return 28; + } + + if (4 == month || 6 == month || 9 == month || 11 == month) + { + return 30; + } + + return 31; +} + +static int getPatchVersion() +{ + const char *buildDate = __DATE__; + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "buildDate: %s", buildDate); + QDate date = QLocale(QLocale::English).toDate(QString(buildDate).replace(" ", " 0"), "MMM dd yyyy"); + int year = date.year(); + int day = date.day(); + int month = date.month(); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "buildDate: %d %d %d", year, month, day); + + int ret = year % 100; + ret *= 1000; + + for (int i = 1; i < month; ++i) + { + ret += getDays(year, i); + } + + ret += day; + return ret; +} + +void MainWindow::on_act_about_triggered() +{ + int mainVersion = VERSION_MAIN; + int subVersion = VERSION_SUB; + int buildVersion = 10000; + int patchVersion = 0; + + patchVersion = getPatchVersion(); + + HGChar version[32] = { 0 }; + sprintf(version, "%d.%d.%d.%d", mainVersion, subVersion, buildVersion, patchVersion); + + QString title = tr("about %1").arg(tr("Production tool")); + QString content; + content += tr("

DriverVer: %1

").arg(QString::fromLocal8Bit(version)); + + QMessageBox::about(this, title, content); +} diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h index 09f4298..5b82bb4 100644 --- a/app/HGProductionTool/mainwindow.h +++ b/app/HGProductionTool/mainwindow.h @@ -85,6 +85,8 @@ private slots: void on_act_openLog_triggered(); + void on_act_about_triggered(); + private: QSplitter *m_top_splitter; QSplitter *m_bot_splitter; diff --git a/app/HGProductionTool/mainwindow.ui b/app/HGProductionTool/mainwindow.ui index 5bd2765..198b069 100644 --- a/app/HGProductionTool/mainwindow.ui +++ b/app/HGProductionTool/mainwindow.ui @@ -46,8 +46,15 @@ + + + menu_about + + + + @@ -106,6 +113,11 @@ act_setLogPath + + + act_about + +