summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-17 22:22:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-20 21:23:16 -0700
commiteba6e76b963115a77b5f8607bc6c3ea1040a466f (patch)
treee926eb7112a902561c1b66f4d6a342ec2a7134b5 /profile-widget
parentf0307abf50397da79671ce79707eb4ce1f78acd0 (diff)
downloadsubsurface-eba6e76b963115a77b5f8607bc6c3ea1040a466f.tar.gz
Undo: make "move dive computer to front" undoable
Instead of the elegant solution that just modifies the dive, keep two copies and add either the old or the new copy. This is primitive, but it trivially keeps the dives in the right order. The order might change on renumbering the dive computers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index f9655127e..46a1eb1a0 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1590,14 +1590,7 @@ void ProfileWidget2::splitCurrentDC()
void ProfileWidget2::makeFirstDC()
{
- make_first_dc();
- mark_divelist_changed(true);
- // this is now the first DC, so we need to redraw the profile and refresh the dive list
- // (and no, it's not just enough to rewrite the text - the first DC is special so values in the
- // dive list may change).
- // As a side benefit, this returns focus to the dive list.
- dc_number = 0;
- emit refreshDisplay(true);
+ Command::moveDiveComputerToFront(current_dive, dc_number);
}
void ProfileWidget2::hideEvents()