← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bugfixes into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bugfixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Looks life we have been too keen cleaning up and removed the song usage trigger.
This was before Alpha 2!
Add the missing code back in. 
-- 
https://code.launchpad.net/~trb143/openlp/bugfixes/+merge/31566
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bugfixes into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2010-07-27 10:20:20 +0000
+++ openlp/core/lib/serviceitem.py	2010-08-02 17:58:41 +0000
@@ -35,7 +35,7 @@
 
 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,10 @@
         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)

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2010-07-27 09:32:52 +0000
+++ openlp/core/ui/slidecontroller.py	2010-08-02 17:58:41 +0000
@@ -602,6 +602,8 @@
         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():

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2010-07-31 00:34:37 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2010-08-02 17:58:41 +0000
@@ -133,11 +133,10 @@
         QtCore.QSettings().setValue(self.settingsSection + u'/active',
             QtCore.QVariant(self.SongUsageActive))
 
-    def onReceiveSongUsage(self, items):
-        """
-        SongUsage a live song from SlideController
-        """
-        audit = items[0].audit
+    def onReceiveSongUsage(self, audit):
+        """
+        Song Usage for live song from SlideController
+        """
         if self.SongUsageActive and audit:
             song_usage_item = SongUsageItem()
             song_usage_item.usagedate = datetime.today()


Follow ups