forked from openlp/openlp
Fix song usage missing code
This commit is contained in:
parent
0b9d454d3a
commit
4e0a3ca40b
@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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():
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user