forked from openlp/openlp
- fix a bug, which occurs when viewing (preview/live) a song without/with incomplete footer.
- clean up bzr-revno: 1353
This commit is contained in:
commit
4b5a1fe5ce
@ -88,8 +88,8 @@ class ServiceItem(object):
|
|||||||
self.audit = u''
|
self.audit = u''
|
||||||
self.items = []
|
self.items = []
|
||||||
self.iconic_representation = None
|
self.iconic_representation = None
|
||||||
self.raw_footer = None
|
self.raw_footer = []
|
||||||
self.foot_text = None
|
self.foot_text = u''
|
||||||
self.theme = None
|
self.theme = None
|
||||||
self.service_item_type = None
|
self.service_item_type = None
|
||||||
self._raw_frames = []
|
self._raw_frames = []
|
||||||
@ -183,9 +183,8 @@ class ServiceItem(object):
|
|||||||
else:
|
else:
|
||||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||||
self.title = clean_tags(self.title)
|
self.title = clean_tags(self.title)
|
||||||
self.foot_text = None
|
self.foot_text = \
|
||||||
if self.raw_footer:
|
u'<br>'.join([footer for footer in self.raw_footer if footer])
|
||||||
self.foot_text = u'<br>'.join(self.raw_footer)
|
|
||||||
|
|
||||||
def add_from_image(self, path, title):
|
def add_from_image(self, path, title):
|
||||||
"""
|
"""
|
||||||
|
@ -636,7 +636,6 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
bible_text = u''
|
bible_text = u''
|
||||||
old_item = None
|
old_item = None
|
||||||
old_chapter = -1
|
old_chapter = -1
|
||||||
raw_footer = []
|
|
||||||
raw_slides = []
|
raw_slides = []
|
||||||
raw_title = []
|
raw_title = []
|
||||||
for item in items:
|
for item in items:
|
||||||
@ -657,13 +656,13 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
second_text = self._decodeQtObject(bitem, 'second_text')
|
second_text = self._decodeQtObject(bitem, 'second_text')
|
||||||
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
||||||
footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
|
footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
|
||||||
if footer not in raw_footer:
|
if footer not in service_item.raw_footer:
|
||||||
raw_footer.append(footer)
|
service_item.raw_footer.append(footer)
|
||||||
if second_bible:
|
if second_bible:
|
||||||
footer = u'%s (%s %s %s)' % (book, second_version,
|
footer = u'%s (%s %s %s)' % (book, second_version,
|
||||||
second_copyright, second_permissions)
|
second_copyright, second_permissions)
|
||||||
if footer not in raw_footer:
|
if footer not in service_item.raw_footer:
|
||||||
raw_footer.append(footer)
|
service_item.raw_footer.append(footer)
|
||||||
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, second_text)
|
verse_text, second_text)
|
||||||
raw_slides.append(bible_text.rstrip())
|
raw_slides.append(bible_text.rstrip())
|
||||||
@ -707,11 +706,6 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
service_item.theme = self.settings.bible_theme
|
service_item.theme = self.settings.bible_theme
|
||||||
for slide in raw_slides:
|
for slide in raw_slides:
|
||||||
service_item.add_from_text(slide[:30], slide)
|
service_item.add_from_text(slide[:30], slide)
|
||||||
if service_item.raw_footer:
|
|
||||||
for footer in raw_footer:
|
|
||||||
service_item.raw_footer.append(footer)
|
|
||||||
else:
|
|
||||||
service_item.raw_footer = raw_footer
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def formatTitle(self, start_item, old_item):
|
def formatTitle(self, start_item, old_item):
|
||||||
|
@ -330,7 +330,6 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def generateSlideData(self, service_item, item=None, xmlVersion=False):
|
def generateSlideData(self, service_item, item=None, xmlVersion=False):
|
||||||
log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
|
log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
|
||||||
raw_footer = []
|
|
||||||
item_id = self._getIdOfItemToGenerate(item, self.remoteSong)
|
item_id = self._getIdOfItemToGenerate(item, self.remoteSong)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsEdit)
|
service_item.add_capability(ItemCapabilities.AllowsEdit)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
||||||
@ -392,16 +391,15 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
service_item.add_from_text(slide[:30], unicode(slide))
|
service_item.add_from_text(slide[:30], unicode(slide))
|
||||||
service_item.title = song.title
|
service_item.title = song.title
|
||||||
author_list = [unicode(author.display_name) for author in song.authors]
|
author_list = [unicode(author.display_name) for author in song.authors]
|
||||||
raw_footer.append(song.title)
|
service_item.raw_footer.append(song.title)
|
||||||
raw_footer.append(u', '.join(author_list))
|
service_item.raw_footer.append(u', '.join(author_list))
|
||||||
raw_footer.append(song.copyright)
|
service_item.raw_footer.append(song.copyright)
|
||||||
if QtCore.QSettings().value(u'general/ccli number',
|
if QtCore.QSettings().value(u'general/ccli number',
|
||||||
QtCore.QVariant(u'')).toString():
|
QtCore.QVariant(u'')).toString():
|
||||||
raw_footer.append(unicode(
|
service_item.raw_footer.append(unicode(
|
||||||
translate('SongsPlugin.MediaItem', 'CCLI License: ') +
|
translate('SongsPlugin.MediaItem', 'CCLI License: ') +
|
||||||
QtCore.QSettings().value(u'general/ccli number',
|
QtCore.QSettings().value(u'general/ccli number',
|
||||||
QtCore.QVariant(u'')).toString()))
|
QtCore.QVariant(u'')).toString()))
|
||||||
service_item.raw_footer = raw_footer
|
|
||||||
service_item.audit = [
|
service_item.audit = [
|
||||||
song.title, author_list, song.copyright, unicode(song.ccli_number)
|
song.title, author_list, song.copyright, unicode(song.ccli_number)
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user