fix instant records (timers, deleted through the timer menu are still in the instant...
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 31dd30336a99f33fa1ddb51acf569509e939458f..559d73dce737322a9a8c4167c03ce549e69b4029 100644 (file)
@@ -977,12 +977,21 @@ class InfoBarExtensions:
 
        def extensionCallback(self, answer):
                if answer[1] == "pipon":
+                       self.session.nav.stopService()
                        self.pip = self.session.instantiateDialog(PictureInPicture)
-                       self.pip.show()
-                       self.pipshown = True
-                       print "would show PiP now"
+                       #self.pip.show()
+                       
+                       newservice = self.session.nav.getCurrentlyPlayingServiceReference()
+                       self.pipservice = eServiceCenter.getInstance().play(newservice)
+                       if self.pipservice and not self.pipservice.setTarget(1):
+                               self.pipservice.start()
+                               self.pipshown = True
+                       else:
+                               self.pipservice = None
+                               del self.pip
+
                elif answer[1] == "pipoff":
-                       self.pip.hide()
+                       #self.pip.hide()
                        del self.pip
                        self.pipshown = False
 
@@ -1056,11 +1065,16 @@ class InfoBarInstantRecord:
                return False
 
        def recordQuestionCallback(self, answer):
+               print "pre:\n", self.recording
+               
                if answer is None or answer[1] == "no":
                        return
                list = []
-               for x in self.recording:
-                       if x.dontSave:
+               recording = self.recording[:]
+               for x in recording:
+                       if not x in self.session.nav.RecordTimer.timer_list:
+                               self.recording.remove(x)
+                       elif x.dontSave and x.isRunning():
                                list.append(TimerEntryComponent(x, False))              
 
                if answer[1] == "changeduration":
@@ -1081,6 +1095,8 @@ class InfoBarInstantRecord:
                                self.selectedEntry = len(self.recording)
                                self.session.openWithCallback(self.inputCallback, InputBox, title=_("How many minutes do you want to record?"), text="5", maxSize=False, type=Input.NUMBER)
                        self.startInstantRecording(limitEvent = limitEvent)
+                       
+               print "after:\n", self.recording
 
        def changeDuration(self, entry):
                if entry is not None: