diff --git a/product/src/sys/sys_startup/AutoStart.cpp b/product/src/sys/sys_startup/AutoStart.cpp index f9535540..55031749 100644 --- a/product/src/sys/sys_startup/AutoStart.cpp +++ b/product/src/sys/sys_startup/AutoStart.cpp @@ -1,6 +1,6 @@ #include "AutoStart.h" #include "ui_AutoStart.h" - +#include "pub_utility_api/I18N.h" AutoStart::AutoStart(bool hmiAuto, bool sysAuto, QWidget *parent) : QDialog(parent), ui(new Ui::AutoStart) @@ -18,7 +18,19 @@ AutoStart::AutoStart(bool hmiAuto, bool sysAuto, QWidget *parent) : { ui->hmiCheckBox->setEnabled(false); } - setWindowTitle(tr("自启动设置")); + QButtonGroup *buttonGroup = new QButtonGroup(this); + buttonGroup->setExclusive(true); // 设置为互斥模式 + + // 将复选框添加到按钮组 + buttonGroup->addButton(ui->checkBox); + buttonGroup->addButton(ui->checkBox_2); + const std::string strLanguage = std::move( iot_public::getCurLanguage()); + if(strLanguage =="zh") + { + ui->checkBox->setChecked(true); + }else + ui->checkBox_2->setChecked(true); + setWindowTitle(tr("系统设置")); } AutoStart::~AutoStart() @@ -41,6 +53,10 @@ bool AutoStart::isSysAutoStart() return ui->sysCheckBox->isChecked(); } +bool AutoStart::isZh() +{ + return ui->checkBox->isChecked(); +} void AutoStart::showEvent(QShowEvent *) { ui->sysCheckBox->setChecked(m_sysAuto); diff --git a/product/src/sys/sys_startup/AutoStart.h b/product/src/sys/sys_startup/AutoStart.h index 4ac77706..a32ca6e1 100644 --- a/product/src/sys/sys_startup/AutoStart.h +++ b/product/src/sys/sys_startup/AutoStart.h @@ -17,6 +17,7 @@ public: void init(); bool isHmiAutoStart(); bool isSysAutoStart(); + bool isZh(); protected: void showEvent(QShowEvent *) override; diff --git a/product/src/sys/sys_startup/AutoStart.ui b/product/src/sys/sys_startup/AutoStart.ui index c7c5d94d..f8617003 100644 --- a/product/src/sys/sys_startup/AutoStart.ui +++ b/product/src/sys/sys_startup/AutoStart.ui @@ -7,26 +7,26 @@ 0 0 234 - 166 + 217 234 - 166 + 217 234 - 166 + 217 Dialog - + :/auto_start.ico:/auto_start.ico @@ -54,28 +54,94 @@ - - - - Qt::LeftToRight - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - true - - + + + + + + + 系统语言 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + 中文 + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + 英文 + + + + + + + Qt::Horizontal + + + + 70 + 20 + + + + + + + + + Qt::LeftToRight + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + - + + + buttonBox diff --git a/product/src/sys/sys_startup/ButtonForm.cpp b/product/src/sys/sys_startup/ButtonForm.cpp index 9915505d..152af152 100644 --- a/product/src/sys/sys_startup/ButtonForm.cpp +++ b/product/src/sys/sys_startup/ButtonForm.cpp @@ -19,7 +19,8 @@ #include #include "pub_utility_api/FileUtil.h" #include "../include/sys/sys_login_api/CLoginDlg.h" - +#include +#include using namespace sys_startup; ButtonForm::ButtonForm(int mode,bool isZh, QWidget *parent): @@ -28,6 +29,7 @@ ButtonForm::ButtonForm(int mode,bool isZh, QWidget *parent): m_mode(mode), m_bIsZh(isZh) { + ui->setupUi(this); } @@ -74,7 +76,7 @@ void ButtonForm::addToolButtons(QVector &buttonVec) //toolBtn->setIcon(icon); toolBtn->setText(m_bIsZh?buttonInfo.m_zh:buttonInfo.m_en); #ifdef Q_PROCESSOR_ARM_64 - toolBtn->setEnabled(buttonInfo.m_enable); + toolBtn->setEnabled(buttonInfo.m_enable); #endif connect(toolBtn,&QToolButton::clicked,[=](){ executeTask(buttonInfo.m_cmd,buttonInfo.m_param); @@ -228,6 +230,61 @@ void ButtonForm::autoStartDlg() { setHmiAuto(!isHmi,text); } + QString language ="en"; + if(dlg->isZh()) + { + language ="zh"; + } + const std::string strCurDir = iot_public::CFileUtil::getCurModuleDir(); + + std::string objFullPath = strCurDir; + objFullPath = objFullPath+"/../../" + "platform" + "/common/sysconfig/language.xml"; + + qDebug()< HMI 开机自启动 HMI auto start + + + + 系统语言 + System language + + + + 中文 + Chinese + + + + 英文 + English @@ -148,8 +163,8 @@ - 自启动设置 - Auto start setting + 系统设置 + System setting