aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/python/Components/config.py14
-rw-r--r--lib/python/Screens/Setup.py6
2 files changed, 11 insertions, 9 deletions
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()
diff --git a/lib/python/Screens/Setup.py b/lib/python/Screens/Setup.py
index cb268580..e2e55974 100644
--- a/lib/python/Screens/Setup.py
+++ b/lib/python/Screens/Setup.py
@@ -51,11 +51,11 @@ class Setup(Screen):
list.append( (ItemText, item) )
def keyOk(self):
- self["config"].handleKey(0)
+ self["config"].handleKey(config.choseElement)
def keyLeft(self):
- self["config"].handleKey(1)
+ self["config"].handleKey(config.prevElement)
def keyRight(self):
- self["config"].handleKey(2)
+ self["config"].handleKey(config.nextElement)
def keySave(self):
print "save requested"