diff --git a/src/View/Configure/Window.py b/src/View/Configure/Window.py index 3e51f5c137a49a24b2a8164e3baeaf36268677e3..8d941180dd4b4b8670ad07ed23e2876a6830fe85 100644 --- a/src/View/Configure/Window.py +++ b/src/View/Configure/Window.py @@ -140,6 +140,7 @@ class ConfigureWindow(ASubWindow, ListedSubWindow): def setup_sc(self): self._undo_stack = QUndoStack() + self.debug_sc = QShortcut(QKeySequence("Ctrl+G"), self) self.undo_sc = QShortcut(QKeySequence.Undo, self) self.redo_sc = QShortcut(QKeySequence.Redo, self) self.copy_sc = QShortcut(QKeySequence.Copy, self) @@ -173,6 +174,8 @@ class ConfigureWindow(ASubWindow, ListedSubWindow): for button in buttons: self.find(QPushButton, button).clicked.connect(buttons[button]) + self.debug_sc.activated.connect(self.set_debug) + def accept(self): # Solvers self.conf.solvers = self.solver_table_model.rows.copy() @@ -209,6 +212,11 @@ class ConfigureWindow(ASubWindow, ListedSubWindow): self.conf.save() self.close() + # Debug + def set_debug(self): + self.conf.debug = not self.conf.debug + print(f"[DEBUG] Debug mode set : {self.conf.debug}") + # Solvers def edit_solver(self): diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index a907426d1a966e6089d59177e4211235ba2ed61a..5150409cbd293c7d51361812e379162d57cddb9f 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -114,7 +114,8 @@ 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("F5"), self) + return def setup_connection(self): """Connect action to callback function @@ -165,7 +166,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_solver) def changeEvent(self, event): if event.type() == QEvent.LanguageChange: diff --git a/src/View/ui/ConfigureDialog.ui b/src/View/ui/ConfigureDialog.ui index 8f9a56039cddece09d10bd78c18abd1c233b521d..bbde334eeac0c8939556bc1d7259bcbedb9fb5a3 100644 --- a/src/View/ui/ConfigureDialog.ui +++ b/src/View/ui/ConfigureDialog.ui @@ -21,6 +21,9 @@ <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QTabWidget" name="tabWidget"> + <property name="enabled"> + <bool>true</bool> + </property> <property name="currentIndex"> <number>0</number> </property> @@ -37,6 +40,9 @@ <bool>false</bool> </property> <widget class="QWidget" name="tab_solvers"> + <property name="enabled"> + <bool>true</bool> + </property> <attribute name="title"> <string>Solvers</string> </attribute> @@ -224,6 +230,9 @@ </layout> </widget> <widget class="QWidget" name="tab_backup"> + <property name="enabled"> + <bool>false</bool> + </property> <attribute name="title"> <string>Backup</string> </attribute> @@ -414,6 +423,19 @@ <string>Editor</string> </attribute> <layout class="QGridLayout" name="gridLayout_8"> + <item row="3" column="0"> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> <item row="0" column="0"> <widget class="QLabel" name="label_11"> <property name="font"> @@ -422,11 +444,11 @@ </font> </property> <property name="text"> - <string>This value must be used for reading or editing files in speficic case</string> + <string>This value must be used for reading or editing files in speficic case.</string> </property> </widget> </item> - <item row="1" column="0"> + <item row="2" column="0"> <layout class="QHBoxLayout" name="horizontalLayout_8"> <item> <widget class="QLabel" name="label"> @@ -444,18 +466,12 @@ </item> </layout> </item> - <item row="2" column="0"> - <spacer name="verticalSpacer_5"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <item row="1" column="0"> + <widget class="QLabel" name="label_12"> + <property name="text"> + <string> - The "@file" keyworkd is replace by the path of file to open.</string> </property> - </spacer> + </widget> </item> </layout> </widget> diff --git a/src/View/ui/MainWindow.ui b/src/View/ui/MainWindow.ui index 619b87e638847abac24efd0b85dec620487be857..eb64701c2a7f3e66befe88cc401c1388301a4a84 100644 --- a/src/View/ui/MainWindow.ui +++ b/src/View/ui/MainWindow.ui @@ -597,6 +597,9 @@ <property name="text"> <string>Run solver</string> </property> + <property name="shortcut"> + <string>F5</string> + </property> </action> <action name="action_stop_solver"> <property name="text"> @@ -746,9 +749,6 @@ <property name="toolTip"> <string>Run solver on current study</string> </property> - <property name="shortcut"> - <string>Ctrl+X</string> - </property> </action> <action name="action_toolBar_kill_solver"> <property name="enabled"> diff --git a/src/config.py b/src/config.py index b58325be2eb5155ed53df65a5dd7ba95a33c5c53..66d9139626697dc719d9f7a43e4032c6e78b6b32 100644 --- a/src/config.py +++ b/src/config.py @@ -19,8 +19,6 @@ class Config(SQL): self.filename = Config.filename() self.set_default_value() - print(self.filename) - super(Config, self).__init__(filename = self.filename) def _create(self): @@ -135,6 +133,10 @@ class Config(SQL): v = self.execute("SELECT value FROM data WHERE key='lang'") self.lang = v[0] + # Debug + v = self.execute("SELECT value FROM data WHERE key='debug'") + self.debug = v[0] == "True" + self._load_solver() self._load_stricklers() @@ -183,6 +185,7 @@ class Config(SQL): "backup_max": self.backup_max, "editor": self.editor, "lang": self.lang, + "debug": self.debug, } for key in data: @@ -226,6 +229,9 @@ class Config(SQL): # Stricklers self.stricklers = StricklersList() + # Debug + self.debug = False + @classmethod def filename(cls): file = ""