+class ParentalControlBouquetEditor(Screen):
+ #This new class allows adding complete bouquets to black- and whitelists
+ #The servicereference that is stored for bouquets is their refstr as listed in bouquets.tv
+ def __init__(self, session):
+ Screen.__init__(self, session)
+ self.skinName = "ParentalControlEditor"
+ self.list = []
+ self.bouquetslist = ParentalControlList(self.list)
+ self["servicelist"] = self.bouquetslist;
+ self.readBouquetList()
+ self.onLayoutFinish.append(self.selectBouquet)
+
+ self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"],
+ {
+ "ok": self.select,
+ "cancel": self.cancel
+ }, -1)
+
+ def cancel(self):
+ from Components.ParentalControl import parentalControl
+ parentalControl.save()
+ self.close()
+
+ def select(self):
+ self.bouquetslist.toggleSelectedLock()
+
+ def readBouquetList(self):
+ serviceHandler = eServiceCenter.getInstance()
+ refstr = '1:134:1:0:0:0:0:0:0:0:FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet'
+ bouquetroot = eServiceReference(refstr)
+ self.bouquetlist = {}
+ list = serviceHandler.list(bouquetroot)
+ if list is not None:
+ self.bouquetlist = list.getContent("CN", True)
+
+ def selectBouquet(self):
+ from Components.ParentalControl import parentalControl
+ self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionType(x[0])) for x in self.bouquetlist]
+ self.bouquetslist.setList(self.list)
+