aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/ConfigList.py5
-rw-r--r--lib/python/Components/InputDevice.py6
-rw-r--r--lib/python/Components/Lcd.py8
-rw-r--r--lib/python/Components/NimManager.py1
-rw-r--r--lib/python/Components/RFmod.py2
-rw-r--r--lib/python/Components/SetupDevices.py8
-rw-r--r--lib/python/Components/config.py36
7 files changed, 43 insertions, 23 deletions
diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py
index 7ed00014..6ff9116f 100644
--- a/lib/python/Components/ConfigList.py
+++ b/lib/python/Components/ConfigList.py
@@ -19,8 +19,9 @@ class ConfigList(HTMLComponent, GUIComponent):
def handleKey(self, key):
selection = self.getCurrent()
- selection[1].handleKey(key)
- self.invalidateCurrent()
+ if selection[1].parent.enabled:
+ selection[1].handleKey(key)
+ self.invalidateCurrent()
def getCurrent(self):
return self.l.getCurrentSelection()
diff --git a/lib/python/Components/InputDevice.py b/lib/python/Components/InputDevice.py
index f800f302..bfb5435b 100644
--- a/lib/python/Components/InputDevice.py
+++ b/lib/python/Components/InputDevice.py
@@ -2,7 +2,7 @@ from config import config #global config instance
from config import configElement
from config import ConfigSubsection
-from config import ConfigSlider
+from config import configSlider
from config import configSelection
class inputDevices:
@@ -17,8 +17,8 @@ class inputDevices:
def InitInputDevices():
config.inputDevices = ConfigSubsection();
- config.inputDevices.repeat = configElement("config.inputDevices.repeat", ConfigSlider, 5, "");
- config.inputDevices.delay = configElement("config.inputDevices.delay", ConfigSlider, 4, "");
+ config.inputDevices.repeat = configElement("config.inputDevices.repeat", configSlider, 5, (1, 10))
+ config.inputDevices.delay = configElement("config.inputDevices.delay", configSlider, 4, (1, 10))
#this instance anywhere else needed?
iDevices = inputDevices();
diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py
index 552d5485..ea0c37a1 100644
--- a/lib/python/Components/Lcd.py
+++ b/lib/python/Components/Lcd.py
@@ -1,5 +1,5 @@
from config import config #global config instance
-from config import ConfigSlider
+from config import configSlider
from config import configSelection
from config import ConfigSubsection
from config import configElement
@@ -25,9 +25,9 @@ class LCD:
def InitLcd():
config.lcd = ConfigSubsection();
- config.lcd.bright = configElement("config.lcd.bright", ConfigSlider, 10, "")
- config.lcd.contrast = configElement("config.lcd.contrast", ConfigSlider, 10, "")
- config.lcd.standby = configElement("config.lcd.standby", ConfigSlider, 0, "")
+ config.lcd.bright = configElement("config.lcd.bright", configSlider, 10, (1, 10))
+ config.lcd.contrast = configElement("config.lcd.contrast", configSlider, 10, (1, 10))
+ config.lcd.standby = configElement("config.lcd.standby", configSlider, 0, (1,10))
config.lcd.invert = configElement("config.lcd.invert", configSelection, 0, (("disable", _("Disable")), ("enable", _("Enable"))))
ilcd = LCD()
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py
index 1ad4c229..ac73c00e 100644
--- a/lib/python/Components/NimManager.py
+++ b/lib/python/Components/NimManager.py
@@ -2,7 +2,6 @@ from config import config #global config instance
from config import configElement
from config import ConfigSubsection
-from config import ConfigSlider
from config import configSelection
from config import currentConfigSelectionElement
from config import getConfigSelectionElement
diff --git a/lib/python/Components/RFmod.py b/lib/python/Components/RFmod.py
index 5ea88ec0..6c7214bc 100644
--- a/lib/python/Components/RFmod.py
+++ b/lib/python/Components/RFmod.py
@@ -26,7 +26,7 @@ def InitRFmod():
config.rfmod.sound = configElement("config.rfmod.sound", configSelection, 0, (("enable", _("Enable")), ("disable", _("Disable"))) );
config.rfmod.soundcarrier = configElement("config.rfmod.soundcarrier", configSelection, 1, ("4.5 MHz", "5.5 MHz", "6.0 MHz", "6.5 MHz") );
config.rfmod.channel = configElement("config.rfmod.channel", configSelection, 6, ("30", "31", "32", "33", "34", "35", "36", "37", "38", "39") );
- config.rfmod.finetune = configElement("config.rfmod.finetune", ConfigSlider, 5, "");
+ config.rfmod.finetune = configElement("config.rfmod.finetune", configSlider, 5, (1, 10));
iRFmod = RFmod()
diff --git a/lib/python/Components/SetupDevices.py b/lib/python/Components/SetupDevices.py
index 2c5990a9..3398af71 100644
--- a/lib/python/Components/SetupDevices.py
+++ b/lib/python/Components/SetupDevices.py
@@ -2,7 +2,7 @@
from config import config #global config instance
from config import configElement
from config import ConfigSubsection
-from config import ConfigSlider
+from config import configSlider
from config import configSelection
from config import configText
from Components.Timezones import timezones
@@ -24,9 +24,9 @@ def InitSetupDevices():
config.keyboard.keymap = configElement("config.keyboard.keymap", configSelection, 1, (_("English"), _("German")) );
config.osd = ConfigSubsection();
- config.osd.alpha = configElement("config.osd.alpha", ConfigSlider, 0, "");
- config.osd.bright = configElement("config.osd.bright", ConfigSlider, 5, "");
- config.osd.contrast = configElement("config.osd.contrast", ConfigSlider, 5, "");
+ config.osd.alpha = configElement("config.osd.alpha", configSlider, 0, (1, 10));
+ config.osd.bright = configElement("config.osd.bright", configSlider, 5, (1, 10));
+ config.osd.contrast = configElement("config.osd.contrast", configSlider, 5, (1, 10));
def languageNotifier(configElement):
language.activateLanguage(configElement.value)
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index 06bb62a2..635eb748 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -293,7 +293,27 @@ class configSequence:
return ("mtext"[1-selected:], value, [mPos])
else:
return ("text", value)
+
+class configNothing:
+ def __init__(self, parent):
+ self.parent = parent
+ self.markedPos = 0
+
+ def cancel(self):
+ self.parent.reload()
+
+ def save(self):
+ self.parent.save()
+ def nextEntry(self):
+ self.parent.vals[1](self.parent.getConfigPath())
+
+ def handleKey(self, key):
+ pass
+
+ def __call__(self, selected): #needed by configlist
+ return ("text", "")
+
class configText:
# used as first parameter
# is the text of a fixed size or is the user able to extend the length of the text
@@ -378,7 +398,7 @@ config = Config();
configfile = configFile()
-class ConfigSlider:
+class configSlider:
def __init__(self, parent):
self.parent = parent
@@ -392,21 +412,21 @@ class ConfigSlider:
if self.parent.value < 0:
self.parent.value = 0
- if self.parent.value > 10:
- self.parent.value = 10
+ if self.parent.value > self.parent.vals[1]:
+ self.parent.value = self.parent.vals[1]
def handleKey(self, key):
if key == config.key["prevElement"]:
- self.parent.value = self.parent.value - 1
+ self.parent.value = self.parent.value - self.parent.vals[0]
if key == config.key["nextElement"]:
- self.parent.value = self.parent.value + 1
+ self.parent.value = self.parent.value + self.parent.vals[0]
self.checkValues()
self.parent.change()
def __call__(self, selected): #needed by configlist
self.checkValues()
- return ("slider", self.parent.value * 10)
+ return ("slider", self.parent.value, self.parent.vals[1])
class ConfigSubsection:
def __init__(self):
@@ -428,7 +448,7 @@ class configElement:
return 0 #prevent bigger then array
def datafromFile(self, control, data):
- if control == ConfigSlider:
+ if control == configSlider:
return int(data)
elif control == configSelection:
try:
@@ -458,7 +478,7 @@ class configElement:
return ""
def datatoFile(self, control, data):
- if control == ConfigSlider:
+ if control == configSlider:
return str(data)
elif control == configSelection:
if len(self.vals) < data + 1: