Skip to content

Commit a64d199

Browse files
committedAug 5, 2017
[processing] If an error occurs while running an algorith, always
keep the algorithm dialog open after execution Otherwise it's hard to see the error - you have to know to check the python log. Keeping the dialog open at the log makes the error immediately visible to the user
1 parent 16629b4 commit a64d199

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎python/plugins/processing/gui/AlgorithmDialog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def accept(self):
229229
feedback.pushInfo(
230230
self.tr('Execution completed in {0:0.2f} seconds'.format(time.time() - start_time)))
231231
self.buttonCancel.setEnabled(False)
232-
self.finish(parameters, context, feedback)
232+
self.finish(True, parameters, context, feedback)
233233
else:
234234
self.buttonCancel.setEnabled(False)
235235
self.resetGUI()
@@ -250,7 +250,7 @@ def on_complete(ok, results):
250250
feedback.pushInfo('')
251251

252252
self.buttonCancel.setEnabled(False)
253-
self.finish(results, context, feedback)
253+
self.finish(ok, results, context, feedback)
254254

255255
task = QgsProcessingAlgRunnerTask(self.alg, parameters, context, feedback)
256256
task.executed.connect(on_complete)
@@ -269,8 +269,8 @@ def on_complete(ok, results):
269269
self.bar.pushMessage("", self.tr("Wrong or missing parameter value: {0}").format(e.parameter.description()),
270270
level=QgsMessageBar.WARNING, duration=5)
271271

272-
def finish(self, result, context, feedback):
273-
keepOpen = ProcessingConfig.getSetting(ProcessingConfig.KEEP_DIALOG_OPEN)
272+
def finish(self, successful, result, context, feedback):
273+
keepOpen = not successful or ProcessingConfig.getSetting(ProcessingConfig.KEEP_DIALOG_OPEN)
274274

275275
if self.iterateParam is None:
276276

‎python/plugins/processing/gui/AlgorithmDialogBase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def reject(self):
238238
self._saveGeometry()
239239
super(AlgorithmDialogBase, self).reject()
240240

241-
def finish(self, context, feedback):
241+
def finish(self, successful, result, context, feedback):
242242
pass
243243

244244
def toggleCollapsed(self):

0 commit comments

Comments
 (0)
Please sign in to comment.