X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ddb050fe8357a01b1fc52070ee9f87450c407c1c..897c01289c6e24a3cce676f7c200ccb3b2959f94:/lib/python/Components/Converter/StringList.py diff --git a/lib/python/Components/Converter/StringList.py b/lib/python/Components/Converter/StringList.py index ed264651..4199212a 100644 --- a/lib/python/Components/Converter/StringList.py +++ b/lib/python/Components/Converter/StringList.py @@ -1,14 +1,17 @@ from Converter import Converter from enigma import eListboxPythonStringContent - +from Components.Element import cached class StringList(Converter): """Turns a simple python list into a list which can be used in a listbox.""" def __init__(self, type): Converter.__init__(self, type) + self.content = None def changed(self, what): - self.content = eListboxPythonStringContent() + if not self.content: + self.content = eListboxPythonStringContent() + if self.source: self.content.setList(self.source.list) self.downstream_elements.changed(what) @@ -20,6 +23,7 @@ class StringList(Converter): if x is not self.master: x.index = index + @cached def getCurrent(self): if self.source is None: return None @@ -28,6 +32,7 @@ class StringList(Converter): current = property(getCurrent) # pass through: getIndex / setIndex to master + @cached def getIndex(self): if self.master is None: return None