summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogimportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-19 21:52:41 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-19 21:52:41 -0800
commit762315e7eef47c1a5357e9c8691676707e3c630e (patch)
tree8c1a25f1a026e920ff416677a759eb3708aa38f2 /qt-ui/divelogimportdialog.cpp
parent6a2efd9ff6e3657c35612f65c322ded25c984532 (diff)
downloadsubsurface-762315e7eef47c1a5357e9c8691676707e3c630e.tar.gz
Update Qt4 patch
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelogimportdialog.cpp')
-rw-r--r--qt-ui/divelogimportdialog.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index ce12ef7ec..f4e43ef90 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -377,14 +377,22 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
seabear = true;
firstLine = "Sample time;Sample depth;Sample NDL;Sample TTS;Sample stopdepth;Sample temperature;Sample pressure";
blockSignals(true);
+#if QT_VERSION >= 0x050000
ui->knownImports->setCurrentText("Seabear CSV");
+#else
+ ui->knownImports->setCurrentIndex(4);
+#endif
blockSignals(false);
} else if (firstLine.contains("Tauchgangs-Nr.:")) {
xp5 = true;
//"Abgelaufene Tauchzeit (Std:Min.)\tTiefe\tStickstoff Balkenanzeige\tSauerstoff Balkenanzeige\tAufstiegsgeschwindigkeit\tRestluftzeit\tRestliche Tauchzeit\tDekompressionszeit (Std:Min)\tDekostopp-Tiefe\tTemperatur\tPO2\tPressluftflasche\tLesen des Druckes\tStatus der Verbindung\tTauchstatus";
firstLine = "Sample time\tSample depth\t\t\t\t\t\t\t\tSample temperature\t";
blockSignals(true);
+#if QT_VERSION >= 0x050000
ui->knownImports->setCurrentText("XP5");
+#else
+ ui->knownImports->setCurrentIndex(2);
+#endif
blockSignals(false);
}
@@ -393,9 +401,17 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
apd=true;
firstLine = "Sample time\tSample depth\t\t\t\t\tSample pO₂\t\t\t\t\t\t\t\t\tSample temperature\t\tSample CNS\tSample stopdepth";
blockSignals(true);
+#if QT_VERSION >= 0x050000
ui->CSVSeparator->setCurrentText(tr("Tab"));
+#else
+ ui->CSVSeparator->setCurrentIndex(0);
+#endif
if (triggeredBy == INITIAL && fileNames.first().contains(".apd", Qt::CaseInsensitive))
+#if QT_VERSION >= 0x050000
ui->knownImports->setCurrentText("APD Log Viewer");
+#else
+ ui->knownImports->setCurrentIndex(1);
+#endif
blockSignals(false);
}
@@ -414,7 +430,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
separator = ";";
if (ui->CSVSeparator->currentText() != separator) {
blockSignals(true);
+#if QT_VERSION >= 0x050000
ui->CSVSeparator->setCurrentText(separator);
+#else
+ if (separator == "Tab")
+ ui->CSVSeparator->setCurrentIndex(0);
+ else if (separator == ",")
+ ui->CSVSeparator->setCurrentIndex(1);
+ else
+ ui->CSVSeparator->setCurrentIndex(2);
+#endif
blockSignals(false);
currColumns = firstLine.split(separator);
}
@@ -465,7 +490,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
if (ui->CSVSeparator->currentText() != separator || separator == "Tab") {
ui->CSVSeparator->blockSignals(true);
+#if QT_VERSION >= 0x050000
ui->CSVSeparator->setCurrentText(separator);
+#else
+ if (separator == "Tab")
+ ui->CSVSeparator->setCurrentIndex(0);
+ else if (separator == ",")
+ ui->CSVSeparator->setCurrentIndex(1);
+ else
+ ui->CSVSeparator->setCurrentIndex(2);
+#endif
ui->CSVSeparator->blockSignals(false);
if (separator == "Tab")
separator = "\t";