Skip to content

Commit

Permalink
Fix bug in algo execution dialog that prevented loading results.
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@333 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Aug 3, 2012
1 parent e46b466 commit d4a316a
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/sextante/gui/AlgorithmExecutionDialog.py
Expand Up @@ -166,7 +166,6 @@ def setParamValue(self, param, widget):

@pyqtSlot()
def accept(self):
#~ try:
if self.setParamValues():
msg = self.alg.checkParameterValuesBeforeExecuting()
if msg:
Expand Down Expand Up @@ -205,39 +204,25 @@ def accept(self):
self.setInfo("Algorithm %s started" % self.alg.name)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(True)
self.tabWidget.setCurrentIndex(1) # log tab
self.finish()
else:
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
if iterateParam:
UnthreadedAlgorithmExecutor.runalgIterating(self.alg, iterateParam, self)
else:
command = self.alg.getAsCommand()
if command:
SextanteLog.addToLog(SextanteLog.LOG_ALGORITHM, command)
if UnthreadedAlgorithmExecutor.runalg(self.alg, self):
SextantePostprocessing.handleAlgorithmResults(self.alg, not keepOpen)
self.executed = True
QApplication.restoreOverrideCursor()
if not keepOpen:
self.close()
else:
self.progressLabel.setText("")
self.progress.setMaximum(100)
self.progress.setValue(0)
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)


self.finish()
else:
QMessageBox.critical(self, "Unable to execute algorithm", "Wrong or missing parameter values")

@pyqtSlot()
def finish(self):
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
SextantePostprocessing.handleAlgorithmResults(self.alg, not keepOpen)
self.executed = True
self.setInfo("Algorithm %s finished correctly" % self.alg.name)
QApplication.restoreOverrideCursor()
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
if not keepOpen:
self.close()
else:
Expand Down

0 comments on commit d4a316a

Please sign in to comment.