- def addItems(self, list, childNode):
- for x in childNode:
- if x.nodeType != xml.dom.minidom.Element.nodeType:
- continue
- elif x.tagName == 'item':
- ItemText = getValbyAttr(x, "text")
- b = eval(XMLTools.mergeText(x.childNodes));
- print "item " + ItemText + " " + b.configPath
- if b == "":
- continue
- #add to configlist
- item = b.controlType(b)
-
- # the first b is the item itself, ignored by the configList.
- # the second one is converted to string.
- list.append( (ItemText, item) )
-
- def keyOk(self):
- if (self["config"].getCurrent()[1].parent.enabled == True):
- self["config"].handleKey(config.key["choseElement"])
- def keyLeft(self):
- if (self["config"].getCurrent()[1].parent.enabled == True):
- self["config"].handleKey(config.key["prevElement"])
- def keyRight(self):
- if (self["config"].getCurrent()[1].parent.enabled == True):
- self["config"].handleKey(config.key["nextElement"])
-
- def keySave(self):
- print "save requested"
- for x in self["config"].list:
- x[1].save()
- self.close()
-
- def keyCancel(self):
- print "cancel requested"
- for x in self["config"].list:
- x[1].cancel()
- self.close()
-
- def keyNumberGlobal(self, number):
- print "You pressed number " + str(number)
- if (self["config"].getCurrent()[1].parent.enabled == True):
- self["config"].handleKey(config.key[str(number)])
-
-
- # TODO ugly as hell. any better ideas?
- def keyNumber1(self):
- self.keyNumberGlobal(1)
- def keyNumber2(self):
- self.keyNumberGlobal(2)
- def keyNumber3(self):
- self.keyNumberGlobal(3)
- def keyNumber4(self):
- self.keyNumberGlobal(4)
- def keyNumber5(self):
- self.keyNumberGlobal(5)
- def keyNumber6(self):
- self.keyNumberGlobal(6)
- def keyNumber7(self):
- self.keyNumberGlobal(7)
- def keyNumber8(self):
- self.keyNumberGlobal(8)
- def keyNumber9(self):
- self.keyNumberGlobal(9)
- def keyNumber0(self):
- self.keyNumberGlobal(0)