Song editing cleaned up

This commit is contained in:
Tim Bentley 2010-06-05 16:46:14 +01:00
parent 61b4850941
commit 7bf8e71acf
2 changed files with 17 additions and 26 deletions

View File

@ -469,27 +469,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.SongTabWidget.setCurrentIndex(1)
self.AuthorsListView.setFocus()
#split the verse list by space and mark lower case for testing
taglist = unicode(self.trUtf8(' bitped'))
taglist = unicode(self.trUtf8(' bitpedvc'))
for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '):
if len(verse) > 1:
if (verse[0:1] == u'%s' % self.trUtf8('v') or
verse[0:1] == u'%s' % self.trUtf8('c')) \
if taglist.find(verse[0:1]) > -1 \
and verse[1:].isdigit():
pass
else:
self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus()
return False, \
self.trUtf8('Invalid verse entry - Vx or Cx')
else:
if taglist.find(verse) > -1:
pass
else:
self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus()
return False, \
self.trUtf8(\
'Invalid verse entry, values must be I,B,T,P,E,O,Vx,Cx')
'Invalid verse entry, values must be I,B,T,P,E,O,V,C followed by a number')
return True, u''
def onTitleEditItemLostFocus(self):

View File

@ -335,20 +335,20 @@ class SongMediaItem(MediaManagerItem):
break
for verse in verseList:
if verse[1]:
if verse[0][u'type'] == "Verse" \
or verse[0][u'type'] == "Chorus":
if verse[0][u'label'] == order[1:] and \
verse[0][u'type'][0] == order[0]:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\
(verse[1][:30], verse[1], verseTag)
else:
if verse[0][u'type'][0] == order[0]:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\
(verse[1][:30], verse[1], verseTag)
# if verse[0][u'type'] == "Verse" \
# or verse[0][u'type'] == "Chorus":
if verse[0][u'label'] == order[1:] and \
verse[0][u'type'][0] == order[0]:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\
(verse[1][:30], verse[1], verseTag)
# else:
# if verse[0][u'type'][0] == order[0]:
# verseTag = u'%s:%s' % \
# (verse[0][u'type'], verse[0][u'label'])
# service_item.add_from_text\
# (verse[1][:30], verse[1], verseTag)
else:
verses = song.lyrics.split(u'\n\n')
for slide in verses: