summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogexportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-03-30 20:59:28 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-04 09:33:56 -0700
commit8c9e5becb20d2d8c8aa1f7108775cc520b08fae1 (patch)
treecc7bdbc918716ba4d7cf9d39acebce1ecc1cbc31 /desktop-widgets/divelogexportdialog.cpp
parenta89b36c661662346c6c8092bdd2cefebf8f58c8a (diff)
downloadsubsurface-8c9e5becb20d2d8c8aa1f7108775cc520b08fae1.tar.gz
Export profile data
This introduces a csv file that contains the data from the structs defined in profile.c, in particular all deco information computed for the dive profle (including NDL, TTS, ceilings, surface GFs etc). Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets/divelogexportdialog.cpp')
-rw-r--r--desktop-widgets/divelogexportdialog.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp
index 3e712fc5d..216a296eb 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -15,6 +15,7 @@
#include "core/settings/qPrefDisplay.h"
#include "desktop-widgets/mainwindow.h"
#include "profile-widget/profilewidget2.h"
+#include "core/save-profiledata.h"
#include "core/dive.h" // Allows access to helper functions in TeX export.
// Retrieves the current unit settings defined in the Subsurface preferences.
@@ -98,6 +99,8 @@ void DiveLogExportDialog::showExplanation()
ui->description->setText(tr("Write dive as LaTeX macros to file."));
} else if (ui->exportProfile->isChecked()) {
ui->description->setText(tr("Write the profile image as PNG file."));
+ } else if (ui->exportProfileData->isChecked()) {
+ ui->description->setText(tr("Write profile data to a CSV file."));
}
}
@@ -175,6 +178,10 @@ void DiveLogExportDialog::on_buttonBox_accepted()
filename = QFileDialog::getSaveFileName(this, tr("Save profile image"), lastDir);
if (!filename.isNull() && !filename.isEmpty())
exportProfile(qPrintable(filename), ui->exportSelected->isChecked());
+ } else if (ui->exportProfileData->isChecked()) {
+ filename = QFileDialog::getSaveFileName(this, tr("Save profile data"), lastDir);
+ if (!filename.isNull() && !filename.isEmpty())
+ save_profiledata(qPrintable(filename), ui->exportSelected->isChecked());
}
break;
case 1: