temp
This commit is contained in:
@@ -35,6 +35,11 @@ file(GLOB project_uis ./src/*.ui)
|
|||||||
qt5_wrap_ui(ui_FILES ${project_uis})
|
qt5_wrap_ui(ui_FILES ${project_uis})
|
||||||
file(GLOB project_res ./src/*.qrc)
|
file(GLOB project_res ./src/*.qrc)
|
||||||
|
|
||||||
|
set(TS_FILES
|
||||||
|
./src/translations/en_US.ts
|
||||||
|
./src/translations/zh_CN.ts)
|
||||||
|
find_package(Qt5 COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED)
|
||||||
|
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
||||||
set(TS_FILES
|
set(TS_FILES
|
||||||
./src/translations/en_US.ts
|
./src/translations/en_US.ts
|
||||||
./src/translations/zh_CN.ts)
|
./src/translations/zh_CN.ts)
|
||||||
@@ -45,6 +50,7 @@ set(cpp_source_all ${project_headers} ${project_cpps} ${project_cxx} ${project_r
|
|||||||
qt5_create_translation(QM_FILES ${cpp_source_all} ${TS_FILES})
|
qt5_create_translation(QM_FILES ${cpp_source_all} ${TS_FILES})
|
||||||
add_executable(${PROJECT_NAME} ${cpp_source_all} ${ui_FILES} ${QM_FILES} )
|
add_executable(${PROJECT_NAME} ${cpp_source_all} ${ui_FILES} ${QM_FILES} )
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES} )
|
||||||
if(UNIX AND USE_SHIMLIB)
|
if(UNIX AND USE_SHIMLIB)
|
||||||
link_directories(/usr/local/lib64)
|
link_directories(/usr/local/lib64)
|
||||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "generalform.h"
|
#include "generalform.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@@ -21,7 +22,9 @@ GeneralForm::GeneralForm(QWidget* parent) : QWidget(parent)
|
|||||||
layout->addWidget(lanHeader);
|
layout->addWidget(lanHeader);
|
||||||
|
|
||||||
QHBoxLayout* lanHeaderLayout = new QHBoxLayout(lanHeader);
|
QHBoxLayout* lanHeaderLayout = new QHBoxLayout(lanHeader);
|
||||||
lanHeaderLayout->addWidget(new QLabel(tr("Language")));
|
lbl_lan = new QLabel(tr("Language"));
|
||||||
|
lanHeaderLayout->addWidget(lbl_lan);
|
||||||
|
|
||||||
QPushButton* btnLan = new QPushButton(lanHeader);
|
QPushButton* btnLan = new QPushButton(lanHeader);
|
||||||
lanHeaderLayout->addWidget(btnLan);
|
lanHeaderLayout->addWidget(btnLan);
|
||||||
lanHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
lanHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||||
@@ -101,8 +104,15 @@ void GeneralForm::changeEvent(QEvent* event)
|
|||||||
{
|
{
|
||||||
if (event->type() == QEvent::LanguageChange)
|
if (event->type() == QEvent::LanguageChange)
|
||||||
{
|
{
|
||||||
qDebug() << "change language";
|
//this->retranslateUi();
|
||||||
|
lbl_lan->setText(tr("Language"));
|
||||||
}
|
}
|
||||||
QWidget::changeEvent(event);
|
}
|
||||||
}
|
|
||||||
|
void GeneralForm::retranslateUi()
|
||||||
|
{
|
||||||
|
|
||||||
|
//lbl_lan->setText(QApplication::translate("GeneralForm", "Language", nullptr));
|
||||||
|
lbl_lan->setText(tr("Language"));
|
||||||
|
|
||||||
|
} // retranslateUi
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
class SelectDialog;
|
class SelectDialog;
|
||||||
|
class QLabel;
|
||||||
|
|
||||||
class GeneralForm : public QWidget
|
class GeneralForm : public QWidget
|
||||||
{
|
{
|
||||||
@@ -19,8 +20,11 @@ protected:
|
|||||||
void changeEvent(QEvent* event);
|
void changeEvent(QEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void retranslateUi();
|
||||||
QVBoxLayout* layout = nullptr;
|
QVBoxLayout* layout = nullptr;
|
||||||
SelectDialog* dialog = nullptr;
|
SelectDialog* dialog = nullptr;
|
||||||
|
|
||||||
|
QLabel* lbl_lan = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GENERALFORM_H
|
#endif // GENERALFORM_H
|
||||||
@@ -12,15 +12,15 @@ GetIPDialog::GetIPDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBaseDialog
|
|||||||
|
|
||||||
setWindowModality(Qt::WindowModal);
|
setWindowModality(Qt::WindowModal);
|
||||||
QFormLayout* form = new QFormLayout(formWidget);
|
QFormLayout* form = new QFormLayout(formWidget);
|
||||||
QString value1 = QString("IP Address");
|
QString value1 = QString(tr("IP Address"));
|
||||||
_ip = new QLineEdit(this);
|
_ip = new QLineEdit(this);
|
||||||
form->addRow(value1, _ip);
|
form->addRow(value1, _ip);
|
||||||
QString value2 = QString("Netmask");
|
QString value2 = QString(tr("Netmask"));
|
||||||
_mask = new QLineEdit(this);
|
_mask = new QLineEdit(this);
|
||||||
form->addRow(value2, _mask);
|
form->addRow(value2, _mask);
|
||||||
|
|
||||||
lbl_error = new QLabel(this);
|
lbl_error = new QLabel(this);
|
||||||
lbl_error->setObjectName("warn");
|
lbl_error->setObjectName(tr("warn"));
|
||||||
form->addRow("", lbl_error);
|
form->addRow("", lbl_error);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ GetRouteDialog::GetRouteDialog(QWidget* parent, Qt::WindowFlags f) : GUIFormBase
|
|||||||
|
|
||||||
setWindowModality(Qt::WindowModal);
|
setWindowModality(Qt::WindowModal);
|
||||||
QFormLayout* form = new QFormLayout(formWidget);
|
QFormLayout* form = new QFormLayout(formWidget);
|
||||||
QString value1 = QString("Destination");
|
QString value1 = QString(tr("Destination"));
|
||||||
_des = new QLineEdit(this);
|
_des = new QLineEdit(this);
|
||||||
form->addRow(value1, _des);
|
form->addRow(value1, _des);
|
||||||
QString value2 = QString("Netmask");
|
QString value2 = QString(tr("Netmask"));
|
||||||
_mask = new QLineEdit(this);
|
_mask = new QLineEdit(this);
|
||||||
form->addRow(value2, _mask);
|
form->addRow(value2, _mask);
|
||||||
QString value3 = QString("Gateway");
|
QString value3 = QString(tr("Gateway"));
|
||||||
_gw = new QLineEdit(this);
|
_gw = new QLineEdit(this);
|
||||||
form->addRow(value3, _gw);
|
form->addRow(value3, _gw);
|
||||||
|
|
||||||
|
|||||||
@@ -185,3 +185,11 @@ void systemSettingForm::saveServersInfo()
|
|||||||
//qIfConfig(lhost);
|
//qIfConfig(lhost);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void systemSettingForm::changeEvent(QEvent* event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::LanguageChange)
|
||||||
|
{
|
||||||
|
ui->retranslateUi(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,9 @@ public:
|
|||||||
explicit systemSettingForm(QWidget *parent = nullptr);
|
explicit systemSettingForm(QWidget *parent = nullptr);
|
||||||
~systemSettingForm();
|
~systemSettingForm();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void changeEvent(QEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::systemSettingForm *ui;
|
Ui::systemSettingForm *ui;
|
||||||
SelectDialog* sd_protocal = nullptr;
|
SelectDialog* sd_protocal = nullptr;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>527</width>
|
<width>619</width>
|
||||||
<height>612</height>
|
<height>612</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user