From eba6e76b963115a77b5f8607bc6c3ea1040a466f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 17 May 2019 22:22:55 +0200 Subject: 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 --- profile-widget/profilewidget2.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'profile-widget') 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() -- cgit v1.2.3-70-g09d2