From c8c997f4a88db6ad66eb06344a21943d212f5af5 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 13 Oct 2006 23:10:22 +0000 Subject: [PATCH] add "infobar timeout", "show infobar on channel change", "show infobar on skip forward/backward" options to Customize config --- data/setup.xml | 3 +++ lib/python/Components/UsageConfig.py | 8 ++++++- lib/python/Screens/InfoBarGenerics.py | 32 +++++++++++++++++---------- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/data/setup.xml b/data/setup.xml index 08e4dcb7..408e8769 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -23,6 +23,9 @@ config.usage.multibouquet config.usage.quickzap_bouquet_change config.usage.e1like_radio_mode + config.usage.infobar_timeout + config.usage.show_infobar_on_zap + config.usage.show_infobar_on_skip config.network.dhcp diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 36fc4178..f26b5876 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -1,4 +1,4 @@ -from config import ConfigSubsection, ConfigYesNo, config +from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection def InitUsageConfig(): config.usage = ConfigSubsection(); @@ -6,3 +6,9 @@ def InitUsageConfig(): config.usage.multibouquet = ConfigYesNo(default = False) config.usage.quickzap_bouquet_change = ConfigYesNo(default = False) config.usage.e1like_radio_mode = ConfigYesNo(default = False) + config.usage.infobar_timeout = ConfigSelection(default = _("5 seconds"), choices = [ + _("no timeout"), _("1 second"), _("2 seconds"), _("3 seconds"), _("4 seconds"), + _("5 seconds"), _("6 seconds"), _("7 seconds"), _("8 seconds"), + _("9 seconds"), _("10 seconds")]) + config.usage.show_infobar_on_zap = ConfigYesNo(default = True) + config.usage.show_infobar_on_skip = ConfigYesNo(default = True) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index af8f0a91..33d70970 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 """ @@ -804,13 +809,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: @@ -1455,7 +1461,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 +1494,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: -- 2.30.2