songimportform

The song import functions for OpenLP.

class openlp.plugins.songs.forms.songimportform.SongImportForm(parent, plugin)[source]

Bases: openlp.core.ui.lib.wizard.OpenLPWizard, openlp.core.common.registryproperties.RegistryProperties

This is the Song Import Wizard, which allows easy importing of Songs into OpenLP from other formats like OpenLyrics, OpenSong and CCLI.

add_custom_pages()[source]

Add song wizard specific pages.

add_file_select_item()[source]

Add a file selection page.

completeChanged
custom_init()[source]

Song wizard specific initialisation.

custom_page_changed(page_id)[source]

Called when changing to a page other than the progress page.

custom_signals()[source]

Song wizard specific signals.

disablable_widget(page, prefix)[source]

Disable a widget.

get_files(title, listbox, filters='')[source]

Opens a QFileDialog and writes the filenames to the given listbox.

Parameters:
  • title – The title of the dialog (str).
  • listbox – A listbox (QListWidget).
  • filters

    The file extension filters. It should contain the file descriptions as well as the file extensions. For example:

    'SongBeamer Files (*.sng)'
    
get_list_of_files(list_box)[source]

Return a list of file from the list_box

Parameters:list_box – The source list box
on_add_button_clicked()[source]

Add a file or directory.

on_browse_button_clicked()[source]

Browse for files or a directory.

on_current_index_changed(index)[source]

Called when the format combo box’s index changed.

on_error_copy_to_button_clicked()[source]

Copy the error report to the clipboard.

on_error_save_to_button_clicked()[source]

Save the error report to a file.

on_filepath_edit_text_changed()[source]

Called when the content of the Filename/Folder edit box changes.

on_remove_button_clicked()[source]

Remove a file from the list.

perform_wizard()[source]

Perform the actual import. This method pulls in the correct importer class, and then runs the do_import method of the importer to do the actual importing.

pre_wizard()[source]

Perform pre import tasks

remove_selected_items(list_box)[source]

Remove selected list_box items

Parameters:list_box – the source list box
retranslateUi()[source]

Song wizard localisation.

set_defaults()[source]

Set default form values for the song import wizard.

setupUi(image)[source]

Set up the song wizard UI.

validateCurrentPage()[source]

Re-implement the validateCurrentPage() method. Validate the current page before moving on to the next page. Provide each song format class with a chance to validate its input by overriding is_valid_source().

class openlp.plugins.songs.forms.songimportform.SongImportSourcePage[source]

Bases: PyQt5.QtWidgets.QWizardPage

Subclass of QtGui.QWizardPage to override isComplete() for Source Page.

isComplete()[source]

Return True if:

  • an available format is selected, and
  • if MultipleFiles mode, at least one file is selected
  • or if SingleFile mode, the specified file exists
  • or if SingleFolder mode, the specified folder exists

When this method returns True, the wizard’s Next button is enabled.