forked from openlp/openlp
- improved usage of different bibles and/or books in one service item
This commit is contained in:
parent
30e867e020
commit
1b1261a1a4
@ -471,6 +471,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
items = self.listView.selectedIndexes()
|
||||
if len(items) == 0:
|
||||
return False
|
||||
first = True
|
||||
bible_text = u''
|
||||
old_chapter = u''
|
||||
raw_footer = []
|
||||
@ -502,7 +503,6 @@ class BibleMediaItem(MediaManagerItem):
|
||||
# 'dual_permission')
|
||||
dual_text = self._decodeQtObject(reference, 'dual_text')
|
||||
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
||||
old_chapter = chapter
|
||||
# footer
|
||||
footer = u'%s (%s %s)' % (book, version, copyright)
|
||||
if footer not in raw_footer:
|
||||
@ -512,11 +512,11 @@ class BibleMediaItem(MediaManagerItem):
|
||||
if footer not in raw_footer:
|
||||
raw_footer.append(footer)
|
||||
# If we were previously 'Verse Per Line' we have to add the old
|
||||
# bible_text first, because it was not added till now.
|
||||
# bible_text, because it was not added until now.
|
||||
if bible_text:
|
||||
raw_slides.append(bible_text)
|
||||
bible_text = u''
|
||||
bible_text = u'%s %s \n\n %s %s' % (verse_text, text,
|
||||
bible_text = u'%s %s\n\n%s %s' % (verse_text, text,
|
||||
verse_text, dual_text)
|
||||
raw_slides.append(bible_text)
|
||||
bible_text = u''
|
||||
@ -527,34 +527,23 @@ class BibleMediaItem(MediaManagerItem):
|
||||
bible_text = u''
|
||||
# If we are 'Verse Per Line' then force a new line.
|
||||
elif self.parent.settings_tab.layout_style == 1:
|
||||
bible_text = u'%s %s %s \n\n' % (bible_text, verse_text, text)
|
||||
bible_text = u'%s %s %s\n\n' % (bible_text, verse_text, text)
|
||||
# We have to be 'Continuous'.
|
||||
elif item.row() < len(items) - 1:
|
||||
#bitem = self.listView.item(item.row() + 1)
|
||||
bitem = items[item.row() + 1]
|
||||
reference = bitem.data(QtCore.Qt.UserRole)
|
||||
if isinstance(reference, QtCore.QVariant):
|
||||
reference = reference.toPyObject()
|
||||
#todo replace 'new' by 'next'
|
||||
next_bible = self._decodeQtObject(reference, 'bible')
|
||||
next_dual_bible = self._decodeQtObject(reference, 'dual_bible')
|
||||
next_verse = self._decodeQtObject(reference, 'verse')
|
||||
next_chapter = self._decodeQtObject(reference, 'chapter')
|
||||
next_book = self._decodeQtObject(reference, 'book')
|
||||
# If the next verse is a dual one, then we append 'bible_text'.
|
||||
if next_dual_bible:
|
||||
else:
|
||||
# We add a line break if the previously verse has a different
|
||||
# book or bible version.
|
||||
if first:
|
||||
bible_text = u'%s %s %s' % (bible_text, verse_text, text)
|
||||
raw_slides.append(bible_text)
|
||||
bible_text = u''
|
||||
# We add a line break if the next verse is not part of a series
|
||||
# of verses, has a different book, bible or so on.
|
||||
elif bible != next_bible or book != next_book or \
|
||||
int(verse) + 1 != int(next_verse) or \
|
||||
int(chapter) != int(next_chapter):
|
||||
bible_text = u'%s %s %s \n\n' % (bible_text, verse_text,
|
||||
elif bible != old_bible or book != old_book:
|
||||
bible_text = u'%s\n\n%s %s' % (bible_text, verse_text,
|
||||
text)
|
||||
else:
|
||||
bible_text = u'%s %s %s' % (bible_text, verse_text, text)
|
||||
if first:
|
||||
first = False
|
||||
old_chapter = chapter
|
||||
old_book = book
|
||||
old_bible = bible
|
||||
# If there are no more items we check whether we have to add bible_text.
|
||||
if bible_text:
|
||||
raw_slides.append(bible_text)
|
||||
|
Loading…
Reference in New Issue
Block a user