Skip to content

Commit

Permalink
[processing] Add option whether to load batch output layers on comple…
Browse files Browse the repository at this point in the history
…tion

By always trying to load all layers, we severely limit the usefulness
of batch processing. E.g. try clipping 200 layers - and then
get ready to punch something as you wait for all the results to load.
  • Loading branch information
nyalldawson committed Nov 10, 2017
1 parent 3fc9030 commit 2ed2248
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/gui/BatchAlgorithmDialog.py
Expand Up @@ -81,6 +81,9 @@ def accept(self):

feedback = self.createFeedback()

load_layers = self.mainWidget.checkLoadLayersOnCompletion.isChecked()
project = QgsProject.instance() if load_layers else None

for row in range(self.mainWidget.tblParameters.rowCount()):
col = 0
parameters = {}
Expand All @@ -107,7 +110,7 @@ def accept(self):
if isinstance(out, (QgsProcessingParameterRasterDestination,
QgsProcessingParameterFeatureSink)):
# load rasters and sinks on completion
parameters[out.name()] = QgsProcessingOutputLayerDefinition(text, QgsProject.instance())
parameters[out.name()] = QgsProcessingOutputLayerDefinition(text, project)
else:
parameters[out.name()] = text
col += 1
Expand Down
7 changes: 7 additions & 0 deletions python/plugins/processing/ui/widgetBatchPanel.ui
Expand Up @@ -120,6 +120,13 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QCheckBox" name="checkLoadLayersOnCompletion">
<property name="text">
<string>Load layers on completion</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
Expand Down

0 comments on commit 2ed2248

Please sign in to comment.