forked from openlp/openlp
Added "Search Settings" > "Don't show error fofr no results in combined quick search" checkbox
for controlling whetever no results message is shown or not.
This commit is contained in:
parent
34231003ce
commit
eca11970f8
@ -59,7 +59,8 @@ __default_settings__ = {
|
||||
'bibles/range separator': '',
|
||||
'bibles/list separator': '',
|
||||
'bibles/end separator': '',
|
||||
'bibles/last directory import': ''
|
||||
'bibles/last directory import': '',
|
||||
'bibles/hide combined quick error': False
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,6 +128,22 @@ class BiblesTab(SettingsTab):
|
||||
self.language_selection_layout.addWidget(self.language_selection_label)
|
||||
self.language_selection_layout.addWidget(self.language_selection_combo_box)
|
||||
self.right_layout.addWidget(self.language_selection_group_box)
|
||||
# a
|
||||
self.bible_search_settings_group_box = QtWidgets.QGroupBox(self.right_column)
|
||||
self.bible_search_settings_group_box.setObjectName('bible_search_settings_group_box')
|
||||
self.right_layout.addWidget(self.bible_search_settings_group_box)
|
||||
|
||||
self.hide_combined_quick_error_check_box = QtWidgets.QCheckBox(self.bible_search_settings_group_box)
|
||||
self.hide_combined_quick_error_check_box.setObjectName('hide_combined_quick_error_check_box')
|
||||
self.right_layout.addWidget(self.hide_combined_quick_error_check_box)
|
||||
|
||||
|
||||
#self.is_verse_number_visible_check_box = QtWidgets.QCheckBox(self.verse_display_group_box)
|
||||
#self.is_verse_number_visible_check_box.setObjectName('is_verse_number_visible_check_box')
|
||||
#self.verse_display_layout.addRow(self.is_verse_number_visible_check_box)
|
||||
|
||||
|
||||
# b
|
||||
self.left_layout.addStretch()
|
||||
self.right_layout.addStretch()
|
||||
# Signals and slots
|
||||
@ -151,6 +167,8 @@ class BiblesTab(SettingsTab):
|
||||
self.end_separator_line_edit.editingFinished.connect(self.on_end_separator_line_edit_finished)
|
||||
Registry().register_function('theme_update_list', self.update_theme_list)
|
||||
self.language_selection_combo_box.activated.connect(self.on_language_selection_combo_box_changed)
|
||||
self.hide_combined_quick_error_check_box.stateChanged.connect\
|
||||
(self.on_hide_combined_quick_error_check_box_changed)
|
||||
|
||||
def retranslateUi(self):
|
||||
self.verse_display_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display'))
|
||||
@ -194,7 +212,10 @@ class BiblesTab(SettingsTab):
|
||||
LanguageSelection.Application, translate('BiblesPlugin.BiblesTab', 'Application Language'))
|
||||
self.language_selection_combo_box.setItemText(
|
||||
LanguageSelection.English, translate('BiblesPlugin.BiblesTab', 'English'))
|
||||
|
||||
self.bible_search_settings_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Search Settings'))
|
||||
self.hide_combined_quick_error_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Don\'t show error '
|
||||
'for no results in '
|
||||
'combined quick search'))
|
||||
def on_bible_theme_combo_box_changed(self):
|
||||
self.bible_theme = self.bible_theme_combo_box.currentText()
|
||||
|
||||
@ -302,6 +323,13 @@ class BiblesTab(SettingsTab):
|
||||
self.end_separator_line_edit.setText(get_reference_separator('sep_e_default'))
|
||||
self.end_separator_line_edit.setPalette(self.get_grey_text_palette(True))
|
||||
|
||||
def on_hide_combined_quick_error_check_box_changed(self, check_state):
|
||||
"""
|
||||
Event handler for the 'hide_combined_quick_error' check box
|
||||
"""
|
||||
self.hide_combined_quick_error = (check_state == QtCore.Qt.Checked)
|
||||
#self.check_hide_combined_quick_error()
|
||||
|
||||
def load(self):
|
||||
settings = Settings()
|
||||
settings.beginGroup(self.settings_section)
|
||||
@ -355,6 +383,9 @@ class BiblesTab(SettingsTab):
|
||||
self.end_separator_check_box.setChecked(True)
|
||||
self.language_selection = settings.value('book name language')
|
||||
self.language_selection_combo_box.setCurrentIndex(self.language_selection)
|
||||
self.hide_combined_quick_error = settings.value('hide combined quick error')
|
||||
self.hide_combined_quick_error_check_box.setChecked(self.hide_combined_quick_error)
|
||||
#self.check_hide_combined_quick_error()
|
||||
settings.endGroup()
|
||||
|
||||
def save(self):
|
||||
@ -386,6 +417,7 @@ class BiblesTab(SettingsTab):
|
||||
if self.language_selection != settings.value('book name language'):
|
||||
settings.setValue('book name language', self.language_selection)
|
||||
self.settings_form.register_post_process('bibles_load_list')
|
||||
settings.setValue('hide combined quick error', self.hide_combined_quick_error)
|
||||
settings.endGroup()
|
||||
if self.tab_visited:
|
||||
self.settings_form.register_post_process('bibles_config_updated')
|
||||
|
@ -736,7 +736,8 @@ class BibleMediaItem(MediaManagerItem):
|
||||
if not self.search_results and len(text) - text.count(' ') > 2 and bible:
|
||||
self.on_quick_text_search()
|
||||
# If no Text or Reference is found, message is given.
|
||||
if not self.search_results:
|
||||
if not self.search_results and not \
|
||||
Settings().value(self.settings_section + '/hide combined quick error'):
|
||||
self.application.set_normal_cursor()
|
||||
reference_separators = {
|
||||
'verse': get_reference_separator('sep_v_display'),
|
||||
|
Loading…
Reference in New Issue
Block a user