From dabc04c7dd1250753f070c9bc6aac6630c25eb1b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 25 Sep 2010 07:11:00 +0100 Subject: [PATCH 1/2] Fix replacement backgrounds --- openlp/core/ui/maindisplay.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 3e49aaf92..f1ebda4e0 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -234,8 +234,11 @@ class MainDisplay(DisplayWidget): Display an image, as is. """ if image: - js = u'show_image("data:image/png;base64,%s");' % \ - image_to_byte(image) + if isinstance(image, QtGui.QImage): + js = u'show_image("data:image/png;base64,%s");' % \ + image_to_byte(image) + else: + js = u'show_image("data:image/png;base64,%s");' % image else: js = u'show_image("");' self.frame.evaluateJavaScript(js) @@ -246,7 +249,7 @@ class MainDisplay(DisplayWidget): Used after Image plugin has changed the background """ log.debug(u'resetImage') - self.displayImage(self.serviceItem.bg_frame) + self.displayImage(self.serviceItem.bg_image_bytes) def resetVideo(self): """ From 6a171899f5b341b9a7fd24c19643480ade64e385 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 25 Sep 2010 07:29:03 +0100 Subject: [PATCH 2/2] Remove visible lag on displaying first picture of background --- openlp/core/ui/maindisplay.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f1ebda4e0..45079a1c8 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -183,6 +183,9 @@ class MainDisplay(DisplayWidget): The slide text to be displayed """ log.debug(u'text') + # Wait for the webview to update before displayiong text. + while not self.loaded: + Receiver.send_message(u'openlp_process_events') self.frame.evaluateJavaScript(u'show_text("%s")' % \ slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')) return self.preview()