summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogimportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-21 21:29:49 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-11 16:22:27 -0700
commitc30efc95d47291d8eadc6a5902eb5cc2a1dba13c (patch)
treee70d6f5eab83c20bbb89b6dc6da7599006db036f /desktop-widgets/divelogimportdialog.cpp
parent014c04f8bd30740e7711f3b3a01619fd27b5b613 (diff)
downloadsubsurface-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/divelogimportdialog.cpp')
-rw-r--r--desktop-widgets/divelogimportdialog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp
index c72f179e4..e10f9b7af 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -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();
}