← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/trivialfixes into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/48719

Fix song service load (Bug #696219)
Cleanups
Change cursor when activating plugins
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/48719
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2011-02-03 23:25:52 +0000
+++ openlp/core/lib/mediamanageritem.py	2011-02-06 00:01:59 +0000
@@ -158,7 +158,7 @@
 
         ``icon``
             The icon of the button. This can be an instance of QIcon, or a
-            string cotaining either the absolute path to the image, or an
+            string containing either the absolute path to the image, or an
             internal resource path starting with ':/'.
 
         ``slot``

=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py	2011-01-31 20:39:55 +0000
+++ openlp/core/lib/toolbar.py	2011-02-06 00:01:59 +0000
@@ -61,7 +61,7 @@
 
         ``icon``
             The icon of the button. This can be an instance of QIcon, or a
-            string cotaining either the absolute path to the image, or an
+            string containing either the absolute path to the image, or an
             internal resource path starting with ':/'.
 
         ``tooltip``

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2011-01-18 18:53:09 +0000
+++ openlp/core/ui/pluginform.py	2011-02-06 00:01:59 +0000
@@ -129,7 +129,9 @@
         if self.programaticChange:
             return
         if status == 0:
+            Receiver.send_message(u'cursor_busy')
             self.activePlugin.toggleStatus(PluginStatus.Active)
+            Receiver.send_message(u'cursor_normal')
         else:
             self.activePlugin.toggleStatus(PluginStatus.Inactive)
         status_text = unicode(

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2011-02-05 17:31:13 +0000
+++ openlp/core/ui/thememanager.py	2011-02-06 00:01:59 +0000
@@ -334,9 +334,8 @@
             row = self.themeListWidget.row(item)
             self.themeListWidget.takeItem(row)
             self.deleteTheme(theme)
-            # As we do not reload the themes, push out the change
-            # Reaload the list as the internal lists and events need
-            # to be triggered
+            # As we do not reload the themes, push out the change. Reload the
+            # list as the internal lists and events need to be triggered.
             self._pushThemes()
 
     def deleteTheme(self, theme):

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-02-03 03:50:04 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-02-06 00:01:59 +0000
@@ -32,7 +32,7 @@
 from sqlalchemy.sql import or_
 
 from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \
-    ItemCapabilities, translate, check_item_selected
+    ItemCapabilities, translate, check_item_selected, PluginStatus
 from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
     SongImportForm
 from openlp.plugins.songs.lib import OpenLyrics, SongXML
@@ -396,46 +396,46 @@
         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 == re.compile(r'\W+', re.UNICODE).sub(u' ',
-                item.data_string[u'title'].split(u'@')[0].lower()).strip(),
-                Song.search_title.asc())
-            author_list = item.data_string[u'authors'].split(u', ')
-            # The service item always has an author (at least it has u'' as
-            # author). However, songs saved in the database do not have to have
-            # an author.
-            if u'' in author_list:
-                author_list.remove(u'')
-            editId = 0
-            add_song = True
-            if search_results:
-                for song in search_results:
-                    same_authors = True
-                    # If the author counts are different, we do not have to do
-                    # any further checking. This is also important when a song
-                    # does not have any author (because we can not loop over an
-                    # empty list).
-                    if len(song.authors) == len(author_list):
-                        for author in song.authors:
-                            if author.display_name not in author_list:
-                                same_authors = False
-                    else:
-                        same_authors = False
-                    # All authors are the same, so we can stop here and the song
-                    # does not have to be saved.
-                    if same_authors:
-                        add_song = False
-                        editId = song.id
-                        break
-            if add_song:
-                if self.addSongFromService:
-                    editId = self.openLyrics.xml_to_song(item.xml_version)
-                    self.onSearchTextButtonClick()
-            # Update service with correct song id.
-            if editId:
-                Receiver.send_message(u'service_item_update',
-                    u'%s:%s' % (editId, item._uuid))
+        if self.plugin.status != PluginStatus.Active or not item.data_string:
+            return
+        search_results = self.parent.manager.get_all_objects(Song,
+            Song.search_title == re.compile(r'\W+', re.UNICODE).sub(u' ',
+            item.data_string[u'title'].split(u'@')[0].lower()).strip(),
+            Song.search_title.asc())
+        author_list = item.data_string[u'authors'].split(u', ')
+        # The service item always has an author (at least it has u'' as
+        # author). However, songs saved in the database do not have to have
+        # an author.
+        if u'' in author_list:
+            author_list.remove(u'')
+        editId = 0
+        add_song = True
+        if search_results:
+            for song in search_results:
+                same_authors = True
+                # If the author counts are different, we do not have to do any
+                # further checking. This is also important when a song does not
+                # have any author (because we can not loop over an empty list).
+                if len(song.authors) == len(author_list):
+                    for author in song.authors:
+                        if author.display_name not in author_list:
+                            same_authors = False
+                else:
+                    same_authors = False
+                # All authors are the same, so we can stop here and the song
+                # does not have to be saved.
+                if same_authors:
+                    add_song = False
+                    editId = song.id
+                    break
+        if add_song:
+            if self.addSongFromService:
+                editId = self.openLyrics.xml_to_song(item.xml_version)
+                self.onSearchTextButtonClick()
+        # Update service with correct song id.
+        if editId:
+            Receiver.send_message(u'service_item_update',
+                u'%s:%s' % (editId, item._uuid))
 
     def collateSongTitles(self, song_1, song_2):
         """


Follow ups