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.
Create a menu item and add it to the “Export” menu.
Parameters: export_menu – The Export menu
Create a menu item and add it to the “Import” menu.
Parameters: import_menu – The Import menu.
Add menu items to the menu, given the menubar.
Parameters: menubar – The application’s menu bar.
Create a menu item and add it to the “Tools” menu.
Parameters: tools_menu – The Tools menu
-
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
orFalse
.
-
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.
-
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 –