mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -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):
|
||||
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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user