67dd2485bd6f7d418f634073adfcaa3a535eb042
[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.Button import Button
6 from Components.config import config
7
8 from enigma import eDVBSatelliteEquipmentControl
9
10 class Dish(Screen):
11         def __init__(self, session):
12                 Screen.__init__(self, session)
13                 self["Dishpixmap"] = BlinkingPixmapConditional()
14                 self["Dishpixmap"].onVisibilityChange.append(self.DishpixmapVisibilityChanged)
15                 #self["Dishpixmap"] = Pixmap()
16                 config.usage.showdish.addNotifier(self.configChanged)
17                 self.configChanged(config.usage.showdish)
18
19         def configChanged(self, configElement):
20                 if not configElement.value:
21                         self["Dishpixmap"].setConnect(lambda: False)
22                 else:
23                         self["Dishpixmap"].setConnect(eDVBSatelliteEquipmentControl.getInstance().isRotorMoving)
24
25         def DishpixmapVisibilityChanged(self, state):
26                 if state:
27                         self.show() # show complete screen
28                 else:
29                         self.hide() # hide complete screen