mirror of https://gitlab.com/pamhyr/pamhyr2
Friction: Forbidden duplicate window.
parent
94a0a96659
commit
254f0d0e8e
|
|
@ -68,7 +68,7 @@ class FrictionsWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.setup_title(title)
|
self.setup_title(title)
|
||||||
|
|
||||||
super(FrictionsWindow, self).__init__(
|
super(FrictionsWindow, self).__init__(
|
||||||
name=self._title, ui="Frictions", parent=parent
|
name=title, ui="Frictions", parent=parent
|
||||||
)
|
)
|
||||||
|
|
||||||
self.setup_sc()
|
self.setup_sc()
|
||||||
|
|
@ -246,9 +246,17 @@ class FrictionsWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self._table.redo()
|
self._table.redo()
|
||||||
|
|
||||||
def edit_stricklers(self):
|
def edit_stricklers(self):
|
||||||
self.strick = StricklersWindow(
|
strick = self.sub_win_filter_first(
|
||||||
|
"Stricklers",
|
||||||
|
contain = []
|
||||||
|
)
|
||||||
|
|
||||||
|
if strick is None:
|
||||||
|
strick = StricklersWindow(
|
||||||
study = self._study,
|
study = self._study,
|
||||||
config = self.parent.conf,
|
config = self.parent.conf,
|
||||||
parent = self
|
parent = self
|
||||||
)
|
)
|
||||||
self.strick.show()
|
strick.show()
|
||||||
|
else:
|
||||||
|
strick.activateWindow()
|
||||||
|
|
|
||||||
|
|
@ -494,21 +494,38 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
lateral.activateWindow()
|
lateral.activateWindow()
|
||||||
|
|
||||||
def open_stricklers(self):
|
def open_stricklers(self):
|
||||||
|
strick = self.sub_win_filter_first(
|
||||||
|
"Stricklers",
|
||||||
|
contain = []
|
||||||
|
)
|
||||||
|
|
||||||
|
if strick is None:
|
||||||
strick = StricklersWindow(
|
strick = StricklersWindow(
|
||||||
study = self.model,
|
study = self.model,
|
||||||
config = self.conf,
|
config = self.conf,
|
||||||
parent = self
|
parent = self
|
||||||
)
|
)
|
||||||
strick.show()
|
strick.show()
|
||||||
|
else:
|
||||||
|
strick.activateWindow()
|
||||||
|
|
||||||
def open_frictions(self):
|
def open_frictions(self):
|
||||||
if (self.model is not None and
|
if (self.model is not None and
|
||||||
self.model.river.has_current_reach()):
|
self.model.river.has_current_reach()):
|
||||||
|
|
||||||
|
frictions = self.sub_win_filter_first(
|
||||||
|
"Frictions",
|
||||||
|
contain = [self.model.river.current_reach().name]
|
||||||
|
)
|
||||||
|
|
||||||
|
if frictions is None:
|
||||||
frictions = FrictionsWindow(
|
frictions = FrictionsWindow(
|
||||||
study = self.model,
|
study = self.model,
|
||||||
parent = self
|
parent = self
|
||||||
)
|
)
|
||||||
frictions.show()
|
frictions.show()
|
||||||
|
else:
|
||||||
|
frictions.activateWindow()
|
||||||
else:
|
else:
|
||||||
self.msg_select_reach()
|
self.msg_select_reach()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ logger = logging.getLogger()
|
||||||
|
|
||||||
class StricklersWindow(ASubMainWindow, ListedSubWindow):
|
class StricklersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
def __init__(self, title="Stricklers", study=None, config=None, parent=None):
|
def __init__(self, title="Stricklers", study=None, config=None, parent=None):
|
||||||
title = title + " - " + study.name
|
self._title = title + " - " + study.name
|
||||||
|
|
||||||
super(StricklersWindow, self).__init__(
|
super(StricklersWindow, self).__init__(
|
||||||
name=title, ui="Stricklers", parent=parent
|
name=title, ui="Stricklers", parent=parent
|
||||||
|
|
@ -64,7 +64,7 @@ class StricklersWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.setup_table()
|
self.setup_table()
|
||||||
self.setup_connections()
|
self.setup_connections()
|
||||||
|
|
||||||
self.ui.setWindowTitle(title)
|
self.ui.setWindowTitle(self._title)
|
||||||
|
|
||||||
def setup_sc(self):
|
def setup_sc(self):
|
||||||
self._undo_stack = QUndoStack()
|
self._undo_stack = QUndoStack()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue