Skip to content
Permalink
Browse files

Fix errors calculating gdal command when dialog is being constructed

  • Loading branch information
nyalldawson committed Aug 13, 2017
1 parent ba6e2dc commit 95fe5cdc040aa02f8ad55bab775516013b69bd1b
Showing with 9 additions and 1 deletion.
  1. +9 −1 python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
@@ -37,7 +37,8 @@
QSizePolicy,
QDialogButtonBox)

from qgis.core import QgsProcessingFeedback
from qgis.core import (QgsProcessingFeedback,
QgsProcessingParameterDefinition)
from qgis.gui import QgsMessageBar

from processing.gui.AlgorithmDialog import AlgorithmDialog
@@ -111,6 +112,13 @@ def parametersHaveChanged(self):
for output in self.alg.destinationParameterDefinitions():
if not output.name() in parameters or parameters[output.name()] is None:
parameters[output.name()] = self.tr("[temporary file]")
for p in self.alg.parameterDefinitions():
if ( not p.name() in parameters and not p.flags() & QgsProcessingParameterDefinition.FlagOptional) \
or (not p.checkValueIsAcceptable(parameters[p.name()], context)):
# not ready yet
self.text.setPlainText('')
return

commands = self.alg.getConsoleCommands(parameters, context, feedback)
commands = [c for c in commands if c not in ['cmd.exe', '/C ']]
self.text.setPlainText(" ".join(commands))

0 comments on commit 95fe5cd

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