git-gui: Allow the user to copy the version data to the clipboard.
If a user wants to report an issue they will likely want to include the version number with their issue report. This may be difficult to enter if the version number includes an abbreviated commit SHA1 on the end of it. So we now give the user a context menu option on the version box which allows them to copy all of the relevant version data to the clipboard, ready for pasting into a report. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 20, 2007 at 20:47 UTC
98063115920338a1a6472a22c6792b13e37012b5
1 file changed
+10
git-gui.sh
+10
@@ -2563,8 +2563,18 @@ $copyright" \
2563
-font font_ui
2564
pack $w.vers -side top -fill x -padx 5 -pady 5
2565
2566
+ menu $w.ctxm -tearoff 0
2567
+ $w.ctxm add command \
2568
+ -label {Copy} \
2569
+ -font font_ui \
2570
+ -command "
2571
+ clipboard clear
2572
+ clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
2573
+ "
2574
+
2575
bind $w <Visibility> "grab $w; focus $w"
2576
bind $w <Key-Escape> "destroy $w"
2577
+ bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
2578
wm title $w "About $appname"
2579
tkwait window $w
2580
}