From e8f08443396f2438ec9a36cb49ebe41f6ba0a232 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 16 Oct 2015 17:43:48 +0100 Subject: [PATCH] custom --- openlp/plugins/custom/customplugin.py | 6 ++---- openlp/plugins/custom/lib/mediaitem.py | 12 +++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index e2087b92a..4f0741266 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -72,11 +72,9 @@ class CustomPlugin(Plugin): """ Called to find out if the custom plugin is currently using a theme. - Returns True if the theme is being used, otherwise returns False. + Returns count of the times the theme is used. """ - if self.db_manager.get_all_objects(CustomSlide, CustomSlide.theme_name == theme): - return True - return False + return len(self.db_manager.get_all_objects(CustomSlide, CustomSlide.theme_name == theme)) def rename_theme(self, old_theme, new_theme): """ diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index dc0411ad8..d01b5b1a4 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -85,6 +85,7 @@ class CustomMediaItem(MediaManagerItem): """ log.debug('Config loaded') self.add_custom_from_service = Settings().value(self.settings_section + '/add custom from service') + self.search_as_you_type = Settings().value('advanced/search as type') def retranslateUi(self): """ @@ -269,11 +270,12 @@ class CustomMediaItem(MediaManagerItem): :param text: The search text """ - search_length = 2 - if len(text) > search_length: - self.on_search_text_button_clicked() - elif not text: - self.on_clear_text_button_click() + if self.search_as_you_type: + search_length = 2 + if len(text) > search_length: + self.on_search_text_button_clicked() + elif not text: + self.on_clear_text_button_click() def service_load(self, item): """