Skip to content

Commit

Permalink
Don't set thinking cursors when running processing algorithms
Browse files Browse the repository at this point in the history
Since now they're run in a background thread, it's not appropriate
anymore
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent e1184cd commit e9e335a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions python/plugins/processing/gui/AlgorithmDialog.py
Expand Up @@ -220,8 +220,6 @@ def accept(self):
except:
pass

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))

self.setInfo(
self.tr('<b>Algorithm \'{0}\' starting...</b>').format(self.alg.displayName()), escape_html=False)

Expand All @@ -239,7 +237,6 @@ def accept(self):
self.finish(parameters, context, feedback)
else:
self.buttonCancel.setEnabled(False)
QApplication.restoreOverrideCursor()
self.resetGUI()
else:
command = self.alg.asPythonCommand(parameters, context)
Expand Down Expand Up @@ -294,7 +291,6 @@ def finish(self, result, context, feedback):

self.executed = True
self.setInfo(self.tr('Algorithm \'{0}\' finished').format(self.alg.displayName()), escape_html=False)
QApplication.restoreOverrideCursor()

if not keepOpen:
self.close()
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/processing/gui/AlgorithmDialogBase.py
Expand Up @@ -188,13 +188,11 @@ def setMainWidget(self, widget):
QgsProject.instance().layersWillBeRemoved.connect(self.mainWidget.layerRegistryChanged)

def error(self, msg):
QApplication.restoreOverrideCursor()
self.setInfo(msg, True)
self.resetGUI()
self.tabWidget.setCurrentIndex(1)

def resetGUI(self):
QApplication.restoreOverrideCursor()
self.lblProgress.setText('')
self.progressBar.setMaximum(100)
self.progressBar.setValue(0)
Expand All @@ -208,33 +206,27 @@ def setInfo(self, msg, error=False, escape_html=True):
self.txtLog.append(html.escape(msg))
else:
self.txtLog.append(msg)
QCoreApplication.processEvents()

def setCommand(self, cmd):
if self.showDebug:
self.txtLog.append('<code>{}<code>'.format(html.escape(cmd, quote=False)))
QCoreApplication.processEvents()

def setDebugInfo(self, msg):
if self.showDebug:
self.txtLog.append('<span style="color:blue">{}</span>'.format(html.escape(msg, quote=False)))
QCoreApplication.processEvents()

def setConsoleInfo(self, msg):
if self.showDebug:
self.txtLog.append('<code><span style="color:darkgray">{}</span></code>'.format(html.escape(msg, quote=False)))
QCoreApplication.processEvents()

def setPercentage(self, value):
if self.progressBar.maximum() == 0:
self.progressBar.setMaximum(100)
self.progressBar.setValue(value)
QCoreApplication.processEvents()

def setText(self, text):
self.lblProgress.setText(text)
self.setInfo(text, False)
QCoreApplication.processEvents()

def getParamValues(self):
return {}
Expand Down

0 comments on commit e9e335a

Please sign in to comment.