summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-23 05:11:08 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-23 05:11:08 (GMT)
commita8139888f8d250c6d173ddbe892e98fc49763702 (patch)
tree017a047beb7c70be8712b8cfe456e00f7cee0e2b /git-gui.sh
parent83751fc109e951a5cbde9ee39970f6b1d2da07c7 (diff)
downloadgit-a8139888f8d250c6d173ddbe892e98fc49763702.zip
git-a8139888f8d250c6d173ddbe892e98fc49763702.tar.gz
git-a8139888f8d250c6d173ddbe892e98fc49763702.tar.bz2
git-gui: Refactor current branch menu items to make i18n easier
The i18n team has also identified a rather ugly block of code in git-gui that is used to make a pair of Repository menu items show the current branch name. This code is difficult to convert to use [mc ...] to lookup the translation, so I'm refactoring it into a procedure. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 2912872..a38293a 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1682,7 +1682,7 @@ menu .mbar.repository
.mbar.repository add command \
-label {Browse Current Branch's Files} \
-command {browser::new $current_branch}
-trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Browse \$current_branch's Files\" ;#"
+set ui_browse_current [.mbar.repository index last]
.mbar.repository add command \
-label {Browse Branch Files...} \
-command browser_open::dialog
@@ -1691,12 +1691,21 @@ trace add variable current_branch write ".mbar.repository entryconf [.mbar.repos
.mbar.repository add command \
-label {Visualize Current Branch's History} \
-command {do_gitk $current_branch}
-trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Visualize \$current_branch's History\" ;#"
+set ui_visualize_current [.mbar.repository index last]
.mbar.repository add command \
-label {Visualize All Branch History} \
-command {do_gitk --all}
.mbar.repository add separator
+proc current_branch_write {args} {
+ global current_branch
+ .mbar.repository entryconf $::ui_browse_current \
+ -label "Browse $current_branch's Files"
+ .mbar.repository entryconf $::ui_visualize_current \
+ -label "Visualize $current_branch's History"
+}
+trace add variable current_branch write current_branch_write
+
if {[is_enabled multicommit]} {
.mbar.repository add command -label {Database Statistics} \
-command do_stats