Skip to content

Commit d19ccb7

Browse files
committed
[processing] don't close dialog if execution fails (fix #9893)
1 parent 4ff930e commit d19ccb7

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

python/plugins/processing/gui/AlgorithmExecutionDialog.py

+8-20
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(C) 2013 by CS Systemes d'information (CS SI)
1010
Email : volayaf at gmail dot com
1111
otb at c-s dot fr (CS SI)
12-
Contributors : Victor Olaya
12+
Contributors : Victor Olaya
1313
Alexia Mondot (CS SI) - managing the new parameter ParameterMultipleExternalInput
1414
***************************************************************************
1515
* *
@@ -169,9 +169,9 @@ def setParamValues(self):
169169
def setParamValue(self, param, widget):
170170
"""
171171
set the .value of the parameter according to the given widget
172-
the way to get the value is different for each value,
172+
the way to get the value is different for each value,
173173
so there is a code for each kind of parameter
174-
174+
175175
param : -il <ParameterMultipleInput> or -method <ParameterSelection> ...
176176
"""
177177
if isinstance(param, ParameterRaster):
@@ -191,7 +191,7 @@ def setParamValue(self, param, widget):
191191
return param.setValue(widget.getValue())
192192
if isinstance(param, ParameterTableField):
193193
if param.optional and widget.currentIndex() == 0:
194-
return param.setValue(None)
194+
return param.setValue(None)
195195
return param.setValue(widget.currentText())
196196
elif isinstance(param, ParameterMultipleInput):
197197
if param.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
@@ -260,10 +260,7 @@ def accept(self):
260260
self.finish()
261261
else:
262262
QApplication.restoreOverrideCursor()
263-
if not keepOpen:
264-
self.close()
265-
else:
266-
self.resetGUI()
263+
self.resetGUI()
267264
else:
268265
command = self.alg.getAsCommand()
269266
if command:
@@ -273,10 +270,7 @@ def accept(self):
273270
self.finish()
274271
else:
275272
QApplication.restoreOverrideCursor()
276-
if not keepOpen:
277-
self.close()
278-
else:
279-
self.resetGUI()
273+
self.resetGUI()
280274
except AlgorithmExecutionDialog.InvalidParameterValue, ex:
281275
try:
282276
self.buttonBox.accepted.connect(lambda :
@@ -309,15 +303,9 @@ def finish(self):
309303

310304
def error(self, msg):
311305
QApplication.restoreOverrideCursor()
312-
keepOpen = ProcessingConfig.getSetting(
313-
ProcessingConfig.KEEP_DIALOG_OPEN)
314306
self.setInfo(msg, True)
315-
if not keepOpen:
316-
QMessageBox.critical(self, 'Error', msg)
317-
self.close()
318-
else:
319-
self.resetGUI()
320-
self.tabWidget.setCurrentIndex(1) # log tab
307+
self.resetGUI()
308+
self.tabWidget.setCurrentIndex(1) # log tab
321309

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

0 commit comments

Comments
 (0)