add support for picture in picture into the infobar (by pressing the blue button)
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 8 Apr 2006 09:42:28 +0000 (09:42 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 8 Apr 2006 09:42:28 +0000 (09:42 +0000)
data/keymap.xml
data/skin.xml
data/skin_default.xml
lib/python/Screens/InfoBar.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/Makefile.am
lib/python/Screens/PictureInPicture.py [new file with mode: 0644]

index 2fa539b..cc558b1 100644 (file)
                <key id="KEY_RED" mapto="instantRecord" flags="m" />
        </map>
 
+       <map context="InfobarExtensions">
+               <key id="KEY_BLUE" mapto="extensions" flags="m" />
+       </map>
+       
        <map context="InfobarChannelSelection">
                <key id="KEY_LEFT" mapto="zapUp" flags="mr" />
                <key id="KEY_RIGHT" mapto="zapDown" flags="mr" />
index 502a3dd..7f55074 100644 (file)
@@ -72,7 +72,7 @@
                        <widget name="ButtonYellow" pixmap="button_yellow.png" position="430,132" size="27,12" />
                        <widget name="ButtonYellowText" position="460,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" />
                        <widget name="ButtonBlue" pixmap="button_blue.png" position="540,132" size="27,12" />
-                       <widget name="ButtonBlueText" position="570,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" />
+                       <widget name="ButtonBlueText" position="570,130" size="95,22" font="Regular;14" backgroundColor="blue" transparent="1" />
                </screen>
 
                <screen name="MoviePlayer" flags="wfNoBorder" position="0,370" size="720,148" title="InfoBar">
index e829da5..6e66602 100644 (file)
                <widget name="duration" position="140,345" size="100,30" font="Regular;22" />
                <widget name="channel" position="240,345" size="270,30" font="Regular;22" />
        </screen>
+       <screen name="PictureInPicture" position="500,100" size="180,140" zPosition="-1" flags="wfNoBorder" >
+               <widget name="video" position="0,0" size="160,120" />
+       </screen>
        <screen name="MovieSelection" position="90,98" size="560,415" title="Select a movie">
                <widget name="waitingtext" position="0,0" size="500,335" zPosition="2" font="Regular;22" />
                <widget name="list" position="0,0" size="560,375" zPosition="1" scrollbarMode="showOnDemand" />
index 8bfef20..a35ff3a 100644 (file)
@@ -17,7 +17,7 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
        InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
        InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift,  \
        InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
-       InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin
+       InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions
 
 from Screens.HelpMenu import HelpableScreen, HelpMenu
 
@@ -30,7 +30,7 @@ class InfoBar(InfoBarShowHide,
        InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, 
        HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
        InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
-       InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, Screen):
+       InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, Screen):
 
        def __init__(self, session):
                Screen.__init__(self, session)
@@ -47,7 +47,7 @@ class InfoBar(InfoBarShowHide,
                                InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
                                InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
                                InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
-                               InfoBarTeletextPlugin:
+                               InfoBarTeletextPlugin, InfoBarExtensions:
                        x.__init__(self)
 
                self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
index d527576..31dd303 100644 (file)
@@ -29,6 +29,7 @@ from Screens.InputBox import InputBox
 from Screens.MessageBox import MessageBox
 from Screens.MinuteInput import MinuteInput
 from Screens.TimerSelection import TimerSelection
+from Screens.PictureInPicture import PictureInPicture
 from ServiceReference import ServiceReference
 
 from Tools import Notifications
@@ -957,6 +958,34 @@ class InfoBarTimeshift:
                self.timeshift_enabled = False
                self.__seekableStatusChanged()
 
+class InfoBarExtensions:
+       def __init__(self):
+               self.pipshown = False
+               
+               self["InstantExtensionsActions"] = HelpableActionMap(self, "InfobarExtensions",
+                       {
+                               "extensions": (self.extensions, "Extensions..."),
+                       })
+                       
+       def extensions(self):
+               list = []
+               if self.pipshown == False:
+                       list.append((_("Activate Picture in Picture"), "pipon"))
+               elif self.pipshown == True:
+                       list.append((_("Disable Picture in Picture"), "pipoff"))
+               self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list = list)
+
+       def extensionCallback(self, answer):
+               if answer[1] == "pipon":
+                       self.pip = self.session.instantiateDialog(PictureInPicture)
+                       self.pip.show()
+                       self.pipshown = True
+                       print "would show PiP now"
+               elif answer[1] == "pipoff":
+                       self.pip.hide()
+                       del self.pip
+                       self.pipshown = False
+
 from RecordTimer import parseEvent
 
 class InfoBarInstantRecord:
@@ -1136,9 +1165,9 @@ class InfoBarAdditionalInfo:
                self.onLayoutFinish.append(self["ButtonYellowText"].update)
 
                self["ButtonBlue"] = PixmapConditional(withTimer = False)
-               self["ButtonBlue"].setConnect(lambda: False)
+               self["ButtonBlue"].setConnect(lambda: True)
                self["ButtonBlueText"] = LabelConditional(text = _("Extensions"), withTimer = False)
-               self["ButtonBlueText"].setConnect(lambda: False)
+               self["ButtonBlueText"].setConnect(lambda: True)
                self.onLayoutFinish.append(self["ButtonBlue"].update)
                self.onLayoutFinish.append(self["ButtonBlueText"].update)
 
index 031e608..8ed0818 100644 (file)
@@ -10,4 +10,4 @@ install_PYTHON = \
        Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
        TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
        Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \
-       MediaPlayer.py TimerSelection.py
+       MediaPlayer.py TimerSelection.py PictureInPicture.py
diff --git a/lib/python/Screens/PictureInPicture.py b/lib/python/Screens/PictureInPicture.py
new file mode 100644 (file)
index 0000000..7b94ce4
--- /dev/null
@@ -0,0 +1,9 @@
+from Screens.Screen import Screen
+
+from Components.VideoWindow import VideoWindow
+
+class PictureInPicture(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               
+               self["video"] = VideoWindow()
\ No newline at end of file