From: Paul Mackerras Date: Tue, 4 Apr 2006 23:39:51 +0000 (+1000) Subject: gitk: Add a help menu item to display key bindings X-Git-Tag: v1.3.0-rc3~7^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4e95e1f738720e2f768098f73e76109c15a4e1ff;p=git.git gitk: Add a help menu item to display key bindings Suggested by Paul Schulz. I made it a separate entry under the Help menu rather than putting it in the About box, though. Signed-off-by: Paul Mackerras --- diff --git a/gitk b/gitk index 4bc7946ae..472c12afc 100755 --- a/gitk +++ b/gitk @@ -353,6 +353,7 @@ proc makewindow {rargs} { menu .bar.help .bar add cascade -label "Help" -menu .bar.help .bar.help add command -label "About gitk" -command about + .bar.help add command -label "Key bindings" -command keys . configure -menu .bar if {![info exists geometry(canv1)]} { @@ -718,6 +719,47 @@ Use and redistribute under the terms of the GNU General Public License} \ pack $w.ok -side bottom } +proc keys {} { + set w .keys + if {[winfo exists $w]} { + raise $w + return + } + toplevel $w + wm title $w "Gitk key bindings" + message $w.m -text { +Gitk key bindings: + + Quit +, p, i Move up one commit +, n, k Move down one commit +, z, j Go back in history list +, x, l Go forward in history list + Scroll commit list up one page + Scroll commit list down one page +, b Scroll diff view up one page + Scroll diff view up one page + Scroll diff view down one page +u Scroll diff view up 18 lines +d Scroll diff view down 18 lines + Find + Move to next find hit + Move to previous find hit + Move to next find hit +/ Move to next find hit, or redo find +? Move to previous find hit +f Scroll diff view to next file + Increase font size + Increase font size + Decrease font size + Decrease font size +} \ + -justify left -bg white -border 2 -relief sunken + pack $w.m -side top -fill both + button $w.ok -text Close -command "destroy $w" + pack $w.ok -side bottom +} + proc shortids {ids} { set res {} foreach id $ids { @@ -1763,7 +1805,7 @@ proc drawrest {} { showstuff $commitidx set drawmsecs [expr {[clock clicks -milliseconds] - $startmsecs}] - puts "overall $drawmsecs ms for $numcommits commits" + #puts "overall $drawmsecs ms for $numcommits commits" } proc findmatches {f} {