Renderer replacement- text now output and pages

This commit is contained in:
Tim Bentley 2010-07-11 17:02:20 +01:00
parent 3d9fca212f
commit 19400843d4
4 changed files with 10 additions and 16 deletions

View File

@ -181,7 +181,7 @@ class ServiceItem(object):
else: else:
frame = self.render_manager.generate_slide(raw_html, u'') frame = self.render_manager.generate_slide(raw_html, u'')
self.cache[row] = frame self.cache[row] = frame
return frame return frame, raw_html[0]
def add_from_image(self, path, title, image): def add_from_image(self, path, title, image):
""" """

View File

@ -251,7 +251,7 @@ class WebViewer(DisplayWidget):
self.currslide = not self.currslide self.currslide = not self.currslide
def text(self, slide): def text(self, slide):
self.frame.findFirstElement('div#lyrics').setInnerXml(self.slides(slide)) self.frame.findFirstElement('div#lyrics').setInnerXml(slide)
def alert(self): def alert(self):
self.frame.findFirstElement('div#alert').setInnerXml(self.alerttext) self.frame.findFirstElement('div#alert').setInnerXml(self.alerttext)

View File

@ -769,24 +769,18 @@ class SlideController(QtGui.QWidget):
self.updatePreview() self.updatePreview()
else: else:
before = time.time() before = time.time()
frame = self.serviceItem.get_rendered_frame(row) frame, raw_html = self.serviceItem.get_rendered_frame(row)
if isinstance(frame, QtGui.QImage): if isinstance(frame, QtGui.QImage):
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
else: else:
if isinstance(frame[u'main'], basestring): self.SlidePreview.setPixmap(QtGui.QPixmap(frame))
self.SlidePreview.setPixmap(
QtGui.QPixmap(frame[u'main']))
else:
self.SlidePreview.setPixmap(
QtGui.QPixmap.fromImage(frame[u'main']))
log.log( log.log(
15, u'Slide Rendering took %4s' % (time.time() - before)) 15, u'Slide Rendering took %4s' % (time.time() - before))
if self.isLive: if self.isLive:
if self.serviceItem.is_text(): if self.serviceItem.is_text():
pass self.mainDisplay.text(raw_html)
#self.mainDisplay.frameView(frame, True)
else: else:
self.displayManager.displayImage(frame[u'main']) self.displayManager.displayImage(frame)
self.selectedRow = row self.selectedRow = row
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix, Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
row) row)

View File

@ -521,16 +521,16 @@ class BibleMediaItem(MediaManagerItem):
permission = self._decodeQtObject(reference, 'permission') permission = self._decodeQtObject(reference, 'permission')
if self.parent.settings_tab.display_style == 1: if self.parent.settings_tab.display_style == 1:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'(u', u')') u'<sup>(u', u')</sup>')
elif self.parent.settings_tab.display_style == 2: elif self.parent.settings_tab.display_style == 2:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'{', u'}') u'<sup>{', u'}</sup>')
elif self.parent.settings_tab.display_style == 3: elif self.parent.settings_tab.display_style == 3:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'[', u']') u'<sup>[', u']</sup>')
else: else:
verse_text = self.formatVerse(old_chapter, chapter, verse, verse_text = self.formatVerse(old_chapter, chapter, verse,
u'', u'') u'<sup>', u'</sup>')
old_chapter = chapter old_chapter = chapter
footer = u'%s (%s %s)' % (book, version, copyright) footer = u'%s (%s %s)' % (book, version, copyright)
#If not found add to footer #If not found add to footer