Disable deletion if a terminal can't be deleted.

In case of user try to delete a terminal element who is bridged
or belong to a physical terminal with more than one level, the deletion
is aborted to avoid mistake in the terminal strip parent of the terminal
element. A dialog is opened when the deletion can't be to explain to
user what to do for enable the deletion.
This commit is contained in:
joshua
2025-07-24 22:24:15 +02:00
parent a121fbe530
commit 74b55f3bf5
5 changed files with 60 additions and 8 deletions

View File

@@ -34,10 +34,10 @@ class DeleteQGraphicsItemCommand : public QUndoCommand
public:
DeleteQGraphicsItemCommand(Diagram *diagram, const DiagramContent &content, QUndoCommand * parent = nullptr);
~DeleteQGraphicsItemCommand() override;
static bool hasNonDeletableTerminal(const DiagramContent &content);
private:
DeleteQGraphicsItemCommand(const DeleteQGraphicsItemCommand &);
void setPotentialsOfRemovedElements();
Terminal *terminalInSamePotential(Terminal *terminal, Conductor *conductor_to_exclude);