mirror of https://gitlab.com/pamhyr/pamhyr2
trad: Add some message window traduction.
parent
6a3bb38dbc
commit
e7c93602a1
|
|
@ -496,6 +496,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def close_model(self):
|
def close_model(self):
|
||||||
|
if not self.dialog_close(cancel=True):
|
||||||
|
return
|
||||||
|
|
||||||
self._study = None
|
self._study = None
|
||||||
self.update_enable_action()
|
self.update_enable_action()
|
||||||
self.conf.set_close_correctly()
|
self.conf.set_close_correctly()
|
||||||
|
|
@ -745,15 +748,16 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
##################
|
##################
|
||||||
|
|
||||||
def msg_select_reach(self):
|
def msg_select_reach(self):
|
||||||
self.message_box("Please select a reach",
|
self.message_box(
|
||||||
"Geometry edition need a reach selected "
|
self._trad["mb_select_reach_title"],
|
||||||
"into river network window to work on it")
|
self._trad["mb_select_reach_msg"]
|
||||||
|
)
|
||||||
|
|
||||||
def dialog_reopen_study(self):
|
def dialog_reopen_study(self):
|
||||||
dlg = QMessageBox(self)
|
dlg = QMessageBox(self)
|
||||||
|
|
||||||
dlg.setWindowTitle("Last open study")
|
dlg.setWindowTitle(self._trad["mb_last_open_title"])
|
||||||
dlg.setText("Do you want to open again the last open study?")
|
dlg.setText(self._trad["mb_last_open_msg"])
|
||||||
opt = QMessageBox.Cancel | QMessageBox.Ok # | QMessageBox.Open
|
opt = QMessageBox.Cancel | QMessageBox.Ok # | QMessageBox.Open
|
||||||
|
|
||||||
dlg.setStandardButtons(opt)
|
dlg.setStandardButtons(opt)
|
||||||
|
|
@ -793,9 +797,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
def dialog_close(self, cancel=True):
|
def dialog_close(self, cancel=True):
|
||||||
dlg = QMessageBox(self)
|
dlg = QMessageBox(self)
|
||||||
|
|
||||||
dlg.setWindowTitle("Close PAMHYR without saving study")
|
dlg.setWindowTitle(self._trad["mb_close_title"])
|
||||||
dlg.setText("Do you want to save current study before PAMHYR close ?")
|
dlg.setText(self._trad["mb_close_msg"])
|
||||||
opt = QMessageBox.Save | QMessageBox.Ignore
|
opt = QMessageBox.Save | QMessageBox.Close
|
||||||
if cancel:
|
if cancel:
|
||||||
opt |= QMessageBox.Cancel
|
opt |= QMessageBox.Cancel
|
||||||
|
|
||||||
|
|
@ -807,7 +811,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
if res == QMessageBox.Save:
|
if res == QMessageBox.Save:
|
||||||
self.save_study()
|
self.save_study()
|
||||||
return True
|
return True
|
||||||
elif res == QMessageBox.Ignore:
|
elif res == QMessageBox.Close:
|
||||||
return True
|
return True
|
||||||
elif res == QMessageBox.Cancel:
|
elif res == QMessageBox.Cancel:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,9 @@ class WindowToolKit(object):
|
||||||
msg.setInformativeText(informative_text)
|
msg.setInformativeText(informative_text)
|
||||||
msg.setWindowTitle(window_title)
|
msg.setWindowTitle(window_title)
|
||||||
|
|
||||||
|
msg.findChild(QLabel, "qt_msgbox_label")\
|
||||||
|
.setFixedWidth(384)
|
||||||
|
|
||||||
msg.exec_()
|
msg.exec_()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,3 +102,29 @@ class MainTranslate(UnitTranslate):
|
||||||
self._dict["active_window"] = _translate(
|
self._dict["active_window"] = _translate(
|
||||||
"MainWindow", "Enable this window"
|
"MainWindow", "Enable this window"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Message box
|
||||||
|
self._dict["mb_select_reach_title"] = _translate(
|
||||||
|
"MainWindow", "Please select a reach"
|
||||||
|
)
|
||||||
|
self._dict["mb_select_reach_msg"] = _translate(
|
||||||
|
"MainWindow",
|
||||||
|
"This edition window need a reach selected "
|
||||||
|
"into the river network to work on it"
|
||||||
|
)
|
||||||
|
|
||||||
|
self._dict["mb_last_open_title"] = _translate(
|
||||||
|
"MainWindow", "Last open study"
|
||||||
|
)
|
||||||
|
self._dict["mb_last_open_msg"] = _translate(
|
||||||
|
"MainWindow",
|
||||||
|
"Do you want to open again the last open study?"
|
||||||
|
)
|
||||||
|
|
||||||
|
self._dict["mb_close_title"] = _translate(
|
||||||
|
"MainWindow", "Close without saving study"
|
||||||
|
)
|
||||||
|
self._dict["mb_close_msg"] = _translate(
|
||||||
|
"MainWindow",
|
||||||
|
"Do you want to save current study before closing it?"
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -2481,6 +2481,41 @@
|
||||||
<source>Data</source>
|
<source>Data</source>
|
||||||
<translation>Données</translation>
|
<translation>Données</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="107"/>
|
||||||
|
<source>Please select a reach</source>
|
||||||
|
<translation>Veuillez sélectionner un bief</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="110"/>
|
||||||
|
<source>Geometry edition need a reach selected into the river network to work on it</source>
|
||||||
|
<translation type="obsolete">L'édition de la géométrie nécessite un bief sélectionné dans le réseau fluvial pour pouvoir travailler dessus</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="116"/>
|
||||||
|
<source>Last open study</source>
|
||||||
|
<translation>Dernière étude ouverte</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="119"/>
|
||||||
|
<source>Do you want to open again the last open study?</source>
|
||||||
|
<translation>Voulez-vous rouvrir la dernière étude ?</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="110"/>
|
||||||
|
<source>This edition window need a reach selected into the river network to work on it</source>
|
||||||
|
<translation>Cette fenêtre d'édition a besoin d'un bief sélectionné dans le réseau pour travailler dessus</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="124"/>
|
||||||
|
<source>Close without saving study</source>
|
||||||
|
<translation>Fermer sans sauvegarder l'étude</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../View/Translate.py" line="127"/>
|
||||||
|
<source>Do you want to save current study before closing it?</source>
|
||||||
|
<translation>Souhaitez-vous sauvegarder l'étude en cours avant de la fermer ?</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWindow_reach</name>
|
<name>MainWindow_reach</name>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue