From b65e592df9a1165ae23460026234513f1ad35761 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 21 Feb 2015 11:59:37 +0200 Subject: [PATCH] Bug #1412216: Detect when a song has a problem, show a message to the user, and flip back to the previous screen. --- openlp/plugins/songs/forms/songselectform.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openlp/plugins/songs/forms/songselectform.py b/openlp/plugins/songs/forms/songselectform.py index c208988f7..8482bee6b 100755 --- a/openlp/plugins/songs/forms/songselectform.py +++ b/openlp/plugins/songs/forms/songselectform.py @@ -187,6 +187,14 @@ class SongSelectForm(QtGui.QDialog, Ui_SongSelectDialog): self.application.process_events() # Get the full song song = self.song_select_importer.get_song(song, self._update_song_progress) + if not song: + QtGui.QMessageBox.critical( + self, translate('SongsPlugin.SongSelectForm', 'Incomplete song'), + translate('SongsPlugin.SongSelectForm', 'This song is missing some information, like the lyrics, ' + 'and cannot be imported.'), + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.OK) + self.stacked_widget.setCurrentIndex(1) + return # Update the UI self.title_edit.setText(song['title']) self.copyright_edit.setText(song['copyright'])