fix showing of infobar on servicechange via servicelist
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 14 Jun 2007 21:09:07 +0000 (21:09 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 14 Jun 2007 21:09:07 +0000 (21:09 +0000)
lib/python/Screens/ChannelSelection.py
lib/python/Screens/InfoBarGenerics.py

index 728cecf2ecb8a4af36e6e6436bb8c1e3074483bf..eb6f90593775dc7ae2a693856e50de7c7ea28acc 100644 (file)
@@ -1054,6 +1054,7 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect
                self.lastroot = config.tv.lastroot
                self.revertMode = None
                config.usage.multibouquet.addNotifier(self.multibouquet_config_changed)
+               self.new_service_played = False
 
        def multibouquet_config_changed(self, val):
                self.recallBouquetMode()
@@ -1129,12 +1130,18 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect
                ref = self.session.nav.getCurrentlyPlayingServiceReference()
                nref = self.getCurrentSelection()
                if ref is None or ref != nref:
+                       self.new_service_played = True
                        self.session.nav.playService(nref)
                        self.saveRoot()
                        self.saveChannel(nref)
                        config.servicelist.lastmode.save()
                        self.addToHistory(nref)
 
+       def newServicePlayed(self):
+               ret = self.new_service_played
+               self.new_service_played = False
+               return ret
+
        def addToHistory(self, ref):
                if self.servicePath is not None:
                        tmp=self.servicePath[:]
index f8b6c7eac1a4eaafd6d04766fbc0d5e76d1ece13..da0e6d6ff746b0030b223b1a9ee004a775d44ec2 100644 (file)
@@ -96,11 +96,18 @@ class InfoBarShowHide:
                                if old_begin_time and old_begin_time != self.current_begin_time:
                                        self.doShow()
 
-       def __serviceStarted(self):
-               if self.execing:
+       def __serviceStarted(self, force=False):
+               new = self.servicelist.newServicePlayed()
+               if self.execing or force:
                        self.current_begin_time=0
                        if config.usage.show_infobar_on_zap.value:
                                self.doShow()
+               elif not self.__checkServiceStarted in self.onExecBegin and new:
+                       self.onExecBegin.append(self.__checkServiceStarted)
+
+       def __checkServiceStarted(self):
+               self.__serviceStarted(True)
+               self.onExecBegin.remove(self.__checkServiceStarted)
 
        def __onShow(self):
                self.__state = self.STATE_SHOWN