Skip to content

Commit

Permalink
[processing] Remove selected rows from batch table, not always last row
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 30, 2019
1 parent ec4cfed commit c12fd87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 12 additions & 3 deletions python/plugins/processing/gui/BatchPanel.py
Expand Up @@ -544,9 +544,18 @@ def addRow(self):
wrapper.postInitialize(list(wrappers.values()))

def removeRows(self):
if self.tblParameters.rowCount() > 2:
self.wrappers.pop()
self.tblParameters.setRowCount(self.tblParameters.rowCount() - 1)
rows = set()
for index in self.tblParameters.selectedIndexes():
if index.row() == 0:
continue
rows.add(index.row())

for row in sorted(rows, reverse=True):
if self.tblParameters.rowCount() <= 2:
break

del self.wrappers[row - 1]
self.tblParameters.removeRow(row)

def toggleAdvancedMode(self, checked):
for column, param in enumerate(self.alg.parameterDefinitions()):
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/processing/ui/widgetBatchPanel.ui
Expand Up @@ -89,9 +89,6 @@
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item row="0" column="3">
Expand Down

0 comments on commit c12fd87

Please sign in to comment.