Skip to content
Permalink
Browse files

Don't set thinking cursors when running processing algorithms

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

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

0 comments on commit e9e335a

Please sign in to comment.
You can’t perform that action at this time.