From d56e22bab2c00152ebcdfe066c9ef397dcbac55a Mon Sep 17 00:00:00 2001 From: Ronny Strutz Date: Fri, 7 Oct 2005 12:09:21 +0000 Subject: [PATCH] add configsatlist --- lib/python/Components/config.py | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 7bd8175a..bd5656c9 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -77,6 +77,41 @@ class configSelection: def __call__(self, selected): #needed by configlist self.checkValues() return ("text", self.parent.vals[self.parent.value]) + +class configSatlist: + def __init__(self, parent): + self.parent = parent + + def checkValues(self): + if self.parent.value < 0: + self.parent.value = 0 + + if(self.parent.value >= (len(self.parent.vals) - 1)): + self.parent.value = len(self.parent.vals) - 1 + + print "value" + str(self.parent.value) + print "name " + self.parent.vals[self.parent.value][0] + + def cancel(self): + self.parent.reload() + + def save(self): + self.parent.save() + + def handleKey(self, key): + if key == config.key["prevElement"]: + self.parent.value = self.parent.value - 1 + if key == config.key["nextElement"]: + self.parent.value = self.parent.value + 1 + + self.checkValues() + + self.parent.change() + + def __call__(self, selected): #needed by configlist + self.checkValues() + #fixme + return ("text", str(self.parent.vals[self.parent.value][0])) class configSequence: def __init__(self, parent): -- 2.30.2