forked from openlp/openlp
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:
commit
3131c3f7c8
@ -40,3 +40,5 @@ __pycache__
|
|||||||
# Rejected diff's
|
# Rejected diff's
|
||||||
*.rej
|
*.rej
|
||||||
*.~\?~
|
*.~\?~
|
||||||
|
.coverage
|
||||||
|
cover
|
||||||
|
@ -187,6 +187,14 @@ class SongSelectForm(QtGui.QDialog, Ui_SongSelectDialog):
|
|||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
# Get the full song
|
# Get the full song
|
||||||
song = self.song_select_importer.get_song(song, self._update_song_progress)
|
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
|
# Update the UI
|
||||||
self.title_edit.setText(song['title'])
|
self.title_edit.setText(song['title'])
|
||||||
self.copyright_edit.setText(song['copyright'])
|
self.copyright_edit.setText(song['copyright'])
|
||||||
@ -359,15 +367,11 @@ class SongSelectForm(QtGui.QDialog, Ui_SongSelectDialog):
|
|||||||
Import a song from SongSelect.
|
Import a song from SongSelect.
|
||||||
"""
|
"""
|
||||||
self.song_select_importer.save_song(self.song)
|
self.song_select_importer.save_song(self.song)
|
||||||
question_dialog = QtGui.QMessageBox()
|
if QtGui.QMessageBox.question(self, translate('SongsPlugin.SongSelectForm', 'Song Imported'),
|
||||||
question_dialog.setWindowTitle(translate('SongsPlugin.SongSelectForm', 'Song Imported'))
|
translate('SongsPlugin.SongSelectForm', 'Your song has been imported, would you '
|
||||||
question_dialog.setText(translate('SongsPlugin.SongSelectForm', 'Your song has been imported, would you like '
|
'like to import more songs?'),
|
||||||
'to exit now, or import more songs?'))
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
||||||
question_dialog.addButton(QtGui.QPushButton(translate('SongsPlugin.SongSelectForm', 'Import More Songs')),
|
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
|
||||||
QtGui.QMessageBox.YesRole)
|
|
||||||
question_dialog.addButton(QtGui.QPushButton(translate('SongsPlugin.SongSelectForm', 'Exit Now')),
|
|
||||||
QtGui.QMessageBox.NoRole)
|
|
||||||
if question_dialog.exec_() == QtGui.QMessageBox.Yes:
|
|
||||||
self.on_back_button_clicked()
|
self.on_back_button_clicked()
|
||||||
else:
|
else:
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user