fix for pressing OK in MediaPlayer when currently selected file is already playing...
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 17 Oct 2006 22:08:12 +0000 (22:08 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 17 Oct 2006 22:08:12 +0000 (22:08 +0000)
lib/python/Components/MediaPlayer.py
lib/python/Screens/MediaPlayer.py

index 45551cc..b2cb4eb 100644 (file)
@@ -57,7 +57,7 @@ class PlayList(MenuList, HTMLComponent, GUIComponent):
                self.list = []
                self.l.setList(self.list)
                self.l.setFont(0, gFont("Regular", 18))
-               self.currPlaying = 0
+               self.currPlaying = -1
                self.oldCurrPlaying = -1
        
        def clear(self):
@@ -91,6 +91,8 @@ class PlayList(MenuList, HTMLComponent, GUIComponent):
                self.currPlaying = index
        
        def updateState(self, state):
+               if self.currPlaying == -1:
+                       return
                if len(self.list) > self.oldCurrPlaying and self.oldCurrPlaying != -1:
                        self.list[self.oldCurrPlaying] = PlaylistEntryComponent(self.list[self.oldCurrPlaying][0], STATE_NONE)
                self.list[self.currPlaying] = PlaylistEntryComponent(self.list[self.currPlaying][0], state)
index 446621d..7bde684 100644 (file)
@@ -283,6 +283,7 @@ class MediaPlayer(Screen, InfoBarSeek):
                                self.filelist.descent()
                                self.updateCurrentInfo()
                        else:
+                               self.stopEntry()
                                self.playlist.clear()
                                self.copyDirectory(os.path.dirname(self.filelist.getSelection()[0].getPath()) + "/", recursive = False)
                                self.playServiceRefEntry(self.filelist.getServiceRef())