This commit is contained in:
Tim Bentley 2010-06-19 21:29:24 +01:00
commit cc8b7605e2
3 changed files with 10 additions and 1 deletions

View File

@ -294,7 +294,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
'exist, do you want to add them?'),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
author = Author.populate(display_name=text)
author = Author.populate(first_name=text.rsplit(u' ', 1)[0],
last_name=text.rsplit(u' ', 1)[1], display_name=text)
self.songmanager.save_author(author)
self.song.authors.append(author)
author_item = QtGui.QListWidgetItem(unicode(author.display_name))

View File

@ -172,6 +172,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
author_id = self._getCurrentItemId(self.AuthorsListWidget)
if author_id != -1:
author = self.songmanager.get_author(author_id)
# Just make sure none of the fields is None
if author.first_name is None:
author.first_name = u''
if author.last_name is None:
author.last_name = u''
if author.display_name is None:
author.display_name = u''
self.authorform.setAutoDisplayName(False)
self.authorform.FirstNameEdit.setText(author.first_name)
self.authorform.LastNameEdit.setText(author.last_name)

View File

@ -218,6 +218,7 @@ class SongMediaItem(MediaManagerItem):
Clear the search text.
"""
self.SearchTextEdit.clear()
self.onSearchTextButtonClick()
def onSearchTextEditChanged(self, text):
"""