Skip to content
Permalink
Browse files
[processing] don't close dialog if execution fails (fix #9893)
  • Loading branch information
alexbruy committed Mar 28, 2014
1 parent 4ff930e commit d19ccb7d6cc72bcbe002033e94fadc852e67534f
Showing with 8 additions and 20 deletions.
  1. +8 −20 python/plugins/processing/gui/AlgorithmExecutionDialog.py
@@ -9,7 +9,7 @@
(C) 2013 by CS Systemes d'information (CS SI)
Email : volayaf at gmail dot com
otb at c-s dot fr (CS SI)
Contributors : Victor Olaya
Contributors : Victor Olaya
Alexia Mondot (CS SI) - managing the new parameter ParameterMultipleExternalInput
***************************************************************************
* *
@@ -169,9 +169,9 @@ def setParamValues(self):
def setParamValue(self, param, widget):
"""
set the .value of the parameter according to the given widget
the way to get the value is different for each value,
the way to get the value is different for each value,
so there is a code for each kind of parameter
param : -il <ParameterMultipleInput> or -method <ParameterSelection> ...
"""
if isinstance(param, ParameterRaster):
@@ -191,7 +191,7 @@ def setParamValue(self, param, widget):
return param.setValue(widget.getValue())
if isinstance(param, ParameterTableField):
if param.optional and widget.currentIndex() == 0:
return param.setValue(None)
return param.setValue(None)
return param.setValue(widget.currentText())
elif isinstance(param, ParameterMultipleInput):
if param.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
@@ -260,10 +260,7 @@ def accept(self):
self.finish()
else:
QApplication.restoreOverrideCursor()
if not keepOpen:
self.close()
else:
self.resetGUI()
self.resetGUI()
else:
command = self.alg.getAsCommand()
if command:
@@ -273,10 +270,7 @@ def accept(self):
self.finish()
else:
QApplication.restoreOverrideCursor()
if not keepOpen:
self.close()
else:
self.resetGUI()
self.resetGUI()
except AlgorithmExecutionDialog.InvalidParameterValue, ex:
try:
self.buttonBox.accepted.connect(lambda :
@@ -309,15 +303,9 @@ def finish(self):

def error(self, msg):
QApplication.restoreOverrideCursor()
keepOpen = ProcessingConfig.getSetting(
ProcessingConfig.KEEP_DIALOG_OPEN)
self.setInfo(msg, True)
if not keepOpen:
QMessageBox.critical(self, 'Error', msg)
self.close()
else:
self.resetGUI()
self.tabWidget.setCurrentIndex(1) # log tab
self.resetGUI()
self.tabWidget.setCurrentIndex(1) # log tab

def iterate(self, i):
self.setInfo('<b>Algorithm %s iteration #%i completed</b>'

0 comments on commit d19ccb7

Please sign in to comment.