fixes bug #556
[enigma2.git] / lib / python / Screens / Menu.py
old mode 100644 (file)
new mode 100755 (executable)
index 5f2032f..2a8801c
@@ -97,8 +97,12 @@ class Menu(Screen):
 
        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)
@@ -120,8 +124,12 @@ class Menu(Screen):
 
        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)
@@ -152,7 +160,7 @@ class Menu(Screen):
                        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))
@@ -237,7 +245,7 @@ class Menu(Screen):
                # Calculate index
                number -= 1
 
-               if len(self["menu"].list) > number:
+               if len(self["menu"].list) > number:
                        self["menu"].setIndex(number)
                        self.okbuttonClick()