X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-gui.sh;h=1fca11f278a89bb4d224738ed6dfca9822775a32;hb=208320de8044acea5f637dd64475c3756d899094;hp=9bc5626286b7e9233f7a643253c6edfa99755ba8;hpb=d6db1ad51a5ac8154fcc2413f1eb6142c1a0639a;p=git.git diff --git a/git-gui.sh b/git-gui.sh index 9bc562628..1fca11f27 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -88,13 +88,20 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} { package require msgcat -proc mc {fmt args} { - set fmt [::msgcat::mc $fmt] +proc _mc_trim {fmt} { set cmk [string first @@ $fmt] if {$cmk > 0} { - set fmt [string range $fmt 0 [expr {$cmk - 1}]] + return [string range $fmt 0 [expr {$cmk - 1}]] } - return [eval [list format $fmt] $args] + return $fmt +} + +proc mc {en_fmt args} { + set fmt [_mc_trim [::msgcat::mc $en_fmt]] + if {[catch {set msg [eval [list format $fmt] $args]} err]} { + set msg [eval [list format [_mc_trim $en_fmt]] $args] + } + return $msg } proc strcat {args} { @@ -544,8 +551,15 @@ proc apply_config {} { set name [lindex $option 0] set font [lindex $option 1] if {[catch { + set need_weight 1 foreach {cn cv} $repo_config(gui.$name) { - font configure $font $cn $cv -weight normal + if {$cn eq {-weight}} { + set need_weight 0 + } + font configure $font $cn $cv + } + if {$need_weight} { + font configure $font -weight normal } } err]} { error_popup [strcat [mc "Invalid font specified in %s:" "gui.$name"] "\n\n$err"] @@ -755,7 +769,10 @@ git-version proc _parse_config {arr_name args} { array unset arr set buf {} catch { - set fd_rc [eval [list git_read config --null --list] $args] + set fd_rc [eval \ + [list git_read config] \ + $args \ + [list --null --list]] fconfigure $fd_rc -translation binary set buf [read $fd_rc] close $fd_rc @@ -1969,7 +1986,8 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} { [list .mbar.commit entryconf [.mbar.commit index last] -state] .mbar.commit add command -label [mc "Stage To Commit"] \ - -command do_add_selection + -command do_add_selection \ + -accelerator $M1T-T lappend disable_on_lock \ [list .mbar.commit entryconf [.mbar.commit index last] -state] @@ -2621,6 +2639,8 @@ unset gm # -- Key Bindings # bind $ui_comm <$M1B-Key-Return> {do_commit;break} +bind $ui_comm <$M1B-Key-t> {do_add_selection;break} +bind $ui_comm <$M1B-Key-T> {do_add_selection;break} bind $ui_comm <$M1B-Key-i> {do_add_all;break} bind $ui_comm <$M1B-Key-I> {do_add_all;break} bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break} @@ -2670,6 +2690,8 @@ bind . <$M1B-Key-r> do_rescan bind . <$M1B-Key-R> do_rescan bind . <$M1B-Key-s> do_signoff bind . <$M1B-Key-S> do_signoff +bind . <$M1B-Key-t> do_add_selection +bind . <$M1B-Key-T> do_add_selection bind . <$M1B-Key-i> do_add_all bind . <$M1B-Key-I> do_add_all bind . <$M1B-Key-Return> do_commit