From 03666fb7656ae19fe11d22094846a1279dc4b9f8 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 29 Dec 2013 07:52:44 +0200 Subject: Use field numbers in CSV import instead of indexes For the common user, a field number is more intuitive than field index. So let's use that in numbering CSV import fields. Fixes #388 Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- qt-ui/csvimportdialog.cpp | 10 +++++----- qt-ui/csvimportdialog.ui | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/csvimportdialog.cpp b/qt-ui/csvimportdialog.cpp index 690640222..b88d9ceca 100644 --- a/qt-ui/csvimportdialog.cpp +++ b/qt-ui/csvimportdialog.cpp @@ -6,8 +6,8 @@ const CSVImportDialog::CSVAppConfig CSVImportDialog::CSVApps[CSVAPPS] = { {"", }, - {"APD Log Viewer", 0, 1, 15, 6, 17, 18, "Tab"}, - {"XP5", 0, 1, 9, -1, -1, -1, "Tab"}, + {"APD Log Viewer", 1, 2, 16, 7, 18, 19, "Tab"}, + {"XP5", 1, 2, 10, -1, -1, -1, "Tab"}, {NULL,} }; @@ -43,13 +43,13 @@ CSVImportDialog::~CSVImportDialog() delete ui; } -#define VALUE_IF_CHECKED(x) (ui->x->isEnabled() ? ui->x->value() : -1) +#define VALUE_IF_CHECKED(x) (ui->x->isEnabled() ? ui->x->value() - 1: -1) void CSVImportDialog::on_buttonBox_accepted() { char *error = NULL; - parse_csv_file(ui->CSVFile->text().toUtf8().data(), ui->CSVTime->value(), - ui->CSVDepth->value(), VALUE_IF_CHECKED(CSVTemperature), + parse_csv_file(ui->CSVFile->text().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), diff --git a/qt-ui/csvimportdialog.ui b/qt-ui/csvimportdialog.ui index 6abbb4beb..9c89704f3 100644 --- a/qt-ui/csvimportdialog.ui +++ b/qt-ui/csvimportdialog.ui @@ -68,10 +68,10 @@ - 0 + 1 - 0 + 1 @@ -85,10 +85,10 @@ - 0 + 1 - 1 + 2 @@ -101,6 +101,9 @@ + + 1 + false @@ -115,6 +118,9 @@ + + 1 + false @@ -132,6 +138,9 @@ + + 1 + false @@ -149,6 +158,9 @@ + + 1 + false -- cgit v1.2.3-70-g09d2