git-gui: Refactor about dialog code into its own module
[git/git-svn.git] / lib / about.tcl
blobb19738ecff0fb42b6a2bd5ed6583c5442b0f5ce9
1 # git-gui about git-gui dialog
2 # Copyright (C) 2006, 2007 Shawn Pearce
4 proc do_about {} {
5 global appvers copyright oguilib
6 global tcl_patchLevel tk_patchLevel
8 set w .about_dialog
9 toplevel $w
10 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
12 label $w.header -text [mc "About %s" [appname]] \
13 -font font_uibold
14 pack $w.header -side top -fill x
16 frame $w.buttons
17 button $w.buttons.close -text {Close} \
18 -default active \
19 -command [list destroy $w]
20 pack $w.buttons.close -side right
21 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
23 label $w.desc \
24 -text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
25 -padx 5 -pady 5 \
26 -justify left \
27 -anchor w \
28 -borderwidth 1 \
29 -relief solid
30 pack $w.desc -side top -fill x -padx 5 -pady 5
32 set v {}
33 append v "git-gui version $appvers\n"
34 append v "[git version]\n"
35 append v "\n"
36 if {$tcl_patchLevel eq $tk_patchLevel} {
37 append v "Tcl/Tk version $tcl_patchLevel"
38 } else {
39 append v "Tcl version $tcl_patchLevel"
40 append v ", Tk version $tk_patchLevel"
43 set d {}
44 append d "git wrapper: $::_git\n"
45 append d "git exec dir: [gitexec]\n"
46 append d "git-gui lib: $oguilib"
48 label $w.vers \
49 -text $v \
50 -padx 5 -pady 5 \
51 -justify left \
52 -anchor w \
53 -borderwidth 1 \
54 -relief solid
55 pack $w.vers -side top -fill x -padx 5 -pady 5
57 label $w.dirs \
58 -text $d \
59 -padx 5 -pady 5 \
60 -justify left \
61 -anchor w \
62 -borderwidth 1 \
63 -relief solid
64 pack $w.dirs -side top -fill x -padx 5 -pady 5
66 menu $w.ctxm -tearoff 0
67 $w.ctxm add command \
68 -label {Copy} \
69 -command "
70 clipboard clear
71 clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
74 bind $w <Visibility> "grab $w; focus $w.buttons.close"
75 bind $w <Key-Escape> "destroy $w"
76 bind $w <Key-Return> "destroy $w"
77 bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
78 wm title $w "About [appname]"
79 tkwait window $w