Skip to content

Commit

Permalink
fixed minor issue when executing algorithms from the toolbox
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@274 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed Jun 29, 2012
1 parent f4b0df4 commit 980ad22
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/sextante/gui/ParametersDialog.py
Expand Up @@ -193,12 +193,26 @@ def accept(self):
self.algEx.textChanged.connect(self.setText)
self.algEx.start()
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(True)
self.finish()
else:
keepOpen = SextanteConfig.getSetting(SextanteConfig.KEEP_DIALOG_OPEN)
if iterateParam:
UnthreadedAlgorithmExecutor.runalgIterating(self.alg, iterateParam, self)
else:
UnthreadedAlgorithmExecutor.runalg(self.alg, self)
self.finish()
if UnthreadedAlgorithmExecutor.runalg(self.alg, self):
SextantePostprocessing.handleAlgorithmResults(self.alg, not keepOpen)
self.dialog.executed = True
QApplication.restoreOverrideCursor()
if not keepOpen:
self.dialog.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)


else:
QMessageBox.critical(self.dialog, "Unable to execute algorithm", "Wrong or missing parameter values")
Expand All @@ -217,7 +231,7 @@ def finish(self):
self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).setEnabled(False)
SextantePostprocessing.handleAlgorithmResults(self.alg, not keepOpen)


@pyqtSlot()
def error(self, msg):
Expand Down

0 comments on commit 980ad22

Please sign in to comment.