Skip to content
Permalink
Browse files

Add proxy progress task for non-background algorithms

  • Loading branch information
nirvn authored and nyalldawson committed Aug 8, 2018
1 parent 5d078ec commit 94300eab7cc651d2d8bf2d68b7562b0bfb62c633
Showing with 8 additions and 1 deletion.
  1. +8 −1 python/plugins/processing/gui/AlgorithmDialog.py
@@ -43,7 +43,9 @@
QgsProcessingOutputLayerDefinition,
QgsProcessingParameterFeatureSink,
QgsProcessingParameterRasterDestination,
QgsProcessingAlgorithm)
QgsProcessingAlgorithm,
QgsProxyProgressTask,
QgsTaskManager)
from qgis.gui import (QgsGui,
QgsMessageBar,
QgsProcessingAlgorithmDialogBase)
@@ -219,9 +221,14 @@ def on_complete(ok, results):
task.executed.connect(on_complete)
self.setCurrentTask(task)
else:
self.proxy_progress = QgsProxyProgressTask(self.tr("Executing “{}”").format(self.algorithm().displayName()))
QgsApplication.taskManager().addTask(self.proxy_progress)
feedback.progressChanged.connect(self.proxy_progress.setProxyProgress)
self.feedback_dialog = self.createProgressDialog()
self.feedback_dialog.show()
ok, results = execute(self.algorithm(), parameters, context, feedback)
feedback.progressChanged.disconnect()
self.proxy_progress.finalize(ok)
on_complete(ok, results)

except AlgorithmDialogBase.InvalidParameterValue as e:

0 comments on commit 94300ea

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