mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
BC: Reorganize edit window.
This commit is contained in:
1 parent
11906efb2c
commit
568be94e56
3 files changed
+19
-11
No files matched your search
@@ -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))
|
||||
Reference in new issue
Block a user