duplicatesongremovalform

The duplicate song removal logic for OpenLP.

class openlp.plugins.songs.forms.duplicatesongremovalform.DuplicateSongRemovalForm(plugin)[source]

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

This is the Duplicate Song Removal Wizard. It provides functionality to search for and remove duplicate songs in the database.

add_custom_pages()[source]

Add song wizard specific pages.

add_duplicates_to_song_list(search_song, duplicate_song)[source]

Inserts a song duplicate (two similar songs) to the duplicate song list. If one of the two songs is already part of the duplicate song list, don’t add another duplicate group but add the other song to that group. Returns True if at least one of the songs was added, False if both were already member of a group.

Parameters:
  • search_song – The song we searched the duplicate for.
  • duplicate_song – The duplicate song.
custom_page_changed(page_id)[source]

Called when changing the wizard page.

Parameters:page_id – ID of the page the wizard changed to.
custom_signals()[source]

Song wizard specific signals.

notify_no_duplicates()[source]

Notifies the user, that there were no duplicates found in the database.

on_wizard_exit()[source]

Once the wizard is finished, refresh the song list, since we potentially removed songs from it.

proceed_to_next_review()[source]

Removes the previous review UI elements and calls process_current_duplicate_entry.

process_current_duplicate_entry()[source]

Update the review counter in the wizard header, add song widgets for the current duplicate group to review, if it’s the last duplicate song group, hide the “next” button and show the “finish” button.

remove_button_clicked(song_review_widget)[source]

Removes a song from the database, removes the GUI element representing the song on the review page, and disable the remove button if only one duplicate is left.

Parameters:song_review_widget – The SongReviewWidget whose song we should delete.
retranslateUi()[source]

Song wizard localisation.

set_defaults()[source]

Set default form values for the song import wizard.

update_review_counter_text()[source]

Set the wizard review page header text.

validateCurrentPage()[source]

Controls whether we should switch to the next wizard page. This method loops on the review page as long as there are more song duplicates to review.

openlp.plugins.songs.forms.duplicatesongremovalform.song_generator(songs)[source]

This is a generator function to return tuples of tuple with two songs and their position in the song array. When completed then all songs have once been returned combined with any other songs.

Parameters:songs – All songs in the database.