def _loadState(self): ''' Loads the dialog state from configuration. ''' self._matchType = config.getInt(self._CONFIG_NAME, self._CONFIG_SECTION_OPTIONS, "match_type", self._PARTIAL_MATCH) self._caseSensitiveMatch = config.getBool(self._CONFIG_NAME, self._CONFIG_SECTION_OPTIONS, "case_sensitive", False) self._method = config.getInt(self._CONFIG_NAME, self._CONFIG_SECTION_OPTIONS, "method", self._DEEP_METHOD) if self._matchType == self._EXACT_MATCH: self.checkBoxExactMatch.setChecked(True) elif self._matchType == self._PARTIAL_MATCH: self.checkBoxExactMatch.setChecked(False) self.checkBoxCaseSensitive.setChecked(self._caseSensitiveMatch) if self._method == self._DEEP_METHOD: self.radioButtonDeep.setChecked(True) elif self._method == self._SIMPLE_METHOD: self.radioButtonSimple.setChecked(True) self._refreshCompleters() log.info("Search dialog state was loaded from configuration")
def getBool(self): ''' Gets a value of the settings option converted to boolean. If the option does not exist the 'None' is returned. :return: A value of the option :rtype: boolean ''' return config.getBool(self._name, self._section, self._option, self._default)
def loadState(self): ''' Loads the view's settings from configuration. ''' View.loadState(self) visible = config.getBool(self.NAME, self._CONFIG_SECTION_CONSOLE, "visible", False) if self._widgetConsole.isVisible() != visible: if visible: self._showConsole() else: self._hideConsole()
def testGetBool(self): self._setUpTestFiles() self.assertEqual( True, config.getBool(self._filenames[1], 'Test_4', 'test4_3')) self.assertEqual( None, config.getBool(self._filenames[1], 'Test_4', 'test4_4'))
def testGetBool(self): self._setUpTestFiles() self.assertEqual(True, config.getBool(self._filenames[1], 'Test_4', 'test4_3')) self.assertEqual(None, config.getBool(self._filenames[1], 'Test_4', 'test4_4'))