cleanup lcd code
authorghost <andreas.monzner@multimedia-labs.de>
Wed, 27 Jan 2010 11:14:14 +0000 (12:14 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 27 Jan 2010 11:14:14 +0000 (12:14 +0100)
lib/python/Components/Lcd.py
lib/python/Screens/Standby.py

index 7d27c097ee9fd2c98a68c977a7711253f25d82be..dde158b6a16f4c1d97d697b312f12f239a7637bb 100644 (file)
@@ -28,6 +28,14 @@ class LCD:
        def isOled(self):
                return eDBoxLCD.getInstance().isOled()
 
        def isOled(self):
                return eDBoxLCD.getInstance().isOled()
 
+def leaveStandby():
+       config.lcd.bright.apply()
+
+def standbyCounterChanged(configElement):
+       from Screens.Standby import inStandby
+       inStandby.onClose.append(leaveStandby)
+       config.lcd.standby.apply()
+
 def InitLcd():
        detected = eDBoxLCD.getInstance().detected()
        SystemInfo["Display"] = detected
 def InitLcd():
        detected = eDBoxLCD.getInstance().detected()
        SystemInfo["Display"] = detected
@@ -72,3 +80,6 @@ def InitLcd():
                config.lcd.standby = ConfigNothing()
                config.lcd.bright.apply = lambda : doNothing()
                config.lcd.standby.apply = lambda : doNothing()
                config.lcd.standby = ConfigNothing()
                config.lcd.bright.apply = lambda : doNothing()
                config.lcd.standby.apply = lambda : doNothing()
+
+       config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False)
+
index c598b5459b9209d7ca705ed5d0f93b5e170b740a..406b87cbfe0dd3b765cdb40efdc8f57130746ad8 100644 (file)
@@ -15,8 +15,6 @@ class Standby(Screen):
                #restart last played service
                #unmute adc
                self.leaveMute()
                #restart last played service
                #unmute adc
                self.leaveMute()
-               #set brightness of lcd
-               config.lcd.bright.apply()
                #kill me
                self.close(True)
 
                #kill me
                self.close(True)
 
@@ -63,8 +61,6 @@ class Standby(Screen):
                        self.avswitch.setInput("SCART")
                else:
                        self.avswitch.setInput("AUX")
                        self.avswitch.setInput("SCART")
                else:
                        self.avswitch.setInput("AUX")
-               #set lcd brightness to standby value
-               config.lcd.standby.apply()
                self.onFirstExecBegin.append(self.__onFirstExecBegin)
                self.onClose.append(self.__onClose)
 
                self.onFirstExecBegin.append(self.__onFirstExecBegin)
                self.onClose.append(self.__onClose)