Fix import painting and allow import to Cancel

bzr-revno: 307
This commit is contained in:
Tim Bentley 2009-02-11 19:07:34 +00:00
parent fcc9b37df6
commit feca659f11
4 changed files with 9 additions and 17 deletions

View File

@ -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()

View File

@ -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")

View File

@ -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

View File

@ -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)