Friction: Forbidden duplicate window.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-08-04 16:17:18 +02:00
1 parent 94a0a96659
commit 254f0d0e8e
3 files changed
+42 -17

No files matched your search

+26 -9
View File
@@ -494,21 +494,38 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
lateral.activateWindow()
def open_stricklers(self):
strick = StricklersWindow(
study = self.model,
config = self.conf,
parent = self
strick = self.sub_win_filter_first(
"Stricklers",
contain = []
)
strick.show()
if strick is None:
strick = StricklersWindow(
study = self.model,
config = self.conf,
parent = self
)
strick.show()
else:
strick.activateWindow()
def open_frictions(self):
if (self.model is not None and
self.model.river.has_current_reach()):
frictions = FrictionsWindow(
study = self.model,
parent = self
frictions = self.sub_win_filter_first(
"Frictions",
contain = [self.model.river.current_reach().name]
)
frictions.show()
if frictions is None:
frictions = FrictionsWindow(
study = self.model,
parent = self
)
frictions.show()
else:
frictions.activateWindow()
else:
self.msg_select_reach()