From 226d5ace683c1ac845d3a00fd9f5d2489c2eddcd Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 17 Oct 2006 22:08:12 +0000 Subject: [PATCH] fix for pressing OK in MediaPlayer when currently selected file is already playing (starts from the beginning in that case) --- lib/python/Components/MediaPlayer.py | 4 +++- lib/python/Screens/MediaPlayer.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index 45551ccc..b2cb4eb5 100644 --- a/lib/python/Components/MediaPlayer.py +++ b/lib/python/Components/MediaPlayer.py @@ -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) diff --git a/lib/python/Screens/MediaPlayer.py b/lib/python/Screens/MediaPlayer.py index 446621df..7bde6840 100644 --- a/lib/python/Screens/MediaPlayer.py +++ b/lib/python/Screens/MediaPlayer.py @@ -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()) -- 2.30.2