Skip to content

Commit

Permalink
[processing] If an error occurs while running an algorith, always
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nyalldawson committed Aug 5, 2017
1 parent 16629b4 commit a64d199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions python/plugins/processing/gui/AlgorithmDialog.py
Expand Up @@ -229,7 +229,7 @@ def accept(self):
feedback.pushInfo(
self.tr('Execution completed in {0:0.2f} seconds'.format(time.time() - start_time)))
self.buttonCancel.setEnabled(False)
self.finish(parameters, context, feedback)
self.finish(True, parameters, context, feedback)
else:
self.buttonCancel.setEnabled(False)
self.resetGUI()
Expand All @@ -250,7 +250,7 @@ def on_complete(ok, results):
feedback.pushInfo('')

self.buttonCancel.setEnabled(False)
self.finish(results, context, feedback)
self.finish(ok, results, context, feedback)

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

def finish(self, result, context, feedback):
keepOpen = ProcessingConfig.getSetting(ProcessingConfig.KEEP_DIALOG_OPEN)
def finish(self, successful, result, context, feedback):
keepOpen = not successful or ProcessingConfig.getSetting(ProcessingConfig.KEEP_DIALOG_OPEN)

if self.iterateParam is None:

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/AlgorithmDialogBase.py
Expand Up @@ -238,7 +238,7 @@ def reject(self):
self._saveGeometry()
super(AlgorithmDialogBase, self).reject()

def finish(self, context, feedback):
def finish(self, successful, result, context, feedback):
pass

def toggleCollapsed(self):
Expand Down

0 comments on commit a64d199

Please sign in to comment.