[chirp_devel] [PATCH] Dismissing save confirmation dialog was closing tab

Kosta Arvanitis
Sun Jan 25 21:40:16 PST 2015


# HG changeset patch
# User K. Arvanitis <kosta at alumni.uvic.ca>
# Date 1422250708 28800
#      Sun Jan 25 21:38:28 2015 -0800
# Node ID ed3c35ee774f2d76cf6443ff604574c19e0c3686
# Parent  b25606106a9c0cd78f3cc5f602475da64cde081d
[PATCH] Dismissing save confirmation dialog was closing tab
A typical gtk Dialog will return a response of RESPONSE_DELETE_EVENT
when the dialog window is dismissed.
As a result dismissing the save confirmation dialog was performing similarly
to the user selecting the NO button (RESPONSE_NO)
This created a situation where a person could possibly loose their changes
should they dismiss the save confirmation dialog without using the cancel
button.
The fix essentially handles both the CANCEL and DELETE_EVENT responses as
the same.
Bug #2255
diff -r b25606106a9c -r ed3c35ee774f chirpui/mainapp.py
--- a/chirpui/mainapp.py Wed Jan 21 23:30:19 2015 -0800
+++ b/chirpui/mainapp.py Sun Jan 25 21:38:28 2015 -0800
@@ -731,9 +731,10 @@
             dlg.set_text(_("File is modified, save changes before closing?"))
             res = dlg.run()
             dlg.destroy()
+
             if res == gtk.RESPONSE_YES:
                 self.do_save(eset)
-            elif res == gtk.RESPONSE_CANCEL:
+            elif res != gtk.RESPONSE_NO:
                 raise ModifiedError()
 
         eset.rthread.stop()
 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20150125/a05e0d9f/attachment-0001.html 


More information about the chirp_devel mailing list