← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/general into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/general into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  #634771 OpenLP 1.9.2+bzr1016-0ubuntu1~lucid1 does not start
  https://bugs.launchpad.net/bugs/634771
  #646718 Songbook, Number will not loaded, Title will not be saved
  https://bugs.launchpad.net/bugs/646718


Fix bug #646718 - Load/Save of song number and book against a song
-- 
https://code.launchpad.net/~j-corwin/openlp/general/+merge/36629
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/general into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2010-09-24 20:54:52 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2010-09-25 11:57:44 +0000
@@ -218,6 +218,11 @@
             self.CCLNumberEdit.setText(self.song.ccli_number)
         else:
             self.CCLNumberEdit.setText(u'')
+        if self.song.song_number:
+            self.songBookNumberEdit.setText(self.song.song_number)
+        else:
+            self.songBookNumberEdit.setText(u'')
+
         # lazy xml migration for now
         self.VerseListWidget.clear()
         self.VerseListWidget.setRowCount(0)
@@ -604,7 +609,7 @@
             self.song = Song()
         item = int(self.SongbookCombo.currentIndex())
         text = unicode(self.SongbookCombo.currentText())
-        if item == 0 and text:
+        if self.SongbookCombo.findText(text, QtCore.Qt.MatchExactly) < 0:
             if QtGui.QMessageBox.question(self,
                 translate('SongsPlugin.EditSongForm', 'Add Book'),
                 translate('SongsPlugin.EditSongForm', 'This song book does '
@@ -613,7 +618,6 @@
                 QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
                 book = Book.populate(name=text, publisher=u'')
                 self.songmanager.save_object(book)
-                self.song.book = book
             else:
                 return
         if self.saveSong():
@@ -634,6 +638,12 @@
         self.song.verse_order = unicode(self.VerseOrderEdit.text())
         self.song.ccli_number = unicode(self.CCLNumberEdit.text())
         self.song.song_number = unicode(self.songBookNumberEdit.text())
+        book_name = unicode(self.SongbookCombo.currentText())
+        if book_name:
+            self.song.book = self.songmanager.get_object_filtered(Book,
+                Book.name == book_name)
+        else:
+            self.song.book = None
         if self._validate_song():
             self.processLyrics()
             self.processTitle()


Follow ups