mirror of https://gitlab.com/pamhyr/pamhyr2
MainWindow, SolverRun: Add shortcut for solver run.
parent
adc7736306
commit
39f6baf1a9
|
|
@ -174,4 +174,4 @@ class CheckListWindow(ASubMainWindow, ListedSubWindow):
|
|||
|
||||
def accept(self):
|
||||
self._parent.solver_log(self._solver)
|
||||
self.end()
|
||||
#self.end()
|
||||
|
|
|
|||
|
|
@ -4,12 +4,16 @@ import os
|
|||
from queue import Queue
|
||||
|
||||
from PyQt5 import QtGui
|
||||
from PyQt5.QtGui import (
|
||||
QKeySequence,
|
||||
)
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
QTranslator, QEvent
|
||||
)
|
||||
from PyQt5.QtWidgets import (
|
||||
QMainWindow, QApplication, QAction,
|
||||
QFileDialog,
|
||||
QFileDialog, QShortcut,
|
||||
)
|
||||
from PyQt5.uic import loadUi
|
||||
|
||||
|
|
@ -84,7 +88,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
self
|
||||
)
|
||||
|
||||
self.init_callback()
|
||||
self.setup_sc()
|
||||
self.setup_connection()
|
||||
self.default_style()
|
||||
|
||||
self.trans = QTranslator(self)
|
||||
|
|
@ -108,7 +113,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
"""
|
||||
self.findChild(QAction, action).setEnabled(enable)
|
||||
|
||||
def init_callback(self):
|
||||
def setup_sc(self):
|
||||
self._run_sc = QShortcut(QKeySequence("F5"), self)
|
||||
|
||||
def setup_connection(self):
|
||||
"""Connect action to callback function
|
||||
|
||||
Returns:
|
||||
|
|
@ -157,6 +165,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
.triggered.connect(actions[action])
|
||||
# action.triggered.connect(actions[action])
|
||||
|
||||
self._run_sc.activated.connect(self.run_solver)
|
||||
|
||||
def changeEvent(self, event):
|
||||
if event.type() == QEvent.LanguageChange:
|
||||
|
|
@ -386,6 +395,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
params.show()
|
||||
|
||||
def run_solver(self):
|
||||
if self.model is None:
|
||||
return
|
||||
|
||||
run = SelectSolverWindow(
|
||||
study = self.model,
|
||||
config = self.conf,
|
||||
|
|
|
|||
|
|
@ -63,7 +63,11 @@
|
|||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ok</string>
|
||||
<string>Run</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>ressources/player_play.png</normaloff>ressources/player_play.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue