Theme Manager

class openlp.core.ui.thememanager.ThemeManager(parent=None)[source]

Bases: openlp.core.common.openlpmixin.OpenLPMixin, openlp.core.common.registrymixin.RegistryMixin, PyQt5.QtWidgets.QWidget, openlp.core.ui.thememanager.Ui_ThemeManager, openlp.core.common.registryproperties.RegistryProperties

Manages the orders of Theme.


process the bootstrap initialise setup request


process the bootstrap post setup request


Set up the theme path variables


Change the global theme when a theme is double clicked upon in the Theme Manager list.


Change the global theme when it is changed through the Themes settings tab


Check if theme already exists and displays error message

Parameters:theme_name – Name of the Theme to test
Returns:True or False if theme exists
check_list_state(item, field=None)[source]

If Default theme selected remove delete button. Note for some reason a dummy field is required. Nothing is passed!

  • field
  • item – Service Item to process
clone_theme_data(theme_data, new_theme_name)[source]

Takes a theme and makes a new copy of it as well as saving it.

  • theme_data – The theme to be used
  • new_theme_name – The new theme name to save the data to

Build the Right Click Context menu and set state depending on the type of theme.

Parameters:point – The position of the mouse so the correct item can be found.

Delete a theme.

Parameters:theme – The theme to delete.
generate_and_save_image(name, theme)[source]

Generate and save a preview image

  • name – The name of the theme.
  • theme – The theme data object.
generate_image(theme_data, force_page=False)[source]

Call the renderer to build a Sample Image

  • theme_data – The theme to generated a preview for.
  • force_page – Flag to tell message lines per page need to be generated.

Return an image representing the look of the theme

Parameters:theme – The theme to return the image for.

Returns a theme object from an XML file

Parameters:theme_name – Name of the theme to load from file
Returns:The theme object.

Return the list of loaded themes


Imports any themes on start up and makes sure there is at least one theme


Loads the theme lists and triggers updates across the whole system using direct calls or core functions and events for the plugins. The plugins will call back in to get the real list if they want it.


Loads a new theme with the default settings and then launches the theme editing form for the user to make their customisations. :param field:


Copies an existing theme to a new name :param field:


Delete a theme triggered by the UI. :param field:


Loads the settings for the theme that is to be edited and launches the theme editing form so the user can make their changes. :param field:


Export the theme in a zip file :param field:


Opens a file dialog to select the theme file(s) to import before attempting to extract OpenLP themes from those files. This process will only load version 2 themes. :param field:


Renames an existing theme to a new name :param field:


Display a warning box to the user that a theme already exists

Parameters:theme_name – Name of the theme.
Returns:Confirm if the theme is to be overwritten.
save_theme(theme, image_from, image_to)[source]

Called by theme maintenance Dialog to save the theme and to trigger the reload of the theme list

  • theme – The theme data object.
  • image_from – Where the theme image is currently located.
  • image_to – Where the Theme Image is to be saved to
unzip_theme(file_name, directory)[source]

Unzip the theme, remove the preview file if stored. Generate a new preview file. Check the XML theme version and upgrade if necessary. :param file_name: :param directory:


Called to update the themes’ preview images.