ui

The ui module provides the core user interface for OpenLP

class openlp.core.ui.SplashScreen[source]

Bases: PyQt5.QtWidgets.QSplashScreen

The splash screen

setupUi()[source]

Set up the UI

class openlp.core.ui.AboutForm(parent)[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.aboutdialog.UiAboutDialog

The About dialog

on_volunteer_button_clicked()[source]

Launch a web browser and go to the contribute page on the site.

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

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.settingsdialog.Ui_SettingsDialog, openlp.core.common.registryproperties.RegistryProperties

Provide the form to manipulate the settings for OpenLP

accept()[source]

Process the form saving the settings

bootstrap_post_set_up()[source]

Run any post-setup code for the tabs on the form

exec()[source]

Execute the form

insert_tab(tab_widget, is_visible=True)[source]

Add a tab to the form at a specific location

Parameters:
  • tab_widget – The widget to add
  • is_visible – If this tab should be visible
list_item_changed(item_index)[source]

A different settings tab is selected

Parameters:item_index – The index of the item that was selected
register_post_process(function)[source]

Register for updates to be done on save removing duplicate functions

Parameters:function – The function to be called
reject()[source]

Process the form saving the settings

class openlp.core.ui.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.

Parameters:
  • 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

Parameters:
  • service_item – The Service item to be used
  • image_path – Where the image resides.
change_window_level(window)[source]

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
close()[source]

Remove registered function on close.

closeEvent(event)[source]

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
css_changed()[source]

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.

Parameters:
  • path – Path to Image
  • background – The background color
display_image(image)[source]

Display an image, as is.

Parameters:image – The image to be displayed
footer(text)[source]

Display the Footer

Parameters:text – footer text to be displayed
hide_display(mode=3)[source]

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
image(path)[source]

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.
preview()[source]

Generates a preview of the image displayed.

reset_image()[source]

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

retranslateUi()[source]

Setup the interface translation strings.

set_transparency(enabled)[source]

Set the transparency of the window

Parameters:enabled – Is transparency enabled
setup()[source]

Set up and build the output screen

shake_web_view()[source]

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

show_display()[source]

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

Parameters:
  • slide – The slide text to be displayed
  • animate – Perform transitions if applicable when setting the text
class openlp.core.ui.SlideController(parent)[source]

Bases: openlp.core.ui.slidecontroller.DisplayController, openlp.core.common.registryproperties.RegistryProperties

SlideController is the slide controller widget. This widget is what the user uses to control the displaying of verses/slides/etc on the screen.

add_service_item(item)[source]

Method to install the service item into the controller Called by plugins

Parameters:item – The current service item
add_service_manager_item(item, slide_no)[source]

Method to install the service item into the controller and request the correct toolbar for the plugin. Called by ServiceManager

Parameters:
  • item – The current service item
  • slide_no – The slide number to select
blank_plugin()[source]

Blank/Hide the display screen within a plugin if required.

enable_live_tool_bar(item)[source]

Allows the live toolbar to be customised

Parameters:item – The current service item
enable_preview_tool_bar(item)[source]

Allows the Preview toolbar to be customised

Parameters:item – The current service item
enable_tool_bar(item)[source]

Allows the toolbars to be reconfigured based on Controller Type and ServiceItem Type

Parameters:item – current service item being processed
grab_maindisplay()[source]

Creates an image of the current screen and updates the preview frame.

hide_mode()[source]

Determine what the hide mode should be according to the blank button

hide_plugin(hide)[source]

Tell the plugin to hide the display screen.

initialise()[source]

Initialise the UI elements of the controller

main_display_set_background()[source]

Allow the main display to blank the main display at startup time

on_audio_time_remaining(time)[source]

Update how much time is remaining

Parameters:time – the time remaining
on_blank_display(checked=None)[source]

Handle the blank screen button actions

Parameters:checked – the new state of the of the widget
on_controller_size_changed(width)[source]

Change layout of display control buttons on controller size change

Parameters:width – the new width of the display
on_edit_song(field=None)[source]

From the preview display requires the service Item to be editied

on_go_live(field=None)[source]

If preview copy slide item to live controller from Preview Controller

on_hide_display(checked=None)[source]

Handle the Hide screen button This toggles the desktop screen.

Parameters:checked – the new state of the of the widget
on_hide_display_enable(checked=None)[source]

Handle the on_hide_display_enable This only enables the desktop screen.

Parameters:checked – the new state of the of the widget
on_media_close()[source]

Respond to a request to close the Video

on_media_start(item)[source]

Respond to the arrival of a media service item

Parameters:item – The service item to be processed
on_next_track_clicked()[source]

Go to the next track when next is clicked

on_play_slides_loop(checked=None)[source]

Start or stop ‘Play Slides in Loop’

Parameters:checked – is the check box checked.
on_play_slides_once(checked=None)[source]

Start or stop ‘Play Slides to End’

Parameters:checked – is the check box checked.
on_preview_add_to_service(field=None)[source]

From the preview display request the Item to be added to service

on_preview_double_click(field=None)[source]

Triggered when a preview slide item is doubleclicked

on_slide_blank()[source]

Handle the slidecontroller blank event

on_slide_change(row)[source]

The slide has been changed. Update the slidecontroller accordingly

Parameters:row – Row to be selected
on_slide_selected(field=None)[source]

Slide selected in controller Note for some reason a dummy field is required. Nothing is passed!

on_slide_selected_index(message)[source]

Go to the requested slide

Parameters:message – remote message to be processed.
on_slide_selected_next(wrap=None)[source]

Go to the next slide.

Parameters:wrap – Are we wrapping round the service item
on_slide_selected_next_action(checked)[source]

Wrapper function from create_action so we can throw away the incorrect parameter

Parameters:checked – the new state of the of the widget
on_slide_selected_previous(field=None)[source]

Go to the previous slide.

on_slide_unblank()[source]

Handle the slidecontroller unblank event.

on_song_bar_handler()[source]

Some song handler

on_start_loop()[source]

Start the timer loop running and store the timer id

on_stop_loop()[source]

Stop the timer loop running

on_theme_display(checked=None)[source]

Handle the Theme screen button

Parameters:checked – the new state of the of the widget
on_toggle_loop()[source]

Toggles the loop state.

on_track_triggered(field=None)[source]

Start playing a track

post_set_up()[source]

Call by bootstrap functions

preview_size_changed()[source]

Takes care of the SlidePreview’s size. Is called when one of the the splitters is moved or when the screen size is changed. Note, that this method is (also) called frequently from the mainwindow paintEvent.

receive_spin_delay()[source]

Adjusts the value of the delay_spin_box to the given one.

refresh_service_item()[source]

Method to update the service item if the screen has changed

replace_service_manager_item(item)[source]

Replacement item following a remote edit. This action also takes place when a song that is sent to live from Service Manager is edited.

Parameters:item – The current service item
screen_size_changed()[source]

Settings dialog has changed the screen size of adjust output and screen previews.

service_next(field=None)[source]

Live event to select the next service item from the service manager.

service_previous(field=None)[source]

Live event to select the previous service item from the service manager.

set_audio_items_visibility(visible)[source]

Set the visibility of the audio stuff

set_audio_pause_clicked(checked)[source]

Pause the audio player

Parameters:checked – is the check box checked.
set_blank_menu(visible=True)[source]

Set the correct menu type dependent on the service item type

Parameters:visible – Do I need to hide the menu?
set_live_hot_keys(parent=None)[source]

Set the live hotkeys

Parameters:parent – The parent UI object for actions to be added to.
slide_selected(start=False)[source]

Generate the preview when you click on a slide. If this is the Live Controller also display on the screen

Parameters:start
timerEvent(event)[source]

If the timer event is for this window select next slide

Parameters:event – The triggered event
toggle_display(action)[source]

Toggle the display settings triggered from remote messages.

Parameters:action – The blank action to be processed.
update_preview()[source]

This updates the preview frame, for example after changing a slide or using Blank to Theme.

update_slide_limits()[source]

Updates the Slide Limits variable from the settings.

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

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

Manages the services. This involves taking text strings from plugins and adding them to the service. This service can then be zipped up with all the resources used into one OSZ or oszl file for use on any OpenLP v2 installation. Also handles the UI tasks of moving things up and down etc.

add_service_item(item, rebuild=False, expand=None, replace=False, repaint=True, selected=False, position=-1)[source]

Add a Service item to the list

Parameters:
  • item – Service Item to be added
  • rebuild – Do we need to rebuild the live display (Default False)
  • expand – Override the default expand settings. (Tristate)
  • replace – Is the service item a replacement (Default False)
  • repaint – Do we need to repaint the service item list (Default True)
  • selected – Has the item been selected (Default False)
  • position – The position where the item is dropped (Default -1)
bootstrap_initialise()[source]

To be called as part of initialisation

bootstrap_post_set_up()[source]

Can be set up as a late setup

clean_up()[source]

Empties the service_path of temporary files on system exit.

collapsed(item)[source]

Record if an item is collapsed. Used when repainting the list to get the correct state.

Parameters:item – The service item to be checked
context_menu(point)[source]

The Right click context menu from the Serviceitem list

Parameters:point – The location of the cursor.
create_basic_service()[source]

Create the initial service array with the base items to be saved.

Returns:service array
create_custom(field=None)[source]

Saves the current text item as a custom slide :param field:

decide_save_method(field=None)[source]

Determine which type of save method to use. :param field:

drop_event(event)[source]

Receive drop event and trigger an internal event to get the plugins to build and push the correct service item. The drag event payload carries the plugin name

Parameters:event – Handle of the event passed
expanded(item)[source]

Record if an item is collapsed. Used when repainting the list to get the correct state.

Parameters:item – The service item to be checked
file_name()[source]

Return the current file name including path.

find_service_item()[source]

Finds the first selected ServiceItem in the list and returns the position of the service_item_from_item and its selected child item. For example, if the third child item (in the Slidecontroller known as slide) in the second service item is selected this will return:

(1, 2)
get_drop_position()[source]

Getter for drop_position. Used in: MediaManagerItem

get_service_item()[source]

Send the current item to the Preview slide controller

is_modified()[source]

Getter for boolean property “modified”.

load_file(file_name)[source]

Load an existing service file :param file_name:

load_last_file()[source]

Load the last service item from the service manager when the service was last closed. Can be blank if there was no service present.

make_live(row=-1)[source]

Send the current item to the Live slide controller

Parameters:row – Row number to be displayed if from preview. -1 is passed if the value is not set
make_preview(field=None)[source]

Send the current item to the Preview slide controller :param field:

new_file()[source]

Create a blank new service file.

next_item()[source]

Called by the SlideController to select the next service item.

on_auto_start(field=None)[source]

Toggles to Auto Start Setting.

on_collapse_all(field=None)[source]

Collapse all the service items. :param field:

on_delete_from_service(field=None)[source]

Remove the current ServiceItem from the list. :param field:

on_double_click_live(field=None)[source]

Send the current item to the Live slide controller but triggered by a tablewidget click event. :param field:

on_expand_all(field=None)[source]

Collapse all the service items. :param field:

on_load_service_clicked(load_file=None)[source]

Loads the service file and saves the existing one it there is one unchanged.

Parameters:load_file – The service file to the loaded. Will be None is from menu so selection will be required.
on_move_selection_down()[source]

Moves the cursor selection down the window. Called by the down arrow.

on_move_selection_up()[source]

Moves the cursor selection up the window. Called by the up arrow.

on_new_service_clicked(field=None)[source]

Create a new service. :param field:

on_recent_service_clicked(field=None)[source]

Load a recent file as the service triggered by mainwindow recent service list. :param field:

on_service_down(field=None)[source]

Move the current ServiceItem one position down in the list. :param field:

on_service_end(field=None)[source]

Move the current ServiceItem to the bottom of the list. :param field:

on_service_item_edit_form(field=None)[source]

Opens a dialog to edit the service item and update the service display if changes are saved. :param field:

on_service_item_note_form(field=None)[source]

Allow the service note to be edited :param field:

on_service_item_rename(field=None)[source]

Opens a dialog to rename the service item.

Parameters:field – Not used, but PyQt needs this.
on_service_top(field=None)[source]

Move the current ServiceItem to the top of the list. :param field:

on_service_up(field=None)[source]

Move the current ServiceItem one position up in the list. :param field:

on_set_item(message, field=None)[source]

Called by a signal to select a specific item and make it live usually from remote.

Parameters:
  • field
  • message – The data passed in from a remove message
on_single_click_preview(field=None)[source]

If single click previewing is enabled, and triggered by a tablewidget click event, start a timeout to verify a double-click hasn’t triggered. :param field:

on_single_click_preview_timeout()[source]

If a single click ok, but double click not triggered, send the current item to the Preview slide controller. :param field:

on_start_time_form(field=None)[source]

Opens a dialog to type in service item notes. :param field:

on_theme_change_action(field=None)[source]

Handles theme change events

Parameters:field
on_theme_combo_box_selected(current_index)[source]

Set the theme for the current service.

Parameters:current_index – The combo box index for the selected item
on_timed_slide_interval(field=None)[source]

Shows input dialog for enter interval in seconds for delay :param field:

preview_live(unique_identifier, row)[source]

Called by the SlideController to request a preview item be made live and allows the next preview to be updated if relevant.

Parameters:
  • unique_identifier – Reference to the service_item
  • row – individual row number
previous_item(last_slide=False)[source]

Called by the SlideController to select the previous service item.

Parameters:last_slide – Is this the last slide in the service_item.
process_service_items(service_items)[source]

Process all the array of service items loaded from the saved service

Parameters:service_items – list of service_items
regenerate_service_items(changed=False)[source]

Rebuild the service list as things have changed and a repaint is the easiest way to do this.

Parameters:changed – True if the list has changed for new / removed items. False for a theme change.
remote_edit(field=None)[source]

Triggers a remote edit to a plugin to allow item to be edited. :param field:

repaint_service_list(service_item, service_item_child)[source]

Clear the existing service list and prepaint all the items. This is used when moving items as the move takes place in a supporting list, and when regenerating all the items due to theme changes.

Parameters:
  • service_item – The item which changed. (int)
  • service_item_child – The child of the service_item, which will be selected. (int)
replace_service_item(new_item)[source]

Using the service item passed replace the one with the same edit id if found.

Parameters:new_item – a new service item to up date an existing one.
reset_supported_suffixes()[source]

Resets the Suffixes list.

save_file(field=None)[source]

Save the current service file.

A temporary file is created so that we don’t overwrite the existing one and leave a mangled service file should there be an error when saving. Audio files are also copied into the service manager directory, and then packaged into the zip file.

save_file_as(field=None)[source]

Get a file name and then call ServiceManager.save_file() to save the file.

save_local_file()[source]

Save the current service file but leave all the file references alone to point to the current machine. This format is not transportable as it will not contain any files.

save_modified_service()[source]

Check to see if a service needs to be saved.

servicemanager_next_item
servicemanager_previous_item
servicemanager_set_item
set_file_name(file_name)[source]

Setter for service file.

Parameters:file_name – The service file name
set_item(index)[source]

Makes a specific item in the service live.

Parameters:index – The index of the service item list to be actioned.
set_modified(modified=True)[source]

Setter for property “modified”. Sets whether or not the current service has been modified.

Parameters:modified – Indicates if the service has new or removed items. Used to trigger a remote update.
short_file_name()[source]

Return the current file name, excluding the path.

supported_suffixes(suffix_list)[source]

Adds Suffixes supported to the master list. Called from Plugins.

Parameters:suffix_list – New Suffix’s to be supported
theme_change()[source]

The theme may have changed in the settings dialog so make sure the theme combo box is in the correct state.

toggle_auto_play_slides_loop(field=None)[source]

Toggle Auto play slide loop.

Parameters:field
toggle_auto_play_slides_once(field=None)[source]

Toggle Auto play slide once. Inverts auto play once option for the item

Parameters:field
update_theme_list(theme_list)[source]

Called from ThemeManager when the Themes have changed

Parameters:theme_list – A list of current themes to be displayed
class openlp.core.ui.ThemeForm(parent)[source]

Bases: PyQt5.QtWidgets.QWizard, openlp.core.ui.themewizard.Ui_ThemeWizard, openlp.core.common.registryproperties.RegistryProperties

This is the Theme Import Wizard, which allows easy creation and editing of OpenLP themes.

accept()[source]

Lets save the theme as Finish has been triggered

calculate_lines()[source]

Calculate the number of lines on a page by rendering text

exec(edit=False)[source]

Run the wizard.

initializePage(page_id)[source]

Set up the pages for Initial run through dialog

on_background_combo_box_current_index_changed(index)[source]

Background style Combo box has changed.

on_color_changed(color)[source]

Background / Gradient 1 _color button pushed.

on_current_id_changed(page_id)[source]

Detects Page changes and updates as appropriate. :param page_id: current page number

on_custom_1_button_clicked(number)[source]

Generate layout preview and display the form.

Set the footer colour value

Change state as Footer Area _position check box changed NOTE the font_footer_override is the inverse of the check box value

on_gradient_combo_box_current_index_changed(index)[source]

Background gradient Combo box has changed.

on_gradient_end_color_changed(color)[source]

Gradient 2 _color button pushed.

on_gradient_start_color_changed(color)[source]

Gradient 2 _color button pushed.

on_image_color_changed(color)[source]

Background / Gradient 1 _color button pushed.

on_image_path_edit_path_changed(filename)[source]

Background Image button pushed.

on_main_color_changed(color)[source]

Set the main colour value

on_main_position_check_box_state_changed(value)[source]

Change state as Main Area _position check box changed NOTE the font_main_override is the inverse of the check box value

on_outline_check_check_box_state_changed(state)[source]

Change state as Outline check box changed

on_outline_color_changed(color)[source]

Set the outline colour value

on_shadow_check_check_box_state_changed(state)[source]

Change state as Shadow check box changed

on_shadow_color_changed(color)[source]

Set the shadow colour value

on_video_color_changed(color)[source]

Background / Gradient 1 _color button pushed.

on_video_path_edit_path_changed(filename)[source]

Background video button pushed.

registerFields()[source]

Map field names to screen names,

resizeEvent(event=None)[source]

Rescale the theme preview thumbnail on resize events.

set_alignment_page_values()[source]

Handle the display and state of the Alignments page.

set_background_page_values()[source]

Handle the display and state of the Background page.

set_defaults()[source]

Set up display at start of theme edit.

Handle the display and state of the Footer Area page.

set_main_area_page_values()[source]

Handle the display and state of the Main Area page.

set_position_page_values()[source]

Handle the display and state of the _position page.

set_preview_page_values()[source]

Handle the display and state of the Preview page.

update_lines_text(lines)[source]

Updates the lines on a page on the wizard :param lines: then number of lines to be displayed

update_theme()[source]

Update the theme object from the UI for fields not already updated when the are changed.

validateCurrentPage()[source]

Validate the current page

class openlp.core.ui.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.

bootstrap_initialise()[source]

process the bootstrap initialise setup request

bootstrap_post_set_up()[source]

process the bootstrap post setup request

build_theme_path()[source]

Set up the theme path variables

change_global_from_screen(index=-1)[source]

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

Parameters:index
change_global_from_tab()[source]

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

check_if_theme_exists(theme_name)[source]

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!

Parameters:
  • 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.

Parameters:
  • theme_data – The theme to be used
  • new_theme_name – The new theme name to save the data to
context_menu(point)[source]

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_theme(theme)[source]

Delete a theme.

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

Generate and save a preview image

Parameters:
  • 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

Parameters:
  • theme_data – The theme to generated a preview for.
  • force_page – Flag to tell message lines per page need to be generated.
get_preview_image(theme)[source]

Return an image representing the look of the theme

Parameters:theme – The theme to return the image for.
get_theme_data(theme_name)[source]

Returns a theme object from an XML file

Parameters:theme_name – Name of the theme to load from file
Returns:The theme object.
get_themes()[source]

Return the list of loaded themes

load_first_time_themes()[source]

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

load_themes()[source]

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.

on_add_theme(field=None)[source]

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

on_copy_theme(field=None)[source]

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

on_delete_theme(field=None)[source]

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

on_edit_theme(field=None)[source]

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:

on_export_theme(field=None)[source]

Export the theme in a zip file :param field:

on_import_theme(field=None)[source]

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:

on_rename_theme(field=None)[source]

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

over_write_message_box(theme_name)[source]

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

Parameters:
  • 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:

update_preview_images()[source]

Called to update the themes’ preview images.

class openlp.core.ui.ServiceItemEditForm[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.serviceitemeditdialog.Ui_ServiceItemEditDialog, openlp.core.common.registryproperties.RegistryProperties

This is the form that is used to edit the verses of the song.

get_service_item()[source]

Get the modified service item.

load_data()[source]

Loads the image list.

on_current_row_changed(row)[source]

Called when the currentRow has changed.

Parameters:row – The row number (int).
on_delete_button_clicked()[source]

Delete the current row.

on_down_button_clicked()[source]

Move the current row down in the list

on_up_button_clicked()[source]

Move the current row up in the list.

set_service_item(item)[source]

Set the service item to be edited.

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

Bases: PyQt5.QtWidgets.QWizard, openlp.core.ui.firsttimewizard.UiFirstTimeWizard, openlp.core.common.registryproperties.RegistryProperties

This is the Theme Import Wizard, which allows easy creation and editing of OpenLP themes.

exec()[source]

Run the wizard.

get_next_page_id()[source]

Returns the id of the next FirstTimePage to go to based on enabled plugins

initialize(screens)[source]

Set up the First Time Wizard

Parameters:screens – The screens detected by OpenLP
nextId()[source]

Determine the next page in the Wizard to go to.

on_cancel_button_clicked()[source]

Process the triggering of the cancel button.

on_current_id_changed(page_id)[source]

Detects Page changes and updates as appropriate.

on_no_internet_cancel_button_clicked()[source]

Process the triggering of the “Cancel” button on the No Internet page.

on_no_internet_finish_button_clicked()[source]

Process the triggering of the “Finish” button on the No Internet page.

on_screenshot_downloaded(title, filename, sha256)[source]

Add an item to the list when a theme has been downloaded

Parameters:
  • title – The title of the theme
  • filename – The filename of the theme
set_defaults()[source]

Set up display at start of theme edit.

update_screen_list_combo()[source]

The user changed screen resolution or enabled/disabled more screens, so we need to update the combo box.

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

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.firsttimelanguagedialog.Ui_FirstTimeLanguageDialog

The language selection dialog.

accept()[source]

Run when the dialog is OKed.

exec()[source]

Run the Dialog with correct heading.

reject()[source]

Run when the dialog is canceled.

class openlp.core.ui.Display(parent)[source]

Bases: PyQt5.QtWidgets.QGraphicsView

This is a general display screen class. Here the general display settings will done. It will be used as specialized classes by Main Display and Preview display.

is_web_loaded(field=None)[source]

Called by webView event to show display is fully loaded

resizeEvent(event)[source]

React to resizing of this display

Parameters:event – The event to be handled
setup()[source]

Set up and build the screen base

class openlp.core.ui.ServiceNoteForm[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.common.registryproperties.RegistryProperties

This is the form that is used to edit the verses of the song.

exec()[source]

Execute the form and return the result.

retranslateUi()[source]

Translate the UI on the fly

setupUi()[source]

Set up the UI of the dialog

class openlp.core.ui.ThemeLayoutForm(parent)[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.themelayoutdialog.Ui_ThemeLayoutDialog

The exception dialog

exec(image)[source]

Run the Dialog with correct heading.

class openlp.core.ui.FileRenameForm[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.filerenamedialog.Ui_FileRenameDialog, openlp.core.common.registryproperties.RegistryProperties

The file rename dialog

exec(copy=False)[source]

Run the Dialog with correct heading.

class openlp.core.ui.StartTimeForm[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.starttimedialog.Ui_StartTimeDialog, openlp.core.common.registryproperties.RegistryProperties

The start time dialog

accept()[source]

When the dialog succeeds, this is run

exec()[source]

Run the Dialog with correct heading.

class openlp.core.ui.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.

Parameters:
  • 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

Parameters:
  • service_item – The Service item to be used
  • image_path – Where the image resides.
change_window_level(window)[source]

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
close()[source]

Remove registered function on close.

closeEvent(event)[source]

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
css_changed()[source]

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.

Parameters:
  • path – Path to Image
  • background – The background color
display_image(image)[source]

Display an image, as is.

Parameters:image – The image to be displayed
footer(text)[source]

Display the Footer

Parameters:text – footer text to be displayed
hide_display(mode=3)[source]

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
image(path)[source]

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.
preview()[source]

Generates a preview of the image displayed.

reset_image()[source]

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

retranslateUi()[source]

Setup the interface translation strings.

set_transparency(enabled)[source]

Set the transparency of the window

Parameters:enabled – Is transparency enabled
setup()[source]

Set up and build the output screen

shake_web_view()[source]

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

show_display()[source]

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

Parameters:
  • slide – The slide text to be displayed
  • animate – Perform transitions if applicable when setting the text
class openlp.core.ui.SlideController(parent)[source]

Bases: openlp.core.ui.slidecontroller.DisplayController, openlp.core.common.registryproperties.RegistryProperties

SlideController is the slide controller widget. This widget is what the user uses to control the displaying of verses/slides/etc on the screen.

add_service_item(item)[source]

Method to install the service item into the controller Called by plugins

Parameters:item – The current service item
add_service_manager_item(item, slide_no)[source]

Method to install the service item into the controller and request the correct toolbar for the plugin. Called by ServiceManager

Parameters:
  • item – The current service item
  • slide_no – The slide number to select
blank_plugin()[source]

Blank/Hide the display screen within a plugin if required.

enable_live_tool_bar(item)[source]

Allows the live toolbar to be customised

Parameters:item – The current service item
enable_preview_tool_bar(item)[source]

Allows the Preview toolbar to be customised

Parameters:item – The current service item
enable_tool_bar(item)[source]

Allows the toolbars to be reconfigured based on Controller Type and ServiceItem Type

Parameters:item – current service item being processed
grab_maindisplay()[source]

Creates an image of the current screen and updates the preview frame.

hide_mode()[source]

Determine what the hide mode should be according to the blank button

hide_plugin(hide)[source]

Tell the plugin to hide the display screen.

initialise()[source]

Initialise the UI elements of the controller

main_display_set_background()[source]

Allow the main display to blank the main display at startup time

on_audio_time_remaining(time)[source]

Update how much time is remaining

Parameters:time – the time remaining
on_blank_display(checked=None)[source]

Handle the blank screen button actions

Parameters:checked – the new state of the of the widget
on_controller_size_changed(width)[source]

Change layout of display control buttons on controller size change

Parameters:width – the new width of the display
on_edit_song(field=None)[source]

From the preview display requires the service Item to be editied

on_go_live(field=None)[source]

If preview copy slide item to live controller from Preview Controller

on_hide_display(checked=None)[source]

Handle the Hide screen button This toggles the desktop screen.

Parameters:checked – the new state of the of the widget
on_hide_display_enable(checked=None)[source]

Handle the on_hide_display_enable This only enables the desktop screen.

Parameters:checked – the new state of the of the widget
on_media_close()[source]

Respond to a request to close the Video

on_media_start(item)[source]

Respond to the arrival of a media service item

Parameters:item – The service item to be processed
on_next_track_clicked()[source]

Go to the next track when next is clicked

on_play_slides_loop(checked=None)[source]

Start or stop ‘Play Slides in Loop’

Parameters:checked – is the check box checked.
on_play_slides_once(checked=None)[source]

Start or stop ‘Play Slides to End’

Parameters:checked – is the check box checked.
on_preview_add_to_service(field=None)[source]

From the preview display request the Item to be added to service

on_preview_double_click(field=None)[source]

Triggered when a preview slide item is doubleclicked

on_slide_blank()[source]

Handle the slidecontroller blank event

on_slide_change(row)[source]

The slide has been changed. Update the slidecontroller accordingly

Parameters:row – Row to be selected
on_slide_selected(field=None)[source]

Slide selected in controller Note for some reason a dummy field is required. Nothing is passed!

on_slide_selected_index(message)[source]

Go to the requested slide

Parameters:message – remote message to be processed.
on_slide_selected_next(wrap=None)[source]

Go to the next slide.

Parameters:wrap – Are we wrapping round the service item
on_slide_selected_next_action(checked)[source]

Wrapper function from create_action so we can throw away the incorrect parameter

Parameters:checked – the new state of the of the widget
on_slide_selected_previous(field=None)[source]

Go to the previous slide.

on_slide_unblank()[source]

Handle the slidecontroller unblank event.

on_song_bar_handler()[source]

Some song handler

on_start_loop()[source]

Start the timer loop running and store the timer id

on_stop_loop()[source]

Stop the timer loop running

on_theme_display(checked=None)[source]

Handle the Theme screen button

Parameters:checked – the new state of the of the widget
on_toggle_loop()[source]

Toggles the loop state.

on_track_triggered(field=None)[source]

Start playing a track

post_set_up()[source]

Call by bootstrap functions

preview_size_changed()[source]

Takes care of the SlidePreview’s size. Is called when one of the the splitters is moved or when the screen size is changed. Note, that this method is (also) called frequently from the mainwindow paintEvent.

receive_spin_delay()[source]

Adjusts the value of the delay_spin_box to the given one.

refresh_service_item()[source]

Method to update the service item if the screen has changed

replace_service_manager_item(item)[source]

Replacement item following a remote edit. This action also takes place when a song that is sent to live from Service Manager is edited.

Parameters:item – The current service item
screen_size_changed()[source]

Settings dialog has changed the screen size of adjust output and screen previews.

service_next(field=None)[source]

Live event to select the next service item from the service manager.

service_previous(field=None)[source]

Live event to select the previous service item from the service manager.

set_audio_items_visibility(visible)[source]

Set the visibility of the audio stuff

set_audio_pause_clicked(checked)[source]

Pause the audio player

Parameters:checked – is the check box checked.
set_blank_menu(visible=True)[source]

Set the correct menu type dependent on the service item type

Parameters:visible – Do I need to hide the menu?
set_live_hot_keys(parent=None)[source]

Set the live hotkeys

Parameters:parent – The parent UI object for actions to be added to.
slide_selected(start=False)[source]

Generate the preview when you click on a slide. If this is the Live Controller also display on the screen

Parameters:start
timerEvent(event)[source]

If the timer event is for this window select next slide

Parameters:event – The triggered event
toggle_display(action)[source]

Toggle the display settings triggered from remote messages.

Parameters:action – The blank action to be processed.
update_preview()[source]

This updates the preview frame, for example after changing a slide or using Blank to Theme.

update_slide_limits()[source]

Updates the Slide Limits variable from the settings.

class openlp.core.ui.DisplayController(parent)[source]

Bases: PyQt5.QtWidgets.QWidget

Controller is a general display controller widget.

send_to_plugins(*args)[source]

This is the generic function to send signal for control widgets, created from within other plugins This function is needed to catch the current controller

Parameters:args – Arguments to send to the plugins
class openlp.core.ui.GeneralTab(parent)[source]

Bases: openlp.core.lib.settingstab.SettingsTab

GeneralTab is the general settings tab in the settings dialog.

load()[source]

Load the settings to populate the form

on_display_changed()[source]

Called when the width, height, x position or y position has changed.

on_logo_background_color_changed(color)[source]

Select the background color for logo.

on_override_radio_button_pressed(checked)[source]

Toggle screen state depending on check box state.

Parameters:checked – The state of the check box (boolean).
post_set_up(postUpdate=False)[source]

Apply settings after settings tab has loaded and most of the system so must be delayed

retranslateUi()[source]

Translate the general settings tab to the currently selected language

save()[source]

Save the settings from the form

setupUi()[source]

Create the user interface for the general settings tab

class openlp.core.ui.ThemesTab(parent)[source]

Bases: openlp.core.lib.settingstab.SettingsTab

ThemesTab is the theme settings tab in the settings dialog.

load()[source]

Load the theme settings into the tab

on_default_combo_box_changed(value)[source]

Set the global default theme

on_global_level_button_clicked()[source]

Set the theme level

on_service_level_button_clicked()[source]

Set the theme level

on_song_level_button_clicked()[source]

Set the theme level

retranslateUi()[source]

Translate the UI on the fly

save()[source]

Save the settings

setupUi()[source]

Set up the UI

update_theme_list(theme_list)[source]

Called from ThemeManager when the Themes have changed.

Parameters:theme_list

The list of available themes:

['Bible Theme', 'Song Theme']
class openlp.core.ui.AdvancedTab(parent)[source]

Bases: openlp.core.lib.settingstab.SettingsTab

The AdvancedTab manages the advanced settings tab including the UI and the loading and saving of the displayed settings.

cancel()[source]

Dialogue was cancelled, remove any pending data path change.

check_data_overwrite(data_path)[source]

Check if there’s already data in the target directory.

generate_service_name_example()[source]

Display an example of the template used

load()[source]

Load settings from disk.

on_alternate_rows_check_box_toggled(checked)[source]

Notify user about required restart.

Parameters:checked – The state of the check box (boolean).
on_data_directory_cancel_button_clicked()[source]

Cancel the data directory location change

on_data_directory_copy_check_box_toggled()[source]

Copy existing data when you change your data directory.

on_data_directory_path_edit_path_changed(new_data_path)[source]

Browse for a new data directory location.

on_end_slide_button_clicked()[source]

Stop at the end either top ot bottom

on_next_item_button_clicked()[source]

Advance to the next service item

on_search_as_type_check_box_changed(check_state)[source]
on_service_name_day_changed(service_day)[source]

React to the day of the service name changing.

on_service_name_revert_button_clicked()[source]

Revert to the default service name.

on_wrap_slide_button_clicked()[source]

Wrap round the service item

retranslateUi()[source]

Setup the interface translation strings.

save()[source]

Save settings to disk.

service_name_check_box_toggled(default_service_enabled)[source]

Service Name options changed

setupUi()[source]

Configure the UI elements for the tab.

update_service_name_example(returned_value)[source]

Update the example service name.

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

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.plugindialog.Ui_PluginViewDialog, openlp.core.common.registryproperties.RegistryProperties

The plugin form provides user control over the plugins OpenLP uses.

load()[source]

Load the plugin details into the screen

on_plugin_list_widget_selection_changed()[source]

If the selected plugin changes, update the form

on_status_checkbox_changed(status)[source]

If the status of a plugin is altered, apply the change

class openlp.core.ui.FormattingTagForm(parent)[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.formattingtagdialog.Ui_FormattingTagDialog, openlp.core.ui.formattingtagcontroller.FormattingTagController

The FormattingTagForm manages the settings tab .

accept()[source]

Update Custom Tag details if not duplicate and save the data.

exec()[source]

Load Display and set field state.

on_current_cell_changed(cur_row, cur_col, pre_row, pre_col)[source]

This function processes all user edits in the table. It is called on each cell change.

on_delete_clicked()[source]

Delete selected custom row.

on_new_clicked()[source]

Add a new tag to edit list and select it for editing.

on_row_selected()[source]

Table Row selected so display items and set field state.

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

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.shortcutlistdialog.Ui_ShortcutListDialog, openlp.core.common.registryproperties.RegistryProperties

The shortcut list dialog

exec()[source]

Execute the dialog

static get_shortcut_string(shortcut, for_display=False)[source]
keyPressEvent(event)[source]

Respond to certain key presses

keyReleaseEvent(event)[source]

Respond to certain key presses

on_alternate_push_button_clicked(toggled)[source]

Save the new alternate shortcut.

on_clear_alternate_button_clicked(toggled)[source]

Restore the defaults of this action.

on_clear_primary_button_clicked(toggled)[source]

Restore the defaults of this action.

on_current_item_changed(item=None, previousItem=None)[source]

A item has been pressed. We adjust the button’s text to the action’s shortcut which is encapsulate in the item.

on_custom_radio_button_clicked(toggled)[source]

The custom shortcut radio button was clicked, thus we have to restore the custom shortcuts by calling those functions triggered by button clicks.

on_default_radio_button_clicked(toggled)[source]

The default radio button has been clicked, which means we have to make sure, that we use the default shortcuts for the action.

on_item_double_clicked(item, column)[source]

A item has been double clicked. The primaryPushButton will be checked and the item’s shortcut will be displayed.

on_primary_push_button_clicked(toggled)[source]

Save the new primary shortcut.

on_restore_defaults_clicked(button)[source]

Restores all default shortcuts.

refresh_shortcut_list()[source]

This refreshes the item’s shortcuts shown in the list. Note, this neither adds new actions nor removes old actions.

reload_shortcut_list()[source]

Reload the tree_widget list to add new and remove old actions.

save()[source]

Save the shortcuts. Note, that we do not have to load the shortcuts, as they are loaded in ActionList.

class openlp.core.ui.FormattingTagController[source]

Bases: object

The FormattingTagController manages the non UI functions .

end_tag_changed(start_html, end_html)[source]

Validate the HTML tags when the end tag has been changed.

start_html
The start html tag.
end_html
The end html tag.
pre_save()[source]

Cleanup the array before save validation runs

save_tags()[source]

Save the new tags if they are valid.

start_html_to_end_html(start_html)[source]

Return the end HTML for a given start HTML or None if invalid.

start_html
The start html tag.
start_tag_changed(start_html, end_html)[source]

Validate the HTML tags when the start tag has been changed.

start_html
The start html tag.
end_html
The end html tag.
validate_for_save(desc, tag, start_html, end_html)[source]

Validate a custom tag and add to the tags array if valid..

desc
Explanation of the tag.
tag
The tag in the song used to mark the text.
start_html
The start html tag.
end_html
The end html tag.
class openlp.core.ui.SingleColumnTableWidget(parent)[source]

Bases: PyQt5.QtWidgets.QTableWidget

Class to for a single column table widget to use for the verse table widget.

resizeEvent(event)[source]

Resize the first column together with the widget.

class openlp.core.ui.ProjectorManager(parent=None, projectordb=None)[source]

Bases: openlp.core.common.openlpmixin.OpenLPMixin, openlp.core.common.registrymixin.RegistryMixin, PyQt5.QtWidgets.QWidget, openlp.core.ui.projector.manager.UiProjectorManager, openlp.core.common.registryproperties.RegistryProperties

Manage the projectors.

add_projector(projector, start=False)[source]

Builds manager list item, projector thread, and timer for projector instance.

Parameters:
  • projector – Projector instance to add
  • start – Start projector if True
add_projector_from_wizard(ip, opts=None)[source]

Add a projector from the edit dialog

Parameters:
  • ip – IP address of new record item to find
  • opts – Needed by PyQt5
authentication_error(name)[source]

Display warning dialog when attempting to connect with invalid pin

Parameters:name – Name from QListWidgetItem
bootstrap_initialise()[source]

Pre-initialize setups.

bootstrap_post_set_up()[source]

Post-initialize setups.

context_menu(point)[source]

Build the Right Click Context menu and set state.

Parameters:point – The position of the mouse so the correct item can be found.
edit_projector_from_wizard(projector)[source]

Update projector from the wizard edit page

Parameters:projector – Projector() instance of projector with updated information
get_projector_list()[source]

Return the list of active projectors

Returns:list
get_settings()[source]

Retrieve the saved settings

get_toolbar_item(name, enabled=False, hidden=False)[source]
no_authentication_error(name)[source]

Display warning dialog when pin saved for item but projector does not require pin.

Parameters:name – Name from QListWidgetItem
on_add_projector(opt=None)[source]

Calls edit dialog to add a new projector to the database

Parameters:opt – Needed by PyQt5
on_blank_projector(opt=None)[source]

Calls projector thread to send blank screen command

Parameters:opt – Needed by PyQt5
on_connect_projector(opt=None)[source]

Calls projector thread to connect to projector

Parameters:opt – Needed by PyQt5
on_delete_projector(opt=None)[source]

Deletes a projector from the list and the database

Parameters:opt – Needed by PyQt5
on_disconnect_projector(opt=None)[source]

Calls projector thread to disconnect from projector

Parameters:opt – Needed by PyQt5
on_doubleclick_item(item, opt=None)[source]

When item is doubleclicked, will connect to projector.

Parameters:
  • item – List widget item for connection.
  • opt – Needed by PyQt5
on_edit_input(opt=None)[source]
on_edit_projector(opt=None)[source]

Calls edit dialog with selected projector to edit information

Parameters:opt – Needed by PyQt5
on_poweroff_projector(opt=None)[source]

Calls projector link to send Power Off command

Parameters:opt – Needed by PyQt5
on_poweron_projector(opt=None)[source]

Calls projector link to send Power On command

Parameters:opt – Needed by PyQt5
on_select_input(opt=None, edit=False)[source]

Builds menu for ‘Select Input’ option, then calls the selected projector item to change input source.

Parameters:opt – Needed by PyQt5
on_show_projector(opt=None)[source]

Calls projector thread to send open shutter command

Parameters:opt – Needed by PyQt5
on_status_projector(opt=None)[source]

Builds message box with projector status information

Parameters:opt – Needed by PyQt5
update_icons()[source]

Update the icons when the selected projectors change

update_status(ip, status=None, msg=None)[source]

Update the status information/icon for selected list item

Parameters:
  • ip – IP address of projector
  • status – Optional status code
  • msg – Optional status message
class openlp.core.ui.ProjectorTab(parent)[source]

Bases: openlp.core.lib.settingstab.SettingsTab

Openlp Settings -> Projector settings

load()[source]

Load the projector settings on startup

on_dialog_type_combo_box_changed()[source]
retranslateUi()[source]

Translate the UI on the fly

save()[source]

Save the projector settings

setupUi()[source]

Setup the UI

class openlp.core.ui.ProjectorEditForm(parent=None, projectordb=None)[source]

Bases: PyQt5.QtWidgets.QDialog, openlp.core.ui.projector.editform.Ui_ProjectorEditForm

Class to add or edit a projector entry in the database.

Fields that are editable:
ip = Column(String(100)) port = Column(String(8)) pin = Column(String(20)) name = Column(String(20)) location = Column(String(30)) notes = Column(String(200))
accept_me()[source]

Validate input before accepting input.

cancel_me()[source]

Cancel button clicked - just close.

editProjector
exec(projector=None)[source]
help_me()[source]

Show a help message about the input fields.

newProjector