InitialConditions: Forbidden duplicate window.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-08-04 16:40:37 +02:00
1 parent f4a852f8f3
commit 06b6d59494
1 file changed
+12 -4
+12 -4
View File
@@ -531,11 +531,19 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def open_initial_conditions(self):
if self.model.river.has_current_reach():
initial = InitialConditionsWindow(
study = self.model,
parent = self
initial = self.sub_win_filter_first(
"Initial condition",
contain = [self.model.river.current_reach().name]
)
initial.show()
if initial is None:
initial = InitialConditionsWindow(
study = self.model,
parent = self
)
initial.show()
else:
initial.activateWindow()
else:
self.msg_select_reach()