diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-12-23 23:45:12 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-09 20:58:04 -0800 |
commit | 82c47bdd794c05e51c73afda14b8bfc95f6694e1 (patch) | |
tree | e1852b32d8d5370710076da6fe54959b1b6cf4c0 /desktop-widgets/divelogimportdialog.cpp | |
parent | 0249e125898134d3f6d4a2a8972f3eeb30c02803 (diff) | |
download | subsurface-82c47bdd794c05e51c73afda14b8bfc95f6694e1.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/divelogimportdialog.cpp')
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index f8e44067d..638cf6094 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -1011,9 +1011,8 @@ void DiveLogImportDialog::on_buttonBox_accepted() } } - add_imported_dives(&table, &trips, false, false, true); - Command::clear(); - MainWindow::instance()->refreshDisplay(); + QString source = fileNames.size() == 1 ? fileNames[0] : tr("multiple files"); + Command::importDives(&table, &trips, false, false, true, source); } TagDragDelegate::TagDragDelegate(QObject *parent) : QStyledItemDelegate(parent) |