Instant recordings - confirmation for Stop (and delete) all recording
authorims <ims21@users.sourceforge.net>
Wed, 25 Mar 2015 21:54:34 +0000 (22:54 +0100)
committerlittlesat <littlesat99@yahoo.com>
Wed, 25 Mar 2015 22:32:53 +0000 (23:32 +0100)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Screens/InfoBarGenerics.py

index 0e4cb62..a75d556 100644 (file)
@@ -2241,14 +2241,20 @@ class InfoBarInstantRecord:
                        self.recording.remove(self.recording[entry])
 
        def stopAllCurrentRecordings(self, list):
-               msg = ''
+               def confirm(answer=False):
+                       if answer:
+                               for entry in list:
+                                       self.session.nav.RecordTimer.removeEntry(entry[0])
+                                       self.recording.remove(entry[0])
+                                       if self.deleteRecording:
+                                               self.moveToTrash(entry[0])
+               msg =  _("Stop recordings:")
+               if self.deleteRecording:
+                       msg = _("Stop and delete recordings:")
+               msg += "\n"
                for entry in list:
-                       msg += entry[0].name + "\n"
-                       self.session.nav.RecordTimer.removeEntry(entry[0])
-                       self.recording.remove(entry[0])
-                       if self.deleteRecording:
-                               self.moveToTrash(entry[0])
-               self.session.open(MessageBox, _("Stopped recordings:") + "\n" + msg, MessageBox.TYPE_INFO, timeout=5)
+                       msg += " - " + entry[0].name + "\n"
+               self.session.openWithCallback(confirm, MessageBox, msg, MessageBox.TYPE_YESNO)
 
        def getProgramInfoAndEvent(self, info, name):
                info["serviceref"] = hasattr(self, "SelectedInstantServiceRef") and self.SelectedInstantServiceRef or self.session.nav.getCurrentlyPlayingServiceOrGroup()