Commits

Virgil Dupras  committed 07f0b08

Fixed debug mode under Qt.

  • Participants
  • Parent commits 6f6a11b

Comments (0)

Files changed (3)

File qt/controller/preferences_panel.py

         self.fontSizeSpinBox.setValue(self.app.prefs.tableFontSize)
         self.scopeDialogCheckBox.setChecked(appm.show_schedule_scope_dialog)
         self.autoDecimalPlaceCheckBox.setChecked(appm.auto_decimal_place)
-        self.debugModeCheckBox.setChecked(bool(QSettings().value('DebugMode')))
+        self.debugModeCheckBox.setChecked(self.app.prefs.debugMode)
         try:
             langindex = SUPPORTED_LANGUAGES.index(self.app.prefs.language)
         except ValueError:
         self.app.prefs.tableFontSize = self.fontSizeSpinBox.value()
         appm.show_schedule_scope_dialog = self.scopeDialogCheckBox.isChecked()
         appm.auto_decimal_place = self.autoDecimalPlaceCheckBox.isChecked()
-        QSettings().setValue('DebugMode', self.debugModeCheckBox.isChecked())
+        self.app.prefs.debugMode = self.debugModeCheckBox.isChecked()
         lang = SUPPORTED_LANGUAGES[self.languageComboBox.currentIndex()]
         oldlang = self.app.prefs.language
         if oldlang not in SUPPORTED_LANGUAGES:

File qt/preferences.py

         self.dateFormat = get('DateFormat', self.dateFormat)
         self.tableFontSize = get('TableFontSize', self.tableFontSize)
         self.language = get('Language', self.language)
+        self.debugMode = get('DebugMode', self.debugMode)
         
     def reset(self):
         locale = QLocale.system()
         self.dateFormat = dateFormat
         self.tableFontSize = QApplication.font().pointSize()
         self.language = ''
+        self.debugMode = False
         
     def _save_values(self, settings):
         set_ = self.set_value
         set_('DateFormat', self.dateFormat)
         set_('TableFontSize', self.tableFontSize)
         set_('Language', self.language)
+        set_('DebugMode', self.debugMode)
     

File run_template_qt.py

 from hscommon.plat import ISLINUX
 from qtlib.error_report_dialog import install_excepthook
 from qtlib.util import setupQtLogging
+from qtlib.preferences import adjust_after_deserialization
 import qt.mg_rc
 from qt.plat import BASE_PATH
 
     app.setOrganizationName('Hardcoded Software')
     app.setApplicationName('moneyGuru')
     settings = QSettings()
-    LOGGING_LEVEL = logging.DEBUG if settings.value('DebugMode') else logging.WARNING
+    LOGGING_LEVEL = logging.DEBUG if adjust_after_deserialization(settings.value('DebugMode')) else logging.WARNING
     setupQtLogging(level=LOGGING_LEVEL)
     logging.debug('started in debug mode')
     if ISLINUX: