aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-11-27 00:50:26 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-11-27 00:50:26 +0000
commit849192972c9dcc9515ee2637e6ffe2a8790c940a (patch)
tree11f73b6503ef6cd89bf0ef5dcf4914f1d2c654be /lib/python/Components
parentf855bd5291c74d34668cdbb77e9c89c80f4a5dc9 (diff)
downloadenigma2-849192972c9dcc9515ee2637e6ffe2a8790c940a.tar.gz
enigma2-849192972c9dcc9515ee2637e6ffe2a8790c940a.zip
move keySave, keyCancel into ConfigList.py, use cancel confirm in satsetup to fix enduser problems ;)
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/ConfigList.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py
index 4dd401f9..8b880fba 100644
--- a/lib/python/Components/ConfigList.py
+++ b/lib/python/Components/ConfigList.py
@@ -3,6 +3,7 @@ from GUIComponent import *
from config import KEY_LEFT, KEY_RIGHT, KEY_0, KEY_DELETE, KEY_OK, KEY_TIMEOUT, ConfigElement
from Components.ActionMap import NumberActionMap
from enigma import eListbox, eListboxPythonConfigContent, eTimer
+from Screens.MessageBox import MessageBox
class ConfigList(HTMLComponent, GUIComponent, object):
def __init__(self, list, session = None):
@@ -94,6 +95,13 @@ class ConfigList(HTMLComponent, GUIComponent, object):
def timeout(self):
self.handleKey(KEY_TIMEOUT)
+ def isChanged(self):
+ is_changed = False
+ for x in self.list:
+ is_changed |= x[1].isChanged()
+
+ return is_changed
+
class ConfigListScreen:
def __init__(self, list, session = None, on_change = None):
self["config_actions"] = NumberActionMap(["SetupActions", "TextInputActions"],
@@ -139,3 +147,23 @@ class ConfigListScreen:
self["config"].handleKey(KEY_0 + number)
self.__changed()
+ # keySave and keyCancel are just provided in case you need them.
+ # you have to call them by yourself.
+ def keySave(self):
+ for x in self["config"].list:
+ x[1].save()
+ self.close()
+
+ def cancelConfirm(self, result):
+ if not result:
+ return
+
+ for x in self["config"].list:
+ x[1].cancel()
+ self.close()
+
+ def keyCancel(self):
+ if self["config"].isChanged():
+ self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?"))
+ else:
+ self.close()