forked from openlp/openlp
Fix up songusage
This commit is contained in:
parent
929b36705a
commit
9da35664bb
@ -35,7 +35,7 @@ import uuid
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, resize_image, Receiver
|
from openlp.core.lib import build_icon, resize_image
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -390,10 +390,3 @@ class ServiceItem(object):
|
|||||||
Clear's the service item's cache.
|
Clear's the service item's cache.
|
||||||
"""
|
"""
|
||||||
self.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,8 +602,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.enableToolBar(serviceItem)
|
self.enableToolBar(serviceItem)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
self.PreviewListWidget.setFocus()
|
self.PreviewListWidget.setFocus()
|
||||||
if self.isLive:
|
|
||||||
self.serviceItem.trigger_song_usage()
|
|
||||||
Receiver.send_message(u'slidecontroller_%s_started' % self.typePrefix,
|
Receiver.send_message(u'slidecontroller_%s_started' % self.typePrefix,
|
||||||
[serviceItem])
|
[serviceItem])
|
||||||
if self.serviceItem.is_text():
|
if self.serviceItem.is_text():
|
||||||
|
@ -370,6 +370,6 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
translate('SongsPlugin.MediaItem', 'CCLI Licence: ') + ccli))
|
translate('SongsPlugin.MediaItem', 'CCLI Licence: ') + ccli))
|
||||||
service_item.raw_footer = raw_footer
|
service_item.raw_footer = raw_footer
|
||||||
service_item.audit = [
|
service_item.audit = [
|
||||||
song.title, author_audit, song.copyright, song.ccli_number
|
song.title, author_audit, song.copyright, unicode(ccli)
|
||||||
]
|
]
|
||||||
return True
|
return True
|
||||||
|
@ -109,7 +109,7 @@ class SongUsagePlugin(Plugin):
|
|||||||
log.info(u'SongUsage Initialising')
|
log.info(u'SongUsage Initialising')
|
||||||
Plugin.initialise(self)
|
Plugin.initialise(self)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'songs_live_started'),
|
QtCore.SIGNAL(u'slidecontroller_live_started'),
|
||||||
self.onReceiveSongUsage)
|
self.onReceiveSongUsage)
|
||||||
self.SongUsageActive = QtCore.QSettings().value(
|
self.SongUsageActive = QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/active',
|
self.settingsSection + u'/active',
|
||||||
@ -133,10 +133,11 @@ class SongUsagePlugin(Plugin):
|
|||||||
QtCore.QSettings().setValue(self.settingsSection + u'/active',
|
QtCore.QSettings().setValue(self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(self.SongUsageActive))
|
QtCore.QVariant(self.SongUsageActive))
|
||||||
|
|
||||||
def onReceiveSongUsage(self, audit):
|
def onReceiveSongUsage(self, item):
|
||||||
"""
|
"""
|
||||||
Song Usage for live song from SlideController
|
Song Usage for live song from SlideController
|
||||||
"""
|
"""
|
||||||
|
audit = item[0].audit
|
||||||
if self.SongUsageActive and audit:
|
if self.SongUsageActive and audit:
|
||||||
song_usage_item = SongUsageItem()
|
song_usage_item = SongUsageItem()
|
||||||
song_usage_item.usagedate = datetime.today()
|
song_usage_item.usagedate = datetime.today()
|
||||||
|
Loading…
Reference in New Issue
Block a user