Stop reloading songs all the time

This commit is contained in:
Jon Tibble 2011-02-03 03:50:04 +00:00
parent 750a232311
commit 6751aa41b1
3 changed files with 6 additions and 6 deletions

View File

@ -118,7 +118,7 @@ class Plugin(QtCore.QObject):
class MyPlugin(Plugin):
def __init__(self):
Plugin.__init(self, u'MyPlugin', u'0.1')
Plugin.__init__(self, u'MyPlugin', u'0.1')
``name``
Defaults to *None*. The name of the plugin.

View File

@ -506,6 +506,8 @@ class ServiceManager(QtGui.QWidget):
if filePath.endswith(u'osd'):
p_file = filePath
if 'p_file' in locals():
Receiver.send_message(u'cursor_busy')
Receiver.send_message(u'openlp_process_events')
fileTo = open(p_file, u'r')
items = cPickle.load(fileTo)
fileTo.close()
@ -520,6 +522,7 @@ class ServiceManager(QtGui.QWidget):
Receiver.send_message(u'%s_service_load' %
serviceItem.name.lower(), serviceItem)
delete_file(p_file)
Receiver.send_message(u'cursor_normal')
else:
critical_error_message_box(
message=translate('OpenLP.ServiceManager',
@ -536,9 +539,7 @@ class ServiceManager(QtGui.QWidget):
self.mainwindow.addRecentFile(fileName)
self.setModified(False)
QtCore.QSettings(). \
setValue(u'service/last file',QtCore.QVariant(fileName))
# Refresh Plugin lists
Receiver.send_message(u'plugin_list_refresh')
setValue(u'service/last file', QtCore.QVariant(fileName))
def loadLastFile(self):
"""

View File

@ -95,8 +95,6 @@ class SongMediaItem(MediaManagerItem):
self.searchLayout.addLayout(self.searchButtonLayout)
self.pageLayout.addWidget(self.searchWidget)
# Signals and slots
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'plugin_list_refresh'), self.onSearchTextButtonClick)
QtCore.QObject.connect(self.searchTextEdit,
QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClick)
QtCore.QObject.connect(self.searchTextButton,
@ -433,6 +431,7 @@ class SongMediaItem(MediaManagerItem):
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',