changing service in timer edit is now possible
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 45c7745e850ee4be9655678f3c38e7066f454e8e..a9f7754bc06b901df488d835f993603984724a5d 100644 (file)
@@ -96,16 +96,28 @@ class InfoBarShowHide:
                                "hide": self.hide,
                        })
 
-               self.state = self.STATE_HIDDEN
+               self.state = self.STATE_SHOWN
+               
+               self.onExecBegin.append(self.show)
+               self.onClose.append(self.delHideTimer)
                
                self.hideTimer = eTimer()
                self.hideTimer.timeout.get().append(self.doTimerHide)
-               #self.hideTimer.start(1000)
+               self.hideTimer.start(5000)
+
+       def delHideTimer(self):
+               del self.hideTimer
 
        def hide(self): 
                self.instance.hide()
+               
+       def show(self):
+               self.state = self.STATE_SHOWN
+               self.hideTimer.stop()
+               self.hideTimer.start(5000)
 
        def doTimerHide(self):
+               self.hideTimer.stop()
                if self.state == self.STATE_SHOWN:
                        self.instance.hide()
                        self.state = self.STATE_HIDDEN
@@ -115,14 +127,12 @@ class InfoBarShowHide:
                        self.instance.hide()
                        #pls check animation support, sorry
 #                      self.startHide()
+                       self.hideTimer.stop()
                        self.state = self.STATE_HIDDEN
-               else:
+               elif self.state == self.STATE_HIDDEN:
                        self.instance.show()
-#                      self.startShow()
-                       self.state = self.STATE_SHOWN
-                       #TODO: make it customizable
-                       self.hideTimer.start(5000)
-
+                       self.show()
+                       
        def startShow(self):
                self.instance.m_animation.startMoveAnimation(ePoint(0, 600), ePoint(0, 380), 100)
                self.state = self.STATE_SHOWN
@@ -150,7 +160,9 @@ class NumberZap(Screen):
        def __init__(self, session, number):
                Screen.__init__(self, session)
                self.field = str(number)
-               
+
+               self["channel"] = Label(_("Channel:"))
+
                self["number"] = Label(self.field)
 
                self["actions"] = NumberActionMap( [ "SetupActions" ], 
@@ -179,10 +191,12 @@ class InfoBarPowerKey:
        def __init__(self):
                self.powerKeyTimer = eTimer()
                self.powerKeyTimer.timeout.get().append(self.powertimer)
-               self["PowerKeyActions"] = ActionMap( ["PowerKeyActions"],
+               self["PowerKeyActions"] = HelpableActionMap(self, "PowerKeyActions",
                        {
                                "powerdown": self.powerdown,
                                "powerup": self.powerup,
+                               "discreteStandby": (self.standby, "Go standby"),
+                               "discretePowerOff": (self.quit, "Go to deep standby"),
                        })
 
        def powertimer(self):   
@@ -197,10 +211,14 @@ class InfoBarPowerKey:
                self.powerKeyTimer.stop()
                if self.standbyblocked == 0:
                        self.standbyblocked = 1
-                       self.session.open(Standby, self)
+                       self.standby()
+
+       def standby(self):
+               self.session.open(Standby, self)
 
        def quit(self):
-               quitMainloop(0)
+               # halt
+               quitMainloop(1)
 
 class InfoBarNumberZap:
        """ Handles an initial number for NumberZapping """
@@ -254,17 +272,21 @@ class InfoBarChannelSelection:
        def     zapUp(self):
                self.servicelist.moveUp()
                self.servicelist.zap()
+               self.instance.show()
+               self.show()
 
        def     zapDown(self):
                self.servicelist.moveDown()
                self.servicelist.zap()
-
+               self.instance.show()
+               self.show()
+               
 class InfoBarMenu:
        """ Handles a menu action, to open the (main) menu """
        def __init__(self):
-               self["MenuActions"] = ActionMap( [ "InfobarMenuActions" ]
+               self["MenuActions"] = HelpableActionMap(self, "InfobarMenuActions"
                        {
-                               "mainMenu": self.mainMenu,
+                               "mainMenu": (self.mainMenu, "Enter main menu..."),
                        })
 
        def mainMenu(self):
@@ -329,13 +351,13 @@ class InfoBarServiceName:
 class InfoBarPVR:
        """handles PVR specific actions like seeking, pause"""
        def __init__(self):
-               self["PVRActions"] = ActionMap( [ "InfobarPVRActions" ]
+               self["PVRActions"] = HelpableActionMap(self, "InfobarPVRActions"
                        {
-                               "pauseService": self.pauseService,
-                               "unPauseService": self.unPauseService,
+                               "pauseService": (self.pauseService, "pause"),
+                               "unPauseService": (self.unPauseService, "continue"),
                                
-                               "seekFwd": self.seekFwd,
-                               "seekBack": self.seekBack,
+                               "seekFwd": (self.seekFwd, "skip forward"),
+                               "seekBack": (self.seekBack, "skip backward"),
                        })
                
        def pauseService(self):
@@ -364,9 +386,9 @@ class InfoBarInstantRecord:
        """Instant Record - handles the instantRecord action in order to 
        start/stop instant records"""
        def __init__(self):
-               self["InstnantRecordActions"] = ActionMap( [ "InfobarInstantRecord" ],
+               self["InstnantRecordActions"] = HelpableActionMap(self, "InfobarInstantRecord",
                        {
-                               "instantRecord": self.instantRecord,
+                               "instantRecord": (self.instantRecord, "Instant Record..."),
                        })
                self.recording = None
 
@@ -416,9 +438,9 @@ from Screens.AudioSelection import AudioSelection
 
 class InfoBarAudioSelection:
        def __init__(self):
-               self["AudioSelectionAction"] = ActionMap( [ "InfobarAudioSelectionActions" ]
+               self["AudioSelectionAction"] = HelpableActionMap(self, "InfobarAudioSelectionActions"
                        {
-                               "audioSelection": self.audioSelection,
+                               "audioSelection": (self.audioSelection, "Audio Options..."),
                        })
 
        def audioSelection(self):