X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c7a7c847e336cc9d46fe8b4b52f21ced036a8c4f..d26a119a33db3ad39b4930712cef2b15cbaf0f8c:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index d5275768..0ae0dc42 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -29,6 +29,7 @@ from Screens.InputBox import InputBox from Screens.MessageBox import MessageBox from Screens.MinuteInput import MinuteInput from Screens.TimerSelection import TimerSelection +from Screens.PictureInPicture import PictureInPicture from ServiceReference import ServiceReference from Tools import Notifications @@ -957,6 +958,38 @@ class InfoBarTimeshift: self.timeshift_enabled = False self.__seekableStatusChanged() +class InfoBarExtensions: + def __init__(self): + self.pipshown = False + + self["InstantExtensionsActions"] = HelpableActionMap(self, "InfobarExtensions", + { + "extensions": (self.extensions, "Extensions..."), + }) + + def extensions(self): + list = [] + if self.pipshown == False: + list.append((_("Activate Picture in Picture"), "pipon")) + elif self.pipshown == True: + list.append((_("Disable Picture in Picture"), "pipoff")) + self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list = list) + + def extensionCallback(self, answer): + if answer[1] == "pipon": + self.session.nav.stopService() + self.pip = self.session.instantiateDialog(PictureInPicture) + #self.pip.show() + + newservice = str(ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference())) + "s" + self.pipservice = eServiceCenter.getInstance().play(eServiceReference(newservice)) + self.pipservice.start() + self.pipshown = True + elif answer[1] == "pipoff": + #self.pip.hide() + del self.pip + self.pipshown = False + from RecordTimer import parseEvent class InfoBarInstantRecord: @@ -1136,9 +1169,9 @@ class InfoBarAdditionalInfo: self.onLayoutFinish.append(self["ButtonYellowText"].update) self["ButtonBlue"] = PixmapConditional(withTimer = False) - self["ButtonBlue"].setConnect(lambda: False) + self["ButtonBlue"].setConnect(lambda: True) self["ButtonBlueText"] = LabelConditional(text = _("Extensions"), withTimer = False) - self["ButtonBlueText"].setConnect(lambda: False) + self["ButtonBlueText"].setConnect(lambda: True) self.onLayoutFinish.append(self["ButtonBlue"].update) self.onLayoutFinish.append(self["ButtonBlueText"].update)