forked from openlp/openlp
Song taagging into Slide Controller
This commit is contained in:
parent
1c60a29d68
commit
d0a49ba3a1
@ -104,7 +104,8 @@ class ServiceItem(object):
|
||||
for line in format:
|
||||
lines += line + u'\n'
|
||||
title = lines.split(u'\n')[0]
|
||||
self._display_frames.append({u'title': title, u'text': lines})
|
||||
self._display_frames.append({u'title': title, \
|
||||
u'text': lines, u'verseTag': slide[u'verseTag'] })
|
||||
log.log(15, u'Formatting took %4s' % (time.time() - before))
|
||||
elif self.service_item_type == ServiceItemType.Image:
|
||||
for slide in self._raw_frames:
|
||||
@ -147,7 +148,7 @@ class ServiceItem(object):
|
||||
self._raw_frames.append(
|
||||
{u'title': title, u'image': image})
|
||||
|
||||
def add_from_text(self, title, raw_slide):
|
||||
def add_from_text(self, title, raw_slide, verseTag=None):
|
||||
"""
|
||||
Add a text slide to the service item.
|
||||
|
||||
@ -160,7 +161,7 @@ class ServiceItem(object):
|
||||
self.service_item_type = ServiceItemType.Text
|
||||
title = title.split(u'\n')[0]
|
||||
self._raw_frames.append(
|
||||
{u'title': title, u'raw_slide': raw_slide})
|
||||
{u'title': title, u'raw_slide': raw_slide, u'verseTag':verseTag})
|
||||
|
||||
def add_from_command(self, path, file_name, image):
|
||||
"""
|
||||
|
@ -198,7 +198,7 @@ class MainDisplay(DisplayWidget):
|
||||
elif not self.displayBlank:
|
||||
if transition:
|
||||
if self.hasTransition:
|
||||
delay = 0.1
|
||||
delay = 0.01
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'trans']))
|
||||
self.repaint()
|
||||
time.sleep(delay)
|
||||
|
@ -456,6 +456,8 @@ class SlideController(QtGui.QWidget):
|
||||
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
||||
slide_height = width * self.parent.RenderManager.screen_ratio
|
||||
else:
|
||||
variant = u'%s:%s' % (verse[0][u'type'], verse[0][u'label'])
|
||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(frame[u'text']))
|
||||
item.setText(frame[u'text'])
|
||||
self.PreviewListWidget.setItem(framenumber, 0, item)
|
||||
if slide_height != 0:
|
||||
|
@ -295,7 +295,8 @@ class SongMediaItem(MediaManagerItem):
|
||||
verseList = songXML.get_verses()
|
||||
for verse in verseList:
|
||||
if verse[1]:
|
||||
service_item.add_from_text(verse[1][:30], verse[1])
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user