From dba47e0b252b39fc2d58ec0db2275051e0a29508 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 2 Sep 2005 04:23:01 +0000 Subject: user predefined vars instead of integers for keyhandling in Config --- lib/python/Components/config.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index ed85ed22..5a96a100 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -65,9 +65,9 @@ class configBoolean: self.parent.save() def handleKey(self, key): - if key == 1: + if key == config.prevElement: self.parent.value = self.parent.value - 1 - if key == 2: + if key == config.nextElement: self.parent.value = self.parent.value + 1 self.checkValues() @@ -87,8 +87,10 @@ class configValue: class Config: def __init__(self): - pass - + self.choseElement = 0 + self.prevElement = 1 + self.nextElement = 2 + config = Config(); configfile = configFile() @@ -110,9 +112,9 @@ class ConfigSlider: self.parent.value = 10 def handleKey(self, key): - if key == 1: + if key == config.prevElement: self.parent.value = self.parent.value - 1 - if key == 2: + if key == config.nextElement: self.parent.value = self.parent.value + 1 self.checkValues() -- cgit v1.2.3