Undo: make dive-import undoable

On desktop, replace all add_imported_dives() calls by a new undo-command.
This was rather straight forward, as all the preparation work was done
in previous commits.

By using an undo-command, a full UI-reset can be avoided, making the UI
react smoother.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-12-23 23:45:12 +01:00 committed by Dirk Hohndel
parent 0249e12589
commit 82c47bdd79
9 changed files with 122 additions and 25 deletions

View file

@ -141,6 +141,7 @@ void DiveImportedModel::repopulate(dive_table_t *table, trip_table_t *trips)
endResetModel();
}
// Note: this function is only used from mobile - perhaps move it there or unify.
void DiveImportedModel::recordDives()
{
if (diveTable->nr == 0)