X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FConditionalWidget.py;h=192813f527654d1976d61531a224bd0f362b6ce2;hb=111874bbd87063dc52d061bde1d74694c5c5e092;hp=7d35d9565ca2eb5556217cb47d26012ba2e31afe;hpb=ed40f6f85c9c07c3c1224ae20601082c0309a631;p=vuplus_dvbapp diff --git a/lib/python/Components/ConditionalWidget.py b/lib/python/Components/ConditionalWidget.py index 7d35d95..192813f 100644 --- a/lib/python/Components/ConditionalWidget.py +++ b/lib/python/Components/ConditionalWidget.py @@ -1,4 +1,4 @@ -from GUIComponent import * +from GUIComponent import GUIComponent from enigma import eTimer class ConditionalWidget(GUIComponent): @@ -9,9 +9,12 @@ class ConditionalWidget(GUIComponent): if (withTimer): self.conditionCheckTimer = eTimer() - self.conditionCheckTimer.timeout.get().append(self.update) + self.conditionCheckTimer.callback.append(self.update) self.conditionCheckTimer.start(1000) - + + def postWidgetCreate(self, instance): + self.visible = 0 + def setConnect(self, conditionalFunction): self.conditionalFunction = conditionalFunction @@ -24,24 +27,18 @@ class ConditionalWidget(GUIComponent): def update(self): if (self.conditionalFunction != None): try: - self.conditionalFunction() # check, if the conditionalfunction is still valid self.activateCondition(self.conditionalFunction()) except: self.conditionalFunction = None self.activateCondition(False) - -import time class BlinkingWidget(GUIComponent): def __init__(self): GUIComponent.__init__(self) - - self.blinking = True - + self.blinking = False self.setBlinkTime(500) - self.timer = eTimer() - self.timer.timeout.get().append(self.blink) + self.timer.callback.append(self.blink) def setBlinkTime(self, time): self.blinktime = time