Commit 41e39c7f authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

BC: Rename window title with study name and other minor change.

Showing with 16 additions and 13 deletions
+16 -13
......@@ -45,7 +45,9 @@ _translate = QCoreApplication.translate
class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
def __init__(self, title="BoundaryConditions", study=None, parent=None):
def __init__(self, title="Boundary conditions", study=None, parent=None):
title = title + " - " + study.name
super(BoundaryConditionWindow, self).__init__(
name=title, ui="BoundaryConditions", parent=parent
)
......
......@@ -29,34 +29,35 @@ from View.BoundaryCondition.Edit.Plot import Plot
_translate = QCoreApplication.translate
class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
def __init__(self, title="Edit BoundaryConditions",
def __init__(self, title="Edit boundary condition",
data=None, study=None, parent=None):
super(EditBoundaryConditionWindow, self).__init__(
name=title, ui="EditBoundaryConditions", parent=parent
)
self._data = data
self._study = study
self._title = title
self.setup_window()
self.compute_title()
super(EditBoundaryConditionWindow, self).__init__(
name=self._title, ui="EditBoundaryConditions", parent=parent
)
self.ui.setWindowTitle(self._title)
self.setup_sc()
self.setup_table()
self.setup_plot()
self.setup_connections()
def setup_window(self):
def compute_title(self):
if self._data is not None:
node_name = (self._data.node.name if self._data.node is not None
else _translate("BoundaryCondition", "Not associate"))
title = (
_translate("BoundaryCondition", self._title) +
self._title = (
_translate("Edit boundary condition", self._title) +
f" - {self._study.name} " +
f" - {self._data.name} " +
f"({long_types[self._data.bctype]} - {node_name})"
)
self.ui.setWindowTitle(title)
else:
self.ui.setWindowTitle(_translate("BoundaryCondition", self._title))
def setup_sc(self):
self._undo_stack = QUndoStack()
......
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