← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~arjan-i/openlp/image_background_fix_2.0 into lp:openlp/2.0

 

Arjan Schrijver has proposed merging lp:~arjan-i/openlp/image_background_fix_2.0 into lp:openlp/2.0.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~arjan-i/openlp/image_background_fix_2.0/+merge/142660

When a saved service file is loaded, images always get a black background instead of the configured background. This patch fixes that, although I'm not sure if it fits within the coding standards.
-- 
https://code.launchpad.net/~arjan-i/openlp/image_background_fix_2.0/+merge/142660
Your team OpenLP Core is requested to review the proposed merge of lp:~arjan-i/openlp/image_background_fix_2.0 into lp:openlp/2.0.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2012-12-30 19:41:24 +0000
+++ openlp/core/lib/serviceitem.py	2013-01-10 10:33:21 +0000
@@ -36,9 +36,11 @@
 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 @@
                 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'])


Follow ups