feat: safe workspace tree deletion with reference cleanup and confirmation

- Add deleteRootStruct() that clears orphaned refId references before removal
- Show confirmation dialog listing all fields that reference the deleted type
- Auto-switch view to next root struct when the viewed one is deleted
- Entire operation is a single undo macro (Ctrl+Z restores everything)
This commit is contained in:
IChooseYou
2026-02-19 10:06:13 -07:00
parent 7678da033d
commit d989e2a947
3 changed files with 90 additions and 1 deletions

View File

@@ -99,6 +99,7 @@ public:
void showContextMenu(RcxEditor* editor, int line, int nodeIdx, int subLine, const QPoint& globalPos);
void batchRemoveNodes(const QVector<int>& nodeIndices);
void batchChangeKind(const QVector<int>& nodeIndices, NodeKind newKind);
void deleteRootStruct(uint64_t structId);
void applyCommand(const Command& cmd, bool isUndo);
void refresh();