from Components.config import configfile
from Components.PluginComponent import plugins
from Components.config import config
+from Components.SystemInfo import SystemInfo
from Tools.Directories import resolveFilename, SCOPE_SKIN
self.session.openWithCallback(self.menuClosed, Setup, dialog)
def addMenu(self, destList, node):
+ requires = node.getAttribute("requires")
+ if requires and not SystemInfo.get(requires, False):
+ return
MenuTitle = _(node.getAttribute("text").encode("UTF-8") or "??")
entryID = node.getAttribute("entryID") or "undefined"
weight = node.getAttribute("weight") or 50
self.close(True)
def addItem(self, destList, node):
+ requires = node.getAttribute("requires")
+ if requires and not SystemInfo.get(requires, False):
+ return
item_text = node.getAttribute("text").encode("UTF-8")
entryID = node.getAttribute("entryID") or "undefined"
weight = node.getAttribute("weight") or 50
continue
elif x.tagName == 'item':
item_level = int(x.getAttribute("level") or "0")
+
if item_level <= config.usage.setup_level.index:
self.addItem(list, x)
count += 1
# check if a plugin overrides an existing menu
plugin_menuid = l[2]
for x in list:
- print x[2], plugin_menuid
if x[2] == plugin_menuid:
list.remove(x)
break
})
a = parent.getAttribute("title").encode("UTF-8") or None
+ a = a and _(a)
if a is None:
a = _(parent.getAttribute("text").encode("UTF-8"))
self["title"] = StaticText(a)