849 changes: 39 additions & 810 deletions python/plugins/sextante/algs/mmqgisx/mmqgisx_library.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions python/plugins/sextante/gui/AlgorithmExecutionDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def accept(self):
if command:
SextanteLog.addToLog(SextanteLog.LOG_ALGORITHM, command)
self.algEx = AlgorithmExecutor(self.alg)
self.algEx.finished.connect(self.finish)
self.algEx.algExecuted.connect(self.finish)
self.algEx.error.connect(self.error)
self.algEx.percentageChanged.connect(self.setPercentage)
self.algEx.textChanged.connect(self.setText)
Expand Down Expand Up @@ -298,10 +298,10 @@ def finish(self):

@pyqtSlot(str)
def error(self, msg):
#self.algEx.finished.disconnect()
QApplication.restoreOverrideCursor()
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
self.setInfo(msg, True)
self.algEx.finished.disconnect()
self.setInfo(msg, True)
if not keepOpen:
QMessageBox.critical(self, "Error", msg)
self.close()
Expand All @@ -318,7 +318,7 @@ def iterate(self, i):
def cancel(self):
self.setInfo("<b>Algorithm %s canceled</b>" % self.alg.name)
try:
self.algEx.finished.disconnect()
self.algEx.algExecuted.disconnect()
self.algEx.terminate()
except:
pass
Expand Down
2 changes: 2 additions & 0 deletions python/plugins/sextante/gui/AlgorithmExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AlgorithmExecutor(QThread):
commandSet = pyqtSignal(str)
debugInfoSet = pyqtSignal(str)
consoleInfoSet = pyqtSignal(str)
algExecuted = pyqtSignal()
#started & finished inherited from QThread

def __init__(self, alg, iterParam = None, parent = None):
Expand Down Expand Up @@ -93,6 +94,7 @@ def raiseInternalError(self, error):
def runalg(self):
try:
self.algorithm.execute(self.progress)
self.algExecuted.emit()
except GeoAlgorithmExecutionException, e :
self.error.emit(e.msg)
except BaseException, e:
Expand Down