In this commit:

- Added: self.application.set_normal_cursor() to "Web bible" and "no search results" for combined.

 To do:
- Write tests

Optional fixes that are not yet done/may not be done.
- Ignore '.' in Reference search for smoother searching experience + Remove mention about it in error and add ending to uistrings.py
- Block spaces + single character combos since they kind of break the search.
- Listing search results when typing for Text search
This commit is contained in:
suutari-olli 2016-03-08 03:34:42 +02:00
parent 07c519084a
commit 432177fd2d
3 changed files with 11 additions and 8 deletions

View File

@ -161,12 +161,9 @@ class UiStrings(object):
'(list)sChapter%(verse)sVerse%(range)sVerse | John 3%(verse)'
's16%(range)s17%(list)s5%(verse)s7%(range)s9<br>Book Chapter%'
'(verse)sVerse%(range)sChapter%(verse)sVerse | John 3%(verse)'
's16%(range)s4%(verse)s2<br><br> Book names may be shortened '
'from full names<br>but must not contain any '
'additional dots.', 'Please pay attention to the appended'
'"s" of the wildcards and refrain from '
'translating the words inside the names'
' in the brackets.')
's16%(range)s4%(verse)s2<br><br>',
'Please pay attention to the appended "s" of the wildcards and refrain '
'from translating the words inside the names in the brackets.')
self.BibleShortSearch = translate('OpenLP.Ui', 'The keyword you have entered is empty or shorter '
'than 3 characters long.\nPlease try again with '
'a longer keyword.\n\nYou can separate different keywords by '

View File

@ -281,7 +281,9 @@ class BibleManager(RegistryProperties):
translate('BiblesPlugin.BibleManager', 'Scripture Reference Error'),
translate('BiblesPlugin.BibleManager', '<strong>OpenLP couldnt find anything '
'with your search.</strong><br><br>'
'Please make sure that your reference follows one of these patterns:%s'
'Please make sure that your reference follows one of these patterns:%sBook names may be '
'shortened from full names<br>but must not contain any '
'additional dots.'
% UiStrings().BibleScriptureError % reference_separators))
return None
@ -328,6 +330,7 @@ class BibleManager(RegistryProperties):
if second_bible:
second_web_bible = self.db_cache[second_bible].get_object(BibleMeta, 'download_source')
if web_bible or second_web_bible:
self.application.set_normal_cursor()
self.main_window.information_message(
translate('BiblesPlugin.BibleManager', 'Web Bible cannot be used'),
translate('BiblesPlugin.BibleManager', 'Text Search is not available with Web Bibles.\n'

View File

@ -750,6 +750,7 @@ class BibleMediaItem(MediaManagerItem):
self.second_search_results = bibles[second_bible].get_verses(text)
# If no Text or Reference is found, message is given.
if not self.search_results:
self.application.set_normal_cursor()
reference_separators = {
'verse': get_reference_separator('sep_v_display'),
'range': get_reference_separator('sep_r_display'),
@ -759,7 +760,9 @@ class BibleMediaItem(MediaManagerItem):
translate('BiblesPlugin.BibleManager', '<strong>OpenLP couldnt find '
'anything with your search.</strong><br><br>'
'If you tried to search with Scripture Reference, please make sure that '
'your reference follows one of these patterns:%s'
'your reference follows one of these patterns:%sBook names may be shortened '
'from full names<br>but must not contain any '
'additional dots.'
% UiStrings().BibleScriptureError % reference_separators))
# Finalizing the search
if not self.quickLockButton.isChecked():