Skip to content

Commit

Permalink
[processing] Fix incorrect columns hidden when toggling advanced para…
Browse files Browse the repository at this point in the history
…ms in batch mode
  • Loading branch information
nyalldawson committed Apr 30, 2019
1 parent 1d80fe8 commit 070de69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/plugins/processing/gui/BatchPanel.py
Expand Up @@ -312,6 +312,7 @@ def processingContext(self):
self.context_generator = ContextGenerator(self.processing_context)

self.column_to_parameter_definition = {}
self.parameter_to_column = {}

self.initWidgets()

Expand Down Expand Up @@ -340,13 +341,15 @@ def initWidgets(self):
self.tblParameters.setColumnHidden(column, True)

self.column_to_parameter_definition[column] = param.name()
self.parameter_to_column[param.name()] = column
column += 1

for out in self.alg.destinationParameterDefinitions():
if not out.flags() & QgsProcessingParameterDefinition.FlagHidden:
self.tblParameters.setHorizontalHeaderItem(
column, QTableWidgetItem(out.description()))
self.column_to_parameter_definition[column] = out.name()
self.parameter_to_column[out.name()] = column
column += 1

self.addFillRow()
Expand Down Expand Up @@ -558,9 +561,9 @@ def removeRows(self):
self.tblParameters.removeRow(row)

def toggleAdvancedMode(self, checked):
for column, param in enumerate(self.alg.parameterDefinitions()):
for param in self.alg.parameterDefinitions():
if param.flags() & QgsProcessingParameterDefinition.FlagAdvanced:
self.tblParameters.setColumnHidden(column, not checked)
self.tblParameters.setColumnHidden(self.parameter_to_column[param.name()], not checked)

def parametersForRow(self, row, destinationProject=None, warnOnInvalid=True):
"""
Expand Down

1 comment on commit 070de69

@PedroVenancio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nyalldawson

This fix needs to be backported to 3.4 and 3.6, as reported here:

https://issues.qgis.org/issues/22087

Thank you very much!

Please sign in to comment.