forked from openlp/openlp
plugins again
This commit is contained in:
parent
e8f0844339
commit
9590de703a
@ -67,36 +67,13 @@ class ImagePlugin(Plugin):
|
|||||||
'provided by the theme.')
|
'provided by the theme.')
|
||||||
return about_text
|
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):
|
def upgrade_settings(self, settings):
|
||||||
"""
|
"""
|
||||||
Upgrade the settings of this plugin.
|
Upgrade the settings of this plugin.
|
||||||
|
|
||||||
:param settings: The Settings object containing the old settings.
|
: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
|
pass
|
||||||
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)
|
|
||||||
|
|
||||||
def set_plugin_text_strings(self):
|
def set_plugin_text_strings(self):
|
||||||
"""
|
"""
|
||||||
|
@ -119,14 +119,6 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
icon=':/general/general_edit.png',
|
icon=':/general/general_edit.png',
|
||||||
triggers=self.on_edit_click)
|
triggers=self.on_edit_click)
|
||||||
create_widget_action(self.list_view, separator=True)
|
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(
|
create_widget_action(
|
||||||
self.list_view,
|
self.list_view,
|
||||||
'listView%s%sItem' % (self.plugin.name.title(), StringContent.Preview.title()),
|
'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'),
|
text=translate('OpenLP.MediaManagerItem', '&Add to selected Service Item'),
|
||||||
icon=':/general/general_add.png',
|
icon=':/general/general_add.png',
|
||||||
triggers=self.on_add_edit_click)
|
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()
|
self.add_custom_context_actions()
|
||||||
# Create the context menu and add all actions from the list_view.
|
# Create the context menu and add all actions from the list_view.
|
||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
|
@ -137,22 +137,6 @@ class PresentationPlugin(Plugin):
|
|||||||
self.register_controllers(controller)
|
self.register_controllers(controller)
|
||||||
return bool(self.controllers)
|
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):
|
def about(self):
|
||||||
"""
|
"""
|
||||||
Return information about this plugin.
|
Return information about this plugin.
|
||||||
|
Loading…
Reference in New Issue
Block a user