mirror of https://gitlab.com/pamhyr/pamhyr2
MainWindow: Make toolbar run launch the lasest solver used and add sc on F6.
parent
49dd3c65e1
commit
955af412ea
|
|
@ -175,7 +175,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
self.findChild(QAction, action).setEnabled(enable)
|
||||
|
||||
def setup_sc(self):
|
||||
# self._run_sc = QShortcut(QKeySequence("F5"), self)
|
||||
self._run_sc = QShortcut(QKeySequence("F6"), self)
|
||||
return
|
||||
|
||||
def setup_connection(self):
|
||||
|
|
@ -202,7 +202,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
"action_menu_initial_conditions": self.open_initial_conditions,
|
||||
"action_menu_edit_friction": self.open_frictions,
|
||||
"action_menu_edit_lateral_contribution": self.open_lateral_contrib,
|
||||
"action_menu_run_solver": self.run_solver,
|
||||
"action_menu_run_solver": self.select_and_run_solver,
|
||||
"action_menu_sediment_layers": self.open_sediment_layers,
|
||||
"action_menu_edit_reach_sediment_layers":
|
||||
self.open_reach_sediment_layers,
|
||||
|
|
@ -222,7 +222,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
"action_toolBar_open": self.open_model,
|
||||
"action_toolBar_save": self.save_study,
|
||||
"action_toolBar_close": self.close_model,
|
||||
"action_toolBar_run_solver": self.run_solver,
|
||||
"action_toolBar_run_solver": self.run_lasest_solver,
|
||||
# Current actions
|
||||
"action_toolBar_network": self.open_network,
|
||||
"action_toolBar_geometry": self.open_geometry,
|
||||
|
|
@ -243,7 +243,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
.triggered.connect(actions[action])
|
||||
# action.triggered.connect(actions[action])
|
||||
|
||||
# self._run_sc.activated.connect(self.run_solver)
|
||||
self._run_sc.activated.connect(self.run_lasest_solver)
|
||||
|
||||
def changeEvent(self, event):
|
||||
if event.type() == QEvent.LanguageChange:
|
||||
|
|
@ -808,7 +808,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
)
|
||||
sl.show()
|
||||
|
||||
def run_solver(self):
|
||||
def run_lasest_solver(self):
|
||||
if self._last_solver is None:
|
||||
return
|
||||
|
||||
self.run_solver(self._last_solver)
|
||||
|
||||
def select_and_run_solver(self):
|
||||
if self._study is None:
|
||||
return
|
||||
|
||||
|
|
@ -818,7 +824,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
parent=self
|
||||
)
|
||||
if run.exec():
|
||||
solver = run.solver
|
||||
self.run_solver(run.solver)
|
||||
|
||||
def run_solver(self, solver):
|
||||
if self._study is None:
|
||||
return
|
||||
|
||||
if self.sub_window_exists(
|
||||
CheckListWindow,
|
||||
|
|
|
|||
|
|
@ -35,13 +35,6 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_cancel">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_run">
|
||||
<property name="text">
|
||||
|
|
@ -53,6 +46,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_cancel">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
Loading…
Reference in New Issue