def loadSettings(self): """Load the possibly saved search plugin settings from diks.""" settings = PluginSettings('search') autocomplete = settings.pluginValue('autocomplete', False).toBool() highlight = settings.pluginValue('highlighting', False).toBool() self.enableCompletionOpt.setChecked(autocomplete) self.enableHighlightingOpt.setChecked(highlight) self.scopeBox.setCurrentIndex( settings.pluginValue('scope', 2).toInt()[0]) self.sizeLimitBox.setValue(settings.pluginValue('limit', 0).toInt()[0]) del settings
def writeSettings(self): """Slot for the onSettingsChanged signal. Writes the settings values to disk. """ settings = PluginSettings('search') settings.setPluginValue('autocomplete', self.enableCompletionOpt.isChecked()) settings.setPluginValue('highlighting', self.enableHighlightingOpt.isChecked()) settings.setPluginValue('scope', self.scopeBox.currentIndex()) settings.setPluginValue('limit', self.sizeLimitBox.value()) del settings
def __loadSettings(self): """Loads the plugin settings if available. """ s = PluginSettings('search') self.autocompleteIsEnabled = s.pluginValue( 'autocomplete', False).toBool() self.searchForm.scope = s.pluginValue('scope', 2).toInt()[0] self.searchForm.sizeLimit = s.pluginValue('limit', 0).toInt()[0] self.filterBuilder.setFilterHighlighter( s.pluginValue('highlighting', False).toBool()) # Try to fetch the luma config prefix from the settings file, # and call the loadFilterBookmarks to populate search box self.configPrefix = s.configPrefix self.loadFilterBookmarks()
def writeSettings(self): """Slot for the onSettingsChanged signal. Writes the settings values to disk. """ settings = PluginSettings('search') settings.setPluginValue( 'autocomplete', self.enableCompletionOpt.isChecked()) settings.setPluginValue( 'highlighting', self.enableHighlightingOpt.isChecked()) settings.setPluginValue( 'scope', self.scopeBox.currentIndex()) settings.setPluginValue( 'limit', self.sizeLimitBox.value()) del settings
def __init__(self, configPrefix = None, templateFileName = "templatelist.xml"): if configPrefix == None: #TODO Should get default settings = PluginSettings('template') configPrefix = settings.configPrefix self._templateList = [] self._configPrefix = configPrefix self._configFile = os.path.join(self._configPrefix, templateFileName) if os.path.isfile(self._configFile): self._readTemplateList()
def __loadSettings(self): """Loads the plugin settings if available. """ s = PluginSettings('search') self.autocompleteIsEnabled = s.pluginValue('autocomplete', False).toBool() self.searchForm.scope = s.pluginValue('scope', 2).toInt()[0] self.searchForm.sizeLimit = s.pluginValue('limit', 0).toInt()[0] self.filterBuilder.setFilterHighlighter( s.pluginValue('highlighting', False).toBool()) # Try to fetch the luma config prefix from the settings file, # and call the loadFilterBookmarks to populate search box self.configPrefix = s.configPrefix self.loadFilterBookmarks()