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

BC: Edit: Set window title.

Showing with 17 additions and 2 deletions
+17 -2
......@@ -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))
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