diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-12 22:35:43 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 8e1f736d2b608784e1ea942ec8579d2361691c43 (patch) | |
tree | c6c9c60d112e95158a69b692a1ca32b0923a39d3 /desktop-widgets/command.cpp | |
parent | e99c4c90592c9dba17d5cbb9a99d0bf458fb53d2 (diff) | |
download | subsurface-8e1f736d2b608784e1ea942ec8579d2361691c43.tar.gz |
Undo: make dive site removal undoable
Create a new undo-command for deleting dive sites. If there are dives
associated with that site, the dives will be removed. The frontend
is not yet updated in such a case, as that infrastructure is in a
different PR.
Connect the trashcan icon of the dive site table to the undo command.
Currently, this code is in the dive site model, which makes little
sense, but is how the TableView class works. We might want to change
that when cylinder and weight editing are made undoable.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command.cpp')
-rw-r--r-- | desktop-widgets/command.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-widgets/command.cpp b/desktop-widgets/command.cpp index 2e2982860..80a233404 100644 --- a/desktop-widgets/command.cpp +++ b/desktop-widgets/command.cpp @@ -2,6 +2,7 @@ #include "command.h" #include "command_divelist.h" +#include "command_divesite.h" namespace Command { @@ -76,4 +77,10 @@ void mergeDives(const QVector <dive *> &dives) execute(new MergeDives(dives)); } +// Dive site related commands +void deleteDiveSites(const QVector <dive_site *> &sites) +{ + execute(new DeleteDiveSites(sites)); +} + } // namespace Command |