Softwaremanager: * properly count processed packages.
[enigma2.git] / lib / python / Screens / Menu.py
old mode 100644 (file)
new mode 100755 (executable)
index 93f23df..2a8801c
@@ -61,9 +61,6 @@ class MenuSummary(Screen):
                </widget>
        </screen>"""
 
-       def __init__(self, session, parent):
-               Screen.__init__(self, session, parent)
-
 class Menu(Screen):
 
        ALLOW_SUSPEND = True
@@ -100,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)
@@ -118,13 +119,17 @@ class Menu(Screen):
                self.menuClosed(*res)
 
        def menuClosed(self, *res):
-               if len(res) and res[0]:
+               if res and res[0]:
                        self.close(True)
 
        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)
@@ -155,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))
@@ -240,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()