aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Thoyts <patthoyts@users.sourceforge.net>2010-03-08 12:43:27 +0000
committerPat Thoyts <patthoyts@users.sourceforge.net>2010-07-30 10:05:27 +0100
commit85123549f005ebdfb55a5cbd738c3237aaed6eff (patch)
treeda2495493d4444d58fdbf0188e4d2013ad08bdee
parentfc17e5e5bdb5b4a36c10c2948b8b8db8a12a4b35 (diff)
downloadgit-85123549f005ebdfb55a5cbd738c3237aaed6eff.tar.gz
git-85123549f005ebdfb55a5cbd738c3237aaed6eff.tar.xz
git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32
On Windows the Control-C binding is used to copy and is mapped to the Tk virtual event <<Copy>>. In the initial git-gui dialog this is also bound as an accelerator for the Clone menu item. The effect is that both bindings run, copying the text but resetting the clone page or switching to the clone page when the user tries to copy text from one of the entry fields. This patch avoids this by using Control-L instead for Windows only. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rw-r--r--lib/choose_repository.tcl11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl
index 64f06748b..fae119286 100644
--- a/lib/choose_repository.tcl
+++ b/lib/choose_repository.tcl
@@ -100,12 +100,17 @@ constructor pick {} {
$opts insert end [mc "Clone Existing Repository"] link_clone
$opts insert end "\n"
if {$m_repo ne {}} {
+ if {[tk windowingsystem] eq "win32"} {
+ set key L
+ } else {
+ set key C
+ }
$m_repo add command \
-command [cb _next clone] \
- -accelerator $M1T-C \
+ -accelerator $M1T-$key \
-label [mc "Clone..."]
- bind $top <$M1B-c> [cb _next clone]
- bind $top <$M1B-C> [cb _next clone]
+ bind $top <$M1B-[string tolower $key]> [cb _next clone]
+ bind $top <$M1B-[string toupper $key]> [cb _next clone]
}
$opts tag conf link_open -foreground blue -underline 1