- It works!

- Added text prediction for book names
- New script for reference_combined
- Also on previous: Added mininium search lengt of 3 characters for text to prevent short keywords from crashing OLP.
- Added new icon to code but still using reference icon since it requires packing in order to work.

To DO:
a) New icon, pack it | How?
b) Added stupid error message if nothing is found, make it less stupid.
c) Add example verses to "Reference not found" error. ( and Use this as base for b) 

d) Possibly work on text prediction for Text based search but probably leave it for an another branch.
This commit is contained in:
suutari-olli 2016-03-06 23:45:51 +02:00
parent b1223927a0
commit 0ac56e5a19
2 changed files with 13 additions and 6 deletions

View File

@ -369,8 +369,8 @@ class BibleManager(RegistryProperties):
if show_error:
self.main_window.information_message(
translate('BiblesPlugin.BibleManager', 'No Bibles Available'),
translate('BiblesPlugin.BibleManager', 'There are no Bibles currently installed. Please use the '
'Import Wizard to install one or more Bibles.')
translate('BiblesPlugin.BibleManager', 'There are no Bibles currently installed. Please use the'
' Import Wizard to install one or more Bibles.')
)
return None
language_selection = self.get_language_selection(bible)

View File

@ -435,8 +435,8 @@ class BibleMediaItem(MediaManagerItem):
# Save the current bible to the configuration.
Settings().setValue(self.settings_section + '/quick bible', self.quickVersionComboBox.currentText())
books = []
# We have to do a 'Reference Search'.
if self.quick_search_edit.current_search_type() == BibleSearch.Reference:
# We have to do a 'Reference Search' (Or as part of Combined Search).
if self.quick_search_edit.current_search_type() == BibleSearch.Reference or BibleSearch.Combined:
bibles = self.plugin.manager.get_bibles()
bible = self.quickVersionComboBox.currentText()
if bible:
@ -670,7 +670,7 @@ class BibleMediaItem(MediaManagerItem):
self.second_search_results = \
self.plugin.manager.get_verses(second_bible, text, self.search_results[0].book.book_reference_id)
elif self.quick_search_edit.current_search_type() == BibleSearch.Text:
# We are doing a 'Text Search'.
# We are doing a 'Text Search'.
self.application.set_busy_cursor()
bibles = self.plugin.manager.get_bibles()
self.search_results = self.plugin.manager.verse_search(bible, second_bible, text)
@ -700,7 +700,7 @@ class BibleMediaItem(MediaManagerItem):
self.search_results = new_search_results
self.second_search_results = bibles[second_bible].get_verses(text)
elif self.quick_search_edit.current_search_type() == BibleSearch.Combined:
# Combined search, starting with reference search
# Combined search, starting with reference search (combined)
self.search_results = self.plugin.manager.get_verses_combined(bible, text)
if second_bible and self.search_results:
self.second_search_results = \
@ -735,6 +735,13 @@ class BibleMediaItem(MediaManagerItem):
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.search_results = new_search_results
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.main_window.information_message(
translate('BiblesPlugin.BibleManager', 'Scripture Reference Errorhhh'),
translate('BiblesPlugin.BibleManager', 'You did not enter a search '
'different keywords by a space to search for all of your '
'them by a comma to search for one of them.'))
# Finalizing the search
if not self.quickLockButton.isChecked():
self.list_view.clear()