do not restart previous tv service when leave standby
[enigma2.git] / lib / python / Screens / Standby.py
index 9c555028ddd9b10ee4e2db291c2d0ae17c19a440..06c447039f446fbfee62f92e2b0239b26a890403 100644 (file)
@@ -1,15 +1,19 @@
 from Screen import Screen
 from Components.ActionMap import ActionMap
 from Components.config import config
-from enigma import *
+from Components.AVSwitch import AVSwitch
+from enigma import eDVBVolumecontrol, eDBoxLCD, eServiceReference
+from Components.Sources.Clock import Clock
+
 
 class Standby(Screen):
        def Power(self):
                print "leave standby"
                #set input to encoder
-               eAVSwitch.getInstance().setInput(0)
-               #start last played service
-               self.infobar.servicelist.zap()
+               self.avswitch.setInput("ENCODER")
+               #restart last played service
+               if self.prev_running_service:
+                       self.session.nav.playService(self.prev_running_service)
                #unmute adc
                self.leaveMute()
                #set brightness of lcd
@@ -32,20 +36,37 @@ class Standby(Screen):
        def __init__(self, session, infobar):
                Screen.__init__(self, session)
                self.infobar = infobar
+               self.avswitch = AVSwitch()
+
                print "enter standby"
 
                self["actions"] = ActionMap( [ "StandbyActions" ],
                {
                        "power": self.Power
-               })
+               }, -1)
 
                #mute adc
                self.setMute()
+               #get currently playing service reference
+               self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceReference()
                #stop actual played dvb-service
                self.session.nav.stopService()
                #set input to vcr scart
-               eAVSwitch.getInstance().setInput(1)
+               self.avswitch.setInput("SCART")
                #set lcd brightness to standby value
                eDBoxLCD.getInstance().setLCDBrightness(config.lcd.standby.value * 20)
-               #clear lcd (servicename)
-               setLCD("                             ")
+
+       def createSummary(self):
+               return StandbySummary
+
+class StandbySummary(Screen):
+       skin = """
+       <screen position="0,0" size="132,64">
+               <widget source="CurrentTime" render="Label" position="0,0" size="132,64" font="Regular;40" halign="center">
+                       <convert type="ClockToText" />
+               </widget>
+       </screen>"""
+
+       def __init__(self, session, parent):
+               Screen.__init__(self, session)
+               self["CurrentTime"] = Clock()