summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-07-09 22:13:38 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-09 13:22:00 -0700
commit6cd0928487dc64238aad40b41f929bfdbc01d824 (patch)
treedbd7589d86dd3186128780e84a21cf7fc5477196 /qt-ui
parentd5991800eed5af6d84e91706764817211876b03a (diff)
downloadsubsurface-6cd0928487dc64238aad40b41f929bfdbc01d824.tar.gz
Add support for importing TTS 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')
-rw-r--r--qt-ui/divelogimportdialog.cpp14
-rw-r--r--qt-ui/divelogimportdialog.h1
-rw-r--r--qt-ui/divelogimportdialog.ui22
3 files changed, 32 insertions, 5 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 8e53a998c..98dbefd55 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, ndl, stopdepth
+ // time, depth, temperature, po2, cns, ndl, tts, stopdepth
{ "", },
- { "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, ";" },
+ { "APD Log Viewer", 1, 2, 16, 7, 18, -1, -1, 19, "Tab" },
+ { "XP5", 1, 2, 10, -1, -1, -1, -1, -1, "Tab" },
+ { "SensusCSV", 10, 11, -1, -1, -1, -1, -1, -1, "," },
+ { "Seabear CSV", 1, 2, 6, -1, -1, -1, -1, 5, ";" },
{ NULL, }
};
@@ -47,6 +47,8 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDi
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->CSVtts, SIGNAL(valueChanged(int)), this, SLOT(unknownImports()));
+ connect(ui->ttsCheckBox, 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);
@@ -70,6 +72,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
VALUE_IF_CHECKED(CSVpo2),
VALUE_IF_CHECKED(CSVcns),
VALUE_IF_CHECKED(CSVndl),
+ VALUE_IF_CHECKED(CSVtts),
VALUE_IF_CHECKED(CSVstopdepth),
ui->CSVSeparator->currentIndex(),
specialCSV.contains(ui->knownImports->currentIndex()) ? CSVApps[ui->knownImports->currentIndex()].name.toUtf8().data() : "csv",
@@ -120,6 +123,7 @@ void DiveLogImportDialog::on_knownImports_currentIndexChanged(int index)
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(CSVtts, ttsCheckBox, CSVApps[index].tts);
SET_VALUE_AND_CHECKBOX(CSVstopdepth, stopdepthCheckBox, CSVApps[index].stopdepth);
ui->CSVSeparator->blockSignals(true);
int separator_index = ui->CSVSeparator->findText(CSVApps[index].separator);
diff --git a/qt-ui/divelogimportdialog.h b/qt-ui/divelogimportdialog.h
index ff81fe6da..637d85a37 100644
--- a/qt-ui/divelogimportdialog.h
+++ b/qt-ui/divelogimportdialog.h
@@ -37,6 +37,7 @@ private:
int po2;
int cns;
int ndl;
+ int tts;
int stopdepth;
QString separator;
};
diff --git a/qt-ui/divelogimportdialog.ui b/qt-ui/divelogimportdialog.ui
index 0fbb96b99..987768da8 100644
--- a/qt-ui/divelogimportdialog.ui
+++ b/qt-ui/divelogimportdialog.ui
@@ -159,6 +159,26 @@
</property>
</widget>
</item>
+ <item row="6" column="0">
+ <widget class="QCheckBox" name="ttsCheckBox">
+ <property name="text">
+ <string>TTS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QSpinBox" name="CSVtts">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
<item row="4" column="0">
<widget class="QCheckBox" name="cnsCheckBox">
<property name="text">
@@ -169,6 +189,8 @@
</layout>
<zorder>ndlCheckBox</zorder>
<zorder>CSVndl</zorder>
+ <zorder>ttsCheckBox</zorder>
+ <zorder>CSVtts</zorder>
<zorder>label</zorder>
<zorder>label_2</zorder>
<zorder>CSVTime</zorder>