plugin

Provide the generic plugin functionality for OpenLP plugins.

class openlp.core.lib.plugin.Plugin(name, default_settings, media_item_class=None, settings_tab_class=None, version=None)[source]

Bases: PyQt5.QtCore.QObject, openlp.core.common.registryproperties.RegistryProperties

Base class for openlp plugins to inherit from.

Basic Attributes

name
The name that should appear in the plugins list.
version
The version number of this iteration of the plugin.
settings_section
The namespace to store settings for the plugin.
icon
An instance of QIcon, which holds an icon for this plugin.
log
A log object used to log debugging messages. This is pre-instantiated.
weight
A numerical value used to order the plugins.

Hook Functions

check_pre_conditions()
Provides the Plugin with a handle to check if it can be loaded.
create_media_manager_item()
Creates a new instance of MediaManagerItem to be used in the Media Manager.
add_import_menu_item(import_menu)
Add an item to the Import menu.
add_export_menu_item(export_menu)
Add an item to the Export menu.
create_settings_tab()
Creates a new instance of SettingsTabItem to be used in the Settings dialog.
add_to_menu(menubar)
A method to add a menu item to anywhere in the menu, given the menu bar.
handle_event(event)
A method use to handle events, given an Event object.
about()
Used in the plugin manager, when a person clicks on the ‘About’ button.
static about()[source]

Show a dialog when the user clicks on the ‘About’ button in the plugin manager.

add_export_menu_item(export_menu)[source]

Create a menu item and add it to the “Export” menu.

Parameters:export_menu – The Export menu
add_import_menu_item(import_menu)[source]

Create a menu item and add it to the “Import” menu.

Parameters:import_menu – The Import menu.
add_to_menu(menubar)[source]

Add menu items to the menu, given the menubar.

Parameters:menubar – The application’s menu bar.
add_tools_menu_item(tools_menu)[source]

Create a menu item and add it to the “Tools” menu.

Parameters:tools_menu – The Tools menu
app_startup()[source]

Perform tasks on application startup

check_pre_conditions()[source]

Provides the Plugin with a handle to check if it can be loaded. Failing Preconditions does not stop a settings Tab being created

Returns True or False.

config_update()[source]

Called when Config is changed to restart values dependent on configuration.

create_media_manager_item()[source]

Construct a MediaManagerItem object with all the buttons and things you need, and return it for integration into OpenLP.

create_settings_tab(parent)[source]

Create a tab for the settings window to display the configurable options for this plugin to the user.

finalise()[source]

Called by the plugin Manager to cleanup things.

get_display_css()[source]

Add css style sheets to htmlbuilder.

get_display_html()[source]

Add html code to htmlbuilder.

get_display_javascript()[source]

Add javascript functions to htmlbuilder.

get_string(name)[source]

Encapsulate access of plugins translated text strings

initialise()[source]

Called by the plugin Manager to initialise anything it needs.

is_active()[source]

Indicates if the plugin is active

Returns True or False.

new_service_created()[source]

The plugin’s needs to handle a new song creation

process_add_service_event(replace=False)[source]

Generic Drag and drop handler triggered from service_manager.

refresh_css(frame)[source]

Allow plugins to refresh javascript on displayed screen.

frame
The Web frame holding the page.
rename_theme(old_theme, new_theme)[source]

Renames a theme a plugin is using making the plugin use the new name.

Parameters:
  • old_theme – The name of the theme the plugin should stop using.
  • new_theme – The new name the plugin should now use
set_plugin_ui_text_strings(tooltips)[source]

Called to define all translatable texts of the plugin

Parameters:tooltips
set_status()[source]

Sets the status of the plugin

toggle_status(new_status)[source]

Changes the status of the plugin and remembers it

upgrade_settings(settings)[source]

Upgrade the settings of this plugin.

Parameters:settings – The Settings object containing the old settings.
uses_theme(theme)[source]

Called to find out if a plugin is currently using a theme.

Returns True if the theme is being used, otherwise returns False.

class openlp.core.lib.plugin.PluginStatus[source]

Bases: object

Defines the status of the plugin

Active = 1
Disabled = -1
Inactive = 0
class openlp.core.lib.plugin.StringContent[source]

Bases: object

Provide standard strings for objects to use.

Delete = 'delete'
Edit = 'edit'
Import = 'import'
Live = 'live'
Load = 'load'
Name = 'name'
New = 'new'
Preview = 'preview'
Service = 'service'
VisibleName = 'visible_name'