Skip to content

Commit a2980cd

Browse files
committed
Fixed translation mechanism and added a 1024x1024 icon for Mac OS
1 parent e180f68 commit a2980cd

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed
204 KB
Loading

Dynamix_chart_width_control_GUI/maingui.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ MainGUI::MainGUI(QWidget* parent) :
1919
ui(new Ui::MainGUI)
2020
{
2121
ui->setupUi(this);
22+
//load translators
23+
cn_trans.load(":/translations/DNX_widthGUI_zh_CN.qm");
24+
en_trans.load(":/translations/DNX_widthGUI_en_en.qm");
2225
translate_en();
2326
//connect the slider to the spinbox
2427
connect(ui->horizontalSlider, SIGNAL(sliderMoved(int)), this, SLOT(change_multiplier(int)));
@@ -31,6 +34,8 @@ MainGUI::MainGUI(QWidget* parent) :
3134
connect(ui->active_randomizer1, SIGNAL(clicked()), this, SLOT(activate_multiplier()));
3235
connect(ui->active_randomizer2, SIGNAL(clicked()), this, SLOT(activate_multiplier()));
3336
ui->label_7->setFont(QFont(customfont, 18, 300));
37+
38+
3439
}
3540

3641
//retranslate texts
@@ -44,8 +49,6 @@ void MainGUI::retranslate_text() {
4449

4550
//translate to Chinese
4651
void MainGUI::translate_cn() {
47-
QTranslator cn_trans;
48-
cn_trans.load(":/translations/DNX_widthGUI_zh_CN.qm");
4952
QString tmptext = ui->loaded_file->text();
5053
if (!qApp->installTranslator(&cn_trans)) {
5154
QMessageBox::critical(this, "Error", "Translation not found");
@@ -60,8 +63,6 @@ void MainGUI::translate_cn() {
6063

6164
//translate to English
6265
void MainGUI::translate_en() {
63-
QTranslator en_trans;
64-
en_trans.load(":/translations/DNX_widthGUI_en_en.qm");
6566
QString tmptext = ui->loaded_file->text();
6667
if (!qApp->installTranslator(&en_trans)) {
6768
QMessageBox::critical(this, "Error", "Translation not found");

Dynamix_chart_width_control_GUI/maingui.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ private slots:
4646
Ui::MainGUI* ui;
4747
HintDlg* dlg;
4848
void retranslate_text();
49+
//translators
50+
QTranslator cn_trans;//Chinese
51+
QTranslator en_trans;//English
4952
//translation strings;
5053
QString trans_1;//"Hint"
5154
QString trans_2;//"This chart has Hold-Sub mismatch problems, and they have been automatically fixed."

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* The header that specifies the program version.
44
*
55
* */
6-
#define VERSION_H "v1.2.26"
6+
#define VERSION_H "v1.2.27"
77

88
#endif

0 commit comments

Comments
 (0)