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