From 957a86b11e76a3532921d1d288dc6e9f7dadf9b9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 22 Aug 2011 18:32:18 +0100 Subject: [PATCH] fexes --- openlp/core/ui/maindisplay.py | 4 ++-- openlp/core/ui/printserviceform.py | 12 +++++++++--- openlp/plugins/images/lib/mediaitem.py | 5 ++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 9904868ce..77f2e2f7c 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -228,11 +228,11 @@ class MainDisplay(QtGui.QGraphicsView): shrinkItem.setVisible(False) self.setGeometry(self.screen[u'size']) - def directImage(self, name, path): + def directImage(self, name, path, background): """ API for replacement backgrounds so Images are added directly to cache """ - self.imageManager.add_image(name, path) + self.imageManager.add_image(name, path, u'image', background) if hasattr(self, u'serviceItem'): self.override[u'image'] = name self.override[u'theme'] = self.serviceItem.themedata.theme_name diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index f33092061..b9c1cc4a0 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -188,9 +188,6 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): html_data.body, classId=u'serviceTitle') for index, item in enumerate(self.serviceManager.serviceItems): self._addPreviewItem(html_data.body, item[u'service_item'], index) - # Trigger Audit requests - Receiver.send_message(u'print_service_started', - [item[u'service_item']]) # Add the custom service notes: if self.footerTextEdit.toPlainText(): div = self._addElement(u'div', parent=html_data.body, @@ -299,6 +296,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): ``printer`` A *QPrinter* object. """ + self.update_song_usage() self.document.print_(printer) def displaySizeChanged(self, display): @@ -330,12 +328,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): """ Copies the display text to the clipboard as plain text """ + self.update_song_usage() self.mainWindow.clipboard.setText(self.document.toPlainText()) def copyHtmlText(self): """ Copies the display text to the clipboard as Html """ + self.update_song_usage() self.mainWindow.clipboard.setText(self.document.toHtml()) def printServiceOrder(self): @@ -400,3 +400,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): settings.setValue(u'print notes', QtCore.QVariant(self.notesCheckBox.isChecked())) settings.endGroup() + + def update_song_usage(self): + for index, item in enumerate(self.serviceManager.serviceItems): + # Trigger Audit requests + Receiver.send_message(u'print_service_started', + [item[u'service_item']]) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index d00b8c9f0..18d5d2a1c 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -208,13 +208,16 @@ class ImageMediaItem(MediaManagerItem): if check_item_selected(self.listView, translate('ImagePlugin.MediaItem', 'You must select an image to replace the background with.')): + background = QtGui.QColor(QtCore.QSettings().value( + self.settingsSection + u'/background color', + QtCore.QVariant(u'#000000'))) item = self.listView.selectedIndexes()[0] bitem = self.listView.item(item.row()) filename = unicode(bitem.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): (path, name) = os.path.split(filename) if self.plugin.liveController.display.directImage(name, - filename): + filename, background): self.resetAction.setVisible(True) else: critical_error_message_box(UiStrings().LiveBGError,