initial hide conditional widgets
[enigma2.git] / lib / python / Screens / Dish.py
index a34f0c5..88be377 100644 (file)
@@ -10,11 +10,21 @@ from enigma import eDVBSatelliteEquipmentControl
 class Dish(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
 class Dish(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
-               
                self["transparent"] = Button("")
                self["Dishpixmap"] = BlinkingPixmapConditional()
                self["transparent"] = Button("")
                self["Dishpixmap"] = BlinkingPixmapConditional()
+               self["Dishpixmap"].onVisibilityChange.append(self.DishpixmapVisibilityChanged)
                #self["Dishpixmap"] = Pixmap()
                #self["Dishpixmap"] = Pixmap()
-               if not config.usage.showdish.value:
+               config.usage.showdish.addNotifier(self.configChanged)
+               self.configChanged(config.usage.showdish)
+
+       def configChanged(self, configElement):
+               if not configElement.value:
                        self["Dishpixmap"].setConnect(lambda: False)
                else:
                        self["Dishpixmap"].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
                        self["Dishpixmap"].setConnect(lambda: False)
                else:
                        self["Dishpixmap"].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
+
+       def DishpixmapVisibilityChanged(self, state):
+               if state:
+                       self.show() # show complete screen
+               else:
+                       self.hide() # hide complete screen