</widget>
</screen>"""
- def __init__(self, session, parent):
- Screen.__init__(self, session, parent)
-
class Menu(Screen):
ALLOW_SUSPEND = True
def addMenu(self, destList, node):
requires = node.get("requires")
- if requires and not SystemInfo.get(requires, False):
- return
+ if requires:
+ if requires[0] == '!':
+ if SystemInfo.get(requires[1:], False):
+ return
+ elif not SystemInfo.get(requires, False):
+ return
MenuTitle = _(node.get("text", "??").encode("UTF-8"))
entryID = node.get("entryID", "undefined")
weight = node.get("weight", 50)
self.menuClosed(*res)
def menuClosed(self, *res):
- if len(res) and res[0]:
+ if res and res[0]:
self.close(True)
def addItem(self, destList, node):
requires = node.get("requires")
- if requires and not SystemInfo.get(requires, False):
- return
+ if requires:
+ if requires[0] == '!':
+ if SystemInfo.get(requires[1:], False):
+ return
+ elif not SystemInfo.get(requires, False):
+ return
item_text = node.get("text", "").encode("UTF-8")
entryID = node.get("entryID", "undefined")
weight = node.get("weight", 50)
elif x.tag == 'setup':
id = x.get("id")
if item_text == "":
- item_text = _(getSetupTitle(id)) + "..."
+ item_text = _(getSetupTitle(id))
else:
item_text = _(item_text)
destList.append((item_text, boundFunction(self.openSetup, id), entryID, weight))
# Calculate index
number -= 1
- if len(self["menu"].list) > number:
+ if len(self["menu"].list) > number:
self["menu"].setIndex(number)
self.okbuttonClick()