From 432177fd2d10dac2772f82a4b1ec59a0fba9c8d8 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 8 Mar 2016 03:34:42 +0200 Subject: [PATCH] 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 --- openlp/core/common/uistrings.py | 9 +++------ openlp/plugins/bibles/lib/manager.py | 5 ++++- openlp/plugins/bibles/lib/mediaitem.py | 5 ++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 2766b3117..8e98fd009 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -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
Book Chapter%' '(verse)sVerse%(range)sChapter%(verse)sVerse | John 3%(verse)' - 's16%(range)s4%(verse)s2

Book names may be shortened ' - 'from full names
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

', + '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 ' diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index c726c6032..b74bc6fab 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -281,7 +281,9 @@ class BibleManager(RegistryProperties): translate('BiblesPlugin.BibleManager', 'Scripture Reference Error'), translate('BiblesPlugin.BibleManager', 'OpenLP couldn’t find anything ' 'with your search.

' - '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
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' diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 5895bb1d5..d5fea2968 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -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', 'OpenLP couldn’t find ' 'anything with your search.

' '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
but must not contain any ' + 'additional dots.' % UiStrings().BibleScriptureError % reference_separators)) # Finalizing the search if not self.quickLockButton.isChecked():