mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: implement rudimentary support for undo of dive-merging
For this, an output-parameter was added to the backend merge_dives() function. When non-zero, instead of adding the merged dive to the preferred trip, the preferred trip is returned to the caller. Since the new UndoObject, just like the delete-dives UndoObject, needs to remove/readd a set of dives, the corresponding functionality was split-off in a helper function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
302f6adb79
commit
014c04f8bd
7 changed files with 220 additions and 50 deletions
|
@ -809,9 +809,8 @@ void MainTab::acceptChanges()
|
|||
MainWindow::instance()->dive_list()->verticalScrollBar()->setSliderPosition(scrolledBy);
|
||||
MainWindow::instance()->dive_list()->setFocus();
|
||||
resetPallete();
|
||||
saveTags(QVector<dive *>{ &displayed_dive });
|
||||
saveTags();
|
||||
displayed_dive.divetrip = nullptr; // Should not be necessary, just in case!
|
||||
Command::addDive(&displayed_dive, autogroup, true);
|
||||
return;
|
||||
} else if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) {
|
||||
/* now figure out if things have changed */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue