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. 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 len(self.db_manager.get_all_objects(CustomSlide, CustomSlide.theme_name == theme))
return True
return False
def rename_theme(self, old_theme, new_theme): def rename_theme(self, old_theme, new_theme):
""" """

View File

@ -85,6 +85,7 @@ class CustomMediaItem(MediaManagerItem):
""" """
log.debug('Config loaded') log.debug('Config loaded')
self.add_custom_from_service = Settings().value(self.settings_section + '/add custom from service') 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): def retranslateUi(self):
""" """
@ -269,11 +270,12 @@ class CustomMediaItem(MediaManagerItem):
:param text: The search text :param text: The search text
""" """
search_length = 2 if self.search_as_you_type:
if len(text) > search_length: search_length = 2
self.on_search_text_button_clicked() if len(text) > search_length:
elif not text: self.on_search_text_button_clicked()
self.on_clear_text_button_click() elif not text:
self.on_clear_text_button_click()
def service_load(self, item): def service_load(self, item):
""" """