Some CCLI import fixes, a quitting dialog in one case, and empty lyrics in another.

Fix bug #1412216 where a song from CCLI without lyrics would cause a traceback - now just tell the user.
Fix bug #1423699 so that you're not logged out when you want to import more songs.

bzr-revno: 2515
This commit is contained in:
Raoul Snyman 2015-02-28 06:47:35 +00:00 committed by Tim Bentley
commit 3131c3f7c8
4 changed files with 582 additions and 339 deletions

View File

@ -40,3 +40,5 @@ __pycache__
# Rejected diff's
*.rej
*.~\?~
.coverage
cover

View File

@ -70,7 +70,7 @@ class AlertsManager(OpenLPMixin, RegistryMixin, QtCore.QObject, RegistryProperti
"""
Format and request the Alert and start the timer.
"""
if not self.alert_list or (self.live_controller.display.screens.display_count == 1
if not self.alert_list or (self.live_controller.display.screens.display_count == 1
and not Settings().value('core/display on monitor')):
return
text = self.alert_list.pop(0)

View File

@ -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'])
@ -359,15 +367,11 @@ class SongSelectForm(QtGui.QDialog, Ui_SongSelectDialog):
Import a song from SongSelect.
"""
self.song_select_importer.save_song(self.song)
question_dialog = QtGui.QMessageBox()
question_dialog.setWindowTitle(translate('SongsPlugin.SongSelectForm', 'Song Imported'))
question_dialog.setText(translate('SongsPlugin.SongSelectForm', 'Your song has been imported, would you like '
'to exit now, or import more songs?'))
question_dialog.addButton(QtGui.QPushButton(translate('SongsPlugin.SongSelectForm', 'Import More Songs')),
QtGui.QMessageBox.YesRole)
question_dialog.addButton(QtGui.QPushButton(translate('SongsPlugin.SongSelectForm', 'Exit Now')),
QtGui.QMessageBox.NoRole)
if question_dialog.exec_() == QtGui.QMessageBox.Yes:
if QtGui.QMessageBox.question(self, translate('SongsPlugin.SongSelectForm', 'Song Imported'),
translate('SongsPlugin.SongSelectForm', 'Your song has been imported, would you '
'like to import more songs?'),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
self.on_back_button_clicked()
else:
self.application.process_events()

File diff suppressed because it is too large Load Diff