Commit a6492fbecf3a875ebf6e7201d0113f7150a9fe19
1 parent
982cac1614
Exists in
master
and in
2 other branches
오븐 정보 다이얼로그 수정
- 버전 정보 출력 기능 수정 : define.h 사용
Showing
5 changed files
with
23 additions
and
8 deletions
Show diff stats
app/gui/oven_control/configinfodlg.cpp
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | #include "ui_configinfodlg.h" | 5 | #include "ui_configinfodlg.h" |
| 6 | #include "soundplayer.h" | 6 | #include "soundplayer.h" |
| 7 | #include "config.h" | 7 | #include "config.h" |
| 8 | +#include "define.h" | ||
| 8 | 9 | ||
| 9 | 10 | ||
| 10 | 11 | ||
| @@ -74,11 +75,15 @@ bool ConfigInfoDlg::readFromInfoFile(QMap<QString, QString> &info_map, const QSt | @@ -74,11 +75,15 @@ bool ConfigInfoDlg::readFromInfoFile(QMap<QString, QString> &info_map, const QSt | ||
| 74 | qDebug() << "orgin size " << info_map.size(); | 75 | qDebug() << "orgin size " << info_map.size(); |
| 75 | if(file.open(QIODevice::ReadOnly | QIODevice::Text)){ | 76 | if(file.open(QIODevice::ReadOnly | QIODevice::Text)){ |
| 76 | while(!file.atEnd()){ | 77 | while(!file.atEnd()){ |
| 77 | - QString line = QString::fromUtf8(file.readLine()); | 78 | + QString line = (QString::fromUtf8(file.readLine())).remove(QChar('\n')); |
| 78 | info_map[line.section(',',0,0)] = line.section(',',1,1); | 79 | info_map[line.section(',',0,0)] = line.section(',',1,1); |
| 79 | } | 80 | } |
| 80 | qDebug() << file.fileName() << "read OK!"; | 81 | qDebug() << file.fileName() << "read OK!"; |
| 81 | qDebug() << "final size " << info_map.size(); | 82 | qDebug() << "final size " << info_map.size(); |
| 83 | + QList<QString> list = info_map.keys(); | ||
| 84 | + for(int i=0; i< info_map.size() ;i++){ | ||
| 85 | + qDebug() << list[i] << info_map[list[i]]; | ||
| 86 | + } | ||
| 82 | return true; | 87 | return true; |
| 83 | } | 88 | } |
| 84 | else { | 89 | else { |
| @@ -87,6 +92,13 @@ bool ConfigInfoDlg::readFromInfoFile(QMap<QString, QString> &info_map, const QSt | @@ -87,6 +92,13 @@ bool ConfigInfoDlg::readFromInfoFile(QMap<QString, QString> &info_map, const QSt | ||
| 87 | return false; | 92 | return false; |
| 88 | } | 93 | } |
| 89 | 94 | ||
| 95 | +QString ConfigInfoDlg::getSoftwareVerString() | ||
| 96 | +{ | ||
| 97 | + if(MAJOR_VER == 0) | ||
| 98 | + return QString("V%1.%2.%3 BETA").arg(MAJOR_VER).arg(MINOR_VER).arg(HOTFIX_VER); | ||
| 99 | + else return QString("V%1.%2.%3").arg(MAJOR_VER).arg(MINOR_VER).arg(HOTFIX_VER); | ||
| 100 | +} | ||
| 101 | + | ||
| 90 | 102 | ||
| 91 | void ConfigInfoDlg::loadSoftwareInfo(){ | 103 | void ConfigInfoDlg::loadSoftwareInfo(){ |
| 92 | Config* cfg = Config::getInstance(); | 104 | Config* cfg = Config::getInstance(); |
| @@ -102,14 +114,14 @@ void ConfigInfoDlg::loadSoftwareInfo(){ | @@ -102,14 +114,14 @@ void ConfigInfoDlg::loadSoftwareInfo(){ | ||
| 102 | mapInfos[tr("제조국")] = "Korea"; | 114 | mapInfos[tr("제조국")] = "Korea"; |
| 103 | mapInfos[tr("제조사")] = "프라임"; | 115 | mapInfos[tr("제조사")] = "프라임"; |
| 104 | mapInfos[tr("제품번호")] = "01"; | 116 | mapInfos[tr("제품번호")] = "01"; |
| 105 | - mapInfos[tr("소프트웨어 버전")] ="0.1 BETA"; | ||
| 106 | - | 117 | + mapInfos[tr("소프트웨어 버전")] = getSoftwareVerString(); |
| 107 | mapInfos[tr("현재모델")] = tr(g_strModelTypeName[cfg->getConfigValue(Define::config_model).d32]); | 118 | mapInfos[tr("현재모델")] = tr(g_strModelTypeName[cfg->getConfigValue(Define::config_model).d32]); |
| 108 | 119 | ||
| 109 | readFromInfoFile(mapInfos, QString(MODEL_INFO_FILE_NAME)); | 120 | readFromInfoFile(mapInfos, QString(MODEL_INFO_FILE_NAME)); |
| 110 | 121 | ||
| 111 | for(int i =0;i<MAX_SOFTWARE_INFO_CNT;i++){ | 122 | for(int i =0;i<MAX_SOFTWARE_INFO_CNT;i++){ |
| 112 | strTemp = mapInfos[tr(software_item_name[i])]; | 123 | strTemp = mapInfos[tr(software_item_name[i])]; |
| 124 | + | ||
| 113 | label = new QLabel(this); | 125 | label = new QLabel(this); |
| 114 | label ->setText(tr(software_item_name[i]).append(" :")); | 126 | label ->setText(tr(software_item_name[i]).append(" :")); |
| 115 | ui->gridLayout_info->addWidget(label,i,0); | 127 | ui->gridLayout_info->addWidget(label,i,0); |
app/gui/oven_control/configinfodlg.h
| @@ -32,6 +32,7 @@ protected: | @@ -32,6 +32,7 @@ protected: | ||
| 32 | void keyPressEvent(QKeyEvent* event); | 32 | void keyPressEvent(QKeyEvent* event); |
| 33 | 33 | ||
| 34 | bool readFromInfoFile(QMap<QString , QString> &info_map, const QString &filename); | 34 | bool readFromInfoFile(QMap<QString , QString> &info_map, const QString &filename); |
| 35 | + QString getSoftwareVerString(void); | ||
| 35 | 36 | ||
| 36 | private: | 37 | private: |
| 37 | Ui::ConfigInfoDlg *ui; | 38 | Ui::ConfigInfoDlg *ui; |
app/gui/oven_control/define.h
app/gui/oven_control/lang_en.qm
No preview for this file type
app/gui/oven_control/lang_en.ts
| @@ -457,7 +457,7 @@ to factory setting values?</translation> | @@ -457,7 +457,7 @@ to factory setting values?</translation> | ||
| 457 | <message> | 457 | <message> |
| 458 | <location filename="config.h" line="95"/> | 458 | <location filename="config.h" line="95"/> |
| 459 | <source>제조일자</source> | 459 | <source>제조일자</source> |
| 460 | - <translation>Date of Manufacturing </translation> | 460 | + <translation>Date of Manufacturing</translation> |
| 461 | </message> | 461 | </message> |
| 462 | <message> | 462 | <message> |
| 463 | <location filename="config.h" line="96"/> | 463 | <location filename="config.h" line="96"/> |
| @@ -1066,9 +1066,7 @@ Value</translation> | @@ -1066,9 +1066,7 @@ Value</translation> | ||
| 1066 | <message> | 1066 | <message> |
| 1067 | <location filename="configinfodlg.ui" line="144"/> | 1067 | <location filename="configinfodlg.ui" line="144"/> |
| 1068 | <source>확인</source> | 1068 | <source>확인</source> |
| 1069 | - <translation>Confirm | ||
| 1070 | - | ||
| 1071 | -Confirm</translation> | 1069 | + <translation>Confirm</translation> |
| 1072 | </message> | 1070 | </message> |
| 1073 | <message> | 1071 | <message> |
| 1074 | <location filename="configinfodlg.cpp" line="12"/> | 1072 | <location filename="configinfodlg.cpp" line="12"/> |
| @@ -1138,7 +1136,7 @@ Confirm</translation> | @@ -1138,7 +1136,7 @@ Confirm</translation> | ||
| 1138 | <message> | 1136 | <message> |
| 1139 | <location filename="configinfodlg.cpp" line="101"/> | 1137 | <location filename="configinfodlg.cpp" line="101"/> |
| 1140 | <source>제조일자</source> | 1138 | <source>제조일자</source> |
| 1141 | - <translation>Date of Manufacturing </translation> | 1139 | + <translation>Date of Manufacturing</translation> |
| 1142 | </message> | 1140 | </message> |
| 1143 | <message> | 1141 | <message> |
| 1144 | <location filename="configinfodlg.cpp" line="102"/> | 1142 | <location filename="configinfodlg.cpp" line="102"/> |