From: Felix Domke Date: Sun, 8 Oct 2006 22:35:42 +0000 (+0000) Subject: ask before not saving settings X-Git-Tag: 2.6.0~2992 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/21ef24675a83e78934de665d2a5511141c8e6cf1 ask before not saving settings --- diff --git a/lib/python/Screens/Setup.py b/lib/python/Screens/Setup.py index 09984bd8..48c85c8e 100644 --- a/lib/python/Screens/Setup.py +++ b/lib/python/Screens/Setup.py @@ -1,4 +1,5 @@ from Screen import Screen +from MessageBox import MessageBox from Components.ActionMap import NumberActionMap from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_OK from Components.ConfigList import ConfigList, ConfigListScreen @@ -129,13 +130,20 @@ class Setup(ConfigListScreen, Screen): for x in self["config"].list: x[1].save() self.close() + + def cancelConfirm(self, result): + if not result: + return - def keyCancel(self): print "cancel requested" + for x in self["config"].list: x[1].cancel() self.close() - + + def keyCancel(self): + self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?")) + def getSetupTitle(id): xmldata = setupdom.childNodes[0].childNodes for x in elementsWithTag(xmldata, "setup"):