Main Display

class openlp.core.ui.maindisplay.MainDisplay(parent)[source]

Bases: openlp.core.common.openlpmixin.OpenLPMixin, openlp.core.ui.maindisplay.Display, openlp.core.common.registryproperties.RegistryProperties

This is the display screen as a specialized class from the Display class

alert(text, location)[source]

Display an alert.

  • text – The text to be displayed.
  • location – Where on the screen is the text to be displayed
build_html(service_item, image_path='')[source]

Store the service_item and build the new HTML from it. Add the HTML to the display

  • service_item – The Service item to be used
  • image_path – Where the image resides.

Changes the display window level on Mac OS X so that the main window can be brought into focus but still allow the main display to be above the menu bar and dock when it in focus.

Parameters:window – Window from our application that focus changed to or None if outside our application

Remove registered function on close.


Catch the close event, and check that the close event is triggered by OpenLP closing the display. On Windows this event can be triggered by pressing ALT+F4, which we want to ignore.

Parameters:event – The triggered event

We need to rebuild the CSS on the live display.

direct_image(path, background)[source]

API for replacement backgrounds so Images are added directly to cache.

  • path – Path to Image
  • background – The background color

Display an image, as is.

Parameters:image – The image to be displayed

Display the Footer

Parameters:text – footer text to be displayed

Hide the display by making all layers transparent Store the images so they can be replaced when required

Parameters:mode – How the screen is to be hidden

Add an image as the background. The image has already been added to the cache.

Parameters:path – The path to the image to be displayed. Note, the path is only passed to identify the image. If the image has changed it has to be re-added to the image manager.

Generates a preview of the image displayed.


Reset the background image to the service item image. Used after the image plugin has changed the background.


Setup the interface translation strings.


Set the transparency of the window

Parameters:enabled – Is transparency enabled

Set up and build the output screen


Resizes the web_view a bit to force an update. Workaround for bug #1531319, should not be needed with PyQt 5.6.


Show the stored layers so the screen reappears as it was originally. Make the stored images None to release memory.

text(slide, animate=True)[source]

Add the slide text from slideController

  • slide – The slide text to be displayed
  • animate – Perform transitions if applicable when setting the text