From d2a4cd99656a2710db0a0ecc3207ab435f6b6ea7 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 6 Jan 2015 14:45:49 -0200 Subject: Display the list of column names on the ListView Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelogimportdialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index cff386404..60d74a952 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -18,7 +18,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = { NULL, } }; -ColumnNameProvider::ColumnNameProvider(QObject *parent) +ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(parent) { columnNames << tr("Dive #") << tr("Date") << tr("Time") << tr("Duration") << tr("Location") << tr("GPS") << tr("Weight") << tr("Cyl size") << tr("Start Pressure") << tr("End Press") << tr("Max depth") << tr("Mean depth") << tr("Buddy") << tr("Notes") << tr("Tags") << tr("Air temp") << tr("Water temp") @@ -75,6 +75,9 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDi ui->CSVSeparator->addItems( QStringList() << tr("Separator") << tr("Tab") << ";" << ","); ui->knownImports->setCurrentIndex(1); + ColumnNameProvider *provider = new ColumnNameProvider(this); + ui->avaliableColumns->setModel(provider); + /* manually import CSV file */ QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); connect(close, SIGNAL(activated()), this, SLOT(close())); -- cgit v1.2.3-70-g09d2