summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogimportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-07-09 22:13:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-09 13:22:00 -0700
commitd5991800eed5af6d84e91706764817211876b03a (patch)
tree1d12c3eebbf3c236ce783714d8b9cd3bd51bd5a2 /qt-ui/divelogimportdialog.cpp
parent848a5352c7afedd530186ae842719e8f67c8c66a (diff)
downloadsubsurface-d5991800eed5af6d84e91706764817211876b03a.tar.gz
Add support for importing NDL from CSV files
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelogimportdialog.cpp')
-rw-r--r--qt-ui/divelogimportdialog.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 3eb17ef7e..8e53a998c 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -6,12 +6,12 @@
#include "ui_divelogimportdialog.h"
const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = {
- // time, depth, temperature, po2, cns, stopdepth
+ // time, depth, temperature, po2, cns, ndl, stopdepth
{ "", },
- { "APD Log Viewer", 1, 2, 16, 7, 18, 19, "Tab" },
- { "XP5", 1, 2, 10, -1, -1, -1, "Tab" },
- { "SensusCSV", 10, 11, -1, -1, -1, -1, "," },
- { "Seabear CSV", 1, 2, 6, -1, -1, 5, ";" },
+ { "APD Log Viewer", 1, 2, 16, 7, 18, -1, 19, "Tab" },
+ { "XP5", 1, 2, 10, -1, -1, -1, -1, "Tab" },
+ { "SensusCSV", 10, 11, -1, -1, -1, -1, -1, "," },
+ { "Seabear CSV", 1, 2, 6, -1, -1, -1, 5, ";" },
{ NULL, }
};
@@ -45,6 +45,8 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDi
connect(ui->po2CheckBox, SIGNAL(clicked(bool)), this, SLOT(unknownImports()));
connect(ui->CSVcns, SIGNAL(valueChanged(int)), this, SLOT(unknownImports()));
connect(ui->cnsCheckBox, SIGNAL(clicked(bool)), this, SLOT(unknownImports()));
+ connect(ui->CSVndl, SIGNAL(valueChanged(int)), this, SLOT(unknownImports()));
+ connect(ui->ndlCheckBox, SIGNAL(clicked(bool)), this, SLOT(unknownImports()));
connect(ui->CSVstopdepth, SIGNAL(valueChanged(int)), this, SLOT(unknownImports()));
connect(ui->stopdepthCheckBox, SIGNAL(clicked(bool)), this, SLOT(unknownImports()));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
@@ -67,6 +69,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
ui->CSVDepth->value() - 1, VALUE_IF_CHECKED(CSVTemperature),
VALUE_IF_CHECKED(CSVpo2),
VALUE_IF_CHECKED(CSVcns),
+ VALUE_IF_CHECKED(CSVndl),
VALUE_IF_CHECKED(CSVstopdepth),
ui->CSVSeparator->currentIndex(),
specialCSV.contains(ui->knownImports->currentIndex()) ? CSVApps[ui->knownImports->currentIndex()].name.toUtf8().data() : "csv",
@@ -116,6 +119,7 @@ void DiveLogImportDialog::on_knownImports_currentIndexChanged(int index)
SET_VALUE_AND_CHECKBOX(CSVTemperature, temperatureCheckBox, CSVApps[index].temperature);
SET_VALUE_AND_CHECKBOX(CSVpo2, po2CheckBox, CSVApps[index].po2);
SET_VALUE_AND_CHECKBOX(CSVcns, cnsCheckBox, CSVApps[index].cns);
+ SET_VALUE_AND_CHECKBOX(CSVndl, ndlCheckBox, CSVApps[index].ndl);
SET_VALUE_AND_CHECKBOX(CSVstopdepth, stopdepthCheckBox, CSVApps[index].stopdepth);
ui->CSVSeparator->blockSignals(true);
int separator_index = ui->CSVSeparator->findText(CSVApps[index].separator);