Undo: clear undo history on load / import

Keeping undo-history across load makes little sense. The user was
expressly reminded that they have unsaved work.

For import (from other logs or the dive-computer) an undo-functionality
would be desirable. Nevertheless, this is rather complex since
new and old dives are merged. Implementation would require a finer
backend<->undocommand interface. Thus, leave this for now until more
experience with the undo system is acquired.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-07-21 21:29:49 +02:00 committed by Dirk Hohndel
parent 014c04f8bd
commit c30efc95d4
3 changed files with 7 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#include <QDrag>
#include <QMimeData>
#include <QRegExp>
#include <QUndoStack>
#include "core/qthelper.h"
#include "core/import-csv.h"
@ -1008,6 +1009,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
}
process_imported_dives(&table, false, false);
MainWindow::instance()->undoStack->clear();
MainWindow::instance()->refreshDisplay();
}