From 9590de703aa12c425b0f36bf1bbec305043bc515 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 16 Oct 2015 17:49:58 +0100 Subject: [PATCH] plugins again --- openlp/plugins/images/imageplugin.py | 25 +------------------ openlp/plugins/images/lib/mediaitem.py | 16 ++++++------ .../presentations/presentationplugin.py | 16 ------------ 3 files changed, 9 insertions(+), 48 deletions(-) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 743c20ad9..a1a09854f 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -67,36 +67,13 @@ class ImagePlugin(Plugin): 'provided by the theme.') return about_text - def app_startup(self): - """ - Perform tasks on application startup. - """ - # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed - Plugin.app_startup(self) - # Convert old settings-based image list to the database. - files_from_config = Settings().get_files_from_config(self) - if files_from_config: - for file in files_from_config: - filename = os.path.split(file)[1] - thumb = os.path.join(self.media_item.service_path, filename) - try: - os.remove(thumb) - except: - pass - log.debug('Importing images list from old config: %s' % files_from_config) - self.media_item.save_new_images_list(files_from_config) - def upgrade_settings(self, settings): """ Upgrade the settings of this plugin. :param settings: The Settings object containing the old settings. """ - # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed - files_from_config = settings.get_files_from_config(self) - if files_from_config: - log.debug('Importing images list from old config: %s' % files_from_config) - self.media_item.save_new_images_list(files_from_config) + pass def set_plugin_text_strings(self): """ diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 31e39c655..e2e1d26e8 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -119,14 +119,6 @@ class ImageMediaItem(MediaManagerItem): icon=':/general/general_edit.png', triggers=self.on_edit_click) create_widget_action(self.list_view, separator=True) - if self.has_delete_icon: - create_widget_action( - self.list_view, - 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Delete.title()), - text=self.plugin.get_string(StringContent.Delete)['title'], - icon=':/general/general_delete.png', - can_shortcuts=True, triggers=self.on_delete_click) - create_widget_action(self.list_view, separator=True) create_widget_action( self.list_view, 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Preview.title()), @@ -155,6 +147,14 @@ class ImageMediaItem(MediaManagerItem): text=translate('OpenLP.MediaManagerItem', '&Add to selected Service Item'), icon=':/general/general_add.png', triggers=self.on_add_edit_click) + create_widget_action(self.list_view, separator=True) + if self.has_delete_icon: + create_widget_action( + self.list_view, + 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Delete.title()), + text=self.plugin.get_string(StringContent.Delete)['title'], + icon=':/general/general_delete.png', + can_shortcuts=True, triggers=self.on_delete_click) self.add_custom_context_actions() # Create the context menu and add all actions from the list_view. self.menu = QtGui.QMenu() diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 361df514c..b2118ce46 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -137,22 +137,6 @@ class PresentationPlugin(Plugin): self.register_controllers(controller) return bool(self.controllers) - def app_startup(self): - """ - Perform tasks on application startup. - """ - # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed - super().app_startup() - files_from_config = Settings().value('presentations/presentations files') - for file in files_from_config: - try: - self.media_item.clean_up_thumbnails(file, True) - except AttributeError: - pass - self.media_item.list_view.clear() - Settings().setValue('presentations/thumbnail_scheme', 'md5') - self.media_item.validate_and_load(files_from_config) - def about(self): """ Return information about this plugin.