]> asedeno.scripts.mit.edu Git - git.git/commitdiff
git-gui: Added about dialog box.
authorShawn O. Pearce <spearce@spearce.org>
Tue, 21 Nov 2006 04:55:51 +0000 (23:55 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 21 Nov 2006 05:22:35 +0000 (00:22 -0500)
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>
git-gui

diff --git a/git-gui b/git-gui
index e770717b4e15c931796156ae92a5a2eb16ceaf6b..57120bd2b42e27acef5e201307068d7fd067995d 100755 (executable)
--- a/git-gui
+++ b/git-gui
@@ -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