diff --git a/openlp.pyw b/openlp.pyw index 8cc7a16a6..f3455962d 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -162,6 +162,10 @@ class OpenLP(QtGui.QApplication): #provide a listener for widgets to reqest a screen update. QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_process_events'), self.processEvents) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'cursor_busy'), self.setBusyCursor) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'cursor_normal'), self.setNormalCursor) self.setOrganizationName(u'OpenLP') self.setOrganizationDomain(u'openlp.org') self.setApplicationName(u'OpenLP') @@ -201,8 +205,21 @@ class OpenLP(QtGui.QApplication): self.exceptionForm = ExceptionForm(self.mainWindow) self.exceptionForm.exceptionTextEdit.setPlainText( ''.join(format_exception(exctype, value, traceback))) + self.setNormalCursor() self.exceptionForm.exec_() + def setBusyCursor(self): + """ + Sets the Busy Cursor for the Application + """ + self.setOverrideCursor(QtCore.Qt.BusyCursor) + + def setNormalCursor(self): + """ + Sets the Normal Cursor forthe Application + """ + self.restoreOverrideCursor() + def main(): """ The main function which parses command line options and then runs @@ -264,4 +281,4 @@ if __name__ == u'__main__': """ Instantiate and run the application. """ - main() \ No newline at end of file + main() diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index b39173849..d3cbf41f7 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -220,6 +220,21 @@ class EventReceiver(QtCore.QObject): Waits for openlp to do something "interesting" and sends a remotes_poll_response signal when it does + ``openlp_critical_message`` + Displays a standalong Critical Message + + ``openlp_error_message`` + Displays a standalong Error Message + + ``openlp_information_message`` + Displays a standalong Information Message + + ``cursor_busy`` + Makes the cursor got to a busy form + + ``cursor_normal`` + Resets the cursor to default + """ def __init__(self): """ diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 6147be608..a9484795b 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -349,11 +349,13 @@ class MediaManagerItem(QtGui.QWidget): self.OnNewFileMasks) log.info(u'New files(s) %s', unicode(files)) if files: + Receiver.send_message(u'cursor_busy') self.loadList(files) lastDir = os.path.split(unicode(files[0]))[0] SettingsManager.set_last_dir(self.settingsSection, lastDir) SettingsManager.set_list(self.settingsSection, self.settingsSection, self.getFileList()) + Receiver.send_message(u'cursor_normal') def getFileList(self): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index f6e0a3096..16dbfb2c4 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -612,6 +612,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage) + Receiver.send_message(u'cursor_busy') # Simple message boxes QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_error_message'), self.onErrorMessage) @@ -667,6 +668,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): if savedPlugin != -1: self.MediaToolBox.setCurrentIndex(savedPlugin) self.settingsForm.postSetUp() + Receiver.send_message(u'cursor_normal') def setAutoLanguage(self, value): self.LanguageGroup.setDisabled(value) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 9d7bada14..e58e9eaef 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -895,6 +895,7 @@ class ServiceManager(QtGui.QWidget): Rebuild the service list as things have changed and a repaint is the easiest way to do this. """ + Receiver.send_message(u'cursor_busy') log.debug(u'regenerateServiceItems') # force reset of renderer as theme data has changed self.parent.renderManager.themedata = None @@ -909,6 +910,7 @@ class ServiceManager(QtGui.QWidget): # Set to False as items may have changed rendering # does not impact the saved song so True may also be valid self.setModified(True) + Receiver.send_message(u'cursor_normal') def serviceItemUpdate(self, message): """ diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 170ac3b74..7281bb091 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -139,8 +139,6 @@ class ImageMediaItem(MediaManagerItem): self.settingsSection, self.getFileList()) def loadList(self, list): - self.listView.setCursor(QtCore.Qt.BusyCursor) - Receiver.send_message(u'openlp_process_events') for file in list: filename = os.path.split(unicode(file))[1] thumb = os.path.join(self.servicePath, filename) @@ -155,8 +153,6 @@ class ImageMediaItem(MediaManagerItem): item_name.setIcon(icon) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) self.listView.addItem(item_name) - self.listView.setCursor(QtCore.Qt.ArrowCursor) - Receiver.send_message(u'openlp_process_events') def generateSlideData(self, service_item, item=None, xmlVersion=False): items = self.listView.selectedIndexes()