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

Proposed by Raoul Snyman
Status: Merged
Merged at revision: 855
Proposed branch: lp:~raoul-snyman/openlp/songmaintenance
Merge into: lp:openlp
Diff against target: 43 lines (+10/-1)
3 files modified
openlp/plugins/songs/forms/editsongform.py (+2/-1)
openlp/plugins/songs/forms/songmaintenanceform.py (+7/-0)
openlp/plugins/songs/lib/mediaitem.py (+1/-0)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/songmaintenance
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Jon Tibble Pending
Review via email: mp+27988@code.launchpad.net

This proposal supersedes a proposal from 2010-06-18.

Description of the change

- 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).

To post a comment you must log in.
Revision history for this message
Jon Tibble (meths) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Tim Bentley (trb143) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/songs/forms/editsongform.py'
2--- openlp/plugins/songs/forms/editsongform.py 2010-06-18 19:55:45 +0000
3+++ openlp/plugins/songs/forms/editsongform.py 2010-06-19 10:44:28 +0000
4@@ -294,7 +294,8 @@
5 'exist, do you want to add them?'),
6 QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
7 QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
8- author = Author.populate(display_name=text)
9+ author = Author.populate(first_name=text.rsplit(u' ', 1)[0],
10+ last_name=text.rsplit(u' ', 1)[1], display_name=text)
11 self.songmanager.save_author(author)
12 self.song.authors.append(author)
13 author_item = QtGui.QListWidgetItem(unicode(author.display_name))
14
15=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
16--- openlp/plugins/songs/forms/songmaintenanceform.py 2010-06-08 15:38:09 +0000
17+++ openlp/plugins/songs/forms/songmaintenanceform.py 2010-06-19 10:44:28 +0000
18@@ -172,6 +172,13 @@
19 author_id = self._getCurrentItemId(self.AuthorsListWidget)
20 if author_id != -1:
21 author = self.songmanager.get_author(author_id)
22+ # Just make sure none of the fields is None
23+ if author.first_name is None:
24+ author.first_name = u''
25+ if author.last_name is None:
26+ author.last_name = u''
27+ if author.display_name is None:
28+ author.display_name = u''
29 self.authorform.setAutoDisplayName(False)
30 self.authorform.FirstNameEdit.setText(author.first_name)
31 self.authorform.LastNameEdit.setText(author.last_name)
32
33=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
34--- openlp/plugins/songs/lib/mediaitem.py 2010-06-16 01:23:57 +0000
35+++ openlp/plugins/songs/lib/mediaitem.py 2010-06-19 10:44:28 +0000
36@@ -218,6 +218,7 @@
37 Clear the search text.
38 """
39 self.SearchTextEdit.clear()
40+ self.onSearchTextButtonClick()
41
42 def onSearchTextEditChanged(self, text):
43 """