add possibility to set a callable check function
[enigma2.git] / lib / python / Screens / ParentalControlSetup.py
index cde1f7c264d45d5d79cf743e2658ca465f5848aa..f39afed0f16cba80dab501d3a12301acde8bde10 100644 (file)
@@ -1,17 +1,15 @@
 from Screen import Screen
 from Screen import Screen
-from Components.ConfigList import ConfigList, ConfigListScreen
+from Components.ConfigList import ConfigListScreen
 from Components.ActionMap import NumberActionMap
 from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN
 from Components.ActionMap import NumberActionMap
 from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN
-from Components.ServiceList import ServiceList
 from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList 
 from Components.ParentalControl import parentalControl
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
 from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList 
 from Components.ParentalControl import parentalControl
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
-from Screens.InputBox import InputBox, Input, PinInput
+from Screens.InputBox import PinInput
 from Screens.ChannelSelection import service_types_tv
 from Tools.BoundFunction import boundFunction
 from Screens.ChannelSelection import service_types_tv
 from Tools.BoundFunction import boundFunction
-from ServiceReference import ServiceReference
-from enigma import eServiceCenter, eServiceReference, eTimer
+from enigma import eServiceCenter, eTimer
 from operator import itemgetter
 
 class ProtectedScreen:
 from operator import itemgetter
 
 class ProtectedScreen:
@@ -51,7 +49,7 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen):
                }, -2)
 
        def isProtected(self):
                }, -2)
 
        def isProtected(self):
-               return config.ParentalControl.setuppinactive.value
+               return config.ParentalControl.setuppinactive.value and config.ParentalControl.configured.value
        
        def createSetup(self):
                self.editListEntry = None
        
        def createSetup(self):
                self.editListEntry = None
@@ -192,10 +190,7 @@ class ParentalControlEditor(Screen):
                if list is not None:
                        services = list.getContent("CN", True) #(servicecomparestring, name)
                        for s in services:
                if list is not None:
                        services = list.getContent("CN", True) #(servicecomparestring, name)
                        for s in services:
-                               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]
+                               key = s[1].lower()[0]
                                if key < 'a' or key > 'z':
                                        key = chr(SPECIAL_CHAR)
                                #key = str(key)
                                if key < 'a' or key > 'z':
                                        key = chr(SPECIAL_CHAR)
                                #key = str(key)