From 2ddb05828aa84d628c44e03d3fefd79f1f8c5d20 Mon Sep 17 00:00:00 2001 From: byloveletter Date: Mon, 10 Jul 2017 17:35:46 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A4=EA=B5=AD=EC=96=B4=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 부팅시 다국어 처리 --- app/gui/oven_control/config.cpp | 20 ++++++++++++++++++++ app/gui/oven_control/config.h | 1 + app/gui/oven_control/configlanguagedlg.cpp | 4 +++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp index 7ab22b0..d70b4aa 100644 --- a/app/gui/oven_control/config.cpp +++ b/app/gui/oven_control/config.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "config.h" #include "configdatetimedlg.h" #include "configlanguagedlg.h" @@ -38,6 +39,7 @@ Config::Config(QObject *parent) : QObject(parent) loadConfig(); loadFavorite(); qApp->installEventFilter(&watcher); + applyCurrentConfigLanguage(); applyConfig(); @@ -439,6 +441,24 @@ QString Config::getProductSerial() return strProductSerial; } +void Config::applyCurrentConfigLanguage() +{ + if(configlist.items.language.d32 == 0){ +// QApplication::removeTranslator(); +// QTranslator* trans = new QTranslator(); +// qDebug() << trans->load(":/lang_en.qm"); +// QApplication::removeTranslator(QApplication::) + } + else if(configlist.items.language.d32 ==2){ + QTranslator* trans = new QTranslator(); + qDebug() << trans->load(":/lang_en.qm"); + QApplication::installTranslator(trans); + } + else if(configlist.items.language.d32 == 2){ + //QTranslator *tr + } +} + void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ QDialog *dlg; QString usbPath = ""; diff --git a/app/gui/oven_control/config.h b/app/gui/oven_control/config.h index 1238cf8..7ed1027 100644 --- a/app/gui/oven_control/config.h +++ b/app/gui/oven_control/config.h @@ -439,6 +439,7 @@ public: void insertFavorite(Define::ConfigType idx); void removeFavorite(Define::ConfigType idx); QString getProductSerial(); + void applyCurrentConfigLanguage(); diff --git a/app/gui/oven_control/configlanguagedlg.cpp b/app/gui/oven_control/configlanguagedlg.cpp index 8eebc85..a2cc3fd 100644 --- a/app/gui/oven_control/configlanguagedlg.cpp +++ b/app/gui/oven_control/configlanguagedlg.cpp @@ -1,3 +1,4 @@ +#include #include "config.h" #include "configlanguagedlg.h" #include "ui_configlanguagedlg.h" @@ -27,7 +28,7 @@ ConfigLanguageDlg::ConfigLanguageDlg(QWidget *parent) : Config *cfg = Config::getInstance(); config_item item; - cfg->getConfigValue(config_language); + item = cfg->getConfigValue(config_language); m_nCurSelLang = item.d32; m_pSignalMapper = new QSignalMapper(this); @@ -74,6 +75,7 @@ void ConfigLanguageDlg::onConfigBtnClicked(const int sel){ } void ConfigLanguageDlg::reloadUi(){ + qDebug() << "Set Lang checked " << m_nCurSelLang; switch(m_nCurSelLang){ case 0: ui->pushButton_1->setChecked(true); -- 2.1.4