aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-05-14 15:23:23 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-05-14 15:23:23 +0000
commit7bc4a59528ab13f3062dc1520e76f9ecedd87400 (patch)
tree9d6e91be12147eee77d82ec5b49c24ae44f85bd3 /lib/python/Components
parentab8d418f82b2835c267d88ded5d748a6f0e8a852 (diff)
downloadenigma2-7bc4a59528ab13f3062dc1520e76f9ecedd87400.tar.gz
enigma2-7bc4a59528ab13f3062dc1520e76f9ecedd87400.zip
- work on timers
- add eInput widget - add python/Tools - add flexible listbox content
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/TimeInput.py18
-rw-r--r--lib/python/Components/TimerList.py57
-rw-r--r--lib/python/Components/__init__.py2
3 files changed, 76 insertions, 1 deletions
diff --git a/lib/python/Components/TimeInput.py b/lib/python/Components/TimeInput.py
new file mode 100644
index 00000000..c520fdf5
--- /dev/null
+++ b/lib/python/Components/TimeInput.py
@@ -0,0 +1,18 @@
+from HTMLComponent import *
+from GUIComponent import *
+from VariableText import *
+
+from enigma import eInput, eInputContentNumber
+
+class TimeInput(HTMLComponent, GUIComponent):
+ def __init__(self):
+ GUIComponent.__init__(self)
+ self.content = eInputContentNumber(12, 0, 15)
+
+ def GUIcreate(self, parent, skindata):
+ self.instance = eInput(parent)
+ self.instance.setContent(self.content)
+
+ def GUIdelete(self):
+ self.instance.setContent(None)
+ self.instance = None
diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py
new file mode 100644
index 00000000..da005b01
--- /dev/null
+++ b/lib/python/Components/TimerList.py
@@ -0,0 +1,57 @@
+from HTMLComponent import *
+from GUIComponent import *
+
+from Tools.FuzzyDate import FuzzyTime
+
+from enigma import eListboxPythonMultiContent, eListbox, gFont
+
+
+RT_HALIGN_LEFT = 0
+RT_HALIGN_RIGHT = 1
+RT_HALIGN_CENTER = 2
+RT_HALIGN_BLOCK = 4
+
+RT_VALIGN_TOP = 0
+RT_VALIGN_CENTER = 8
+RT_VALIGN_BOTTOM = 16
+
+RT_WRAP = 32
+
+
+#
+# | <Service> <Name of the Timer> |
+# | <start> <end> |
+#
+def TimerEntry(timer, processed):
+ res = [ ]
+
+ res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, timer.service_ref.getServiceName()))
+ res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "%s, %s" % FuzzyTime(timer.begin)))
+
+ if processed:
+ res.append((200, 30, 200, 20, 1, RT_HALIGN_RIGHT, FuzzyTime(timer.end)[1]))
+ else:
+ res.append((200, 30, 200, 20, 1, RT_HALIGN_RIGHT, "done"))
+ return res
+
+class TimerList(HTMLComponent, GUIComponent):
+ def __init__(self, list):
+ GUIComponent.__init__(self)
+ self.l = eListboxPythonMultiContent()
+ self.l.setList(list)
+ self.l.setFont(0, gFont("Arial", 20))
+ self.l.setFont(1, gFont("Arial", 18))
+
+ def getCurrent(self):
+ return self.l.getCurrentSelection()
+
+ def GUIcreate(self, parent, skindata):
+ self.instance = eListbox(parent)
+ self.instance.setContent(self.l)
+ self.instance.setItemHeight(50)
+
+ def GUIdelete(self):
+ self.instance.setContent(None)
+ self.instance = None
+
+
diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py
index 8a064b22..d7cd406b 100644
--- a/lib/python/Components/__init__.py
+++ b/lib/python/Components/__init__.py
@@ -3,5 +3,5 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo",
"GUIComponent", "GUISkin", "HTMLComponent", "HTMLSkin", "Header",
"Label", "MenuList", "PerServiceDisplay", "ProgressBar", "ServiceList",
"ServiceName", "ServiceScan", "VariableText", "VariableValue", "VolumeBar",
- "components", "config"]
+ "components", "config", "TimerList", "TimeInput" ]