Verse tagging verses must be in format of vX

This commit is contained in:
Tim Bentley 2009-12-04 18:52:44 +00:00
parent 1b6ad5814b
commit 547074d29a
2 changed files with 19 additions and 9 deletions

View File

@ -401,14 +401,24 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if self.AuthorsListView.count() == 0:
self.SongTabWidget.setCurrentIndex(2)
self.AuthorsListView.setFocus()
for verse in unicode(self.VerseOrderEdit.text()):
if verse.isdigit() or u' BCITPEO'.find(verse.upper()) > -1:
for verse in unicode(self.VerseOrderEdit.text()).split(u' '):
if len(verse) == 2:
if verse[0:1] == u'v' and verse[1:].isdigit():
pass
else:
self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus()
return False, \
self.trUtf8('Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O')
self.trUtf8('Invalid verse entry - vX')
else:
if u' BCITPEO'.find(verse.upper()) > -1:
pass
else:
self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus()
return False, \
self.trUtf8(\
'Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O')
return True, u''
def onTitleEditItemLostFocus(self):

View File

@ -297,11 +297,11 @@ class SongMediaItem(MediaManagerItem):
for verse in verseList:
service_item.add_from_text(verse[1][:30], unicode(verse[1]))
else:
for order in service_item.verse_order:
for order in service_item.verse_order.split(u' '):
for verse in verseList:
if verse[1]:
if verse[0][u'type'] == "Verse" and \
verse[0][u'label'][0] == order[0]:
verse[0][u'label'][0] == order[1:]:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\