summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2010-12-19 16:41:32 -0500
committerPaul W. Frields <stickster@gmail.com>2010-12-19 16:41:32 -0500
commit4c8f1b7a34af371afe4aa29bdcc3dde9c32a0202 (patch)
tree02290b678021e0e9baf5c252fcc392e84b3d59eb
parent69c0e3e954b6c4e0b6ddc52b58481044a88a2cdf (diff)
downloadpulsecaster-4c8f1b7a34af371afe4aa29bdcc3dde9c32a0202.tar.gz
pulsecaster-4c8f1b7a34af371afe4aa29bdcc3dde9c32a0202.tar.xz
pulsecaster-4c8f1b7a34af371afe4aa29bdcc3dde9c32a0202.zip
Add confirmation for case where user cancels save
-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()