servicemanager

The service manager sets up, loads, saves and manages services.

class openlp.core.ui.servicemanager.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.servicemanager.ServiceManagerList(service_manager, parent=None)[source]

Bases: PyQt5.QtWidgets.QTreeWidget

Set up key bindings and mouse behaviour for the service list

keyPressEvent(event)[source]

Capture Key press and respond accordingly. :param event:

mouseMoveEvent(event)[source]

Drag and drop event does not care what data is selected as the recipient will use events to request the data move just tell it what plugin to call :param event:

class openlp.core.ui.servicemanager.Ui_ServiceManager[source]

Bases: object

UI part of the Service Manager

setup_ui(widget)[source]

Define the UI :param widget:

openlp.core.ui.servicemanager.get_parent_item_data(item)[source]

Finds and returns the parent item for any item

Parameters:item – The service item list item to be checked.