Skip to content

Commit

Permalink
Fixed a bug where searching in the main Bible window would put focus …
Browse files Browse the repository at this point in the history
…on the

list of search results.
As a result, when "n" was typed it would jump to the first result in Numbers.

M    search/searchpanel.py


git-svn-id: https://bpbible.googlecode.com/svn/trunk@1319 20523bf7-2b47-0410-960a-a116b6c96ec9
  • Loading branch information
jonmmorgan committed Jun 4, 2011
1 parent 818863e commit 9bba540
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion search/searchpanel.py
Expand Up @@ -174,6 +174,7 @@ def __init__(self, parent):
self.stop = False
self.regexes = []
self.fields = []
self.do_not_grab_focus = False

# if search panel is on screen at startup, on_show and set_version will
# both be called. Then if there is no index, it will prompt twice.
Expand Down Expand Up @@ -201,7 +202,10 @@ def on_create(self, event=None):
def on_list(self, event):
item_text = self.verselist.results[event.m_itemIndex]
self.versepreview.SetReference(item_text)
self.verselist.SetFocus()
if self.do_not_grab_focus:
self.do_not_grab_focus = False
else:
self.verselist.SetFocus()
self.versepreview.ForceKillFocus()

def search_and_show(self, key="", version=None):
Expand Down Expand Up @@ -395,6 +399,7 @@ def next_search_result(self, offset):
elif index == item_count:
index = 0

self.do_not_grab_focus = True
self.verselist.SetSelection(index)
self.verselist.EnsureVisible(index)
self.go_to_reference(index)
Expand Down

0 comments on commit 9bba540

Please sign in to comment.