ignore short name brakets in parental control edit list
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 10 Oct 2006 15:42:57 +0000 (15:42 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 10 Oct 2006 15:42:57 +0000 (15:42 +0000)
lib/python/Components/ParentalControlList.py
lib/python/Screens/ChannelSelection.py
lib/python/Screens/ParentalControlSetup.py

index 6315963..9791e1b 100644 (file)
@@ -20,10 +20,9 @@ lockPicture = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "lock-fs8.png"))
 
 def ParentalControlEntryComponent(service, name, locked = True):
        res = [ (service, name, locked) ]
 
 def ParentalControlEntryComponent(service, name, locked = True):
        res = [ (service, name, locked) ]
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 5, 200, 50, 0, RT_HALIGN_LEFT, name))
+       res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 5, 300, 50, 0, RT_HALIGN_LEFT, name))
        if locked:
                res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 32, 32, lockPicture))
        if locked:
                res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 32, 32, lockPicture))
-       
        return res
 
 class ParentalControlList(MenuList, HTMLComponent, GUIComponent):
        return res
 
 class ParentalControlList(MenuList, HTMLComponent, GUIComponent):
index 54c4829..241f5a1 100644 (file)
@@ -486,14 +486,14 @@ class ChannelSelectionEdit:
 MODE_TV = 0
 MODE_RADIO = 1
 
 MODE_TV = 0
 MODE_RADIO = 1
 
+# this makes it much simple to implement a selectable radio or tv mode :)
+service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25)'
+service_types_radio = '1:7:2:0:0:0:0:0:0:0:(type == 2)'
+
 class ChannelSelectionBase(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
 
 class ChannelSelectionBase(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
 
-               # this makes it much simple to implement a selectable radio or tv mode :)
-               self.service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25)'
-               self.service_types_radio = '1:7:2:0:0:0:0:0:0:0:(type == 2)'
-
                self["key_red"] = Button(_("All"))
                self["key_green"] = Button(_("Satellites"))
                self["key_yellow"] = Button(_("Provider"))
                self["key_red"] = Button(_("All"))
                self["key_green"] = Button(_("Satellites"))
                self["key_yellow"] = Button(_("Provider"))
@@ -576,13 +576,13 @@ class ChannelSelectionBase(Screen):
 
        def recallBouquetMode(self):
                if self.mode == MODE_TV:
 
        def recallBouquetMode(self):
                if self.mode == MODE_TV:
-                       self.service_types = self.service_types_tv
+                       self.service_types = service_types_tv
                        if config.usage.multibouquet.value:
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.tv" ORDER BY bouquet'
                        else:
                                self.bouquet_rootstr = '%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'%(self.service_types)
                else:
                        if config.usage.multibouquet.value:
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.tv" ORDER BY bouquet'
                        else:
                                self.bouquet_rootstr = '%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'%(self.service_types)
                else:
-                       self.service_types = self.service_types_radio
+                       self.service_types = service_types_radio
                        if config.usage.multibouquet.value:
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.radio" ORDER BY bouquet'
                        else:
                        if config.usage.multibouquet.value:
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.radio" ORDER BY bouquet'
                        else:
index a8fdcc5..944fc6a 100644 (file)
@@ -8,6 +8,7 @@ from Components.ParentalControl import parentalControl
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
 from Screens.InputBox import InputBox, Input, PinInput
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
 from Screens.InputBox import InputBox, Input, PinInput
+from Screens.ChannelSelection import service_types_tv
 from Tools.Directories import resolveFilename, SCOPE_CONFIG
 from Tools.BoundFunction import boundFunction
 from ServiceReference import ServiceReference
 from Tools.Directories import resolveFilename, SCOPE_CONFIG
 from Tools.BoundFunction import boundFunction
 from ServiceReference import ServiceReference
@@ -162,8 +163,7 @@ class ParentalControlEditor(Screen):
        
        def readServiceList(self):
                serviceHandler = eServiceCenter.getInstance()
        
        def readServiceList(self):
                serviceHandler = eServiceCenter.getInstance()
-               self.service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25)'
-               refstr = '%s ORDER BY name' % (self.service_types_tv)
+               refstr = '%s ORDER BY name' % (service_types_tv)
                self.root = eServiceReference(refstr)
                
                self.servicesList = {}
                self.root = eServiceReference(refstr)
                
                self.servicesList = {}
@@ -172,7 +172,10 @@ 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:
-                               key = s[1].lower()[0]
+                               if s[1][0]=='\xc2' and s[1][1]=='\x86': # ignore shortname brackets
+                                       key = s[1].lower()[2]
+                               else:
+                                       key = s[1].lower()[0]
                                if key < 'a' or key > 'z':
                                        key = '&'
                                #key = str(key)
                                if key < 'a' or key > 'z':
                                        key = '&'
                                #key = str(key)
@@ -180,8 +183,6 @@ class ParentalControlEditor(Screen):
                                        self.servicesList[key] = []
                                self.servicesList[key].append(s)
 
                                        self.servicesList[key] = []
                                self.servicesList[key].append(s)
 
-               print self.servicesList
-
        def chooseLetter(self):
                print "choose letter"
                list = []
        def chooseLetter(self):
                print "choose letter"
                list = []