forked from openlp/openlp
tweaks
This commit is contained in:
parent
2ad441e883
commit
2837c36553
@ -56,8 +56,6 @@ class Renderer(object):
|
|||||||
self.bg_frame = None
|
self.bg_frame = None
|
||||||
self.bg_image = None
|
self.bg_image = None
|
||||||
self.bg_image_bytes = None
|
self.bg_image_bytes = None
|
||||||
self.web = QtWebKit.QWebView()
|
|
||||||
self.web.setVisible(False)
|
|
||||||
|
|
||||||
def set_theme(self, theme):
|
def set_theme(self, theme):
|
||||||
"""
|
"""
|
||||||
@ -95,6 +93,8 @@ class Renderer(object):
|
|||||||
if self._theme.display_shadow:
|
if self._theme.display_shadow:
|
||||||
self.page_width -= int(self._theme.display_shadow_size)
|
self.page_width -= int(self._theme.display_shadow_size)
|
||||||
self.page_height -= int(self._theme.display_shadow_size)
|
self.page_height -= int(self._theme.display_shadow_size)
|
||||||
|
self.web = QtWebKit.QWebView()
|
||||||
|
self.web.setVisible(False)
|
||||||
self.web.resize(self.page_width, self.page_height)
|
self.web.resize(self.page_width, self.page_height)
|
||||||
self.web_frame = self.web.page().mainFrame()
|
self.web_frame = self.web.page().mainFrame()
|
||||||
# Adjust width and height to account for shadow. outline done in css
|
# Adjust width and height to account for shadow. outline done in css
|
||||||
|
@ -306,6 +306,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
# We must have a service item to preview
|
# We must have a service item to preview
|
||||||
if not hasattr(self, u'serviceItem'):
|
if not hasattr(self, u'serviceItem'):
|
||||||
return
|
return
|
||||||
|
Receiver.send_message(u'openlp_process_events')
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
# Wait for the fade to finish before geting the preview.
|
# Wait for the fade to finish before geting the preview.
|
||||||
# Important otherwise preview will have incorrect text if at all !
|
# Important otherwise preview will have incorrect text if at all !
|
||||||
@ -318,6 +319,8 @@ class MainDisplay(DisplayWidget):
|
|||||||
# Important otherwise first preview will miss the background !
|
# Important otherwise first preview will miss the background !
|
||||||
while not self.loaded:
|
while not self.loaded:
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
if self.isLive:
|
||||||
|
self.setVisible(True)
|
||||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||||
self.screen[u'size'].height(),
|
self.screen[u'size'].height(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
@ -326,8 +329,6 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.frame.render(painter)
|
self.frame.render(painter)
|
||||||
painter.end()
|
painter.end()
|
||||||
# Make display show up if in single screen mode
|
# Make display show up if in single screen mode
|
||||||
if self.isLive:
|
|
||||||
self.setVisible(True)
|
|
||||||
return preview
|
return preview
|
||||||
|
|
||||||
def buildHtml(self, serviceItem):
|
def buildHtml(self, serviceItem):
|
||||||
|
@ -636,9 +636,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
if not self.serviceItem:
|
if not self.serviceItem:
|
||||||
return
|
return
|
||||||
|
if self.serviceItem.is_command():
|
||||||
Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(),
|
Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
if self.serviceItem.is_command():
|
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
self.PreviewListWidget.selectRow(0)
|
self.PreviewListWidget.selectRow(0)
|
||||||
@ -651,9 +651,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
index = int(message[0])
|
index = int(message[0])
|
||||||
if not self.serviceItem:
|
if not self.serviceItem:
|
||||||
return
|
return
|
||||||
|
if self.serviceItem.is_command():
|
||||||
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive, index])
|
[self.serviceItem, self.isLive, index])
|
||||||
if self.serviceItem.is_command():
|
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
self.PreviewListWidget.selectRow(index)
|
self.PreviewListWidget.selectRow(index)
|
||||||
@ -768,9 +768,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
row = self.PreviewListWidget.currentRow()
|
row = self.PreviewListWidget.currentRow()
|
||||||
self.selectedRow = 0
|
self.selectedRow = 0
|
||||||
if row > -1 and row < self.PreviewListWidget.rowCount():
|
if row > -1 and row < self.PreviewListWidget.rowCount():
|
||||||
|
if self.serviceItem.is_command() and self.isLive:
|
||||||
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive, row])
|
[self.serviceItem, self.isLive, row])
|
||||||
if self.serviceItem.is_command() and self.isLive:
|
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
frame, raw_html = self.serviceItem.get_rendered_frame(row)
|
frame, raw_html = self.serviceItem.get_rendered_frame(row)
|
||||||
|
Loading…
Reference in New Issue
Block a user