diff --git a/openlp.pyw b/openlp.pyw index 0122e0e37..e3126a9e1 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -23,6 +23,7 @@ import sys import logging from PyQt4 import QtCore, QtGui +from openlp.core.lib import Receiver logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', @@ -36,6 +37,8 @@ from openlp.core.ui import MainWindow, SplashScreen class OpenLP(QtGui.QApplication): def run(self): + QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlpprocessevents"),self.processEvents) + self.setApplicationName('openlp.org') self.setApplicationVersion('1.9.0') self.splash = SplashScreen() diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index cd7ca8906..f7c67cdff 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.resources import * from openlp.core.ui import AboutForm, AlertForm, SettingsDialog, SlideController -from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, Receiver +from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab from openlp.core import PluginManager @@ -40,10 +40,6 @@ class MainWindow(object): pluginpath = os.path.abspath(os.path.join(pluginpath, '..', '..','plugins')) self.plugin_manager = PluginManager(pluginpath) self.setupUi() - QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlprepaint"),self.repaint) - - def repaint(self): - self.main_window.repaint() def setupUi(self): self.main_window.setObjectName("main_window") diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index ac7661266..b92904f33 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -48,11 +48,7 @@ class BiblePlugin(Plugin, PluginUtils): #Register the bible Manager self.biblemanager = BibleManager(self.config) self.searchresults = {} # place to store the search results - self.receiver = Receiver() - QtCore.QObject.connect(self.receiver.get_receiver(),QtCore.SIGNAL("openlprepaint"),self.repaint) - - def repaint(self): - self.MediaManagerItem.repaint() + QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlpreloadbibles"),self.reload_bibles) def get_media_manager_item(self): # Create the MediaManagerItem object diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index dacdee73b..729ced10f 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -41,11 +41,6 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils): QtCore.QObject.connect(self.LocationComboBox, QtCore.SIGNAL("activated(int)"), self.onLocationComboBox) QtCore.QObject.connect(self.TypeComboBox, QtCore.SIGNAL("activated(int)"), self.onTypeComboBox) QtCore.QObject.connect(self.BibleComboBox, QtCore.SIGNAL("activated(int)"), self.onBibleComboBox) - QtCore.QObject.connect(self.ProgressBar, QtCore.SIGNAL("valueChanged(int)"), self.on_ProgressBar_changed) - QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL("openlprepaint"),self.on_ProgressBar_changed) - - def on_ProgressBar_changed(self): - self.repaint() @pyqtSignature("") def on_VersesFileButton_clicked(self): @@ -123,6 +118,8 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils): @pyqtSignature("") def on_CancelButton_clicked(self): + print "Closed selected" + Receiver().send_message("openlpstopimport") self.close() @pyqtSignature("") @@ -136,8 +133,8 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils): self.biblemanager.process_dialog(self) self._import_bible() self.MessageLabel.setText("Import Complete") - self.ProgressBar.setValue(self.barmax) - self.bibleplugin.reload_bibles() # Update form as we have a new bible + self.ProgressBar.setValue(self.barmax) + Receiver().send_message("openlpreloadbibles") def setMax(self, max): log.debug("set Max %s", max)