Section: Improve title.

mesh
Pierre-Antoine Rouby 2023-06-07 11:34:55 +02:00
parent b2bc34a5b0
commit f4fe03b1f1
1 changed files with 16 additions and 9 deletions

View File

@ -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])