+
+from Screens.SubserviceSelection import SubserviceSelection
+
+class InfoBarSubserviceSelection:
+ def __init__(self):
+ self["SubserviceSelectionAction"] = HelpableActionMap(self, "InfobarSubserviceSelectionActions",
+ {
+ "subserviceSelection": (self.subserviceSelection, "Subservice list..."),
+ })
+
+ def subserviceSelection(self):
+ service = self.session.nav.getCurrentService()
+ subservices = service.subServices()
+ n = subservices.getNumberOfSubservices()
+ if n > 0:
+ self.session.openWithCallback(self.subserviceSelected, SubserviceSelection, subservices)
+
+ def subserviceSelected(self, service):
+ if not service is None:
+ self.session.nav.playService(service)
+
+class InfoBarAdditionalInfo:
+ def __init__(self):
+ self["DolbyActive"] = PixmapConditional()
+ # TODO: get the info from c++ somehow
+ self["DolbyActive"].setConnect(lambda: False)
+
+ self["CryptActive"] = PixmapConditional()
+ # TODO: get the info from c++ somehow
+ self["CryptActive"].setConnect(lambda: False)
+
+ self["FormatActive"] = PixmapConditional()
+ # TODO: get the info from c++ somehow
+ self["FormatActive"].setConnect(lambda: False)
+
+ self["ButtonRed"] = Pixmap()
+ self["ButtonRedText"] = Label(_("Record"))
+ self["ButtonGreen"] = Pixmap()
+ self["ButtonGreenText"] = Label(_("Subservices"))
+# self["ButtonGreenText"].hide()
+# self["ButtonGreen"].hidePixmap()
+# self["ButtonYellow"] = Pixmap()
+# self["ButtonBlue"] = Pixmap()
+
+class InfoBarNotifications:
+ def __init__(self):
+ self.onExecBegin.append(self.checkNotifications)
+ Notifications.notificationAdded.append(self.checkNotificationsIfExecing)
+
+ def checkNotificationsIfExecing(self):
+ if self.execing:
+ self.checkNotifications()
+
+ def checkNotifications(self):
+ if len(Notifications.notifications):
+ n = Notifications.notifications[0]
+ Notifications.notifications = Notifications.notifications[1:]
+ print "open",n
+ cb = n[0]
+ if cb is not None:
+ self.session.openWithCallback(cb, *n[1:])
+ else:
+ self.session.open(*n[1:])