Patch attached to prevent delete events from killing the filter dialog
which caused the filter dialog to appear hangup on reopening, if the
dialog had been previously closed by the delete events, for e.g. by
clicking the [X] button on the dialogs' title bar, or pressing Alt-F4
(in Windows)
# HG changeset patch
# User TK Soh <[email protected]>
# Date 1238978652 -3600
# Node ID beb806d2e8785fb7939de63d1e60b2b5eaab75a5
# Parent  8c1d05232b749ae9680284e1117bdc8f6eae4bfb
history: prevent delete events from killing the filter dialog

which caused the filter dialog to appear hangup on reopening, if
the dialog had been previously closed by the delete events, for e.g.
by clicking the [X] button on the dialogs' title bar, or pressing
Alt-F4 (in Windows)

diff -r 8c1d05232b74 -r beb806d2e878 hggtk/history.py
--- a/hggtk/history.py  Tue Mar 31 23:31:06 2009 -0500
+++ b/hggtk/history.py  Mon Apr 06 01:44:12 2009 +0100
@@ -107,6 +107,10 @@
         def close_filter_dialog(dialog, response_id):
             dialog.hide()
 
+        def delete_event(dialog, event, data=None):
+            # return True to prevent the dialog from being destroyed
+            return True     
+
         revs = []
         if self.currow is not None:
             revs.append(self.currow[treemodel.REVID])
@@ -114,6 +118,7 @@
         dlg = FilterDialog(self.repo.root, revs, self.pats,
                 filterfunc=do_reload)
         dlg.connect('response', close_filter_dialog)
+        dlg.connect('delete-event', delete_event)
         dlg.set_modal(False)
         dlg.show()
         
------------------------------------------------------------------------------
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to