diff --git a/src/View/Sections/Window.py b/src/View/Sections/Window.py index 47c648804009d54a67ea91441ee4f1eaa0f4766a..979b3c1a932b653809a7ae0ae4c9bf5a33d2f44d 100644 --- a/src/View/Sections/Window.py +++ b/src/View/Sections/Window.py @@ -38,14 +38,14 @@ _translate = QCoreApplication.translate class SectionsWindow(ASubMainWindow, ListedSubWindow): def __init__(self, title="Sections", study=None, parent=None): - title = title + " - " + study.name - self._study = study - self._current_reach = self._study.river._current_reach - self._sections = self._current_reach.sections + self._reach = self._study.river._current_reach + self._sections = self._reach.sections + + self.setup_title(title) super(SectionsWindow, self).__init__( - name=title, ui="Sections", parent=parent + name=self._title, ui="Sections", parent=parent ) self.setup_sc() @@ -53,7 +53,14 @@ class SectionsWindow(ASubMainWindow, ListedSubWindow): self.setup_graph() self.setup_connections() - self.ui.setWindowTitle(title) + self.ui.setWindowTitle(self._title) + + def setup_title(self, title): + self._title = ( + title + " - " + + self._study.name + " - " + + self._reach.name + ) def setup_sc(self): self._undo_stack = QUndoStack() @@ -68,14 +75,14 @@ class SectionsWindow(ASubMainWindow, ListedSubWindow): table = self.find(QTableView, f"tableView") self._table = TableModel( - data = self._current_reach, + data = self._reach, study = self._study, undo = self._undo_stack, ) table.setModel(self._table) self._delegate_stricklers = ComboBoxDelegate( - data = self._current_reach, + data = self._reach, study = self._study, mode = "stricklers", parent=self @@ -142,7 +149,7 @@ class SectionsWindow(ASubMainWindow, ListedSubWindow): highlight = None if len(rows) > 0: - edge = self._current_reach + edge = self._reach if edge: data = edge.reach sec = self._sections.get(rows[0])