mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-17 00:09:36 -04:00
Don't allow removal of model parameters on which other parameters
depend
This commit is contained in:
parent
921939e4ec
commit
37cc8fc5f1
@ -229,8 +229,12 @@ class ModelerGraphicItem(QGraphicsItem):
|
|||||||
def removeElement(self):
|
def removeElement(self):
|
||||||
if isinstance(self.element, QgsProcessingModelAlgorithm.ModelParameter):
|
if isinstance(self.element, QgsProcessingModelAlgorithm.ModelParameter):
|
||||||
if self.model.childAlgorithmsDependOnParameter(self.element.parameterName()):
|
if self.model.childAlgorithmsDependOnParameter(self.element.parameterName()):
|
||||||
QMessageBox.warning(None, 'Could not remove element',
|
QMessageBox.warning(None, 'Could not remove input',
|
||||||
'Other elements depend on the selected one.\n'
|
'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.')
|
'Remove them before trying to remove it.')
|
||||||
else:
|
else:
|
||||||
self.model.removeModelParameter(self.element.parameterName())
|
self.model.removeModelParameter(self.element.parameterName())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user