X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1a878183819985dbe84735e6102b9596ea803e50..0e3e7773e5d8e7ff159316db3de7fcfad57bb9e8:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index af8f0a91..b69ef4e1 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -85,7 +85,9 @@ class InfoBarShowHide: def startHideTimer(self): if self.__state == self.STATE_SHOWN and not self.__locked: - self.hideTimer.start(5000, True) + idx = config.usage.infobar_timeout.index + if idx: + self.hideTimer.start(idx*1000, True) def __onHide(self): self.__state = self.STATE_HIDDEN @@ -190,7 +192,8 @@ class InfoBarNumberZap: # print "You pressed number " + str(number) if number == 0: self.servicelist.recallPrevService() - self.doShow() + if config.usage.show_infobar_on_zap.value: + self.doShow() else: self.session.openWithCallback(self.numberEntered, NumberZap, number) @@ -312,7 +315,8 @@ class InfoBarChannelSelection: else: self.servicelist.moveUp() self.servicelist.zap() - self.doShow() + if config.usage.show_infobar_on_zap.value: + self.doShow() def zapDown(self): if self.servicelist.inBouquet(): @@ -330,7 +334,8 @@ class InfoBarChannelSelection: else: self.servicelist.moveDown() self.servicelist.zap() - self.doShow() + if config.usage.show_infobar_on_zap.value: + self.doShow() class InfoBarMenu: """ Handles a menu action, to open the (main) menu """ @@ -339,12 +344,21 @@ class InfoBarMenu: { "mainMenu": (self.mainMenu, _("Enter main menu...")), }) + self.session.infobar = None def mainMenu(self): print "loading mainmenu XML..." menu = mdom.childNodes[0] assert menu.tagName == "menu", "root element in menu must be 'menu'!" - self.session.open(MainMenu, menu, menu.childNodes) + + self.session.infobar = self + # so we can access the currently active infobar from screens opened from within the mainmenu + # at the moment used from the SubserviceSelection + + self.session.openWithCallback(self.mainMenuClosed, MainMenu, menu, menu.childNodes) + + def mainMenuClosed(self, *val): + self.session.infobar = None class InfoBarSimpleEventView: """ Opens the Eventview for now/next """ @@ -804,13 +818,14 @@ class InfoBarSeek: def checkSkipShowHideLock(self): wantlock = self.seekstate != self.SEEK_STATE_PLAY - if self.lockedBecauseOfSkipping and not wantlock: - self.unlockShow() - self.lockedBecauseOfSkipping = False + if config.usage.show_infobar_on_zap.value: + if self.lockedBecauseOfSkipping and not wantlock: + self.unlockShow() + self.lockedBecauseOfSkipping = False - if wantlock and not self.lockedBecauseOfSkipping: - self.lockShow() - self.lockedBecauseOfSkipping = True + if wantlock and not self.lockedBecauseOfSkipping: + self.lockShow() + self.lockedBecauseOfSkipping = True def __evEOF(self): if self.seekstate != self.SEEK_STATE_PLAY: @@ -930,8 +945,8 @@ class InfoBarTimeshift: print "enable timeshift" ts = self.getTimeshift() if ts is None: -# self.session.open(MessageBox, _("Timeshift not possible!"), MessageBox.TYPE_ERROR) -# print "no ts interface" + self.session.open(MessageBox, _("Timeshift not possible!"), MessageBox.TYPE_ERROR) + print "no ts interface" return 0; if self.timeshift_enabled: @@ -1118,44 +1133,12 @@ class InfoBarPlugins: def runPlugin(self, plugin): plugin(session = self.session) -# depends on InfoBarExtensions and InfoBarSubtitleSupport -class InfoBarSubtitles: - def __init__(self): - self.addExtension((self.getDisableSubtitleName, self.disableSubtitles, self.subtitlesEnabled), "4") - self.addExtension(extension = self.getSubtitleList, type = InfoBarExtensions.EXTENSION_LIST) - - def getDisableSubtitleName(self): - return _("Disable subtitles") - - def getSubtitleList(self): - list = [] - s = self.getCurrentServiceSubtitle() - l = s and s.getSubtitleList() or [ ] - - for x in l: - list.append(((boundFunction(self.getSubtitleEntryName, x[0]), boundFunction(self.enableSubtitle, x[1]), lambda: True), None)) - return list - - def getSubtitleEntryName(self, name): - return "Enable Subtitles: " + name - - def enableSubtitle(self, subtitles): - print "enable subitles", subtitles - self.selected_subtitle = subtitles - self.subtitles_enabled = True - - def subtitlesEnabled(self): - return self.subtitles_enabled - - def disableSubtitles(self): - self.subtitles_enabled = False - # depends on InfoBarExtensions class InfoBarPiP: def __init__(self): self.session.pipshown = False - self.addExtension((self.getShowHideName, self.showPiP, self.available), "red") + self.addExtension((self.getShowHideName, self.showPiP, self.available), "blue") self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green") self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "yellow") @@ -1455,7 +1438,8 @@ class InfoBarSubserviceSelection: if newservice.valid(): del subservices del service - self.doShow() + if config.usage.show_infobar_on_zap.value: + self.doShow() self.session.nav.playService(newservice) def subserviceSelection(self): @@ -1487,7 +1471,8 @@ class InfoBarSubserviceSelection: self.session.open(SubservicesQuickzap, service[2]) else: self["SubserviceQuickzapAction"].setEnabled(True) - self.doShow() + if config.usage.show_infobar_on_zap.value: + self.doShow() self.session.nav.playService(service[1]) class InfoBarAdditionalInfo: @@ -1780,7 +1765,7 @@ class InfoBarSubtitleSupport(object): def setSubtitlesEnable(self, enable=True): subtitle = self.getCurrentServiceSubtitle() - if enable and self.__selected_subtitle: + if enable and self.__selected_subtitle is not None: if subtitle and not self.__subtitles_enabled: subtitle.enableSubtitles(self.subtitle_window.instance, self.selected_subtitle) self.subtitle_window.show()