git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch by Moritz Venn/Anders Holst: the long awaited 'setting tags from timer menu...
[enigma2.git]
/
lib
/
python
/
Components
/
Lcd.py
diff --git
a/lib/python/Components/Lcd.py
b/lib/python/Components/Lcd.py
index eb3e3df18f3e1bc7225ae5acd02933f4526e7944..0e501237e4af42bbb96dbc9fff5056f7d7bd4386 100644
(file)
--- a/
lib/python/Components/Lcd.py
+++ b/
lib/python/Components/Lcd.py
@@
-1,6
+1,6
@@
from config import config, ConfigSubsection, ConfigSlider, ConfigYesNo, ConfigNothing
from config import config, ConfigSubsection, ConfigSlider, ConfigYesNo, ConfigNothing
-
from enigma import eDBoxLCD
from enigma import eDBoxLCD
+from Components.SystemInfo import SystemInfo
class LCD:
def __init__(self):
class LCD:
def __init__(self):
@@
-29,32
+29,43
@@
class LCD:
return eDBoxLCD.getInstance().isOled()
def InitLcd():
return eDBoxLCD.getInstance().isOled()
def InitLcd():
+ detected = eDBoxLCD.getInstance().detected()
+ SystemInfo["Display"] = detected
+ config.lcd = ConfigSubsection();
+ if detected:
+ def setLCDbright(configElement):
+ ilcd.setBright(configElement.value);
-
def setLCDbrigh
t(configElement):
-
ilcd.setBrigh
t(configElement.value);
+
def setLCDcontras
t(configElement):
+
ilcd.setContras
t(configElement.value);
-
def setLCDcontrast
(configElement):
-
ilcd.setContrast
(configElement.value);
+
def setLCDinverted
(configElement):
+
ilcd.setInverted
(configElement.value);
- def setLCDinverted(configElement):
- ilcd.setInverted(configElement.value);
+ ilcd = LCD()
- ilcd = LCD()
+ config.lcd.standby = ConfigSlider(default=0, limits=(0, 10))
+ config.lcd.standby.addNotifier(setLCDbright);
+ config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)
- config.lcd = ConfigSubsection();
+ config.lcd.bright = ConfigSlider(default=5, limits=(0, 10))
+ config.lcd.bright.addNotifier(setLCDbright);
+ config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright)
+ config.lcd.bright.callNotifiersOnSaveAndCancel = True
- config.lcd.bright = ConfigSlider(default=10, limits=(0, 10))
- config.lcd.bright.addNotifier(setLCDbright);
- config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright)
+ if not ilcd.isOled():
+ config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
+ config.lcd.contrast.addNotifier(setLCDcontrast);
+ else:
+ config.lcd.contrast = ConfigNothing()
- if not ilcd.isOled():
- config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
- config.lcd.contrast.addNotifier(setLCDcontrast);
+ config.lcd.invert = ConfigYesNo(default=False)
+ config.lcd.invert.addNotifier(setLCDinverted);
else:
else:
+ def doNothing():
+ pass
config.lcd.contrast = ConfigNothing()
config.lcd.contrast = ConfigNothing()
-
- config.lcd.standby = ConfigSlider(default=0, limits=(0, 10))
- config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)
-
- config.lcd.invert = ConfigYesNo(default=False)
- config.lcd.invert.addNotifier(setLCDinverted);
+ config.lcd.bright = ConfigNothing()
+ config.lcd.standby = ConfigNothing()
+ config.lcd.bright.apply = lambda : doNothing()
+ config.lcd.standby.apply = lambda : doNothing()