mirror of https://gitlab.com/pamhyr/pamhyr2
BC: Rename window title with study name and other minor change.
parent
33526d4f09
commit
41e39c7fe5
|
|
@ -45,7 +45,9 @@ _translate = QCoreApplication.translate
|
||||||
|
|
||||||
|
|
||||||
class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
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__(
|
super(BoundaryConditionWindow, self).__init__(
|
||||||
name=title, ui="BoundaryConditions", parent=parent
|
name=title, ui="BoundaryConditions", parent=parent
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -29,34 +29,35 @@ from View.BoundaryCondition.Edit.Plot import Plot
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||||
def __init__(self, title="Edit BoundaryConditions",
|
def __init__(self, title="Edit boundary condition",
|
||||||
data=None, study=None, parent=None):
|
data=None, study=None, parent=None):
|
||||||
super(EditBoundaryConditionWindow, self).__init__(
|
|
||||||
name=title, ui="EditBoundaryConditions", parent=parent
|
|
||||||
)
|
|
||||||
|
|
||||||
self._data = data
|
self._data = data
|
||||||
self._study = study
|
self._study = study
|
||||||
self._title = title
|
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_sc()
|
||||||
self.setup_table()
|
self.setup_table()
|
||||||
self.setup_plot()
|
self.setup_plot()
|
||||||
self.setup_connections()
|
self.setup_connections()
|
||||||
|
|
||||||
def setup_window(self):
|
def compute_title(self):
|
||||||
if self._data is not None:
|
if self._data is not None:
|
||||||
node_name = (self._data.node.name if self._data.node is not None
|
node_name = (self._data.node.name if self._data.node is not None
|
||||||
else _translate("BoundaryCondition", "Not associate"))
|
else _translate("BoundaryCondition", "Not associate"))
|
||||||
title = (
|
self._title = (
|
||||||
_translate("BoundaryCondition", self._title) +
|
_translate("Edit boundary condition", self._title) +
|
||||||
|
f" - {self._study.name} " +
|
||||||
f" - {self._data.name} " +
|
f" - {self._data.name} " +
|
||||||
f"({long_types[self._data.bctype]} - {node_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):
|
def setup_sc(self):
|
||||||
self._undo_stack = QUndoStack()
|
self._undo_stack = QUndoStack()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue