SHowTVonLCD: Solve all issue with VU+Solo4K
authorlittlesat <littlesat99@yahoo.com>
Thu, 7 Jan 2016 09:51:17 +0000 (10:51 +0100)
committerlittlesat <littlesat99@yahoo.com>
Thu, 7 Jan 2016 09:51:17 +0000 (10:51 +0100)
The VU+Solo4K has a miniTV plugin installed. Now 'miniTV' is dedicated via
Hotkeys and default assigned to the TV_long key. In the previous commit
the mini plugin did interfere, Now it fully dedicated integrated into
Enigma2. As the miniTV plugin interferes with the dedicated integrated
ShowTVonLCD functionality it should be removed by default and also removed
from the feeds

lib/python/Components/Lcd.py

index db9054d..a42b3a8 100644 (file)
@@ -44,7 +44,7 @@ class LCD:
 def leaveStandby():
        config.lcd.bright.apply()
 
-def standbyCounterChanged(configElement):
+def standbyCounterChanged(dummy):
        from Screens.Standby import inStandby
        inStandby.onClose.append(leaveStandby)
        config.lcd.standby.apply()
@@ -94,14 +94,13 @@ def InitLcd():
 
                if SystemInfo["LcdLiveTV"]:
                        def lcdLiveTvChanged(configElement):
-                               if "live_enable" in SystemInfo["LcdLiveTV"]:
-                                       open(SystemInfo["LcdLiveTV"], "w").write(configElement.value and "enable" or "disable")
-                               else:
-                                       open(SystemInfo["LcdLiveTV"], "w").write(configElement.value and "0" or "1")
-                                       InfoBarInstance = InfoBar.instance
-                                       InfoBarInstance and InfoBarInstance.session.open(dummyScreen)
+                               setLCDLiveTv(configElement.value)
+                               configElement.save()
                        config.lcd.showTv = ConfigYesNo(default = False)
                        config.lcd.showTv.addNotifier(lcdLiveTvChanged)
+
+               if "live_enable" in SystemInfo["LcdLiveTV"]:
+                       config.misc.standbyCounter.addNotifier(standbyCounterChangedLCDLiveTV, initial_call = False)
        else:
                def doNothing():
                        pass
@@ -112,3 +111,20 @@ def InitLcd():
                config.lcd.standby.apply = lambda : doNothing()
 
        config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False)
+
+def setLCDLiveTv(value):
+       if "live_enable" in SystemInfo["LcdLiveTV"]:
+               open(SystemInfo["LcdLiveTV"], "w").write(value and "enable" or "disable")
+       else:
+               open(SystemInfo["LcdLiveTV"], "w").write(value and "0" or "1")
+       InfoBarInstance = InfoBar.instance
+       InfoBarInstance and InfoBarInstance.session.open(dummyScreen)
+
+def leaveStandbyLCDLiveTV():
+       setLCDLiveTv(config.lcd.showTv.value)
+
+def standbyCounterChangedLCDLiveTV(dummy):
+       from Screens.Standby import inStandby
+       if leaveStandbyLCDLiveTV not in inStandby.onClose:
+               inStandby.onClose.append(leaveStandbyLCDLiveTV)
+       setLCDLiveTv(False)