Skip to content

Commit a65ac59

Browse files
committed
- Some more fixes for the translations.
- Added the missing Q_OBJECT macro. - Removed stupid Qt default buttons as they are not translated. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11682 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 06d9d9a commit a65ac59

File tree

10 files changed

+105
-96
lines changed

10 files changed

+105
-96
lines changed

OMEdit/OMEditGUI/Helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
class Helper : public QObject
4343
{
44+
Q_OBJECT
4445
public:
4546
static void initHelperVariables();
4647
/* Global non-translated variables */
@@ -177,6 +178,7 @@ class Helper : public QObject
177178

178179
class GUIMessages : public QObject
179180
{
181+
Q_OBJECT
180182
public:
181183
enum MessagesTypes
182184
{

OMEdit/OMEditGUI/InteractiveSimulationTabWidget.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ bool InteractiveSimulationTab::checkVariablesSelected()
692692

693693
QMessageBox::information(mpParentInteractiveSimulationTabWidget->getParentMainWindow(),
694694
QString(Helper::applicationName).append(" - ").append(Helper::information),
695-
GUIMessages::getMessage(GUIMessages::SELECT_VARIABLE_FOR_OMI), "OK");
695+
GUIMessages::getMessage(GUIMessages::SELECT_VARIABLE_FOR_OMI), Helper::ok);
696696

697697
return false;
698698
}
@@ -926,19 +926,22 @@ void InteractiveSimulationTabWidget::closeInetractiveSimulationTab(int index, bo
926926
msgBox->setIcon(QMessageBox::Information);
927927
msgBox->setText(QString(GUIMessages::getMessage(GUIMessages::CLOSE_INTERACTIVE_SIMULATION_TAB)).arg(pInteractiveSimualtion->getName()));
928928
msgBox->setInformativeText(QString(GUIMessages::getMessage(GUIMessages::INFO_CLOSE_INTERACTIVE_SIMULATION_TAB)));
929-
msgBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
930-
msgBox->setDefaultButton(QMessageBox::Yes);
929+
QPushButton *pOkButton = new QPushButton(Helper::ok);
930+
QPushButton *pCancelButton = new QPushButton(Helper::cancel);
931+
msgBox->addButton(pOkButton, QMessageBox::AcceptRole);
932+
msgBox->addButton(pCancelButton, QMessageBox::RejectRole);
933+
msgBox->setDefaultButton(pOkButton);
931934

932935
int answer = msgBox->exec();
933936

934937
switch (answer)
935938
{
936-
case QMessageBox::Yes:
939+
case QMessageBox::AcceptRole:
937940
// Yes was clicked
938941
removeTab(index);
939942
delete pInteractiveSimualtion;
940943
break;
941-
case QMessageBox::No:
944+
case QMessageBox::RejectRole:
942945
// No was clicked
943946
break;
944947
default:

OMEdit/OMEditGUI/LibraryWidget.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,17 +396,20 @@ bool ModelicaTree::deleteNodeTriggered(ModelicaTreeNode *node, bool askQuestion,
396396
msgBox->setWindowTitle(QString(Helper::applicationName).append(" - ").append(Helper::question));
397397
msgBox->setIcon(QMessageBox::Question);
398398
msgBox->setText(msg);
399-
msgBox->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
400-
msgBox->setDefaultButton(QMessageBox::Yes);
399+
QPushButton *pOkButton = new QPushButton(Helper::ok);
400+
QPushButton *pCancelButton = new QPushButton(Helper::cancel);
401+
msgBox->addButton(pOkButton, QMessageBox::AcceptRole);
402+
msgBox->addButton(pCancelButton, QMessageBox::RejectRole);
403+
msgBox->setDefaultButton(pOkButton);
401404

402405
int answer = msgBox->exec();
403406

404407
switch (answer)
405408
{
406-
case QMessageBox::Yes:
409+
case QMessageBox::AcceptRole:
407410
// Yes was clicked. Don't return.
408411
break;
409-
case QMessageBox::No:
412+
case QMessageBox::RejectRole:
410413
// No was clicked
411414
return false;
412415
default:

OMEdit/OMEditGUI/ModelicaEditor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ void ModelicaEditor::findText(const QString &text, bool forward)
184184

185185
if (!found)
186186
{
187-
QMessageBox::information(mpParentProjectTab->mpParentProjectTabWidget->mpParentMainWindow, Helper::applicationName + " - Information",
188-
GUIMessages::getMessage(GUIMessages::SEARCH_STRING_NOT_FOUND).arg(text), "OK");
187+
QMessageBox::information(mpParentProjectTab->mpParentProjectTabWidget->mpParentMainWindow,
188+
QString(Helper::applicationName).append(" - ").append(Helper::information),
189+
GUIMessages::getMessage(GUIMessages::SEARCH_STRING_NOT_FOUND).arg(text), Helper::ok);
189190
}
190191
}
191192

OMEdit/OMEditGUI/OMEdit_de.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -402,20 +402,20 @@ This is probably wrong because the component is decalred as %3.</oldsource>
402402
<context>
403403
<name>GotoLineWidget</name>
404404
<message>
405-
<location filename="ModelicaEditor.cpp" line="626"/>
405+
<location filename="ModelicaEditor.cpp" line="627"/>
406406
<source>Go to Line</source>
407407
<translation type="unfinished"></translation>
408408
</message>
409409
<message>
410-
<location filename="ModelicaEditor.cpp" line="647"/>
410+
<location filename="ModelicaEditor.cpp" line="648"/>
411411
<source>Enter line number (1 to </source>
412412
<translation type="unfinished"></translation>
413413
</message>
414414
</context>
415415
<context>
416416
<name>GraphicsView</name>
417417
<message>
418-
<location filename="ProjectTabWidget.cpp" line="937"/>
418+
<location filename="ProjectTabWidget.cpp" line="933"/>
419419
<source>Cancel Connection</source>
420420
<translation type="unfinished"></translation>
421421
</message>
@@ -475,12 +475,12 @@ This is probably wrong because the component is decalred as %3.</oldsource>
475475
<translation type="unfinished"></translation>
476476
</message>
477477
<message>
478-
<location filename="ProjectTabWidget.cpp" line="902"/>
478+
<location filename="ProjectTabWidget.cpp" line="901"/>
479479
<source>The class needs to be saved before you can insert a bitmap.</source>
480480
<translation type="unfinished"></translation>
481481
</message>
482482
<message>
483-
<location filename="ProjectTabWidget.cpp" line="1399"/>
483+
<location filename="ProjectTabWidget.cpp" line="1395"/>
484484
<source>Error in class annotation </source>
485485
<translation type="unfinished"></translation>
486486
</message>
@@ -1149,35 +1149,35 @@ This is probably wrong because the component is decalred as %3.</oldsource>
11491149
<context>
11501150
<name>LibraryTree</name>
11511151
<message>
1152-
<location filename="LibraryWidget.cpp" line="583"/>
1152+
<location filename="LibraryWidget.cpp" line="586"/>
11531153
<source>Modelica Standard Library</source>
11541154
<translation type="unfinished"></translation>
11551155
</message>
11561156
<message>
1157-
<location filename="LibraryWidget.cpp" line="606"/>
1157+
<location filename="LibraryWidget.cpp" line="609"/>
11581158
<source>Show Component</source>
11591159
<translation type="unfinished"></translation>
11601160
</message>
11611161
<message>
1162-
<location filename="LibraryWidget.cpp" line="607"/>
1162+
<location filename="LibraryWidget.cpp" line="610"/>
11631163
<source>Shows the component</source>
11641164
<translation type="unfinished"></translation>
11651165
</message>
11661166
<message>
1167-
<location filename="LibraryWidget.cpp" line="610"/>
1167+
<location filename="LibraryWidget.cpp" line="613"/>
11681168
<source>View Documentation</source>
11691169
<translation type="unfinished"></translation>
11701170
</message>
11711171
<message>
1172-
<location filename="LibraryWidget.cpp" line="611"/>
1172+
<location filename="LibraryWidget.cpp" line="614"/>
11731173
<source>View component documentation</source>
11741174
<translation type="unfinished"></translation>
11751175
</message>
11761176
</context>
11771177
<context>
11781178
<name>LibraryWidget</name>
11791179
<message>
1180-
<location filename="LibraryWidget.cpp" line="1346"/>
1180+
<location filename="LibraryWidget.cpp" line="1349"/>
11811181
<source>Modelica Library</source>
11821182
<translation type="unfinished"></translation>
11831183
</message>
@@ -1734,7 +1734,7 @@ This is probably wrong because the component is decalred as %3.</oldsource>
17341734
<context>
17351735
<name>ModelBrowserTree</name>
17361736
<message>
1737-
<location filename="LibraryWidget.cpp" line="1611"/>
1737+
<location filename="LibraryWidget.cpp" line="1614"/>
17381738
<source>Outline</source>
17391739
<translation type="unfinished"></translation>
17401740
</message>
@@ -1795,12 +1795,12 @@ This is probably wrong because the component is decalred as %3.</oldsource>
17951795
<translation type="unfinished"></translation>
17961796
</message>
17971797
<message>
1798-
<location filename="ModelicaEditor.cpp" line="207"/>
1798+
<location filename="ModelicaEditor.cpp" line="208"/>
17991799
<source>Undo changes</source>
18001800
<translation type="unfinished"></translation>
18011801
</message>
18021802
<message>
1803-
<location filename="ModelicaEditor.cpp" line="208"/>
1803+
<location filename="ModelicaEditor.cpp" line="209"/>
18041804
<source>Let me fix errors</source>
18051805
<translation type="unfinished"></translation>
18061806
</message>
@@ -1866,7 +1866,7 @@ This is probably wrong because the component is decalred as %3.</oldsource>
18661866
<translation type="unfinished"></translation>
18671867
</message>
18681868
<message>
1869-
<location filename="LibraryWidget.cpp" line="430"/>
1869+
<location filename="LibraryWidget.cpp" line="433"/>
18701870
<source>while deleting </source>
18711871
<translation type="unfinished"></translation>
18721872
</message>
@@ -2114,17 +2114,17 @@ This is probably wrong because the component is decalred as %3.</oldsource>
21142114
<context>
21152115
<name>ProjectTabWidget</name>
21162116
<message>
2117-
<location filename="ProjectTabWidget.cpp" line="3076"/>
2117+
<location filename="ProjectTabWidget.cpp" line="3072"/>
21182118
<source>Save File As</source>
21192119
<translation type="unfinished"></translation>
21202120
</message>
21212121
<message>
2122-
<location filename="ProjectTabWidget.cpp" line="3076"/>
2122+
<location filename="ProjectTabWidget.cpp" line="3072"/>
21232123
<source>Save File</source>
21242124
<translation type="unfinished"></translation>
21252125
</message>
21262126
<message>
2127-
<location filename="ProjectTabWidget.cpp" line="3195"/>
2127+
<location filename="ProjectTabWidget.cpp" line="3191"/>
21282128
<source>There are unsaved models opened. Do you still want to quit?</source>
21292129
<translation type="unfinished"></translation>
21302130
</message>
@@ -2140,12 +2140,12 @@ This is probably wrong because the component is decalred as %3.</oldsource>
21402140
<context>
21412141
<name>SearchMSLWidget</name>
21422142
<message>
2143-
<location filename="LibraryWidget.cpp" line="1256"/>
2143+
<location filename="LibraryWidget.cpp" line="1259"/>
21442144
<source>Searched Items</source>
21452145
<translation type="unfinished"></translation>
21462146
</message>
21472147
<message>
2148-
<location filename="LibraryWidget.cpp" line="1314"/>
2148+
<location filename="LibraryWidget.cpp" line="1317"/>
21492149
<source>Sorry, no items found</source>
21502150
<translation type="unfinished"></translation>
21512151
</message>
@@ -2486,22 +2486,22 @@ Please wait for a while.</source>
24862486
<context>
24872487
<name>WelcomePageWidget</name>
24882488
<message>
2489-
<location filename="ProjectTabWidget.cpp" line="2649"/>
2489+
<location filename="ProjectTabWidget.cpp" line="2645"/>
24902490
<source>Recent Files</source>
24912491
<translation type="unfinished"></translation>
24922492
</message>
24932493
<message>
2494-
<location filename="ProjectTabWidget.cpp" line="2651"/>
2494+
<location filename="ProjectTabWidget.cpp" line="2647"/>
24952495
<source>No recent files found.</source>
24962496
<translation type="unfinished"></translation>
24972497
</message>
24982498
<message>
2499-
<location filename="ProjectTabWidget.cpp" line="2674"/>
2499+
<location filename="ProjectTabWidget.cpp" line="2670"/>
25002500
<source>Create Model</source>
25012501
<translation type="unfinished"></translation>
25022502
</message>
25032503
<message>
2504-
<location filename="ProjectTabWidget.cpp" line="2677"/>
2504+
<location filename="ProjectTabWidget.cpp" line="2673"/>
25052505
<source>Open Model</source>
25062506
<translation type="unfinished"></translation>
25072507
</message>

0 commit comments

Comments
 (0)