BC: Reorganize edit window.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-05-03 11:48:49 +02:00
1 parent 11906efb2c
commit 568be94e56
3 files changed
+19 -11

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
from View.ASubWindow import ASubMainWindow
from View.ListedSubWindow import ListedSubWindow
from PyQt5.QtCore import (
Qt, QVariant, QAbstractTableModel, QCoreApplication,
)
from PyQt5.QtWidgets import (
QDialogButtonBox, QPushButton, QLineEdit,
QFileDialog, QTableView, QAbstractItemView,
)
from View.BoundaryCondition.translate import long_types
_translate = QCoreApplication.translate
class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
def __init__(self, title="Edit BoundaryConditions", data=None, parent=None):
super(EditBoundaryConditionWindow, self).__init__(
name=title, ui="EditBoundaryConditions", parent=parent
)
self._data = data
self._title = 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"({long_types[self._data.bctype]} - {node_name})"
)
self.ui.setWindowTitle(title)
else:
self.ui.setWindowTitle(_translate("BoundaryCondition", self._title))