From 8b011588569eff024df772f198319966fe818c12 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Thu, 10 Jan 2013 11:12:47 +0100 Subject: [PATCH 1/3] Make sure images use the configured background/border color when loaded from a saved service file --- openlp/core/lib/serviceitem.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 49fd68505..fb45eb3b3 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -36,9 +36,11 @@ import datetime import logging import os import uuid +from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, \ ImageSource +from openlp.core.lib.settings import Settings log = logging.getLogger(__name__) @@ -335,8 +337,11 @@ class ServiceItem(object): self._raw_frames.append(slide) elif self.service_item_type == ServiceItemType.Image: for text_image in serviceitem[u'serviceitem'][u'data']: + settingsSection = serviceitem[u'serviceitem'][u'header'][u'name'] + background = QtGui.QColor(Settings().value(settingsSection + + u'/background color', QtCore.QVariant(u'#000000'))) filename = os.path.join(path, text_image) - self.add_from_image(filename, text_image) + self.add_from_image(filename, text_image, background) elif self.service_item_type == ServiceItemType.Command: for text_image in serviceitem[u'serviceitem'][u'data']: filename = os.path.join(path, text_image[u'title']) From 7e2e72b4a67ce49828b0d2579b80794f0200e739 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Thu, 10 Jan 2013 13:05:33 +0100 Subject: [PATCH 2/3] Read the background color setting outside of the loop --- openlp/core/lib/serviceitem.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index fb45eb3b3..aacb62fbf 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -336,10 +336,10 @@ class ServiceItem(object): for slide in serviceitem[u'serviceitem'][u'data']: self._raw_frames.append(slide) elif self.service_item_type == ServiceItemType.Image: + settingsSection = serviceitem[u'serviceitem'][u'header'][u'name'] + background = QtGui.QColor(Settings().value(settingsSection + + u'/background color', QtCore.QVariant(u'#000000'))) for text_image in serviceitem[u'serviceitem'][u'data']: - settingsSection = serviceitem[u'serviceitem'][u'header'][u'name'] - background = QtGui.QColor(Settings().value(settingsSection - + u'/background color', QtCore.QVariant(u'#000000'))) filename = os.path.join(path, text_image) self.add_from_image(filename, text_image, background) elif self.service_item_type == ServiceItemType.Command: From 28241d591c1a9bbb303a8aa7492514ce1622b7f9 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Tue, 15 Jan 2013 22:28:47 +0100 Subject: [PATCH 3/3] Fix line spacing --- openlp/core/lib/serviceitem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index aacb62fbf..820fa8a79 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -36,6 +36,7 @@ import datetime import logging import os import uuid + from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, \