Skip to content
Permalink
Browse files

Don't allow removal of model parameters on which other parameters

depend
  • Loading branch information
nyalldawson committed Jul 3, 2017
1 parent 921939e commit 37cc8fc5f1623e13d53be45715dbbe6b64cba738
Showing with 6 additions and 2 deletions.
  1. +6 −2 python/plugins/processing/modeler/ModelerGraphicItem.py
@@ -229,8 +229,12 @@ def updateAlgorithm(self, alg):
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())

0 comments on commit 37cc8fc

Please sign in to comment.
You can’t perform that action at this time.