Example #1
0
 def getAccelerator(self, title):
     realAcc = guiConfig.getCompositeValue("gui_accelerators", title)
     if realAcc:
         key, mod = gtk.accelerator_parse(realAcc)
         if gtk.accelerator_valid(key, mod):
             return realAcc
         else:
             plugins.printWarning("Keyboard accelerator '" + realAcc + "' for action '" \
                                  + title + "' is not valid, ignoring ...")
    def listRunningProcesses(self):
        processesToCheck = guiConfig.getCompositeValue("query_kill_processes", "", modeDependent=True)
        if "all" in processesToCheck:
            processesToCheck = [".*"]
        if len(processesToCheck) == 0:
            return []

        running = []
        triggerGroup = plugins.TextTriggerGroup(processesToCheck)
        for process, description in self.processesForKill.values():
            if triggerGroup.stringContainsText(description):
                running.append("PID " + str(process.pid) + " : " + description)

        return running
 def getConfigOptions(self, option):
     fromConfig = guiConfig.getCompositeValue("gui_entry_options", option.name)
     if fromConfig is None:  # Happens on initial startup with no apps...
         return []
     return fromConfig
 def setConfigOverride(self, switch, index, option, *args):
     configName = self.getNaming(switch.name, option, *args)
     if index == switch.getValue() or guiConfig.getCompositeValue("gui_entry_overrides", configName) == "1":
         switch.setValue(index)
 def updateForConfig(self, option):
     fromConfig = guiConfig.getCompositeValue("gui_entry_overrides", option.name)
     # only do this if it hasn't previously been manually overwritten
     if fromConfig is not None and fromConfig != "<not set>" and option.getValue() == option.defaultValue:
         option.setValue(fromConfig)
         return fromConfig
Example #6
0
 def setConfigOverride(self, switch, index, option, *args):
     cleanOption = option.split("\n")[0].replace("_", "")
     configName = self.getNaming(switch.name, option, *args)
     if index == switch.getValue() or guiConfig.getCompositeValue("gui_entry_overrides", configName) == "1":
         switch.setValue(index)