diff --git a/src/View/CheckList/Window.py b/src/View/CheckList/Window.py index 55edfe8bbbaabd631a7a8eadcd212fb4768e8de2..8f720e0f92032d1265fe11aa0355f19d0accdc20 100644 --- a/src/View/CheckList/Window.py +++ b/src/View/CheckList/Window.py @@ -174,4 +174,4 @@ class CheckListWindow(ASubMainWindow, ListedSubWindow): def accept(self): self._parent.solver_log(self._solver) - self.end() + #self.end() diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index f3ab0acb14dad545b352e639fe9fd422a6a4ef9a..a907426d1a966e6089d59177e4211235ba2ed61a 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -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, diff --git a/src/View/ui/CheckList.ui b/src/View/ui/CheckList.ui index 06e6403c1569e3acd353cd980ccc5614cb319f2f..001d92306f0726efbae46b67c0ac42aba3f71dfd 100644 --- a/src/View/ui/CheckList.ui +++ b/src/View/ui/CheckList.ui @@ -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>