X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/8f43ee082c27440c982f88fc5455aa39716e8fae..cd883d9759844701ef57afa0cb03de7722acc5e5:/lib/python/Screens/ParentalControlSetup.py diff --git a/lib/python/Screens/ParentalControlSetup.py b/lib/python/Screens/ParentalControlSetup.py index 780114b8..7c4c3ecf 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): @@ -76,7 +78,7 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): elif config.ParentalControl.mode.value == "simple": self.changePin = getConfigListEntry(_("Change service pin"), NoSave(ConfigNothing())) self.list.append(self.changePin) - self.list.append(getConfigListEntry(_("Remember service pin"), config.ParentalControl.storeservicepin)) + #self.list.append(getConfigListEntry(_("Remember service pin"), config.ParentalControl.storeservicepin)) self.editListEntry = getConfigListEntry(_("Edit services list"), NoSave(ConfigNothing())) self.list.append(self.editListEntry) @@ -117,8 +119,8 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): def keyNumberGlobal(self, number): pass +SPECIAL_CHAR = 96 class ParentalControlEditor(Screen): - SPECIAL_CHAR = 96 def __init__(self, session): Screen.__init__(self, session) self.list = [] @@ -170,7 +172,7 @@ class ParentalControlEditor(Screen): if list is not None: services = list.getContent("CN", True) #(servicecomparestring, name) for s in services: - if s[1][0]=='\xc2' and s[1][1]=='\x86': # ignore shortname brackets + if ord(s[1][0])==0xc2 and ord(s[1][1])==0x86: # ignore shortname brackets key = s[1].lower()[2] else: key = s[1].lower()[0]