factorize the conditionalPixmap
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index c1842796df28a327102c95644140adb40a6eec33..43f4222ac57c5a5102b92bf9381dac1a22a652af 100644 (file)
@@ -17,6 +17,7 @@ from EpgSelection import EPGSelection
 from Screens.MessageBox import MessageBox
 from Screens.Volume import Volume
 from Screens.Mute import Mute
+from Screens.Dish import Dish
 from Screens.Standby import Standby
 from Screens.EventView import EventView
 
@@ -89,6 +90,11 @@ class InfoBarVolumeControl:
                else:
                        self.muteDialog.instance.hide()
 
+class InfoBarDish:
+       def __init__(self):
+               self.dishDialog = self.session.instantiateDialog(Dish)
+               self.onShown.append(self.dishDialog.instance.show)
+
 class InfoBarShowHide:
        """ InfoBar show/hide control, accepts toggleShow and hide actions, might start
        fancy animations. """
@@ -437,7 +443,7 @@ class InfoBarInstantRecord:
                self.recording = None
                
                self["BlinkingPoint"] = BlinkingPixmapConditional()
-               self.onShown.append(self["BlinkingPoint"].hidePixmap)
+               self.onShown.append(self["BlinkingPoint"].hideWidget)
                self["BlinkingPoint"].setConnect(self.session.nav.RecordTimer.isRecording)
                
        def stopCurrentRecording(self): 
@@ -506,6 +512,26 @@ class InfoBarAudioSelection:
                if n > 0:
                        self.session.open(AudioSelection, audio)
 
+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()
@@ -523,8 +549,11 @@ class InfoBarAdditionalInfo:
                self["ButtonRed"] = Pixmap()
                self["ButtonRedText"] = Label(_("Record"))
                self["ButtonGreen"] = Pixmap()
-               self["ButtonYellow"] = Pixmap()
-               self["ButtonBlue"] = Pixmap()
+               self["ButtonGreenText"] = Label(_("Subservices"))
+#              self["ButtonGreenText"].hide()
+#              self["ButtonGreen"].hidePixmap()
+#              self["ButtonYellow"] = Pixmap()
+#              self["ButtonBlue"] = Pixmap()
 
 class InfoBarNotifications:
        def __init__(self):