← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/songmaintenance into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/songmaintenance into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


- Fixed a problem where authors with null names in the db were not editable.
- Fixed the add author shortcut on the edit song form to split up the author's name so that the above error doesn't occur.
- Made the Clear Search button run a blank search (which is what the user expects).
-- 
https://code.launchpad.net/~raoul-snyman/openlp/songmaintenance/+merge/27972
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/songmaintenance into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2010-06-18 19:55:45 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2010-06-18 22:13:26 +0000
@@ -294,7 +294,8 @@
                     '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))

=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
--- openlp/plugins/songs/forms/songmaintenanceform.py	2010-06-08 15:38:09 +0000
+++ openlp/plugins/songs/forms/songmaintenanceform.py	2010-06-18 22:13:26 +0000
@@ -172,6 +172,13 @@
         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)

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2010-06-16 01:23:57 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2010-06-18 22:13:26 +0000
@@ -218,6 +218,7 @@
         Clear the search text.
         """
         self.SearchTextEdit.clear()
+        self.onSearchTextButtonClick()
 
     def onSearchTextEditChanged(self, text):
         """


Follow ups