summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-23 04:36:39 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-23 04:36:39 (GMT)
commit83751fc109e951a5cbde9ee39970f6b1d2da07c7 (patch)
treec8e0bc9c593c9576a3f5dde822ee74ce73d5bc1a
parent9c5a3c7797449e1b3e6455327394677c21f0f908 (diff)
downloadgit-83751fc109e951a5cbde9ee39970f6b1d2da07c7.zip
git-83751fc109e951a5cbde9ee39970f6b1d2da07c7.tar.gz
git-83751fc109e951a5cbde9ee39970f6b1d2da07c7.tar.bz2
git-gui: Refactor diff popup into a procedure to ease i18n work
The folks working on the i18n version of git-gui have had some trouble trying to convert these English strings into [mc] calls due to the double evaluation. Moving this block into a standard procedure eliminates the double evaluation, making their work easier. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-xgit-gui.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 67aed3a..2912872 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2418,17 +2418,19 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command -label {Options...} \
-command do_options
-bind_button3 $ui_diff "
- set cursorX %x
- set cursorY %y
- if {\$ui_index eq \$current_diff_side} {
- $ctxm entryconf $ui_diff_applyhunk -label {Unstage Hunk From Commit}
+proc popup_diff_menu {ctxm x y X Y} {
+ set ::cursorX $x
+ set ::cursorY $y
+ if {$::ui_index eq $::current_diff_side} {
+ $ctxm entryconf $::ui_diff_applyhunk \
+ -label {Unstage Hunk From Commit}
} else {
- $ctxm entryconf $ui_diff_applyhunk -label {Stage Hunk For Commit}
+ $ctxm entryconf $::ui_diff_applyhunk \
+ -label {Stage Hunk For Commit}
}
- tk_popup $ctxm %X %Y
-"
-unset ui_diff_applyhunk
+ tk_popup $ctxm $X $Y
+}
+bind_button3 $ui_diff [list popup_diff_menu $ctxm %x %y %X %Y]
# -- Status Bar
#