forked from openlp/openlp
Fix song service load (Bug #696219)
Cleanups Change cursor when activating plugins bzr-revno: 1274
This commit is contained in:
commit
cbe4f9332c
@ -158,7 +158,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
The icon of the button. This can be an instance of QIcon, or a
|
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 ':/'.
|
internal resource path starting with ':/'.
|
||||||
|
|
||||||
``slot``
|
``slot``
|
||||||
|
@ -61,7 +61,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
|||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
The icon of the button. This can be an instance of QIcon, or a
|
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 ':/'.
|
internal resource path starting with ':/'.
|
||||||
|
|
||||||
``tooltip``
|
``tooltip``
|
||||||
|
@ -28,7 +28,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
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
|
from plugindialog import Ui_PluginViewDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -129,7 +129,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
if self.programaticChange:
|
if self.programaticChange:
|
||||||
return
|
return
|
||||||
if status == 0:
|
if status == 0:
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Active)
|
self.activePlugin.toggleStatus(PluginStatus.Active)
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
else:
|
else:
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
|
@ -334,9 +334,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
row = self.themeListWidget.row(item)
|
row = self.themeListWidget.row(item)
|
||||||
self.themeListWidget.takeItem(row)
|
self.themeListWidget.takeItem(row)
|
||||||
self.deleteTheme(theme)
|
self.deleteTheme(theme)
|
||||||
# As we do not reload the themes, push out the change
|
# As we do not reload the themes, push out the change. Reload the
|
||||||
# Reaload the list as the internal lists and events need
|
# list as the internal lists and events need to be triggered.
|
||||||
# to be triggered
|
|
||||||
self._pushThemes()
|
self._pushThemes()
|
||||||
|
|
||||||
def deleteTheme(self, theme):
|
def deleteTheme(self, theme):
|
||||||
|
@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui
|
|||||||
from sqlalchemy.sql import or_
|
from sqlalchemy.sql import or_
|
||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \
|
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, \
|
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
|
||||||
SongImportForm
|
SongImportForm
|
||||||
from openlp.plugins.songs.lib import OpenLyrics, SongXML
|
from openlp.plugins.songs.lib import OpenLyrics, SongXML
|
||||||
@ -396,7 +396,8 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
Triggered by a song being loaded by the service item
|
Triggered by a song being loaded by the service item
|
||||||
"""
|
"""
|
||||||
log.debug(u'serviceLoad')
|
log.debug(u'serviceLoad')
|
||||||
if item.data_string:
|
if self.plugin.status != PluginStatus.Active or not item.data_string:
|
||||||
|
return
|
||||||
search_results = self.parent.manager.get_all_objects(Song,
|
search_results = self.parent.manager.get_all_objects(Song,
|
||||||
Song.search_title == re.compile(r'\W+', re.UNICODE).sub(u' ',
|
Song.search_title == re.compile(r'\W+', re.UNICODE).sub(u' ',
|
||||||
item.data_string[u'title'].split(u'@')[0].lower()).strip(),
|
item.data_string[u'title'].split(u'@')[0].lower()).strip(),
|
||||||
@ -412,10 +413,9 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
if search_results:
|
if search_results:
|
||||||
for song in search_results:
|
for song in search_results:
|
||||||
same_authors = True
|
same_authors = True
|
||||||
# If the author counts are different, we do not have to do
|
# If the author counts are different, we do not have to do any
|
||||||
# any further checking. This is also important when a song
|
# further checking. This is also important when a song does not
|
||||||
# does not have any author (because we can not loop over an
|
# have any author (because we can not loop over an empty list).
|
||||||
# empty list).
|
|
||||||
if len(song.authors) == len(author_list):
|
if len(song.authors) == len(author_list):
|
||||||
for author in song.authors:
|
for author in song.authors:
|
||||||
if author.display_name not in author_list:
|
if author.display_name not in author_list:
|
||||||
|
Loading…
Reference in New Issue
Block a user