remove onSelectionChanged callbacks before deleting the configInstance["config"]...
[enigma2.git] / lib / python / Screens / Setup.py
index f7b4fa58a8fe81cb787fbad1e1bc2244c32ab3d2..3ff0b76e3ed0f9d6f0361765aba8572ffefddca2 100644 (file)
@@ -1,13 +1,12 @@
 from Screen import Screen
 from Components.ActionMap import NumberActionMap
 from Components.config import config, ConfigNothing
 from Screen import Screen
 from Components.ActionMap import NumberActionMap
 from Components.config import config, ConfigNothing
+from Components.SystemInfo import SystemInfo
 from Components.ConfigList import ConfigListScreen
 from Components.Label import Label
 from Components.Pixmap import Pixmap
 
 import xml.dom.minidom
 from Components.ConfigList import ConfigListScreen
 from Components.Label import Label
 from Components.Pixmap import Pixmap
 
 import xml.dom.minidom
-from skin import elementsWithTag
-
 from Tools import XMLTools
 
 # FIXME: use resolveFile!
 from Tools import XMLTools
 
 # FIXME: use resolveFile!
@@ -133,6 +132,10 @@ class Setup(ConfigListScreen, Screen):
                                if item_level > config.usage.setup_level.index:
                                        continue
 
                                if item_level > config.usage.setup_level.index:
                                        continue
 
+                               requires = x.getAttribute("requires")
+                               if requires and not SystemInfo.get(requires, False):
+                                       continue;
+
                                item_text = _(x.getAttribute("text").encode("UTF-8") or "??")
                                b = eval(XMLTools.mergeText(x.childNodes));
                                if b == "":
                                item_text = _(x.getAttribute("text").encode("UTF-8") or "??")
                                b = eval(XMLTools.mergeText(x.childNodes));
                                if b == "":
@@ -146,7 +149,7 @@ class Setup(ConfigListScreen, Screen):
 
 def getSetupTitle(id):
        xmldata = setupdom.childNodes[0].childNodes
 
 def getSetupTitle(id):
        xmldata = setupdom.childNodes[0].childNodes
-       for x in elementsWithTag(xmldata, "setup"):
+       for x in XMLTools.elementsWithTag(xmldata, "setup"):
                if x.getAttribute("key") == id:
                        return x.getAttribute("title").encode("UTF-8")
        raise "unknown setup id '%s'!" % repr(id)
                if x.getAttribute("key") == id:
                        return x.getAttribute("title").encode("UTF-8")
        raise "unknown setup id '%s'!" % repr(id)