use PixmapConditional for yellow and blue buttons
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 43f4222ac57c5a5102b92bf9381dac1a22a652af..dc597d22b05597540d682b56c0fe9e58f4b7d708 100644 (file)
@@ -1,7 +1,7 @@
 from Screen import Screen
 from Components.ActionMap import ActionMap, HelpableActionMap
 from Components.ActionMap import NumberActionMap
-from Components.Label import Label
+from Components.Label import *
 from Components.config import configfile, configsequencearg
 from Components.config import config, configElement, ConfigSubsection, configSequence
 from ChannelSelection import ChannelSelection
@@ -548,12 +548,17 @@ class InfoBarAdditionalInfo:
                
                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()
+
+               self["ButtonGreen"] = PixmapConditional()
+               self["ButtonGreen"].setConnect(lambda: self.session.nav.getCurrentService().subServices().getNumberOfSubservices() > 0)
+               self["ButtonGreenText"] = LabelConditional(text = _("Subservices"), withTimer = True)
+               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):