← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bug-ol1 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bug-ol1 into lp:openlp.

Requested reviews:
  Andreas Preikschat (googol)

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-ol1/+merge/77029

Fix up tag loading problem with tags not being rendered when loaded with service.
-- 
https://code.launchpad.net/~trb143/openlp/bug-ol1/+merge/77029
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2011-09-23 22:14:23 +0000
+++ openlp/core/ui/servicemanager.py	2011-09-26 18:20:28 +0000
@@ -660,14 +660,17 @@
                 for item in items:
                     self.mainwindow.incrementProgressBar()
                     serviceItem = ServiceItem()
-                    serviceItem.from_service = True
                     serviceItem.renderer = self.mainwindow.renderer
                     serviceItem.set_from_service(item, self.servicePath)
                     self.validateItem(serviceItem)
-                    self.addServiceItem(serviceItem, repaint=False)
+                    self.loadItem_uuid = 0
                     if serviceItem.is_capable(ItemCapabilities.OnLoadUpdate):
                         Receiver.send_message(u'%s_service_load' %
                             serviceItem.name.lower(), serviceItem)
+                    # if the item has been processed
+                    if serviceItem._uuid == self.loadItem_uuid:
+                        serviceItem.edit_id = int(self.loadItem_editId)
+                    self.addServiceItem(serviceItem, repaint=False)
                 delete_file(p_file)
                 self.setFileName(fileName)
                 self.mainwindow.addRecentFile(fileName)
@@ -1122,12 +1125,10 @@
     def serviceItemUpdate(self, message):
         """
         Triggered from plugins to update service items.
+        Save the values as they will be used as part of the service load
         """
-        editId, uuid = message.split(u':')
-        for item in self.serviceItems:
-            if item[u'service_item']._uuid == uuid:
-                item[u'service_item'].edit_id = int(editId)
-        self.setModified()
+        self.loadItem_editId, uuid = message.split(u':')
+        self.loadItem_uuid = int(uuid)
 
     def replaceServiceItem(self, newItem):
         """

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-09-24 15:18:48 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-09-26 18:20:28 +0000
@@ -510,7 +510,8 @@
         # Add the audio file to the service item.
         if len(song.media_files) > 0:
             service_item.add_capability(ItemCapabilities.HasBackgroundAudio)
-            service_item.background_audio = [m.file_name for m in song.media_files]
+            service_item.background_audio = \
+                [m.file_name for m in song.media_files]
         return True
 
     def serviceLoad(self, item):