diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index ca7111d41..1295a6e4f 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -35,7 +35,7 @@ import uuid from PyQt4 import QtGui -from openlp.core.lib import build_icon, resize_image +from openlp.core.lib import build_icon, resize_image, Receiver log = logging.getLogger(__name__) @@ -390,3 +390,14 @@ class ServiceItem(object): Clear's the service item's cache. """ self.cache = {} + + def trigger_song_usage(self): + """ + Send the audit data if it exists + """ + if self.audit: + Receiver.send_message(u'songs_live_started', self.audit) + + + + diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e118036d2..dfb53cd9b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -602,6 +602,8 @@ class SlideController(QtGui.QWidget): self.enableToolBar(serviceItem) self.onSlideSelected() self.PreviewListWidget.setFocus() + if self.isLive: + self.serviceItem.trigger_song_usage() Receiver.send_message(u'slidecontroller_%s_started' % self.typePrefix, [serviceItem]) if self.serviceItem.is_text(): diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 0ec82d15f..59f5907d1 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -133,11 +133,10 @@ class SongUsagePlugin(Plugin): QtCore.QSettings().setValue(self.settingsSection + u'/active', QtCore.QVariant(self.SongUsageActive)) - def onReceiveSongUsage(self, items): + def onReceiveSongUsage(self, audit): """ - SongUsage a live song from SlideController + Song Usage for live song from SlideController """ - audit = items[0].audit if self.SongUsageActive and audit: song_usage_item = SongUsageItem() song_usage_item.usagedate = datetime.today()