+ self["FormatActive"].setConnect(lambda: False)
+
+ self["ButtonRed"] = PixmapConditional(withTimer = False)
+ self["ButtonRed"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
+ self.onShown.append(self["ButtonRed"].update)
+ self["ButtonRedText"] = LabelConditional(text = _("Record"), withTimer = False)
+ self["ButtonRedText"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
+ self.onShown.append(self["ButtonRedText"].update)
+
+ self["ButtonGreen"] = PixmapConditional()
+ self["ButtonGreen"].setConnect(lambda: self.session.nav.getCurrentService().subServices().getNumberOfSubservices() > 0)
+ self["ButtonGreenText"] = LabelConditional(text = _("Subservices"))
+ self["ButtonGreenText"].setConnect(lambda: self.session.nav.getCurrentService().subServices().getNumberOfSubservices() > 0)
+
+ self["ButtonYellow"] = PixmapConditional()
+ self["ButtonYellow"].setConnect(lambda: False)
+
+ self["ButtonBlue"] = PixmapConditional()
+ self["ButtonBlue"].setConnect(lambda: False)
+
+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:])