def updateHelpText(self): for (actionmap, context, actions) in self.helpList: if context == "ColorActionsLong": for index, item in enumerate(actions): func = qButtons.getFunction(item[0]) text = getPluginCaption(func) actions[index] = (item[0], text)
def findButton(self, function): fn = ('red', 'green', 'yellow', 'blue') for key in fn: func = qButtons.getFunction(key) if func == function: key_text = 'key_%s' % (key) return self[key_text]
def updateButtonText(self): global toggleSeenButton toggleSeenButton = None fn = ('red', 'green', 'yellow', 'blue') for key in fn: key_text = 'key_%s' % (key) function = qButtons.getFunction(key) text = getPluginCaption(function) self[key_text].setText(text) if function == "Toggle seen": toggleSeenButton = self[key_text]
def getFunction(self, key): if self.qindex == 0 or not key in self.fn: print "stored function", key return qButtons.getFunction(key) else: num = self.fn.index(key) n = ((self.qindex - 1) * 4) + num print "index funktion", key, str(n) if n < len(self.qbuttons): return self.qbuttons[n][0] else: return "Nothing"
def redpressedlong(self): print("red long") self.startPlugin(qButtons.getFunction("red_long"), None)
def greenpressedlong(self): print("green long") self.startPlugin(qButtons.getFunction("green_long"), None)
def yellowpressed(self): self.startPlugin(qButtons.getFunction("yellow"), self["key_yellow"])
def bluepressed(self): self.startPlugin(qButtons.getFunction("blue"), self["key_blue"])
def redpressed(self): self.startPlugin(qButtons.getFunction("red"), self["key_red"])
def greenpressed(self): self.startPlugin(qButtons.getFunction("green"), self["key_green"])
def yellowpressedlong(self): print("yellow long") self.startPlugin(qButtons.getFunction("yellow_long"), None)
def bluepressedlong(self): print "blue long" self.startPlugin(qButtons.getFunction("blue_long"), None)
def yellowpressedlong(self): print "yellow long" self.startPlugin(qButtons.getFunction("yellow_long"), None)
def greenpressedlong(self): print "green long" self.startPlugin(qButtons.getFunction("green_long"), None)
def redpressedlong(self): print "red long" self.startPlugin(qButtons.getFunction("red_long"), None)
def bluepressedlong(self): print("blue long") self.startPlugin(qButtons.getFunction("blue_long"), None)
def findButton(self, function): for key in self.fn: func = qButtons.getFunction(key) if func == function: key_text = 'key_%s' % (key) return self[key_text]