X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/0efa85535ab64a0697fe415d3750341c516268b8..2c3384af08412169cad78b45eae107effafce328:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 7f90b976..4f10cbcf 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -24,7 +24,6 @@ from Screens.TimerSelection import TimerSelection from Screens.PictureInPicture import PictureInPicture from Screens.SubtitleDisplay import SubtitleDisplay from Screens.RdsDisplay import RdsInfoDisplay, RassInteractive -from Screens.SleepTimerEdit import SleepTimerEdit from Screens.TimeDateInput import TimeDateInput from ServiceReference import ServiceReference @@ -366,8 +365,16 @@ class InfoBarSimpleEventView: self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions", { "showEventInfo": (self.openEventView, _("show event details")), + "showInfobarOrEpgWhenInfobarAlreadyVisible": self.showEventInfoWhenNotVisible, }) + def showEventInfoWhenNotVisible(self): + if self.shown: + self.openEventView() + else: + self.toggleShow() + return 1 + def openEventView(self): epglist = [ ] self.epglist = epglist @@ -1348,25 +1355,21 @@ class InfoBarJobman: def JobViewCB(self, in_background): job_manager.in_background = in_background -# depends on InfoBarExtensions -class InfoBarSleepTimer: - def __init__(self): - self.addExtension((self.getSleepTimerName, self.showSleepTimerSetup, lambda: True), "1") - - def getSleepTimerName(self): - return _("Sleep Timer") - - def showSleepTimerSetup(self): - self.session.open(SleepTimerEdit) - # depends on InfoBarExtensions class InfoBarPiP: def __init__(self): - self.session.pipshown = False + try: + self.session.pipshown + except: + self.session.pipshown = False if SystemInfo.get("NumVideoDecoders", 1) > 1: - self.addExtension((self.getShowHideName, self.showPiP, lambda: True), "blue") - self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green") - self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "yellow") + if (self.allowPiP): + self.addExtension((self.getShowHideName, self.showPiP, lambda: True), "blue") + self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green") + self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "yellow") + else: + self.addExtension((self.getShowHideName, self.showPiP, self.pipShown), "blue") + self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green") def pipShown(self): return self.session.pipshown @@ -1595,21 +1598,21 @@ class InfoBarInstantRecord: if self.isInstantRecordRunning(): self.session.openWithCallback(self.recordQuestionCallback, ChoiceBox, \ title=_("A recording is currently running.\nWhat do you want to do?"), \ - list=((_("add recording (stop after current event)"), "event"), \ + list=((_("stop recording"), "stop"), \ + (_("add recording (stop after current event)"), "event"), \ + (_("add recording (indefinitely)"), "indefinitely"), \ (_("add recording (enter recording duration)"), "manualduration"), \ (_("add recording (enter recording endtime)"), "manualendtime"), \ - (_("add recording (indefinitely)"), "indefinitely"), \ (_("change recording (duration)"), "changeduration"), \ (_("change recording (endtime)"), "changeendtime"), \ - (_("stop recording"), "stop"), \ (_("do nothing"), "no"))) else: self.session.openWithCallback(self.recordQuestionCallback, ChoiceBox, \ title=_("Start recording?"), \ list=((_("add recording (stop after current event)"), "event"), \ + (_("add recording (indefinitely)"), "indefinitely"), \ (_("add recording (enter recording duration)"), "manualduration"), \ (_("add recording (enter recording endtime)"), "manualendtime"), \ - (_("add recording (indefinitely)"), "indefinitely"), \ (_("don't record"), "no"))) from Tools.ISO639 import LanguageCodes @@ -1666,17 +1669,46 @@ class InfoBarAudioSelection: else: break + availableKeys = [] + usedKeys = [] + if SystemInfo["CanDownmixAC3"]: - tlist = [(_("AC3 downmix") + " - " +(_("Off"), _("On"))[config.av.downmix_ac3.value and 1 or 0], "CALLFUNC", self.changeAC3Downmix), - ((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode"), - ("--", "")] + tlist - keys = [ "red", "green", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n - selection += 3 - else: - tlist = [((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode"), ("--", "")] + tlist - keys = [ "red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n + flist = [(_("AC3 downmix") + " - " +(_("Off"), _("On"))[config.av.downmix_ac3.value and 1 or 0], "CALLFUNC", self.changeAC3Downmix), + ((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode")] + usedKeys.extend(["red", "green"]) + availableKeys.extend(["yellow", "blue"]) selection += 2 - self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = tlist, selection = selection, keys = keys, skin_name = "AudioTrackSelection") + else: + flist = [((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode")] + usedKeys.extend(["red"]) + availableKeys.extend(["green", "yellow", "blue"]) + selection += 1 + + if hasattr(self, "runPlugin"): + class PluginCaller: + def __init__(self, fnc, *args): + self.fnc = fnc + self.args = args + def __call__(self, *args, **kwargs): + self.fnc(*self.args) + + Plugins = [ (p.name, PluginCaller(self.runPlugin, p)) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_AUDIOMENU) ] + + for p in Plugins: + selection += 1 + flist.append((p[0], "CALLFUNC", p[1])) + if availableKeys: + usedKeys.append(availableKeys[0]) + del availableKeys[0] + else: + usedKeys.append("") + + flist.append(("--", "")) + usedKeys.append("") + selection += 1 + + keys = usedKeys + [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ] + [""] * n + self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = flist + tlist, selection = selection, keys = keys, skin_name = "AudioTrackSelection") else: del self.audioTracks