- ItemText = _(getValbyAttr(node, "text"))
- if ItemText != "": #check for name
- for x in node.childNodes:
- if x.nodeType != xml.dom.minidom.Element.nodeType:
- continue
- elif x.tagName == 'screen':
- module = getValbyAttr(x, "module")
- screen = getValbyAttr(x, "screen")
-
- if len(screen) == 0:
- screen = module
-
- if module != "":
- module = "Screens." + module
-
- # check for arguments. they will be appended to the
- # openDialog call
- args = XMLTools.mergeText(x.childNodes)
- screen += ", " + args
-
- destList.append((ItemText, boundFunction(self.runScreen, (module, screen))))
- return
- elif x.tagName == 'code':
- destList.append((ItemText, boundFunction(self.execText, XMLTools.mergeText(x.childNodes))))
- return
- elif x.tagName == 'setup':
- id = getValbyAttr(x, "id")
- destList.append((ItemText, boundFunction(self.openSetup, id)))
- return
-
- destList.append((ItemText,self.nothing))
-
-
- def __init__(self, session, parent, childNode):
+ requires = node.get("requires")
+ if requires and not SystemInfo.get(requires, False):
+ return
+ item_text = node.get("text", "").encode("UTF-8")
+ entryID = node.get("entryID", "undefined")
+ weight = node.get("weight", 50)
+ for x in node:
+ if x.tag == 'screen':
+ module = x.get("module")
+ screen = x.get("screen")
+
+ if screen is None:
+ screen = module
+
+ print module, screen
+ if module:
+ module = "Screens." + module
+ else:
+ module = ""
+
+ # check for arguments. they will be appended to the
+ # openDialog call
+ args = x.text or ""
+ screen += ", " + args
+
+ destList.append((_(item_text or "??"), boundFunction(self.runScreen, (module, screen)), entryID, weight))
+ return
+ elif x.tag == 'code':
+ destList.append((_(item_text or "??"), boundFunction(self.execText, x.text), entryID, weight))
+ return
+ elif x.tag == 'setup':
+ id = x.get("id")
+ if item_text == "":
+ item_text = _(getSetupTitle(id)) + "..."
+ else:
+ item_text = _(item_text)
+ destList.append((item_text, boundFunction(self.openSetup, id), entryID, weight))
+ return
+ destList.append((item_text, self.nothing, entryID, weight))
+
+
+ def __init__(self, session, parent):