mirror of https://gitlab.com/pamhyr/pamhyr2
BC: Edit: Set window title.
parent
db75315b6d
commit
cd3d546d73
|
|
@ -4,7 +4,7 @@ from View.ASubWindow import ASubMainWindow
|
|||
from View.ListedSubWindow import ListedSubWindow
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
Qt, QVariant, QAbstractTableModel,
|
||||
Qt, QVariant, QAbstractTableModel, QCoreApplication,
|
||||
)
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
|
|
@ -12,6 +12,7 @@ from PyQt5.QtWidgets import (
|
|||
QFileDialog, QTableView, QAbstractItemView,
|
||||
)
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||
def __init__(self, title="Edit BoundaryConditions", data=None, parent=None):
|
||||
|
|
@ -20,5 +21,19 @@ class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
|||
)
|
||||
|
||||
self._data = data
|
||||
self._title = title
|
||||
|
||||
self.ui.setWindowTitle(title)
|
||||
self.setup_window()
|
||||
|
||||
def setup_window(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) +
|
||||
f"{self._data.name} " +
|
||||
f"({self._data.name} - {node_name})"
|
||||
)
|
||||
self.ui.setWindowTitle(title)
|
||||
else:
|
||||
self.ui.setWindowTitle(_translate("BoundaryCondition", self._title))
|
||||
|
|
|
|||
Loading…
Reference in New Issue