]> asedeno.scripts.mit.edu Git - git.git/blobdiff - lib/console.tcl
Merge branch 'maint'
[git.git] / lib / console.tcl
index 27a880e408fbdcf1f9caf66adf92f42403538341..e5f9ba429b0f0ba15d922aa26624493502d1da27 100644 (file)
@@ -47,26 +47,30 @@ method _init {} {
                -background white -borderwidth 1 \
                -relief sunken \
                -width 80 -height 10 \
+               -wrap none \
                -font font_diff \
                -state disabled \
+               -xscrollcommand [list $w.m.sbx set] \
                -yscrollcommand [list $w.m.sby set]
-       label $w.m.s -text {Working... please wait...} \
+       label $w.m.s -text [mc "Working... please wait..."] \
                -anchor w \
                -justify left \
                -font font_uibold
+       scrollbar $w.m.sbx -command [list $w.m.t xview] -orient h
        scrollbar $w.m.sby -command [list $w.m.t yview]
        pack $w.m.l1 -side top -fill x
        pack $w.m.s -side bottom -fill x
+       pack $w.m.sbx -side bottom -fill x
        pack $w.m.sby -side right -fill y
        pack $w.m.t -side left -fill both -expand 1
        pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
 
        menu $w.ctxm -tearoff 0
-       $w.ctxm add command -label "Copy" \
+       $w.ctxm add command -label [mc "Copy"] \
                -command "tk_textCopy $w.m.t"
-       $w.ctxm add command -label "Select All" \
+       $w.ctxm add command -label [mc "Select All"] \
                -command "focus $w.m.t;$w.m.t tag add sel 0.0 end"
-       $w.ctxm add command -label "Copy All" \
+       $w.ctxm add command -label [mc "Copy All"] \
                -command "
                        $w.m.t tag add sel 0.0 end
                        tk_textCopy $w.m.t
@@ -74,7 +78,7 @@ method _init {} {
                "
 
        if {$is_toplevel} {
-               button $w.ok -text {Close} \
+               button $w.ok -text [mc "Close"] \
                        -state disabled \
                        -command [list destroy $w]
                pack $w.ok -side bottom -anchor e -pady 10 -padx 10
@@ -87,19 +91,12 @@ method _init {} {
 }
 
 method exec {cmd {after {}}} {
-       # -- Cygwin's Tcl tosses the enviroment when we exec our child.
-       #    But most users need that so we have to relogin. :-(
-       #
-       if {[is_Cygwin]} {
-               set cmd [list sh --login -c "cd \"[pwd]\" && [join $cmd { }]"]
+       if {[lindex $cmd 0] eq {git}} {
+               set fd_f [eval git_read --stderr [lrange $cmd 1 end]]
+       } else {
+               lappend cmd 2>@1
+               set fd_f [_open_stdout_stderr $cmd]
        }
-
-       # -- Tcl won't let us redirect both stdout and stderr to
-       #    the same pipe.  So pass it through cat...
-       #
-       set cmd [concat | $cmd |& cat]
-
-       set fd_f [open $cmd r]
        fconfigure $fd_f -blocking 0 -translation binary
        fileevent $fd_f readable [cb _read $fd_f $after]
 }
@@ -184,7 +181,7 @@ method insert {txt} {
 method done {ok} {
        if {$ok} {
                if {[winfo exists $w.m.s]} {
-                       $w.m.s conf -background green -text {Success}
+                       $w.m.s conf -background green -text [mc "Success"]
                        if {$is_toplevel} {
                                $w.ok conf -state normal
                                focus $w.ok
@@ -194,7 +191,7 @@ method done {ok} {
                if {![winfo exists $w.m.s]} {
                        _init $this
                }
-               $w.m.s conf -background red -text {Error: Command Failed}
+               $w.m.s conf -background red -text [mc "Error: Command Failed"]
                if {$is_toplevel} {
                        $w.ok conf -state normal
                        focus $w.ok