add Change recording (add time) to instant recording. It adds time to end of recording
authorims <ims21@users.sourceforge.net>
Fri, 3 Apr 2015 21:03:05 +0000 (23:03 +0200)
committerlittlesat <littlesat99@yahoo.com>
Sat, 4 Apr 2015 13:55:07 +0000 (15:55 +0200)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Screens/InfoBarGenerics.py

index 8251b41..a1cc269 100644 (file)
@@ -2370,6 +2370,11 @@ class InfoBarInstantRecord:
                                self.changeDuration(0)
                        else:
                                self.session.openWithCallback(self.changeDuration, TimerSelection, list)
+               elif answer[1] == "addrecordingtime":
+                       if len(self.recording) == 1:
+                               self.addRecordingTime(0)
+                       else:
+                               self.session.openWithCallback(self.addRecordingTime, TimerSelection, list)
                elif answer[1] == "changeendtime":
                        if len(self.recording) == 1:
                                self.setEndtime(0)
@@ -2434,6 +2439,20 @@ class InfoBarInstantRecord:
                        self.selectedEntry = entry
                        self.session.openWithCallback(self.inputCallback, InputBox, title=_("How many minutes do you want to record?"), text="5", maxSize=False, type=Input.NUMBER)
 
+       def addRecordingTime(self, entry):
+               if entry is not None and entry >= 0:
+                       self.selectedEntry = entry
+                       self.session.openWithCallback(self.inputAddRecordingTime, InputBox, title=_("How many minutes do you want add to record?"), text="5", maxSize=False, type=Input.NUMBER)
+
+       def inputAddRecordingTime(self, value):
+               if value:
+                       print "added", int(value), "minutes for recording."
+                       entry = self.recording[self.selectedEntry]
+                       if int(value) != 0:
+                               entry.autoincrease = False
+                       entry.end += 60 * int(value)
+                       self.session.nav.RecordTimer.timeChanged(entry)
+
        def inputCallback(self, value):
                if value:
                        print "stopping recording after", int(value), "minutes."
@@ -2475,6 +2494,7 @@ class InfoBarInstantRecord:
                        title =_("A recording is currently running.\nWhat do you want to do?")
                        list = common + \
                                ((_("Change recording (duration)"), "changeduration"),
+                               (_("Change recording (add time)"), "addrecordingtime"),
                                (_("Change recording (endtime)"), "changeendtime"),)
                        list += ((_("Stop recording"), "stop"),)
                        if config.usage.movielist_trashcan.value: