From cf59d89afada4ea463c3efc067b81e30a616e920 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 26 May 2012 21:56:12 +0200 Subject: [PATCH] fixed ticket 502 --- openlp/plugins/songs/forms/editsongform.py | 2 +- .../plugins/songs/forms/songmaintenanceform.py | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 195dda729..989f0bc85 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -707,7 +707,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.songBookComboBox.currentText()) if item == 0 and text: temp_song_book = text - self.mediaitem.songMaintenanceForm.exec_() + self.mediaitem.songMaintenanceForm.exec_(True) self.loadAuthors() self.loadBooks() self.loadTopics() diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 7ba49a102..565413854 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -87,7 +87,15 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): QtCore.SIGNAL(u'currentRowChanged(int)'), self.onBooksListRowChanged) - def exec_(self): + def exec_(self, from_song_edit=False): + """ + Show the dialog. + + ``from_song_edit`` + Indicates if the maintenance dialog has been opened from song edit + or from the media manager. Defaults to **False**. + """ + self.from_song_edit = from_song_edit self.typeListWidget.setCurrentRow(0) self.resetAuthors() self.resetTopics() @@ -275,7 +283,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.checkAuthor(author, True): if self.manager.save_object(author): self.resetAuthors() - Receiver.send_message(u'songs_load_list') + if not self.from_song_edit: + Receiver.send_message(u'songs_load_list') else: critical_error_message_box( message=translate('SongsPlugin.SongMaintenanceForm', @@ -373,7 +382,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Receiver.send_message(u'cursor_busy') merge(dbObject) reset() - Receiver.send_message(u'songs_load_list') + if not self.from_song_edit: + Receiver.send_message(u'songs_load_list') Receiver.send_message(u'cursor_normal') def mergeAuthors(self, old_author):