X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4c2cba9ccb6f754aac9378e2fc2c7b546e6d589c..4c1d3d2f5cf39f72bf85041a6ba6665350ea742e:/lib/python/Components/Lcd.py diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index 0e501237..dde158b6 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -28,6 +28,14 @@ class LCD: 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 @@ -42,9 +50,18 @@ def InitLcd(): def setLCDinverted(configElement): ilcd.setInverted(configElement.value); + standby_default = 0 + ilcd = LCD() - config.lcd.standby = ConfigSlider(default=0, limits=(0, 10)) + if not ilcd.isOled(): + config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) + config.lcd.contrast.addNotifier(setLCDcontrast); + else: + config.lcd.contrast = ConfigNothing() + standby_default = 1 + + config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.standby.addNotifier(setLCDbright); config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby) @@ -53,12 +70,6 @@ def InitLcd(): config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright) config.lcd.bright.callNotifiersOnSaveAndCancel = True - if not ilcd.isOled(): - config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) - config.lcd.contrast.addNotifier(setLCDcontrast); - else: - config.lcd.contrast = ConfigNothing() - config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted); else: @@ -69,3 +80,6 @@ def InitLcd(): config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda : doNothing() config.lcd.standby.apply = lambda : doNothing() + + config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False) +