fix movemode, do not use listboxcontent private variables
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 14 Nov 2005 03:02:01 +0000 (03:02 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 14 Nov 2005 03:02:01 +0000 (03:02 +0000)
lib/python/Components/ServiceList.py
lib/python/Screens/ChannelSelection.py
lib/service/listboxservice.h

index 76e1c82..efe928d 100644 (file)
@@ -52,12 +52,6 @@ class ServiceList(HTMLComponent, GUIComponent):
                self.l.setRoot(root)
                self.l.sort()
 
                self.l.setRoot(root)
                self.l.sort()
 
-       def cursorGet(self):
-               return self.l.cursorGet()
-
-       def cursorSet(self, val):
-               self.l.cursorSet(val)
-
 # stuff for multiple marks (edit mode / later multiepg)
        def clearMarks(self):
                self.l.initMarked()
 # stuff for multiple marks (edit mode / later multiepg)
        def clearMarks(self):
                self.l.initMarked()
index 496131b..fc412a8 100644 (file)
@@ -126,10 +126,8 @@ class ChannelSelection(Screen):
                ref=l.getCurrent()
                if ref.valid() and self.mutableList is not None:
                        self.mutableList.removeService(ref)
                ref=l.getCurrent()
                if ref.valid() and self.mutableList is not None:
                        self.mutableList.removeService(ref)
-                       pos = l.cursorGet()
                        self.mutableList.flushChanges() #FIXME dont flush on each single removed service
                        self.setRoot(l.getRoot())
                        self.mutableList.flushChanges() #FIXME dont flush on each single removed service
                        self.setRoot(l.getRoot())
-#                      l.cursorSet(pos) #whats going wrong here????
 
        def endMarkedEdit(self, abort):
                l = self["list"]
 
        def endMarkedEdit(self, abort):
                l = self["list"]
@@ -208,6 +206,8 @@ class ChannelSelection(Screen):
 
        def toggleMoveMode(self):
                if self.movemode:
 
        def toggleMoveMode(self):
                if self.movemode:
+                       if self.entry_marked:
+                               self.channelSelected() # unmark current entry
                        self.movemode = False
                        self.mutableList.flushChanges() # FIXME add check if changes was made
                else:
                        self.movemode = False
                        self.mutableList.flushChanges() # FIXME add check if changes was made
                else:
index e65ffc8..d64805c 100644 (file)
@@ -48,13 +48,14 @@ public:
        void sort();
 
        int setCurrentMarked(bool);
        void sort();
 
        int setCurrentMarked(bool);
-       int cursorSet(int n);
-       int cursorGet();
+
 protected:
        void cursorHome();
        void cursorEnd();
        int cursorMove(int count=1);
        int cursorValid();
 protected:
        void cursorHome();
        void cursorEnd();
        int cursorMove(int count=1);
        int cursorValid();
+       int cursorSet(int n);
+       int cursorGet();
 
        void cursorSave();
        void cursorRestore();
 
        void cursorSave();
        void cursorRestore();