git-gui: Added about dialog box.

Created a help menu with an about dialog box.  This about dialog
shows the copyright notice for the application, the fact that it
is covered by the GPL v2.0 or later, the authors, and the current
version of Git it is invoking when users perform actions within it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Shawn O. Pearce 2006-11-20 23:55:51 -05:00
parent a4abfa62d6
commit 82aa23545f

58
git-gui
View File

@ -2159,6 +2159,55 @@ proc do_commit {} {
commit_tree
}
proc do_about {} {
global appname
set w .about_dialog
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
label $w.header -text "About $appname" \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.close -text {Close} \
-font font_ui \
-command [list destroy $w]
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
label $w.desc \
-text "$appname - a commit creation tool for Git.
Copyright © 2006 Shawn Pearce, Paul Mackerras
Use and redistribute under the terms of the
GNU General Public License, v. 2.0 or later." \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid \
-font font_ui
pack $w.desc -side top -fill x -padx 5 -pady 5
label $w.vers \
-text [exec git --version] \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid \
-font font_ui
pack $w.vers -side top -fill x -padx 5 -pady 5
bind $w <Visibility> "grab $w; focus $w"
bind $w <Key-Escape> "destroy $w"
wm title $w "About $appname"
tkwait window $w
}
proc do_options {} {
global appname gitdir font_descs
global repo_config global_config
@ -2610,6 +2659,7 @@ if {!$single_commit} {
.mbar add cascade -label Pull -menu .mbar.pull
.mbar add cascade -label Push -menu .mbar.push
}
.mbar add cascade -label Help -menu .mbar.help
. configure -menu .mbar
# -- Repository Menu
@ -2758,6 +2808,14 @@ if {!$single_commit} {
menu .mbar.push
}
# -- Help Menm
#
menu .mbar.help
.mbar.help add command -label "About $appname" \
-command do_about \
-font font_ui
# -- Main Window Layout
#
panedwindow .vpane -orient vertical