dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

Reset scope for undo_redo commands in process dock #1200

Closed jensschmeink closed 4 months ago

jensschmeink commented 4 months ago

The scope for the change commands in the process dock are changed to not use the whole currentProject but

Description

The commands to determine the changes to keep in the undo/redo system got a more specific scope: the current selected task group

How Has This Been Tested?

I startet GTlab with a project with multiple task groups and tasks in it. I did several actions like moving, copy, paste, ... and no problem occured but undo was possible.

Checklist:

mariusalexander commented 4 months ago

Can create a suggestion here...

Can you have a look at porcessdock.cpp#L1477: I think you can use the find_lowest_ancestor function here as well:

auto* commonParent = gt::find_lowest_ancestor(objectsToMove << targetComp, gt::get_parent_object);
assert (commonParent);
auto cmd = gtApp->makeCommand(commonParent,
mariusalexander commented 4 months ago

@jensschmeink btw: have you already noticed any improvements for larger projects?

jensschmeink commented 4 months ago

@jensschmeink btw: have you already noticed any improvements for larger projects?

Currently not but my projects are not that huge.

jensschmeink commented 4 months ago

@mariusalexander I applied your suggestions and everything still seems to work fine

mariusalexander commented 4 months ago

Rest looks good to me