git-gui: search and linenumber input are mutual exclusive in the blame view

It was possible to open the search input (Ctrl+S) and the goto-line input (Ctrl+G) at the same time. Prevent this. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Bert Wesarg committed Oct 13, 2011 at 15:48 UTC e0e0a6c64c5e7fffddc7ab8ef5d17626cf689e47
1 file changed +16 -6
lib/blame.tcl
+16 -6
@@ -280,11 +280,11 @@ constructor new {i_commit i_path i_jump} {
280 $w.ctxm add command \
281 -label [mc "Find Text..."] \
282 -accelerator F7 \
283 - -command [list searchbar::show $finder]
283 + -command [cb _show_finder]
284 $w.ctxm add command \
285 -label [mc "Goto Line..."] \
286 -accelerator "Ctrl-G" \
287 - -command [list linebar::show $gotoline]
287 + -command [cb _show_linebar]
288 menu $w.ctxm.enc
289 build_encoding_menu $w.ctxm.enc [cb _setencoding]
290 $w.ctxm add cascade \
@@ -351,13 +351,13 @@ constructor new {i_commit i_path i_jump} {
351 bind $w_cviewer <Tab> "[list focus $w_file];break"
352 bind $w_cviewer <Button-1> [list focus $w_cviewer]
353 bind $w_file <Visibility> [cb _focus_search $w_file]
354 - bind $top <F7> [list searchbar::show $finder]
355 - bind $top <Key-slash> [list searchbar::show $finder]
356 - bind $top <Control-Key-s> [list searchbar::show $finder]
354 + bind $top <F7> [cb _show_finder]
355 + bind $top <Key-slash> [cb _show_finder]
356 + bind $top <Control-Key-s> [cb _show_finder]
357 bind $top <Escape> [list searchbar::hide $finder]
358 bind $top <F3> [list searchbar::find_next $finder]
359 bind $top <Shift-F3> [list searchbar::find_prev $finder]
360 - bind $top <Control-Key-g> [list linebar::show $gotoline]
360 + bind $top <Control-Key-g> [cb _show_linebar]
361 catch { bind $top <Shift-Key-XF86_Switch_VT_3> [list searchbar::find_prev $finder] }
362
363 grid configure $w.header -sticky ew
@@ -1349,4 +1349,14 @@ method _resize {new_height} {
1349 set old_height $new_height
1350 }
1351
1352 +method _show_finder {} {
1353 + linebar::hide $gotoline
1354 + searchbar::show $finder
1355 +}
1356 +
1357 +method _show_linebar {} {
1358 + searchbar::hide $finder
1359 + linebar::show $gotoline
1360 +}
1361 +
1362 }