diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py
index 946eb54e..4f28cd8f 100644
--- a/src/View/MainWindow.py
+++ b/src/View/MainWindow.py
@@ -496,6 +496,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self.update()
def close_model(self):
+ if not self.dialog_close(cancel=True):
+ return
+
self._study = None
self.update_enable_action()
self.conf.set_close_correctly()
@@ -745,15 +748,16 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
##################
def msg_select_reach(self):
- self.message_box("Please select a reach",
- "Geometry edition need a reach selected "
- "into river network window to work on it")
+ self.message_box(
+ self._trad["mb_select_reach_title"],
+ self._trad["mb_select_reach_msg"]
+ )
def dialog_reopen_study(self):
dlg = QMessageBox(self)
- dlg.setWindowTitle("Last open study")
- dlg.setText("Do you want to open again the last open study?")
+ dlg.setWindowTitle(self._trad["mb_last_open_title"])
+ dlg.setText(self._trad["mb_last_open_msg"])
opt = QMessageBox.Cancel | QMessageBox.Ok # | QMessageBox.Open
dlg.setStandardButtons(opt)
@@ -793,9 +797,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def dialog_close(self, cancel=True):
dlg = QMessageBox(self)
- dlg.setWindowTitle("Close PAMHYR without saving study")
- dlg.setText("Do you want to save current study before PAMHYR close ?")
- opt = QMessageBox.Save | QMessageBox.Ignore
+ dlg.setWindowTitle(self._trad["mb_close_title"])
+ dlg.setText(self._trad["mb_close_msg"])
+ opt = QMessageBox.Save | QMessageBox.Close
if cancel:
opt |= QMessageBox.Cancel
@@ -807,7 +811,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if res == QMessageBox.Save:
self.save_study()
return True
- elif res == QMessageBox.Ignore:
+ elif res == QMessageBox.Close:
return True
elif res == QMessageBox.Cancel:
return False
diff --git a/src/View/Tools/ASubWindow.py b/src/View/Tools/ASubWindow.py
index f483b7b0..01db62f4 100644
--- a/src/View/Tools/ASubWindow.py
+++ b/src/View/Tools/ASubWindow.py
@@ -149,6 +149,9 @@ class WindowToolKit(object):
msg.setInformativeText(informative_text)
msg.setWindowTitle(window_title)
+ msg.findChild(QLabel, "qt_msgbox_label")\
+ .setFixedWidth(384)
+
msg.exec_()
diff --git a/src/View/Translate.py b/src/View/Translate.py
index 90d7b423..e41812e9 100644
--- a/src/View/Translate.py
+++ b/src/View/Translate.py
@@ -102,3 +102,29 @@ class MainTranslate(UnitTranslate):
self._dict["active_window"] = _translate(
"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?"
+ )
diff --git a/src/lang/fr.ts b/src/lang/fr.ts
index 4bd645dd..3597c8aa 100644
--- a/src/lang/fr.ts
+++ b/src/lang/fr.ts
@@ -2481,6 +2481,41 @@
DataDonnées
+
+
+ Please select a reach
+ Veuillez sélectionner un bief
+
+
+
+ Geometry edition need a reach selected into the river network to work on it
+ L'édition de la géométrie nécessite un bief sélectionné dans le réseau fluvial pour pouvoir travailler dessus
+
+
+
+ Last open study
+ Dernière étude ouverte
+
+
+
+ Do you want to open again the last open study?
+ Voulez-vous rouvrir la dernière étude ?
+
+
+
+ This edition window need a reach selected into the river network to work on it
+ Cette fenêtre d'édition a besoin d'un bief sélectionné dans le réseau pour travailler dessus
+
+
+
+ Close without saving study
+ Fermer sans sauvegarder l'étude
+
+
+
+ Do you want to save current study before closing it?
+ Souhaitez-vous sauvegarder l'étude en cours avant de la fermer ?
+ MainWindow_reach