From: Stefan Pluecken Date: Thu, 3 Sep 2009 13:05:18 +0000 (+0200) Subject: allow exiting wizards with exit key if there is no step history (i.e. user is in... X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=53a6eecb41d1a7f0f926eb5bc0dd7322580f0e0c allow exiting wizards with exit key if there is no step history (i.e. user is in the first step of the wizard) --- diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 555110a..6833c52 100755 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -1,6 +1,7 @@ from Screen import Screen from Screens.HelpMenu import HelpableScreen +from Screens.MessageBox import MessageBox from Components.config import config, KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS from Components.Label import Label @@ -284,6 +285,8 @@ class Wizard(Screen): if len(self.stepHistory) > 1: self.currStep = self.stepHistory[-2] self.stepHistory = self.stepHistory[:-2] + else: + self.session.openWithCallback(self.exitWizardQuestion, MessageBox, (_("Are you sure you want to exit this wizard?") ) ) if self.currStep < 1: self.currStep = 1 print "currStep:", self.currStep @@ -291,6 +294,11 @@ class Wizard(Screen): self.updateValues() print "after updateValues stepHistory:", self.stepHistory + def exitWizardQuestion(self, ret = False): + if (ret): + self.markDone() + self.close() + def markDone(self): pass