Skip to content

Commit

Permalink
Cancelation terminates thread.
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@248 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Jun 16, 2012
1 parent a5c7b56 commit 1c4a756
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/sextante/core/Sextante.py
Expand Up @@ -277,8 +277,7 @@ def runalg(name, *args):
SextanteLog.addToLog(SextanteLog.LOG_ALGORITHM, alg.getAsCommand())

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
algEx = AlgorithmExecutor(alg)
algEx.start()
alg.execute()
QApplication.restoreOverrideCursor()
return alg.getOutputValuesAsDictionary()

Expand Down
2 changes: 2 additions & 0 deletions src/sextante/gui/BatchProcessingDialog.py
Expand Up @@ -114,6 +114,8 @@ def loadHTMLResults(self, alg, i):

def cancelPressed(self):
self.algs = None
if self.algEx:
self.algEx.terminate()
self.close()

@pyqtSlot()
Expand Down
1 change: 1 addition & 0 deletions src/sextante/gui/ParametersDialog.py
Expand Up @@ -227,6 +227,7 @@ def error(self, msg):
def cancel(self):
try:
self.algEx.finished.disconnect()
self.algEx.terminate()
QApplication.restoreOverrideCursor()
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
except:
Expand Down

0 comments on commit 1c4a756

Please sign in to comment.