From 425c50cdb45efc5c8bca1c86843f049809c7a807 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 22 Jan 2011 20:32:02 +0100 Subject: [PATCH] clean ups --- openlp/core/ui/maindisplay.py | 9 ++++----- openlp/core/ui/slidecontroller.py | 9 ++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 76dab4255..b371d951e 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -137,11 +137,10 @@ class MainDisplay(DisplayWidget): painter_image.begin(initialFrame) painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white) painter_image.drawImage( - (self.screens.current[u'size'].width() \ - - splash_image.width()) / 2, - (self.screens.current[u'size'].height() \ - - splash_image.height()) / 2, - splash_image) + (self.screens.current[u'size'].width() - + splash_image.width()) / 2, + (self.screens.current[u'size'].height() + - splash_image.height()) / 2, splash_image) serviceItem = ServiceItem() serviceItem.bg_image_bytes = image_to_byte(initialFrame) self.webView.setHtml(build_html(serviceItem, self.screen, diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 2e409564c..7266d197c 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -899,7 +899,11 @@ class SlideController(QtGui.QWidget): row) def updatePreview(self): - log.debug(u'updatePreview %s ' %self.screens.current[u'primary']) + """ + This updates the preview frame, for example after changing a slide or + using *Blank to Theme*. + """ + log.debug(u'updatePreview %s ' % self.screens.current[u'primary']) if not self.screens.current[u'primary']: # Grab now, but try again in a couple of seconds if slide change # is slow @@ -910,6 +914,9 @@ class SlideController(QtGui.QWidget): QtGui.QPixmap.fromImage(self.display.preview())) def grabMainDisplay(self): + """ + Creates an image of the current screen and updates the preview frame. + """ winid = QtGui.QApplication.desktop().winId() rect = self.screens.current[u'size'] winimg = QtGui.QPixmap.grabWindow(winid, rect.x(),