From 681c113336426914342cf68fb03e7cd399c29c9a Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Wed, 11 Oct 2006 15:16:56 +0000 Subject: improve parental control retry count --- lib/python/Screens/ParentalControlSetup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/python/Screens/ParentalControlSetup.py') diff --git a/lib/python/Screens/ParentalControlSetup.py b/lib/python/Screens/ParentalControlSetup.py index c3c0cb0b..d4911953 100644 --- a/lib/python/Screens/ParentalControlSetup.py +++ b/lib/python/Screens/ParentalControlSetup.py @@ -19,7 +19,10 @@ import operator class ProtectedScreen: def __init__(self): if self.isProtected(): - self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.protectedWithPin()], title = self.getPinText(), windowTitle = _("Change pin code"))) + self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.protectedWithPin()], triesEntry = self.getTriesEntry(), title = self.getPinText(), windowTitle = _("Change pin code"))) + + def getTriesEntry(self): + return config.ParentalControl.retries.setuppin def getPinText(self): return _("Please enter the correct pin code") @@ -31,10 +34,9 @@ class ProtectedScreen: return config.ParentalControl.setuppin.value def pinEntered(self, result): - if result[0] is None: + if result is None: self.close() - if not result[0]: - print result, "-", self.protectedWithPin() + elif not result: self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): -- cgit v1.2.3