Commit graph

6 commits

Author SHA1 Message Date
Berthold Stoeger
3d511b069f undo: add event removal undo command
This was a trivial copy & past of the event-adding undo command
with a switch of the undo() and redo() actions.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-07 00:13:35 +02:00
Berthold Stoeger
ab8e317b28 undo: implement renaming of events
There is a slight complexity here owing to the fact that the profile
works on a copy of the current dive: We get a copy of the event and
have to search for the original event in the current dive. This
could be done in the undo command. Nevertheless, here we do it in
the profile so that when in the future the profile can work on a
non-copied dive we can simply remove this function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-07 00:13:35 +02:00
Berthold Stoeger
f9fe6d759f undo: split out EventBase class
All event-based commands will work on a dive computer and
need to replot the profile, etc. Therefore, in analogy to
the dive-list commands create a base class with two virtual
functions undoit() and redoit() that must be defined in the
derived classes that do the actual work.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-07 00:13:35 +02:00
Berthold Stoeger
1971cfad54 undo: implement set point change undo command
This is a simple copy of the other add-event commands. It could
be made more friendly by stating the pO2 value in the text.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-07 00:13:35 +02:00
Berthold Stoeger
33fb6461fb undo: add undo command for dive-mode switch
This basically copies the bookmark code, with the addition that
the dive mode is recorded in the text of the undo command.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-07 00:13:35 +02:00
Berthold Stoeger
30c7499a3c undo: implement addBookmark undo command
Create a new translation unit for event-related undo commands.
Create a base class of commands that add events and one subclass
that adds a bookmark event.
Use this command in the profile-widget.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-07 00:13:35 +02:00