fixed ticket 502

This commit is contained in:
Andreas Preikschat 2012-05-26 21:56:12 +02:00
parent b909d27b3b
commit cf59d89afa
2 changed files with 14 additions and 4 deletions

View File

@ -707,7 +707,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
text = unicode(self.songBookComboBox.currentText()) text = unicode(self.songBookComboBox.currentText())
if item == 0 and text: if item == 0 and text:
temp_song_book = text temp_song_book = text
self.mediaitem.songMaintenanceForm.exec_() self.mediaitem.songMaintenanceForm.exec_(True)
self.loadAuthors() self.loadAuthors()
self.loadBooks() self.loadBooks()
self.loadTopics() self.loadTopics()

View File

@ -87,7 +87,15 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
QtCore.SIGNAL(u'currentRowChanged(int)'), QtCore.SIGNAL(u'currentRowChanged(int)'),
self.onBooksListRowChanged) 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.typeListWidget.setCurrentRow(0)
self.resetAuthors() self.resetAuthors()
self.resetTopics() self.resetTopics()
@ -275,6 +283,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if self.checkAuthor(author, True): if self.checkAuthor(author, True):
if self.manager.save_object(author): if self.manager.save_object(author):
self.resetAuthors() self.resetAuthors()
if not self.from_song_edit:
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')
else: else:
critical_error_message_box( critical_error_message_box(
@ -373,6 +382,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
Receiver.send_message(u'cursor_busy') Receiver.send_message(u'cursor_busy')
merge(dbObject) merge(dbObject)
reset() reset()
if not self.from_song_edit:
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')
Receiver.send_message(u'cursor_normal') Receiver.send_message(u'cursor_normal')