summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-09 01:34:28 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-09 02:34:53 (GMT)
commit827c71199da9b762e0758fe96302d0c8b7a04bb9 (patch)
tree0a0eacdd5bbbcd1541426456efa7c85ad4d34a72 /lib
parent84d3d7b84c600d90486205bf801580009dc523a8 (diff)
downloadgit-827c71199da9b762e0758fe96302d0c8b7a04bb9.zip
git-827c71199da9b762e0758fe96302d0c8b7a04bb9.tar.gz
git-827c71199da9b762e0758fe96302d0c8b7a04bb9.tar.bz2
git-gui: Allow double-click in checkout dialog to start checkout
If the user double clicks a branch in the checkout dialog then they probably want to start the checkout process on that branch. I found myself doing this without realizing it, and of course it did nothing as there was no action bound to the listbox's Double-Button-1 event handler. Since I did it without thinking, others will probably also try, and expect the same behavior. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/branch_checkout.tcl1
-rw-r--r--lib/choose_rev.tcl4
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/branch_checkout.tcl b/lib/branch_checkout.tcl
index 62230ef..72c45b4 100644
--- a/lib/branch_checkout.tcl
+++ b/lib/branch_checkout.tcl
@@ -30,6 +30,7 @@ constructor dialog {} {
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
set w_rev [::choose_rev::new $w.rev {Revision}]
+ $w_rev bind_listbox <Double-Button-1> [cb _checkout]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
labelframe $w.options -text {Options}
diff --git a/lib/choose_rev.tcl b/lib/choose_rev.tcl
index 1aab56f..afd8170 100644
--- a/lib/choose_rev.tcl
+++ b/lib/choose_rev.tcl
@@ -185,6 +185,10 @@ method focus_filter {} {
}
}
+method bind_listbox {event script} {
+ bind $w_list $event $script
+}
+
method get_local_branch {} {
if {$revtype eq {head}} {
return [_expr $this]