From 77e4e376c62c8e231cc9cea0ef518168b8f83d9a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 22 Sep 2011 22:07:31 +0200 Subject: [PATCH 1/2] Fixed bug #812289. Forced the mediaitem to get the QListWidgetItem from the list again. Fixes: https://launchpad.net/bugs/812289 --- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 146ef0422..1c254406c 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -682,7 +682,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.songBookComboBox.currentText()) if item == 0 and text: temp_song_book = text - self.mediaitem.song_maintenance_form.exec_() + self.mediaitem.songMaintenanceForm.exec_() self.loadAuthors() self.loadBooks() self.loadTopics() diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 7d5e85af5..ac56b4c53 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -239,7 +239,7 @@ class SongMediaItem(MediaManagerItem): + u'%'), Song.comments.like(u'%' + search_keywords.lower() + u'%'))) - def onSongListLoad(self): + def onSongListLoad(self, item_id=None): """ Handle the exit from the edit dialog and trigger remote updates of songs @@ -371,7 +371,7 @@ class SongMediaItem(MediaManagerItem): self.editSongForm.loadSong(item_id, False) self.editSongForm.exec_() self.autoSelectId = -1 - self.onSongListLoad() + self.onSongListLoad(item_id) self.editItem = None def onDeleteClick(self): @@ -428,8 +428,11 @@ class SongMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None, xmlVersion=False, remote=False): - log.debug(u'generateSlideData (%s:%s)' % (service_item, item)) - item_id = self._getIdOfItemToGenerate(item, self.remoteSong) + log.debug(u'generateSlideData: %s, %s, %s' % (service_item, item, self.remoteSong)) + # The ``None`` below is a workaround for bug #812289 - I think that Qt + # deletes the item somewhere along the line because the user is taking + # so long to update their item (or something weird like that). + item_id = self._getIdOfItemToGenerate(None, self.remoteSong) service_item.add_capability(ItemCapabilities.CanEdit) service_item.add_capability(ItemCapabilities.CanPreview) service_item.add_capability(ItemCapabilities.CanLoop) From a6821c0b7d74d4bc433b0fbd259e135aa0446ab8 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 22 Sep 2011 22:39:27 +0200 Subject: [PATCH 2/2] Removed some unnecessary experimental code. --- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index ac56b4c53..f20095500 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -239,7 +239,7 @@ class SongMediaItem(MediaManagerItem): + u'%'), Song.comments.like(u'%' + search_keywords.lower() + u'%'))) - def onSongListLoad(self, item_id=None): + def onSongListLoad(self): """ Handle the exit from the edit dialog and trigger remote updates of songs @@ -371,7 +371,7 @@ class SongMediaItem(MediaManagerItem): self.editSongForm.loadSong(item_id, False) self.editSongForm.exec_() self.autoSelectId = -1 - self.onSongListLoad(item_id) + self.onSongListLoad() self.editItem = None def onDeleteClick(self):