summaryrefslogtreecommitdiffstats
path: root/pulsecaster/ui.py
diff options
context:
space:
mode:
Diffstat (limited to 'pulsecaster/ui.py')
-rw-r--r--pulsecaster/ui.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pulsecaster/ui.py b/pulsecaster/ui.py
index 7a318a4..2ac69cc 100644
--- a/pulsecaster/ui.py
+++ b/pulsecaster/ui.py
@@ -238,8 +238,18 @@ class PulseCasterUI:
self.file_chooser.show()
def hideFileChooser(self, *args):
- if self.filesinkpath:
- self.file_chooser.hide()
+ if not self.filesinkpath:
+ confirm = gtk.MessageDialog(type=gtk.MESSAGE_WARNING,
+ buttons=gtk.BUTTONS_YES_NO,
+ message_format=_('Are you sure you want to cancel ' +
+ 'saving your work? If you choose "Yes" ' +
+ 'your audio recording will be erased ' +
+ 'permanently.'))
+ response = confirm.run()
+ confirm.destroy()
+ if response == gtk.RESPONSE_NO:
+ return
+ self.file_chooser.hide()
def updateFileSinkPath(self, *args):
self.filesinkpath = self.file_chooser.get_filename()