X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4e8cae716ad3fdf29a7b2a45e5eec0a530f93277..fb412ff32c7938649c72d55eed3f5c8ccb5e0a99:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 67212656..2624209c 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -1020,6 +1020,7 @@ class InfoBarExtensions: PIPON = 0 PIPOFF = 1 MOVEPIP = 2 + PIPSWAP = 3 def extensions(self): list = [] @@ -1028,29 +1029,30 @@ class InfoBarExtensions: elif self.pipshown == True: list.append((_("Disable Picture in Picture"), self.PIPOFF)) list.append((_("Move Picture in Picture"), self.MOVEPIP)) + list.append((_("Swap services"), self.PIPSWAP)) self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list = list) def extensionCallback(self, answer): if answer is not None: if answer[1] == self.PIPON: -# self.session.nav.stopService() self.pip = self.session.instantiateDialog(PictureInPicture) - #self.pip.show() newservice = self.session.nav.getCurrentlyPlayingServiceReference() - self.pipservice = eServiceCenter.getInstance().play(newservice) - if self.pipservice and not self.pipservice.setTarget(1): - self.pipservice.start() + + if self.pip.playService(newservice): self.pipshown = True else: - self.pipservice = None + self.pipshown = False del self.pip self.session.nav.playService(newservice) elif answer[1] == self.PIPOFF: - #self.pip.hide() - self.pipservice = None del self.pip self.pipshown = False + elif answer[1] == self.PIPSWAP: + swapservice = self.pip.getCurrentService() + self.pip.playService(self.session.nav.getCurrentlyPlayingServiceReference()) + self.session.nav.playService(swapservice) + elif answer[1] == self.MOVEPIP: self.session.open(PiPSetup, pip = self.pip) @@ -1410,8 +1412,11 @@ class InfoBarNotifications: Notifications.notificationAdded.append(self.checkNotificationsIfExecing) def checkNotificationsIfExecing(self): - if self.execing: - self.checkNotifications() + try: + if self.execing: + self.checkNotifications() + except: + print "******************************* A SEVERE ERROR HAPPENED... Someone who understands the code... please fix :) *******" def checkNotifications(self): if len(Notifications.notifications):