update preview frame, when using 'blank to screen/theme'; fixed bug when replacing live background when no item is live

This commit is contained in:
Andreas Preikschat 2011-01-22 19:16:25 +01:00
parent b5ac73adaa
commit 4ff9157adf
2 changed files with 12 additions and 9 deletions

View File

@ -241,7 +241,10 @@ class MainDisplay(DisplayWidget):
Used after Image plugin has changed the background Used after Image plugin has changed the background
""" """
log.debug(u'resetImage') log.debug(u'resetImage')
self.displayImage(self.serviceItem.bg_image_bytes) if hasattr(self, u'serviceItem'):
self.displayImage(self.serviceItem.bg_image_bytes)
else:
self.displayImage(None)
# Update the preview frame. # Update the preview frame.
Receiver.send_message(u'maindisplay_active') Receiver.send_message(u'maindisplay_active')
@ -343,13 +346,11 @@ class MainDisplay(DisplayWidget):
Generates a preview of the image displayed. Generates a preview of the image displayed.
""" """
log.debug(u'preview for %s', self.isLive) log.debug(u'preview for %s', self.isLive)
# We must have a service item to preview
if not hasattr(self, u'serviceItem'):
return
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
if self.isLive: # We must have a service item to preview
if self.isLive and hasattr(self, u'serviceItem'):
# 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!
if self.serviceItem.themedata and \ if self.serviceItem.themedata and \
self.serviceItem.themedata.display_slide_transition: self.serviceItem.themedata.display_slide_transition:
while self.frame.evaluateJavaScript(u'show_text_complete()') \ while self.frame.evaluateJavaScript(u'show_text_complete()') \
@ -362,9 +363,8 @@ class MainDisplay(DisplayWidget):
# if was hidden keep it hidden # if was hidden keep it hidden
if self.isLive: if self.isLive:
self.setVisible(True) self.setVisible(True)
# if was hidden keep it hidden if self.hideMode:
if self.hideMode and self.isLive: self.hideDisplay(self.hideMode)
self.hideDisplay(self.hideMode)
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)

View File

@ -783,6 +783,7 @@ class SlideController(QtGui.QWidget):
QtCore.QSettings().remove( QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank') self.parent.generalSettingsSection + u'/screen blank')
self.blankPlugin(checked) self.blankPlugin(checked)
self.updatePreview()
def onThemeDisplay(self, checked): def onThemeDisplay(self, checked):
""" """
@ -804,6 +805,7 @@ class SlideController(QtGui.QWidget):
QtCore.QSettings().remove( QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank') self.parent.generalSettingsSection + u'/screen blank')
self.blankPlugin(checked) self.blankPlugin(checked)
self.updatePreview()
def onHideDisplay(self, checked): def onHideDisplay(self, checked):
""" """
@ -827,6 +829,7 @@ class SlideController(QtGui.QWidget):
QtCore.QSettings().remove( QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank') self.parent.generalSettingsSection + u'/screen blank')
self.hidePlugin(checked) self.hidePlugin(checked)
self.updatePreview()
def blankPlugin(self, blank): def blankPlugin(self, blank):
""" """