← Back to team overview

openlp-core team mailing list archive

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

 

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

Requested reviews:
  OpenLP Core (openlp-core)


Fix bug with service item edit ids missing
Fix name format error
Add debugging to help with service load and song edit bugs.  Need to see what is happening when we hit them.
-- 
https://code.launchpad.net/~trb143/openlp/bugs/+merge/41411
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bugs into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2010-11-04 16:26:30 +0000
+++ openlp/core/lib/mediamanageritem.py	2010-11-21 14:17:54 +0000
@@ -514,7 +514,7 @@
                 self.parent.serviceManager.addServiceItem(service_item,
                     replace=True)
             else:
-                #Turn off the remote edit update message indicator
+                # Turn off the remote edit update message indicator
                 QtGui.QMessageBox.information(self,
                     translate('OpenLP.MediaManagerItem',
                         'Invalid Service Item'),

=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2010-11-04 16:26:30 +0000
+++ openlp/core/lib/serviceitem.py	2010-11-21 14:17:54 +0000
@@ -100,6 +100,7 @@
         self.bg_image_bytes = None
         self.search_string = u''
         self.data_string = u''
+        self.edit_id = None
         self._new_item()
 
     def _new_item(self):

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2010-11-19 18:05:49 +0000
+++ openlp/core/ui/servicemanager.py	2010-11-21 14:17:54 +0000
@@ -308,7 +308,7 @@
         self.maintainAction.setVisible(False)
         self.notesAction.setVisible(False)
         if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit)\
-            and hasattr(serviceItem[u'service_item'], u'editId'):
+            and serviceItem[u'service_item'].edit_id:
             self.editAction.setVisible(True)
         if serviceItem[u'service_item']\
             .is_capable(ItemCapabilities.AllowsMaintain):
@@ -864,7 +864,7 @@
         editId, uuid = message.split(u':')
         for item in self.serviceItems:
             if item[u'service_item']._uuid == uuid:
-                item[u'service_item'].editId = editId
+                item[u'service_item'].edit_id = editId
 
     def replaceServiceItem(self, newItem):
         """
@@ -873,7 +873,7 @@
         """
         newItem.render()
         for itemcount, item in enumerate(self.serviceItems):
-            if item[u'service_item'].editId == newItem.editId and \
+            if item[u'service_item'].edit_id == newItem.edit_id and \
                 item[u'service_item'].name == newItem.name:
                 newItem.merge(item[u'service_item'])
                 item[u'service_item'] = newItem
@@ -983,7 +983,7 @@
             .is_capable(ItemCapabilities.AllowsEdit):
             Receiver.send_message(u'%s_edit' %
                 self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' %
-                self.serviceItems[item][u'service_item'].editId )
+                self.serviceItems[item][u'service_item'].edit_id )
 
     def findServiceItem(self):
         """

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2010-11-03 18:35:56 +0000
+++ openlp/core/ui/slidecontroller.py	2010-11-21 14:17:54 +0000
@@ -942,7 +942,7 @@
         """
         self.songEdit = True
         Receiver.send_message(u'%s_edit' % self.serviceItem.name.lower(),
-            u'P:%s' % self.serviceItem.editId)
+            u'P:%s' % self.serviceItem.edit_id)
 
     def onGoLive(self):
         """

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2010-10-28 14:56:52 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2010-11-21 14:17:54 +0000
@@ -165,7 +165,7 @@
         customSlide = self.parent.manager.get_object(CustomSlide, item_id)
         title = customSlide.title
         credit = customSlide.credits
-        service_item.editId = item_id
+        service_item.edit_id = item_id
         theme = customSlide.theme_name
         if theme:
             service_item.theme = theme

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2010-11-03 17:19:44 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2010-11-21 14:17:54 +0000
@@ -192,6 +192,7 @@
         Handle the exit from the edit dialog and trigger remote updates
         of songs
         """
+        log.debug(u'onSongListLoad')
         # Called to redisplay the song list screen edit from a search
         # or from the exit of the Song edit dialog.  If remote editing is active
         # Trigger it and clean up so it will not update again.
@@ -259,6 +260,7 @@
         Receiver.send_message(u'songs_load_list')
 
     def onNewClick(self):
+        log.debug(u'onNewClick')
         self.edit_song_form.newSong()
         self.edit_song_form.exec_()
 
@@ -266,6 +268,7 @@
         self.song_maintenance_form.exec_()
 
     def onRemoteEditClear(self):
+        log.debug(u'onRemoteEditClear')
         self.remoteTriggered = None
         self.remoteSong = -1
 
@@ -275,6 +278,7 @@
         the Song Id in the payload along with an indicator to say which
         type of display is required.
         """
+        log.debug(u'onRemoteEdit %s' % songid)
         fields = songid.split(u':')
         valid = self.parent.manager.get_object(Song, fields[1])
         if valid:
@@ -287,6 +291,7 @@
         """
         Edit a song
         """
+        log.debug(u'onEditClick')
         if check_item_selected(self.listView,
             translate('SongsPlugin.MediaItem',
             'You must select an item to edit.')):
@@ -324,6 +329,7 @@
             self.onSearchTextButtonClick()
 
     def generateSlideData(self, service_item, item=None):
+        log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
         raw_footer = []
         author_list = u''
         author_audit = []
@@ -345,7 +351,7 @@
         service_item.add_capability(ItemCapabilities.AddIfNewItem)
         song = self.parent.manager.get_object(Song, item_id)
         service_item.theme = song.theme_name
-        service_item.editId = item_id
+        service_item.edit_id = item_id
         if song.lyrics.startswith(u'<?xml version='):
             songXML = SongXMLParser(song.lyrics)
             verseList = songXML.get_verses()
@@ -357,7 +363,7 @@
                     service_item.add_from_text(
                         verse[1][:30], unicode(verse[1]), verseTag)
             else:
-                #Loop through the verse list and expand the song accordingly.
+                # Loop through the verse list and expand the song accordingly.
                 for order in song.verse_order.upper().split(u' '):
                     if len(order) == 0:
                         break
@@ -397,6 +403,7 @@
         """
         Triggered by a song being loaded by the service item
         """
+        log.debug(u'serviceLoad')
         if item.data_string:
             search_results = self.parent.manager.get_all_objects(Song,
                 Song.search_title.like(u'%' +
@@ -408,9 +415,13 @@
             if search_results:
                 for song in search_results:
                     count = 0
+                    # temp debug to find why service items do not edit
+                    log.debug(u'author list %s' % author_list)
                     for author in song.authors:
+                        log.debug(u'author %s' % author.display_name)
                         if author.display_name in author_list:
                             count += 1
+                    log.debug(u'found %s : %s' % (count, len(author_list)))
                     if count == len(author_list):
                         editId = song.id
                         uuid = item._uuid


Follow ups