NFIFlash: integrate configuration backup/restore, string corrections
[enigma2.git] / lib / python / Screens / SessionGlobals.py
index f2d56154f6e2411f7a9ce8da3c1d8e6990478a32..6a9379bc63c70bd04ef016e026f7c9c8e8c9c19f 100644 (file)
@@ -22,6 +22,9 @@ class SessionGlobals(Screen):
                self["TunerInfo"] = TunerInfo()
                self["RecordState"] = RecordState(session)
                self["Standby"] = Boolean(fixed = False)
                self["TunerInfo"] = TunerInfo()
                self["RecordState"] = RecordState(session)
                self["Standby"] = Boolean(fixed = False)
+               
+               from Components.SystemInfo import SystemInfo
+               
                combine = Combine(func = lambda s: {(False, False): 0, (False, True): 1, (True, False): 2, (True, True): 3}[(s[0].boolean, s[1].boolean)])
                combine.connect(self["Standby"])
                combine.connect(self["RecordState"])
                combine = Combine(func = lambda s: {(False, False): 0, (False, True): 1, (True, False): 2, (True, True): 3}[(s[0].boolean, s[1].boolean)])
                combine.connect(self["Standby"])
                combine.connect(self["RecordState"])
@@ -33,9 +36,14 @@ class SessionGlobals(Screen):
                #    false      true      on   off    off
                #    true       true     blnk  off    blnk
                
                #    false      true      on   off    off
                #    true       true     blnk  off    blnk
                
-               PATTERN_ON     = (20, 0xffffffff, 0)
-               PATTERN_OFF    = (20, 0, 0xffffffff)
-               PATTERN_BLINK  = (20, 0x55555555, 0x84fc8c04)
+               PATTERN_ON     = (20, 0xffffffff, 0xffffffff)
+               PATTERN_OFF    = (20, 0, 0)
+               PATTERN_BLINK  = (20, 0x55555555, 0xa7fccf7a)
+
+               nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)
 
 
-               FrontpanelLed(which = 0, boolean = False, patterns = [PATTERN_OFF, PATTERN_BLINK, PATTERN_ON, PATTERN_BLINK]).connect(combine)
-               FrontpanelLed(which = 1, boolean = False, patterns = [PATTERN_ON, PATTERN_ON, PATTERN_OFF, PATTERN_OFF]).connect(combine)
+               if nr_leds == 1:
+                       FrontpanelLed(which = 0, boolean = False, patterns = [PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine)
+               elif nr_leds == 2:
+                       FrontpanelLed(which = 0, boolean = False, patterns = [PATTERN_OFF, PATTERN_BLINK, PATTERN_ON, PATTERN_BLINK]).connect(combine)
+                       FrontpanelLed(which = 1, boolean = False, patterns = [PATTERN_ON, PATTERN_ON, PATTERN_OFF, PATTERN_OFF]).connect(combine)