From 37cc8fc5f1623e13d53be45715dbbe6b64cba738 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 3 Jul 2017 11:02:45 +1000 Subject: [PATCH] Don't allow removal of model parameters on which other parameters depend --- python/plugins/processing/modeler/ModelerGraphicItem.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/plugins/processing/modeler/ModelerGraphicItem.py b/python/plugins/processing/modeler/ModelerGraphicItem.py index 33bd83ee1a2..39b957e8adc 100644 --- a/python/plugins/processing/modeler/ModelerGraphicItem.py +++ b/python/plugins/processing/modeler/ModelerGraphicItem.py @@ -229,8 +229,12 @@ class ModelerGraphicItem(QGraphicsItem): def removeElement(self): if isinstance(self.element, QgsProcessingModelAlgorithm.ModelParameter): if self.model.childAlgorithmsDependOnParameter(self.element.parameterName()): - QMessageBox.warning(None, 'Could not remove element', - 'Other elements depend on the selected one.\n' + QMessageBox.warning(None, 'Could not remove input', + 'Algorithms depend on the selected input.\n' + 'Remove them before trying to remove it.') + elif self.model.otherParametersDependOnParameter(self.element.parameterName()): + QMessageBox.warning(None, 'Could not remove input', + 'Other inputs depend on the selected input.\n' 'Remove them before trying to remove it.') else: self.model.removeModelParameter(self.element.parameterName())