InitialConditions: Forbidden duplicate window.

results
Pierre-Antoine Rouby 2023-08-04 16:40:37 +02:00
parent f4a852f8f3
commit 06b6d59494
1 changed files with 12 additions and 4 deletions

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()