forked from openlp/openlp
Sort out multiple Chorus tags
This commit is contained in:
parent
828695ea0e
commit
18eb768f2f
@ -494,8 +494,8 @@ class SlideController(QtGui.QWidget):
|
||||
bits = frame[u'verseTag'].split(u':')
|
||||
tag = None
|
||||
#If verse handle verse number else tag only
|
||||
if bits[0] == self.trUtf8('Verse') or \
|
||||
bits[0] == self.trUtf8('Chorus'):
|
||||
if bits[0] == self.trUtf8('Verse'): #or \
|
||||
#bits[0] == self.trUtf8('Chorus'):
|
||||
tag = u'%s%s' % (bits[0][0], bits[1][0:] )
|
||||
row = bits[1][0:]
|
||||
else:
|
||||
|
@ -411,16 +411,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.SongTabWidget.setCurrentIndex(2)
|
||||
self.AuthorsListView.setFocus()
|
||||
#split the verse list by space and mark lower case for testing
|
||||
taglist = unicode(self.trUtf8(' bcitped'))
|
||||
taglist = unicode(self.trUtf8(' bitped'))
|
||||
for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '):
|
||||
if len(verse) > 1:
|
||||
if verse[0:1] == u'%s' % self.trUtf8('v') and verse[1:].isdigit():
|
||||
if (verse[0:1] == u'%s' % self.trUtf8('v') or
|
||||
verse[0:1] == u'%s' % self.trUtf8('c')) \
|
||||
and verse[1:].isdigit():
|
||||
pass
|
||||
else:
|
||||
self.SongTabWidget.setCurrentIndex(0)
|
||||
self.VerseOrderEdit.setFocus()
|
||||
return False, \
|
||||
self.trUtf8('Invalid verse entry - vX')
|
||||
self.trUtf8('Invalid verse entry - vX or cX')
|
||||
else:
|
||||
if taglist.find(verse) > -1:
|
||||
pass
|
||||
@ -429,7 +431,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.VerseOrderEdit.setFocus()
|
||||
return False, \
|
||||
self.trUtf8(\
|
||||
'Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O')
|
||||
'Invalid verse entry - values must be Numeric, I,B,T,P,E,O')
|
||||
return True, u''
|
||||
|
||||
def onTitleEditItemLostFocus(self):
|
||||
|
@ -59,46 +59,43 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
|
||||
def onAddIntro(self):
|
||||
self.startNewLine()
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:1]---\n'
|
||||
% self.trUtf8('Intro'))
|
||||
self.VerseTextEdit.insertPlainText(u'---[Intro:1]---\n')
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def onAddEnding(self):
|
||||
self.startNewLine()
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:1]---\n'
|
||||
% self.trUtf8('Ending'))
|
||||
self.VerseTextEdit.insertPlainText(u'---[Ending:1]---\n')
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def onAddOther(self):
|
||||
self.startNewLine()
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:1]---\n'
|
||||
% self.trUtf8('Other'))
|
||||
self.VerseTextEdit.insertPlainText(u'---[Other:1]---\n')
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def onAddPreChorus(self):
|
||||
self.startNewLine()
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:1]---\n'
|
||||
% self.trUtf8('Pre-Chorus'))
|
||||
self.VerseTextEdit.insertPlainText(u'---[Pre-Chorus:1]---\n')
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def onAddBridge(self):
|
||||
self.startNewLine()
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:1]---\n'
|
||||
% self.trUtf8('Bridge'))
|
||||
self.VerseTextEdit.insertPlainText(u'---[Bridge:1]---\n')
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def onAddChorus(self):
|
||||
self.startNewLine()
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:1]---\n'
|
||||
% self.trUtf8('Chorus'))
|
||||
count = self.VerseTextEdit.toPlainText().\
|
||||
count(u'---[Chorus')
|
||||
self.VerseTextEdit.insertPlainText(u'---[Chorus:%s]---\n'
|
||||
% unicode(count + 1))
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def onAddVerse(self):
|
||||
self.startNewLine()
|
||||
count = self.VerseTextEdit.toPlainText().\
|
||||
count(u'---[%s' % self.trUtf8('Verse'))
|
||||
self.VerseTextEdit.insertPlainText(u'---[%s:%s]---\n'
|
||||
% (self.trUtf8('Verse'), count + 1))
|
||||
count(u'---[Verse')
|
||||
self.VerseTextEdit.insertPlainText(u'---[Verse:%s]---\n'
|
||||
% unicode(count + 1))
|
||||
self.VerseTextEdit.setFocus()
|
||||
|
||||
def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'):
|
||||
@ -155,7 +152,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
return text
|
||||
|
||||
def onVerseComboChanged(self, id):
|
||||
if unicode(self.VerseListComboBox.currentText()) == self.trUtf8('Verse'):
|
||||
if unicode(self.VerseListComboBox.currentText()) == self.trUtf8('Verse') or \
|
||||
unicode(self.VerseListComboBox.currentText()) == self.trUtf8('Chrous'):
|
||||
self.SubVerseListComboBox.setEnabled(True)
|
||||
else:
|
||||
self.SubVerseListComboBox.setEnabled(False)
|
||||
|
@ -312,7 +312,8 @@ class SongMediaItem(MediaManagerItem):
|
||||
if verse[1]:
|
||||
if verse[0][u'type'] == "Verse" \
|
||||
or verse[0][u'type'] == "Chorus":
|
||||
if verse[0][u'label'] == order[1:]:
|
||||
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\
|
||||
|
Loading…
Reference in New Issue
Block a user