Skip to content
Permalink
Browse files

[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
  • Loading branch information
nyalldawson committed Aug 2, 2017
1 parent 16629b4 commit a64d199e6f216cdaeb99d2e5cc6b56af93371452
@@ -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()
@@ -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)
@@ -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:

@@ -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):

0 comments on commit a64d199

Please sign in to comment.
You can’t perform that action at this time.