add PositionGauge renderer
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 10 Jul 2006 16:19:41 +0000 (16:19 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 10 Jul 2006 16:19:41 +0000 (16:19 +0000)
lib/python/Components/Renderer/Makefile.am
lib/python/Components/Renderer/PositionGauge.py [new file with mode: 0644]

index cc220cb..ba082d4 100644 (file)
@@ -2,4 +2,4 @@ installdir = $(LIBDIR)/enigma2/python/Components/Renderer
 
 install_PYTHON = \
        __init__.py Label.py Progress.py Listbox.py Renderer.py Pixmap.py \
 
 install_PYTHON = \
        __init__.py Label.py Progress.py Listbox.py Renderer.py Pixmap.py \
-       FixedLabel.py
\ No newline at end of file
+       FixedLabel.py PositionGauge.py
diff --git a/lib/python/Components/Renderer/PositionGauge.py b/lib/python/Components/Renderer/PositionGauge.py
new file mode 100644 (file)
index 0000000..cb1cad5
--- /dev/null
@@ -0,0 +1,51 @@
+from Renderer import Renderer
+from enigma import ePositionGauge
+
+class PositionGauge(Renderer):
+       def __init__(self):
+               Renderer.__init__(self)
+               self.__position = 0
+               self.__length = 0
+               self.__cutlist = [ ]
+       
+       GUI_WIDGET = ePositionGauge
+       
+       def postWidgetCreate(self, instance):
+               self.changed()
+               instance.setInOutList(self.__cutlist)
+
+       def changed(self):
+               (self.length, self.position) = (self.source.length or 0, self.source.position or 0)
+
+       def cutlist_changed(self):
+               self.cutlist = self.source.cutlist or [ ]
+
+       def getPosition(self):
+               return self.__position
+       
+       def setPosition(self, pos):
+               self.__position = pos
+               if self.instance is not None:
+                       self.instance.setPosition(pos)
+       
+       position = property(getPosition, setPosition)
+
+       def getLength(self):
+               return self.__length
+       
+       def setLength(self, len):
+               self.__length = len
+               if self.instance is not None:
+                       self.instance.setLength(len)
+
+       length = property(getLength, setLength)
+
+       def getCutlist(self):
+               return self.__cutlist
+       
+       def setCutlist(self, cutlist):
+               self.__cutlist = cutlist
+               if self.instance is not None:
+                       self.instance.setInOutList(cutlist)
+
+       cutlist = property(getCutlist, setCutlist)