aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter/StringListSelection.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-09-24 00:06:18 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-09-24 00:06:18 +0000
commit67ea9ad86c87e61ff57ec78403f43fde0ceb7632 (patch)
treed3758335186b48ae9ef619f81fa21ec98fc36153 /lib/python/Components/Converter/StringListSelection.py
parent63b6e4c2a144c099d248f686fb929d478ff174ab (diff)
downloadenigma2-67ea9ad86c87e61ff57ec78403f43fde0ceb7632.tar.gz
enigma2-67ea9ad86c87e61ff57ec78403f43fde0ceb7632.zip
push down initial 'changed' event
Diffstat (limited to 'lib/python/Components/Converter/StringListSelection.py')
-rw-r--r--lib/python/Components/Converter/StringListSelection.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/StringListSelection.py b/lib/python/Components/Converter/StringListSelection.py
new file mode 100644
index 00000000..747a82a6
--- /dev/null
+++ b/lib/python/Components/Converter/StringListSelection.py
@@ -0,0 +1,24 @@
+from Components.Converter.Converter import Converter
+from Components.Element import cached
+
+class StringListSelection(Converter, object):
+ "extracts the first element of a the current string list element for displaying it on LCD"
+ def __init__(self, args):
+ Converter.__init__(self, args)
+
+ def selChanged(self):
+ self.downstream_elements.changed((self.CHANGED_ALL, 0))
+
+ @cached
+ def getText(self):
+ cur = self.source.current
+ if cur and len(cur):
+ return cur[0]
+ return None
+
+ text = property(getText)
+
+ def changed(self, what):
+ if what[0] == self.CHANGED_DEFAULT:
+ self.source.onSelectionChanged.append(self.selChanged)
+ Converter.changed(self, what)