Skip to content

Commit

Permalink
Fix errors calculating gdal command when dialog is being constructed
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 13, 2017
1 parent ba6e2dc commit 95fe5cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 95fe5cd

Please sign in to comment.