+ if isinstance(service[1], str):
+ if service[1] == "quickzap":
+ from Screens.SubservicesQuickzap import SubservicesQuickzap
+ self.session.open(SubservicesQuickzap, service[2])
+ else:
+ self["SubserviceQuickzapAction"].setEnabled(True)
+ if config.usage.show_infobar_on_zap.value:
+ self.doShow()
+ self.session.nav.playService(service[1])
+
+ def addSubserviceToBouquetCallback(self, service):
+ if len(service) > 1 and isinstance(service[1], eServiceReference):
+ self.selectedSubservice = service
+ if self.bouquets is None:
+ cnt = 0
+ else:
+ cnt = len(self.bouquets)
+ if cnt > 1: # show bouquet list
+ self.bsel = self.session.openWithCallback(self.bouquetSelClosed, BouquetSelector, self.bouquets, self.addSubserviceToBouquet)
+ elif cnt == 1: # add to only one existing bouquet
+ self.addSubserviceToBouquet(self.bouquets[0][1])
+ self.session.open(MessageBox, _("Service has been added to the favourites."), MessageBox.TYPE_INFO)
+
+ def bouquetSelClosed(self, confirmed):
+ self.bsel = None
+ del self.selectedSubservice
+ if confirmed:
+ self.session.open(MessageBox, _("Service has been added to the selected bouquet."), MessageBox.TYPE_INFO)
+
+ def addSubserviceToBouquet(self, dest):
+ serviceHandler = eServiceCenter.getInstance()
+ list = dest and serviceHandler.list(dest)
+ mutableList = dest and list and list.startEdit()
+ if mutableList:
+ if not mutableList.addService(self.selectedSubservice[1]):
+ mutableList.flushChanges()
+ # do some voodoo to check if the subservice is added to the
+ # current selected bouquet in channellist
+ cur_root = self.servicelist.getRoot();
+ str1 = cur_root.toString()
+ str2 = dest.toString()
+ pos1 = str1.find("FROM BOUQUET")
+ pos2 = str2.find("FROM BOUQUET")
+ if pos1 != -1 and pos2 != -1 and str1[pos1:] == str2[pos2:]:
+ self.servicelist.setMode()
+ if self.bsel:
+ self.bsel.close(True)
+ else:
+ del self.selectedSubservice