aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/Menu.py
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-01 23:15:24 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-01 23:15:24 +0000
commitd89be097be4a9ac52166c5f47cc189c5522d3441 (patch)
tree7da4329e4fa22017a7312da52bfe7b1df8a16a02 /lib/python/Screens/Menu.py
parentec200e0207d0a5ddb91c9c6c4ab8ae1c8f33ecea (diff)
downloadenigma2-d89be097be4a9ac52166c5f47cc189c5522d3441.tar.gz
enigma2-d89be097be4a9ac52166c5f47cc189c5522d3441.zip
add possibilty to hide menu entries when needed hardware is not available
Diffstat (limited to 'lib/python/Screens/Menu.py')
-rw-r--r--lib/python/Screens/Menu.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py
index 7c084d45..ce7f2ea6 100644
--- a/lib/python/Screens/Menu.py
+++ b/lib/python/Screens/Menu.py
@@ -5,6 +5,7 @@ from Components.Sources.StaticText import StaticText
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
@@ -102,6 +103,9 @@ class Menu(Screen):
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
@@ -122,6 +126,9 @@ class Menu(Screen):
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
@@ -173,6 +180,7 @@ class Menu(Screen):
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