1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

Set the known import selection for Seabear import

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2015-01-22 18:09:44 +02:00 committed by Dirk Hohndel
parent 2e77e710a0
commit 5ac5619a77

View file

@ -373,6 +373,9 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
if (firstLine.contains("SEABEAR")) { if (firstLine.contains("SEABEAR")) {
seabear = true; seabear = true;
firstLine = "Sample time;Sample depth;Sample ndl;Sample tts;Sample stopdepth;Sample temperature;Sample pressure"; firstLine = "Sample time;Sample depth;Sample ndl;Sample tts;Sample stopdepth;Sample temperature;Sample pressure";
blockSignals(true);
ui->knownImports->setCurrentText("Seabear CSV");
blockSignals(false);
} }
QString separator = ui->CSVSeparator->currentText() == tr("Tab") ? "\t" : ui->CSVSeparator->currentText(); QString separator = ui->CSVSeparator->currentText() == tr("Tab") ? "\t" : ui->CSVSeparator->currentText();
currColumns = firstLine.split(separator); currColumns = firstLine.split(separator);
@ -411,7 +414,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
} }
if (matchedSome) { if (matchedSome) {
ui->dragInstructions->setText(tr("Some column headers were pre-populated; please drag and drop the headers so they match the column they are in.")); ui->dragInstructions->setText(tr("Some column headers were pre-populated; please drag and drop the headers so they match the column they are in."));
if (triggeredBy != KNOWNTYPES) { if (triggeredBy != KNOWNTYPES && !seabear) {
blockSignals(true); blockSignals(true);
ui->knownImports->setCurrentIndex(0); // <- that's "Manual import" ui->knownImports->setCurrentIndex(0); // <- that's "Manual import"
blockSignals(false); blockSignals(false);