[PATCH] Fix behavior when "Save modified files?" window is closed



After modifying a file, not saving the changes, and attempting to close
the file or quite meld, a user is presented with a "Save modified
files?" dialog window.  Previously, pressing the escape key at this window
or closing the window would result in the modified file being closed and
the modifications lost.  This is at odds with most other applications
which assume when a user presses the escape key or closes the dialog
window they only want to close the dialog window, not discard their
modifications.  This change makes meld behave similar to other
applications.

Signed-off-by: Peter Tyser <ptyser gmail com>
---
 meld/meldapp.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/meld/meldapp.py b/meld/meldapp.py
index 81e6991..1e0a786 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -740,7 +740,8 @@ class MeldApp(gnomeglade.Component):
 
     def try_remove_page(self, page):
         "See if a page will allow itself to be removed"
-        if page.on_delete_event() != gtk.RESPONSE_CANCEL:
+        resp = page.on_delete_event()
+        if resp != gtk.RESPONSE_CANCEL and resp != gtk.RESPONSE_DELETE_EVENT:
             self.scheduler.remove_scheduler( page.scheduler )
             i = self.notebook.page_num( page.widget )
             assert(i>=0)
-- 
1.6.2-rc2.GIT



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]