add "infobar timeout", "show infobar on channel change", "show infobar on
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 13 Oct 2006 23:10:22 +0000 (23:10 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 13 Oct 2006 23:10:22 +0000 (23:10 +0000)
skip forward/backward" options to Customize config

data/setup.xml
lib/python/Components/UsageConfig.py
lib/python/Screens/InfoBarGenerics.py

index 08e4dcb..408e876 100644 (file)
@@ -23,6 +23,9 @@
                        <item text="Enable multiple bouquets">config.usage.multibouquet</item>
                        <item text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item>
                        <item text="Alternative radio mode">config.usage.e1like_radio_mode</item>
+                       <item text="Infobar timeout">config.usage.infobar_timeout</item>
+                       <item text="Show infobar on channel change">config.usage.show_infobar_on_zap</item>
+                       <item text="Show infobar on skip forward/backward">config.usage.show_infobar_on_skip</item>
                </setup>
                <setup key="network" title="Network setup">
                        <item text="Use DHCP">config.network.dhcp</item>
index 36fc417..f26b587 100644 (file)
@@ -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)
index af8f0a9..33d7097 100644 (file)
@@ -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: