diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-21 21:29:49 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-11 16:22:27 -0700 |
commit | c30efc95d47291d8eadc6a5902eb5cc2a1dba13c (patch) | |
tree | e70d6f5eab83c20bbb89b6dc6da7599006db036f /desktop-widgets/downloadfromdivecomputer.cpp | |
parent | 014c04f8bd30740e7711f3b3a01619fd27b5b613 (diff) | |
download | subsurface-c30efc95d47291d8eadc6a5902eb5cc2a1dba13c.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/downloadfromdivecomputer.cpp')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 1e239c378..e63de8f56 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -14,6 +14,7 @@ #include <QMessageBox> #include <QShortcut> #include <QTimer> +#include <QUndoStack> DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), downloading(false), @@ -507,6 +508,7 @@ void DownloadFromDCWidget::on_ok_clicked() // first new dive) and select it again after processing all the dives int uniqId = downloadTable.dives[downloadTable.nr - 1]->id; process_imported_dives(&downloadTable, preferDownloaded(), true); + MainWindow::instance()->undoStack->clear(); // after process_imported_dives does any merging or resorting needed, we need // to recreate the model for the dive list so we can select the newest dive MainWindow::instance()->recreateDiveList(); |