openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #18746
[Merge] lp:~arjan-i/openlp/image_background_fix_trunk into lp:openlp
Arjan Schrijver has proposed merging lp:~arjan-i/openlp/image_background_fix_trunk into lp:openlp.
Requested reviews:
Raoul Snyman (raoul-snyman)
Tim Bentley (trb143)
Related bugs:
Bug #1098167 in OpenLP: "Images always get black background when loaded from saved service file"
https://bugs.launchpad.net/openlp/+bug/1098167
For more details, see:
https://code.launchpad.net/~arjan-i/openlp/image_background_fix_trunk/+merge/143412
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_trunk/+merge/143412
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2012-12-29 20:56:56 +0000
+++ openlp/core/lib/serviceitem.py 2013-01-15 21:33:29 +0000
@@ -37,7 +37,9 @@
import os
import uuid
-from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource
+from PyQt4 import QtCore, QtGui
+
+from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource, Settings
log = logging.getLogger(__name__)
@@ -405,13 +407,15 @@
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', u'#000000'))
if path:
for text_image in serviceitem[u'serviceitem'][u'data']:
filename = os.path.join(path, text_image)
- self.add_from_image(filename, text_image)
+ self.add_from_image(filename, text_image, background)
else:
for text_image in serviceitem[u'serviceitem'][u'data']:
- self.add_from_image(text_image[u'path'], text_image[u'title'])
+ self.add_from_image(text_image[u'path'], text_image[u'title'], background)
elif self.service_item_type == ServiceItemType.Command:
for text_image in serviceitem[u'serviceitem'][u'data']:
if path:
Follow ups