set appvers {@@GITGUI_VERSION@@}
set copyright {
-Copyright © 2006, 2007 Shawn Pearce, Paul Mackerras.
+Copyright © 2006, 2007 Shawn Pearce, et. al.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
+set gitgui_credits {
+Paul Mackerras
+}
######################################################################
##
[file normalize [file dirname $_gitdir]]] \
end]
+######################################################################
+##
+## global init
+
+set current_diff_path {}
+set current_diff_side {}
+set diff_actions [list]
+set ui_status_value {Initializing...}
+
+set HEAD {}
+set PARENT {}
+set MERGE_HEAD [list]
+set commit_type {}
+set empty_tree {}
+set current_branch {}
+set current_diff_path {}
+set selected_commit_type new
+
######################################################################
##
## task management
global current_diff_path current_diff_side
set p $current_diff_path
- if {$p eq {}
- || $current_diff_side eq {}
+ if {$p eq {}} {
+ # No diff is being shown.
+ } elseif {$current_diff_side eq {}
|| [catch {set s $file_states($p)}]
|| [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} {
clear_diff
return
}
- # -- Make sure our current branch exists.
- #
- if {$commit_type eq {initial}} {
- lappend all_heads $current_branch
- set all_heads [lsort -unique $all_heads]
- populate_branch_menu
- }
-
# -- Cleanup after ourselves.
#
catch {file delete $msg_p}
if {[is_enabled singlecommit]} do_quit
+ # -- Make sure our current branch exists.
+ #
+ if {$commit_type eq {initial}} {
+ lappend all_heads $current_branch
+ set all_heads [lsort -unique $all_heads]
+ populate_branch_menu
+ }
+
# -- Update in memory status
#
set selected_commit_type new
commit_tree
}
+proc do_credits {} {
+ global gitgui_credits
+
+ set w .credits_dialog
+
+ toplevel $w
+ wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
+
+ label $w.header -text {git-gui Contributors} -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
+
+ frame $w.credits
+ text $w.credits.t \
+ -background [$w.header cget -background] \
+ -yscrollcommand [list $w.credits.sby set] \
+ -width 20 \
+ -height 10 \
+ -wrap none \
+ -borderwidth 1 \
+ -relief solid \
+ -padx 5 -pady 5 \
+ -font font_ui
+ scrollbar $w.credits.sby -command [list $w.credits.t yview]
+ pack $w.credits.sby -side right -fill y
+ pack $w.credits.t -fill both -expand 1
+ pack $w.credits -side top -fill both -expand 1 -padx 5 -pady 5
+
+ label $w.desc \
+ -text "All portions are copyrighted by their respective authors
+and are distributed under the GNU General Public License." \
+ -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
+
+ $w.credits.t insert end "[string trim $gitgui_credits]\n"
+ $w.credits.t conf -state disabled
+ $w.credits.t see 1.0
+
+ bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Key-Escape> [list destroy $w]
+ wm title $w [$w.header cget -text]
+ tkwait window $w
+}
+
proc do_about {} {
global appvers copyright
global tcl_patchLevel tk_patchLevel
button $w.buttons.close -text {Close} \
-font font_ui \
-command [list destroy $w]
+ button $w.buttons.credits -text {Contributors} \
+ -font font_ui \
+ -command do_credits
+ pack $w.buttons.credits -side left
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
label $w.desc \
- -text "git-gui - a commit creation tool for Git.
+ -text "git-gui - a graphical user interface for Git.
$copyright" \
-padx 5 -pady 5 \
-justify left \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
}
+# -- Merge Menu
+#
+if {[is_enabled branch]} {
+ menu .mbar.merge
+ .mbar.merge add command -label {Local Merge...} \
+ -command do_local_merge \
+ -font font_ui
+ lappend disable_on_lock \
+ [list .mbar.merge entryconf [.mbar.merge index last] -state]
+ .mbar.merge add command -label {Abort Merge...} \
+ -command do_reset_hard \
+ -font font_ui
+ lappend disable_on_lock \
+ [list .mbar.merge entryconf [.mbar.merge index last] -state]
+
+}
+
+# -- Transport Menu
+#
+if {[is_enabled transport]} {
+ menu .mbar.fetch
+
+ menu .mbar.push
+ .mbar.push add command -label {Push...} \
+ -command do_push_anywhere \
+ -font font_ui
+}
+
if {[is_MacOSX]} {
# -- Apple Menu (Mac OS X only)
#
set doc_path [file join $doc_path Documentation index.html]
if {[is_Cygwin]} {
- set doc_path [exec cygpath --windows $doc_path]
+ set doc_path [exec cygpath --mixed $doc_path]
}
if {$browser eq {}} {
# fall through to setup UI for commits
}
default {
- puts stderr "usage: $argv0 \[{blame|citool}\]"
+ puts stderr "usage: $argv0 \[{blame|browser|citool}\]"
exit 1
}
}
pack .branch.cb -side left -fill x
pack .branch -side top -fill x
-if {[is_enabled branch]} {
- menu .mbar.merge
- .mbar.merge add command -label {Local Merge...} \
- -command do_local_merge \
- -font font_ui
- lappend disable_on_lock \
- [list .mbar.merge entryconf [.mbar.merge index last] -state]
- .mbar.merge add command -label {Abort Merge...} \
- -command do_reset_hard \
- -font font_ui
- lappend disable_on_lock \
- [list .mbar.merge entryconf [.mbar.merge index last] -state]
-
-
- menu .mbar.fetch
-
- menu .mbar.push
- .mbar.push add command -label {Push...} \
- -command do_push_anywhere \
- -font font_ui
-}
-
# -- Main Window Layout
#
panedwindow .vpane -orient vertical
# -- Diff Header
#
-set current_diff_path {}
-set current_diff_side {}
-set diff_actions [list]
proc trace_current_diff_path {varname args} {
global current_diff_path diff_actions file_states
if {$current_diff_path eq {}} {
# -- Status Bar
#
-set ui_status_value {Initializing...}
label .status -textvariable ui_status_value \
-anchor w \
-justify left \
set file_lists($ui_index) [list]
set file_lists($ui_workdir) [list]
-set HEAD {}
-set PARENT {}
-set MERGE_HEAD [list]
-set commit_type {}
-set empty_tree {}
-set current_branch {}
-set current_diff_path {}
-set selected_commit_type new
-
wm title . "[appname] ([file normalize [file dirname [gitdir]]])"
focus -force $ui_comm