From c12fd877edfac7db3ef697cd6f9ff300ee732e16 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sat, 27 Apr 2019 10:32:34 +1000 Subject: [PATCH] [processing] Remove selected rows from batch table, not always last row --- python/plugins/processing/gui/BatchPanel.py | 15 ++++++++++++--- python/plugins/processing/ui/widgetBatchPanel.ui | 3 --- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/python/plugins/processing/gui/BatchPanel.py b/python/plugins/processing/gui/BatchPanel.py index 91a17429b44..73450af95c1 100644 --- a/python/plugins/processing/gui/BatchPanel.py +++ b/python/plugins/processing/gui/BatchPanel.py @@ -544,9 +544,18 @@ class BatchPanel(BASE, WIDGET): 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()): diff --git a/python/plugins/processing/ui/widgetBatchPanel.ui b/python/plugins/processing/ui/widgetBatchPanel.ui index c85bb6c2148..ff400cda03a 100644 --- a/python/plugins/processing/ui/widgetBatchPanel.ui +++ b/python/plugins/processing/ui/widgetBatchPanel.ui @@ -89,9 +89,6 @@ true - - false -