new undo system

Also enables undoing when working with node input arrays
This commit is contained in:
itsmattkc
2021-01-29 16:10:34 +11:00
parent 4e5db91c17
commit ad4b83a098
69 changed files with 1218 additions and 837 deletions
@@ -571,7 +571,7 @@ void ProjectExplorer::DeleteSelected()
return;
}
QUndoCommand* command = new QUndoCommand();
MultiUndoCommand* command = new MultiUndoCommand();
foreach (Item* item, selected) {
// Verify whether this item is in use anywhere
@@ -629,7 +629,7 @@ void ProjectExplorer::DeleteSelected()
if (msgbox.clickedButton() == offline_btn || msgbox.clickedButton() == delete_clip_btn) {
// For safety, even if we're deleting clips, we'll offline the footage nodes too
new OfflineFootageCommand(footage_nodes, command);
command->add_child(new OfflineFootageCommand(footage_nodes));
}
@@ -676,7 +676,7 @@ void ProjectExplorer::DeleteSelected()
break;
}
new ProjectViewModel::RemoveItemCommand(&model_, item, command);
command->add_child(new ProjectViewModel::RemoveItemCommand(&model_, item));
}
Core::instance()->undo_stack()->pushIfHasChildren(command);