aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Taiane Ramos <exhora.tat@gmail.com>2013-11-23 00:40:48 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-22 21:39:20 -0800
commit450fd9c7bdf6942a4f451760e1aeb0c07d2a9231 (patch)
tree84a63d2c054556595391b4f0f82a3adfb7477df0
parenta6b35141e4d38b045182d0820cf4e3e9bd2143eb (diff)
downloadsubsurface-450fd9c7bdf6942a4f451760e1aeb0c07d2a9231.tar.gz
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 <exhora.tat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/mainwindow.cpp7
1 files changed, 7 insertions, 0 deletions
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