Skip to content

Commit

Permalink
[processing] When running an algorithm in place mode, don't auto close
Browse files Browse the repository at this point in the history
the dialog after changing features

Otherwise it can be a real pain to iteratively change/undo/tweak parameter
value
  • Loading branch information
nyalldawson committed Mar 6, 2020
1 parent 4e1e684 commit bc3077e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions python/plugins/processing/gui/AlgorithmDialog.py
Expand Up @@ -259,10 +259,7 @@ def on_complete(ok, results):

self.cancelButton().setEnabled(False)

if not self.in_place:
self.finish(ok, results, self.context, self.feedback)
elif ok:
self.close()
self.finish(ok, results, self.context, self.feedback, in_place=self.in_place)

self.feedback = None
self.context = None
Expand Down Expand Up @@ -316,10 +313,10 @@ def on_complete(ok, results):
self.messageBar().pushMessage("", e.message,
level=Qgis.Warning, duration=5)

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

if self.iterateParam is None:
if not in_place and self.iterateParam is None:

# add html results to results dock
for out in self.algorithm().outputDefinitions():
Expand All @@ -334,7 +331,7 @@ def finish(self, successful, result, context, feedback):
self.setResults(result)
self.setInfo(self.tr('Algorithm \'{0}\' finished').format(self.algorithm().displayName()), escapeHtml=False)

if not keepOpen:
if not in_place and not keepOpen:
self.close()
else:
self.resetGui()
Expand Down

0 comments on commit bc3077e

Please sign in to comment.