Fix bug #1423699 so that you're not logged out when you want to import more songs.

Fixes: https://launchpad.net/bugs/1423699
This commit is contained in:
Raoul Snyman 2015-02-28 00:28:24 +02:00
parent b65e592df9
commit 7d7fec194e
3 changed files with 575 additions and 341 deletions

View File

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

View File

@ -192,7 +192,7 @@ class SongSelectForm(QtGui.QDialog, Ui_SongSelectDialog):
self, translate('SongsPlugin.SongSelectForm', 'Incomplete song'), self, translate('SongsPlugin.SongSelectForm', 'Incomplete song'),
translate('SongsPlugin.SongSelectForm', 'This song is missing some information, like the lyrics, ' translate('SongsPlugin.SongSelectForm', 'This song is missing some information, like the lyrics, '
'and cannot be imported.'), 'and cannot be imported.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.OK) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok)
self.stacked_widget.setCurrentIndex(1) self.stacked_widget.setCurrentIndex(1)
return return
# Update the UI # Update the UI
@ -367,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