Esempio n. 1
0
 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
Esempio n. 2
0
    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
Esempio n. 3
0
    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()
Esempio n. 4
0
    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
Esempio n. 5
0
    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()
Esempio n. 6
0
 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
Esempio n. 7
0
    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()