diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-04-01 21:07:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 8c6205fc0d43af849769c11f8a8fb79396895ecc (patch) | |
tree | d61c9f4bc7224bbf6e7190b84d2a25a8ba786473 /desktop-widgets/mainwindow.cpp | |
parent | 9b5eab4ca1589fe28062819e7ebe8daa3929d45a (diff) | |
download | subsurface-8c6205fc0d43af849769c11f8a8fb79396895ecc.tar.gz |
Undo: on save remove focus from active fields
The editing of a dive field is only performed when focus
is removed from the field. On pressing CTRL-s, the changes
in the currently active field were therefore not saved.
Remove the focus from all fields to trigger an edit command
yand thus ensure that all changes are saved.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 09af6414f..84c4c867a 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -528,11 +528,13 @@ void MainWindow::on_actionOpen_triggered() void MainWindow::on_actionSave_triggered() { + mainTab->stealFocus(); // Make sure that any currently edited field is updated before saving. file_save(); } void MainWindow::on_actionSaveAs_triggered() { + mainTab->stealFocus(); // Make sure that any currently edited field is updated before saving. file_save_as(); } @@ -582,6 +584,7 @@ void MainWindow::on_actionCloudstoragesave_triggered() qDebug() << "Saving cloud storage to:" << filename; if (mainTab->isEditing()) mainTab->acceptChanges(); + mainTab->stealFocus(); // Make sure that any currently edited field is updated before saving. showProgressBar(); int error = save_dives(qPrintable(filename)); |