Preconfigured import of Subsurface CSV log file

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2014-12-26 16:11:38 +02:00 committed by Dirk Hohndel
parent e471335af6
commit 1e04aec7fd
5 changed files with 367 additions and 1 deletions

View file

@ -12,6 +12,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
{ "XP5", 1, 2, 10, -1, -1, -1, -1, -1, -1, "Tab" },
{ "SensusCSV", 10, 11, -1, -1, -1, -1, -1, -1, -1, "," },
{ "Seabear CSV", 1, 2, 6, -1, -1, 3, 4, 5, 7, ";" },
{ "SubsurfaceCSV", -1, -1, -1, -1, -1, -1, -1, -1, -1, "," },
{ NULL, }
};
@ -25,6 +26,7 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDi
/* Add indexes of XSLTs requiring special handling to the list */
specialCSV << 3;
specialCSV << 5;
for (int i = 0; !CSVApps[i].name.isNull(); ++i)
ui->knownImports->addItem(CSVApps[i].name);
@ -160,8 +162,10 @@ void DiveLogImportDialog::on_knownImports_currentIndexChanged(int index)
{
if (specialCSV.contains(index)) {
ui->groupBox_3->setEnabled(false);
ui->CSVUnits->setEnabled(false);
} else {
ui->groupBox_3->setEnabled(true);
ui->CSVUnits->setEnabled(true);
}
if (index == 0)
return;

View file

@ -64,7 +64,7 @@ private:
QString separator;
};
#define CSVAPPS 6
#define CSVAPPS 7
static const CSVAppConfig CSVApps[CSVAPPS];
};