diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 683459825..cc80ad564 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -158,7 +158,7 @@ class MediaManagerItem(QtGui.QWidget): ``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`` diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index b1aa3d96f..6ae80045e 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -61,7 +61,7 @@ class OpenLPToolbar(QtGui.QToolBar): ``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`` diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index d6ffc69f0..3b41d76a3 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import PluginStatus, StringContent, translate +from openlp.core.lib import PluginStatus, Receiver, StringContent, translate from plugindialog import Ui_PluginViewDialog log = logging.getLogger(__name__) @@ -129,7 +129,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): 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( diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index e0dbf789a..317065c6e 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -334,9 +334,8 @@ class ThemeManager(QtGui.QWidget): 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): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 2fbf777c6..6b57b4b0c 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui 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, SongExportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML @@ -401,46 +401,46 @@ class SongMediaItem(MediaManagerItem): 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): """