diff options
Diffstat (limited to 'qt-ui/divelogimportdialog.cpp')
-rw-r--r-- | qt-ui/divelogimportdialog.cpp | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 36e69d06f..41c906279 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -5,15 +5,14 @@ #include "ui_divelogimportdialog.h" const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = { - {"", }, - {"APD Log Viewer", 1, 2, 16, 7, 18, 19, "Tab"}, - {"XP5", 1, 2, 10, -1, -1, -1, "Tab"}, - {"SensusCSV", 10, 11, -1, -1, -1, -1, ","}, - {NULL,} + { "", }, + { "APD Log Viewer", 1, 2, 16, 7, 18, 19, "Tab" }, + { "XP5", 1, 2, 10, -1, -1, -1, "Tab" }, + { "SensusCSV", 10, 11, -1, -1, -1, -1, "," }, + { NULL, } }; -DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : - QDialog(parent), +DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDialog(parent), selector(true), ui(new Ui::DiveLogImportDialog) { @@ -52,7 +51,7 @@ DiveLogImportDialog::~DiveLogImportDialog() delete ui; } -#define VALUE_IF_CHECKED(x) (ui->x->isEnabled() ? ui->x->value() - 1: -1) +#define VALUE_IF_CHECKED(x) (ui->x->isEnabled() ? ui->x->value() - 1 : -1) void DiveLogImportDialog::on_buttonBox_accepted() { char *error = NULL; @@ -60,14 +59,14 @@ void DiveLogImportDialog::on_buttonBox_accepted() if (ui->tabWidget->currentIndex() == 0) { for (int i = 0; i < fileNames.size(); ++i) { parse_csv_file(fileNames[i].toUtf8().data(), ui->CSVTime->value() - 1, - ui->CSVDepth->value() - 1, VALUE_IF_CHECKED(CSVTemperature), - VALUE_IF_CHECKED(CSVpo2), - VALUE_IF_CHECKED(CSVcns), - VALUE_IF_CHECKED(CSVstopdepth), - ui->CSVSeparator->currentIndex(), - specialCSV.contains(ui->knownImports->currentIndex()) ? CSVApps[ui->knownImports->currentIndex()].name.toUtf8().data() : "csv", - ui->CSVUnits->currentIndex(), - &error); + ui->CSVDepth->value() - 1, VALUE_IF_CHECKED(CSVTemperature), + VALUE_IF_CHECKED(CSVpo2), + VALUE_IF_CHECKED(CSVcns), + VALUE_IF_CHECKED(CSVstopdepth), + ui->CSVSeparator->currentIndex(), + specialCSV.contains(ui->knownImports->currentIndex()) ? CSVApps[ui->knownImports->currentIndex()].name.toUtf8().data() : "csv", + ui->CSVUnits->currentIndex(), + &error); if (error != NULL) { MainWindow::instance()->showError(error); free(error); @@ -77,16 +76,16 @@ void DiveLogImportDialog::on_buttonBox_accepted() } else { for (int i = 0; i < fileNames.size(); ++i) { parse_manual_file(fileNames[i].toUtf8().data(), - ui->ManualSeparator->currentIndex(), - ui->Units->currentIndex(), - VALUE_IF_CHECKED(DiveNumber), - VALUE_IF_CHECKED(Date), VALUE_IF_CHECKED(Time), - VALUE_IF_CHECKED(Duration), VALUE_IF_CHECKED(Location), - VALUE_IF_CHECKED(Gps), VALUE_IF_CHECKED(MaxDepth), - VALUE_IF_CHECKED(MeanDepth), VALUE_IF_CHECKED(Buddy), - VALUE_IF_CHECKED(Notes), VALUE_IF_CHECKED(Weight), - VALUE_IF_CHECKED(Tags), - &error); + ui->ManualSeparator->currentIndex(), + ui->Units->currentIndex(), + VALUE_IF_CHECKED(DiveNumber), + VALUE_IF_CHECKED(Date), VALUE_IF_CHECKED(Time), + VALUE_IF_CHECKED(Duration), VALUE_IF_CHECKED(Location), + VALUE_IF_CHECKED(Gps), VALUE_IF_CHECKED(MaxDepth), + VALUE_IF_CHECKED(MeanDepth), VALUE_IF_CHECKED(Buddy), + VALUE_IF_CHECKED(Notes), VALUE_IF_CHECKED(Weight), + VALUE_IF_CHECKED(Tags), + &error); if (error != NULL) { MainWindow::instance()->showError(error); free(error); @@ -104,8 +103,8 @@ void DiveLogImportDialog::on_buttonBox_accepted() ui->CSV->setValue(VAL);\ ui->CSV->setEnabled(VAL >= 0);\ ui->BOX->setChecked(VAL >= 0);\ - ui->CSV->blockSignals(false);\ - }) + ui->CSV->blockSignals(false); \ +}) void DiveLogImportDialog::on_knownImports_currentIndexChanged(int index) { if (specialCSV.contains(index)) { |