From 450fd9c7bdf6942a4f451760e1aeb0c07d2a9231 Mon Sep 17 00:00:00 2001 From: Taiane Ramos Date: Sat, 23 Nov 2013 00:40:48 -0200 Subject: Save button on menu calls InfoWidget save When editing a dive and clicking save button on menu bar, it saved dive information but didn't mark dive as not being edited anymore. For closing file, user should always click on the save button on the bottom of the page and then saving it. Now when clicking save button on menu bar, it will call the accept_changes before saving to disk. Signed-off-by: exhora Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index df108f3d0..1b18b00db 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -721,6 +721,10 @@ void MainWindow::file_save_as(void) filename = QFileDialog::getSaveFileName(this, tr("Save File as"), default_filename, tr("Subsurface XML files (*.ssrf *.xml *.XML)")); if (!filename.isNull() && !filename.isEmpty()) { + + if(ui.InfoWidget->isEditing()) + ui.InfoWidget->acceptChanges(); + save_dives(filename.toUtf8().data()); set_filename(filename.toUtf8().data(), TRUE); setTitle(MWTF_FILENAME); @@ -735,6 +739,9 @@ void MainWindow::file_save(void) if (!existing_filename) return file_save_as(); + if(ui.InfoWidget->isEditing()) + ui.InfoWidget->acceptChanges(); + current_default = prefs.default_filename; if (strcmp(existing_filename, current_default) == 0) { /* if we are using the default filename the directory -- cgit v1.2.3-70-g09d2