revert last changes, don't drop "selectionChanged"
authorAxel Buehning <axel.buehning@multimedia-labs.de>
Fri, 24 Feb 2006 12:57:17 +0000 (12:57 +0000)
committerAxel Buehning <axel.buehning@multimedia-labs.de>
Fri, 24 Feb 2006 12:57:17 +0000 (12:57 +0000)
lib/python/Components/HelpMenuList.py
lib/python/Screens/HelpMenu.py

index e6f8539..c8ff379 100644 (file)
@@ -52,8 +52,13 @@ class HelpMenuList(GUIComponent):
                self.instance = eListbox(parent)
                self.instance.setContent(self.l)
                self.instance.setItemHeight(42)
+               self.instance.selectionChanged.get().append(self.selectionChanged)
                
        def GUIdelete(self):
                self.instance.setContent(None)
+               self.instance.selectionChanged.get().remove(self.selectionChanged)
                self.instance = None
 
+       def selectionChanged(self):
+               for x in self.onSelChanged:
+                       x()
index c19233e..e947ac9 100644 (file)
@@ -18,6 +18,7 @@ class HelpMenu(Screen):
                self.onSelChanged = [ ]
                
                self["list"] = HelpMenuList(list, self.close)
+               self["list"].onSelChanged.append(self.SelectionChanged)
                
                self["rc"] = Pixmap()
                self["arrowup"] = MovingPixmap()
@@ -26,17 +27,7 @@ class HelpMenu(Screen):
                {
                        "ok": self["list"].ok,
                        "back": self.close,
-                       "up": self.up,
-                       "down": self.down
                }, -1)
-       
-       def up(self):
-               self["list"].instance.moveSelection(self["list"].instance.moveUp)
-               self.SelectionChanged()
-               
-       def down(self):
-               self["list"].instance.moveSelection(self["list"].instance.moveDown)
-               self.SelectionChanged()
                
        def SelectionChanged(self):
                selection = self["list"].getCurrent()[3]
@@ -59,4 +50,3 @@ class HelpableScreen:
                if len(args):
                        (actionmap, context, action) = args
                        actionmap.action(context, action)
-