restart previous running services in onClose event
[enigma2.git] / lib / python / Screens / Setup.py
index 1f262e32139ae207f1c380e102df2cce84f523a5..f352e8cb0e026aaf227b6e665602cb1a8e37c9e6 100644 (file)
@@ -1,6 +1,7 @@
 from Screen import Screen
 from Components.ActionMap import NumberActionMap
-from Components.config import config
+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
@@ -78,6 +79,9 @@ class Setup(ConfigListScreen, Screen):
        def __init__(self, session, setup):
                Screen.__init__(self, session)
 
+               # for the skin: first try a setup_<setupID>, then Setup
+               self.skinName = ["setup_" + setup, "Setup" ]
+
                self.onChangedEntry = [ ]
 
                self.setup = setup
@@ -130,6 +134,10 @@ class Setup(ConfigListScreen, Screen):
                                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 == "":
@@ -138,7 +146,8 @@ class Setup(ConfigListScreen, Screen):
                                item = b
                                # the first b is the item itself, ignored by the configList.
                                # the second one is converted to string.
-                               list.append( (item_text, item) )
+                               if not isinstance(item, ConfigNothing):
+                                       list.append( (item_text, item) )
 
 def getSetupTitle(id):
        xmldata = setupdom.childNodes[0].childNodes