# HG changeset patch
# User Peter Ruibal <[email protected]>
# Date 1233580167 28800
# Node ID b47fbcc761176b94bb6e1e49d86b420cd25c89a2
# Parent 4a01fb43ef7ad7b2f46d0e44c28be1c59e6f184c
history: Auto-select/deselect diff target with context menu.
diff -r 4a01fb43ef7a -r b47fbcc76117 hggtk/history.py
--- a/hggtk/history.py Sat Feb 07 23:50:04 2009 -0800
+++ b/hggtk/history.py Mon Feb 02 05:09:27 2009 -0800
@@ -330,11 +330,16 @@
_menu.show_all()
return _menu
+ def _restore_original_selection(self, widget, *args):
+ self.tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
+ self.tree.get_selection().select_path(self._orig_sel)
+
def tree_diff_context_menu(self):
_menu = gtk.Menu()
_menu.append(create_menu('_diff with selected', self._diff_revs))
_menu.append(create_menu('visual diff with selected',
self._vdiff_selected))
+ _menu.connect_after('selection-done', self._restore_original_selection)
_menu.show_all()
return _menu
@@ -603,6 +608,9 @@
if srow == crow:
self._tree_popup_menu(widget, event.button, event.time)
else:
+ widget.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
+ widget.get_selection().select_path(crow)
+ self._orig_sel = srow
self._revs = (int(model[srow][treemodel.REVID]),
int(model[crow][treemodel.REVID]))
self._tree_popup_menu_diff(widget, event.button, event.time)
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop