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