forked from openlp/openlp
Fix song number/book save and load
bzr-revno: 1061
This commit is contained in:
commit
f7b90c5a76
@ -218,6 +218,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
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 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
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 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
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 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user