summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/divelogimportdialog.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index d6f9ee783..0beb5fd15 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -463,10 +463,21 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
ui->knownImports->setCurrentText("XP5");
blockSignals(false);
} else if (firstLine.contains("FSH")) {
+ QString units = "Metric";
dl7 = true;
+ while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
+ /* DL7 actually defines individual units (e.g. depth, temp, pressure, etc.)
+ * and there are quite a few other options as well, but let's use metric
+ * unless depth unit is clearly Imperial. */
+
+ if (firstLine.contains("ThFt")) {
+ units = "Imperial";
+ }
+ }
firstLine = "|Sample time|Sample depth||||||||";
blockSignals(true);
ui->knownImports->setCurrentText("DAN DL7");
+ ui->CSVUnits->setCurrentText(units);
blockSignals(false);
}