Only select played service in service list when in primer InfoBar
authorLittlesat <littlesat99@yahoo.com>
Sun, 10 Nov 2013 19:23:23 +0000 (20:23 +0100)
committerLittlesat <littlesat99@yahoo.com>
Sun, 10 Nov 2013 19:23:23 +0000 (20:23 +0100)
Navigation.py

index f9ff93f..539c461 100644 (file)
@@ -54,7 +54,7 @@ class Navigation:
                        x(rec_service, event)
 
        def playService(self, ref, checkParentalControl=True, forceRestart=False):
-               oldref = self.currentlyPlayingServiceReference
+               oldref = self.currentlyPlayingServiceOrGroup
                if ref and oldref and ref == oldref and not forceRestart:
                        print "ignore request to play already running service(1)"
                        return 0
@@ -62,7 +62,8 @@ class Navigation:
                if ref is None:
                        self.stopService()
                        return 0
-               InfoBarInstance = InfoBar.instance
+               from Components.ServiceEventTracker import InfoBarCount
+               InfoBarInstance = InfoBarCount == 1 and InfoBar.instance
                if not checkParentalControl or parentalControl.isServicePlayable(ref, boundFunction(self.playService, checkParentalControl=False, forceRestart=forceRestart)):
                        if ref.flags & eServiceReference.isGroup:
                                if not oldref:
@@ -81,16 +82,15 @@ class Navigation:
                                self.pnav.stopService()
                                self.currentlyPlayingServiceReference = playref
                                self.currentlyPlayingServiceOrGroup = ref
-                               if InfoBarInstance is not None:
-                                       if InfoBarInstance.servicelist.servicelist.setCurrent(ref):
-                                               self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent()
+                               if InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(ref):
+                                       self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent()
                                if self.pnav.playService(playref):
                                        print "Failed to start", playref
                                        self.currentlyPlayingServiceReference = None
                                        self.currentlyPlayingServiceOrGroup = None
                                return 0
-               elif oldref:
-                       InfoBarInstance.servicelist.servicelist.setCurrent(oldref)
+               elif oldref and InfoBarInstance and InfoBarInstance.servicelist.servicelist.setCurrent(oldref):
+                       self.currentlyPlayingServiceOrGroup = InfoBarInstance.servicelist.servicelist.getCurrent()
                return 1
 
        def getCurrentlyPlayingServiceReference(self):