Code

Merge git://repo.or.cz/git-gui
authorJunio C Hamano <gitster@pobox.com>
Thu, 13 Nov 2008 05:12:41 +0000 (21:12 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Nov 2008 05:12:41 +0000 (21:12 -0800)
* git://repo.or.cz/git-gui:
  git-gui: Request blame metadata in utf-8.
  git-gui: Add the Show SSH Key item to the clone dialog.
  git-gui: Fix focus transition in the blame viewer.

git-gui/git-gui.sh
git-gui/lib/blame.tcl
git-gui/lib/choose_repository.tcl
git-gui/lib/search.tcl

index 12b496bec9233a86da18a45073d964bd559f059c..cf9ef6ee07244b28ab7725aec8fb595ee613644a 100755 (executable)
@@ -997,6 +997,17 @@ citool {
 }
 }
 
+######################################################################
+##
+## execution environment
+
+set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
+
+# Suggest our implementation of askpass, if none is set
+if {![info exists env(SSH_ASKPASS)]} {
+       set env(SSH_ASKPASS) [gitexec git-gui--askpass]
+}
+
 ######################################################################
 ##
 ## repository setup
@@ -1073,15 +1084,6 @@ set selected_commit_type new
 set nullid "0000000000000000000000000000000000000000"
 set nullid2 "0000000000000000000000000000000000000001"
 
-set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
-
-######################################################################
-
-# Suggest our implementation of askpass, if none is set
-if {![info exists env(SSH_ASKPASS)]} {
-       set env(SSH_ASKPASS) [gitexec git-gui--askpass]
-}
-
 ######################################################################
 ##
 ## task management
index 765d08c004b68254713e2524b53d6df0bdc0c007..c1cd7f3b92fddb60be9fe261d7b75c5df85b60c1 100644 (file)
@@ -321,7 +321,7 @@ constructor new {i_commit i_path i_jump} {
                        tk_popup $w.ctxm %X %Y
                "
                bind $i <Shift-Tab> "[list focus $w_cviewer];break"
-               bind $i <Tab>       "[list focus $w_cviewer];break"
+               bind $i <Tab>       "[cb _focus_search $w_cviewer];break"
        }
 
        foreach i [concat $w_columns $w_cviewer] {
@@ -337,10 +337,10 @@ constructor new {i_commit i_path i_jump} {
                bind $i <Control-Key-f> {catch {%W yview scroll  1 pages};break}
        }
 
-       bind $w_cviewer <Shift-Tab> "[list focus $w_file];break"
+       bind $w_cviewer <Shift-Tab> "[cb _focus_search $w_file];break"
        bind $w_cviewer <Tab>       "[list focus $w_file];break"
-       bind $w_cviewer <Button-1> [list focus $w_cviewer]
-       bind $w_file    <Visibility> [list focus $w_file]
+       bind $w_cviewer <Button-1>   [list focus $w_cviewer]
+       bind $w_file    <Visibility> [cb _focus_search $w_file]
        bind $top       <F7>         [list searchbar::show $finder]
        bind $top       <Escape>     [list searchbar::hide $finder]
        bind $top       <F3>         [list searchbar::find_next $finder]
@@ -382,6 +382,14 @@ constructor new {i_commit i_path i_jump} {
        _load $this $i_jump
 }
 
+method _focus_search {win} {
+       if {[searchbar::visible $finder]} {
+               focus [searchbar::editor $finder]
+       } else {
+               focus $win
+       }
+}
+
 method _handle_destroy {win} {
        if {$win eq $w} {
                _kill $this
@@ -551,7 +559,7 @@ method _read_file {fd jump} {
 } ifdeleted { catch {close $fd} }
 
 method _exec_blame {cur_w cur_d options cur_s} {
-       lappend options --incremental
+       lappend options --incremental --encoding=utf-8
        if {$commit eq {}} {
                lappend options --contents $path
        } else {
index 909131689ea837cb67bd587a6acc8b5eb3127c4e..f9ff62a3b22fcc481c88dc35268d06d2fc4a5795 100644 (file)
@@ -43,12 +43,18 @@ constructor pick {} {
                        $w.mbar.apple add command \
                                -label [mc "About %s" [appname]] \
                                -command do_about
+                       $w.mbar.apple add command \
+                               -label [mc "Show SSH Key"] \
+                               -command do_ssh_key
                } else {
                        $w.mbar add cascade -label [mc Help] -menu $w.mbar.help
                        menu $w.mbar.help
                        $w.mbar.help add command \
                                -label [mc "About %s" [appname]] \
                                -command do_about
+                       $w.mbar.help add command \
+                               -label [mc "Show SSH Key"] \
+                               -command do_ssh_key
                }
 
                wm protocol $top WM_DELETE_WINDOW exit
index d292f20f66a6319c34c3b38e28ebc120e7dd8400..32c8656fc9b15498073a09e516777f71827dc3b1 100644 (file)
@@ -19,11 +19,11 @@ constructor new {i_w i_text args} {
 
        frame  $w
        label  $w.l       -text [mc Find:]
+       entry  $w.ent -textvariable ${__this}::searchstring -background lightgreen
        button $w.bn      -text [mc Next] -command [cb find_next]
        button $w.bp      -text [mc Prev] -command [cb find_prev]
        checkbutton $w.cs -text [mc Case-Sensitive] \
                -variable ${__this}::casesensitive -command [cb _incrsearch]
-       entry  $w.ent -textvariable ${__this}::searchstring -background lightgreen
        pack   $w.l   -side left
        pack   $w.cs  -side right
        pack   $w.bp  -side right
@@ -40,19 +40,27 @@ constructor new {i_w i_text args} {
 }
 
 method show {} {
-       if {![winfo ismapped $w]} {
+       if {![visible $this]} {
                grid $w
        }
        focus -force $w.ent
 }
 
 method hide {} {
-       if {[winfo ismapped $w]} {
+       if {[visible $this]} {
                focus $ctext
                grid remove $w
        }
 }
 
+method visible {} {
+       return [winfo ismapped $w]
+}
+
+method editor {} {
+       return $w.ent
+}
+
 method _get_new_anchor {} {
        # use start of selection if it is visible,
        # or the bounds of the visible area