Commit 06b6d594 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

InitialConditions: Forbidden duplicate window.

Showing with 12 additions and 4 deletions
+12 -4
...@@ -531,11 +531,19 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ...@@ -531,11 +531,19 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def open_initial_conditions(self): def open_initial_conditions(self):
if self.model.river.has_current_reach(): if self.model.river.has_current_reach():
initial = InitialConditionsWindow( initial = self.sub_win_filter_first(
study = self.model, "Initial condition",
parent = self 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: else:
self.msg_select_reach() self.msg_select_reach()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment