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

SubWindow: Minor change.

Showing with 30 additions and 16 deletions
+30 -16
......@@ -279,17 +279,24 @@ class ASubWindow(QDialog):
file_names = dialog.selectedFiles()
callback(file_names)
def message_box(self, value,
text: str,
def message_box(self, text: str,
informative_text: str,
window_title: str = "Warning"):
"""Open a new message box
Args:
text: Short text string
informative_text: Verbose text string
window_title: Title of message box window
Returns:
Nothing
"""
msg = QMessageBox()
msg.setIcon(QMessageBox.Warning)
msg.setText(f"{value} : {text}")
msg.setInformativeText(f"{informative_text}")
msg.setWindowTitle(f"{window_title}")
# msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
# _width = len(f"{text} : {value}")
# msg.setStyleSheet("QLabel{min-width:200 px; font-size: 13px;} QPushButton{width:10px; font-size: 12px};"
# "background-color: Ligthgray; color : gray; font-size: 8pt; color: #888a80;")
msg.setText(text)
msg.setInformativeText(informative_text)
msg.setWindowTitle(window_title)
msg.exec_()
......@@ -60,7 +60,7 @@ class ConfigureAddSolverWindow(ASubWindow):
def accept(self):
if self.get_line_edit_text("lineEdit_name") == "":
self.message_box(
"Add solver", "A solver need a name",
"A solver need a name",
"Please give a name to your solver"
)
else:
......
......@@ -80,7 +80,10 @@ class GeomatryWindow(ASubWindow):
self.bief_name = pathlib.Path(self.filename).stem
self.setWindowTitle(f"{self.ui.mainwindow_title} {self.bief_name}")
self.model = qtableview_reach.PandasModelEditable(self.filename, self.tableView_header)
self.model = qtableview_reach.PandasModelEditable(
self.filename,
self.tableView_header
)
self.tableView.setModel(self.model)
self.update_text_label()
......@@ -91,15 +94,19 @@ class GeomatryWindow(ASubWindow):
self.fichier_ouvert = True
# Profile selection when line change in table
self.tableView.selectionModel().selectionChanged.connect(
self.select_current_profile
)
self.tableView.selectionModel()\
.selectionChanged\
.connect(self.select_current_profile)
# Update plot when profile data change
self.model.dataChanged.connect(self.update_graphic_1)
self.model.dataChanged.connect(self.update_graphic_2)
self.tableView.selectionModel().selectionChanged.connect(self.update_graphic_1)
self.tableView.selectionModel().selectionChanged.connect(self.update_graphic_2)
self.tableView.selectionModel()\
.selectionChanged\
.connect(self.update_graphic_1)
self.tableView.selectionModel()\
.selectionChanged\
.connect(self.update_graphic_2)
def update_text_label(self):
......
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