This commit is contained in:
Tim Bentley 2015-10-16 17:43:48 +01:00
parent ae1124f8bd
commit e8f0844339
2 changed files with 9 additions and 9 deletions

View File

@ -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):
"""

View File

@ -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):
"""