Skip to content

Commit

Permalink
Fix order and translation of Ok/cancel button in survey import dialog…
Browse files Browse the repository at this point in the history
… window
  • Loading branch information
piMoll committed May 1, 2022
1 parent 6bd3f50 commit bc9fa60
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gui/saveDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def __init__(self, parent):

# Create Ok/Cancel Button and connect signal
buttonBox = QDialogButtonBox(main_widget)
buttonBox.setStandardButtons(QDialogButtonBox.Ok |
QDialogButtonBox.Cancel)
buttonBox.setStandardButtons(QDialogButtonBox.Cancel |
QDialogButtonBox.Ok)
buttonBox.button(QDialogButtonBox.Ok).setText(self.tr("OK"))
buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Abbrechen"))
buttonBox.accepted.connect(self.apply)
Expand Down
6 changes: 4 additions & 2 deletions gui/surveyImportDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ def connectGuiElements(self):
self.buttonTemplateExcelProtocol.clicked.connect(
lambda: self.onDownloadTemplate('excelProtocol'))

self.buttonBox.accepted.connect(self.onOk)
self.buttonBox.accepted.connect(self.onImport)
self.buttonBox.rejected.connect(self.onCancel)
self.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr('Import'))
self.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr('Abbrechen'))

def onSelectSurveyType(self):
newSurveyType = None
Expand Down Expand Up @@ -131,7 +133,7 @@ def onDownloadTemplate(self, templateName):
QMessageBox.information(self, self.tr('Download Vorlage'),
msg, QMessageBox.Ok)

def onOk(self):
def onImport(self):
if self.surveyType and self.filePath:
self.doImport = True

Expand Down
Binary file modified i18n/SeilaplanPlugin_de.qm
Binary file not shown.
10 changes: 10 additions & 0 deletions i18n/SeilaplanPlugin_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,16 @@ Pfad zu Dokumentation:
<source>Download Vorlage</source>
<translation>Download Vorlage</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="65"/>
<source>Import</source>
<translation>Import</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="66"/>
<source>Abbrechen</source>
<translation>Abbrechen</translation>
</message>
</context>
<context>
<name>SurveyImportDialogUI</name>
Expand Down
Binary file modified i18n/SeilaplanPlugin_en.qm
Binary file not shown.
10 changes: 10 additions & 0 deletions i18n/SeilaplanPlugin_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2426,6 +2426,16 @@ The algorithm calculates a solution, which in first priority is minimizing the n
<source>Download Vorlage</source>
<translation>Download template</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="65"/>
<source>Import</source>
<translation>Import</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="66"/>
<source>Abbrechen</source>
<translation>Cancel</translation>
</message>
</context>
<context>
<name>SurveyImportDialogUI</name>
Expand Down
Binary file modified i18n/SeilaplanPlugin_fr.qm
Binary file not shown.
10 changes: 10 additions & 0 deletions i18n/SeilaplanPlugin_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2426,6 +2426,16 @@ Il est recherché la solution qui, en première priorité, minimalise le nombre
<source>Download Vorlage</source>
<translation>Télécharger le modèle</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="65"/>
<source>Import</source>
<translation>Importer</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="66"/>
<source>Abbrechen</source>
<translation>Annuler</translation>
</message>
</context>
<context>
<name>SurveyImportDialogUI</name>
Expand Down
Binary file modified i18n/SeilaplanPlugin_it.qm
Binary file not shown.
10 changes: 10 additions & 0 deletions i18n/SeilaplanPlugin_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,16 @@ C&apos;è cercato la soluzione che, in prima priorità, minimizza il numero dei
<source>Download Vorlage</source>
<translation>Scaricare il template</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="65"/>
<source>Import</source>
<translation>Importare</translation>
</message>
<message>
<location filename="../gui/surveyImportDialog.py" line="66"/>
<source>Abbrechen</source>
<translation></translation>
</message>
</context>
<context>
<name>SurveyImportDialogUI</name>
Expand Down
1 change: 1 addition & 0 deletions scripts/cheatsheet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pyrcc5 -o resources/resources.py resources/resources.qrc
# Compile gui
pyuic5 gui/seilaplanDialog.ui -o gui/ui_seilaplanDialog.py
pyuic5 gui/adjustmentDialog.ui -o gui/ui_adjustmentDialog.py
pyuic5 gui/surveyImportDialog.ui -o gui/ui_surveyImportDialog.py

# get new translation texts
bash scripts/update-strings.sh SeilaplanPlugin_de SeilaplanPlugin_en SeilaplanPlugin_fr SeilaplanPlugin_it
Expand Down

0 comments on commit bc9fa60

Please sign in to comment.