Skip to content
Permalink
Browse files

History algorithm execution progress & cancel button.

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@277 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com
cpolymeris@gmail.com committed Jul 1, 2012
1 parent 0d475df commit 655bd11cfc0bd179ee02599c39a11ebe83084bf0
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/sextante/core/Sextante.py
@@ -358,16 +358,32 @@ def runandload(name, *args):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS):
algEx = AlgorithmExecutor(alg)
progress = QProgressDialog()
progress.setWindowTitle(alg.name)
progress.setLabelText("Executing %s..." % alg.name)
def finish():
SextantePostprocessing.handleAlgorithmResults(alg)
QApplication.restoreOverrideCursor()
progress.close()
def error(msg):
QApplication.restoreOverrideCursor()
QMessageBox.critical(None, "Error", msg)
SextanteLog.addToLog(SextanteLog.LOG_ERROR, msg)
def cancel():
try:
algEx.finished.disconnect()
algEx.terminate()
QApplication.restoreOverrideCursor()
progress.close()
except:
pass
algEx.error.connect(error)
algEx.finished.connect(finish)
algEx.textChanged.connect(lambda t: progress.setLabelText(t))
algEx.percentageChanged.connect(lambda x: progress.setValue(x))
progress.canceled.connect(cancel)
algEx.start()
progress.show()
else:
if UnthreadedAlgorithmExecutor.runalg(alg, SilentProgress()):
SextantePostprocessing.handleAlgorithmResults(alg)

0 comments on commit 655bd11

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