From 8c6205fc0d43af849769c11f8a8fb79396895ecc Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 1 Apr 2019 21:07:51 +0200 Subject: 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 --- desktop-widgets/mainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'desktop-widgets/mainwindow.cpp') 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)); -- cgit v1.2.3-70-g09d2