Notification support in TaskView
[enigma2.git] / lib / python / Screens / Dish.py
1 from Screen import Screen
2
3 from Components.BlinkingPixmap import BlinkingPixmapConditional
4 from Components.Pixmap import Pixmap
5 from Components.config import config
6
7 from enigma import eDVBSatelliteEquipmentControl
8
9 class Dish(Screen):
10         def __init__(self, session):
11                 Screen.__init__(self, session)
12                 self["Dishpixmap"] = BlinkingPixmapConditional()
13                 self["Dishpixmap"].onVisibilityChange.append(self.DishpixmapVisibilityChanged)
14                 #self["Dishpixmap"] = Pixmap()
15                 config.usage.showdish.addNotifier(self.configChanged)
16                 self.configChanged(config.usage.showdish)
17
18         def configChanged(self, configElement):
19                 if not configElement.value:
20                         self["Dishpixmap"].setConnect(lambda: False)
21                 else:
22                         self["Dishpixmap"].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
23
24         def DishpixmapVisibilityChanged(self, state):
25                 if state:
26                         self.show() # show complete screen
27                 else:
28                         self.hide() # hide complete screen