GUI for CSV import

This patch implements GUI for importing CSV log files. One is able to
configure what columns contain time, depth and temperature fields.
Pre-configured log applications currently included are ADP log viewer
and XP5. (Both of these use actually tab as separator, so the field
separator currently hard-coded.)

[Dirk Hohndel: minor fixes]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2013-10-16 22:05:19 +03:00 committed by Dirk Hohndel
parent 80bced4f56
commit 4c49670cdb
11 changed files with 494 additions and 32 deletions

48
qt-ui/csvimportdialog.h Normal file
View file

@ -0,0 +1,48 @@
#ifndef CSVIMPORTDIALOG_H
#define CSVIMPORTDIALOG_H
#include <QDialog>
#include <QModelIndex>
#include "../dive.h"
#include "../divelist.h"
namespace Ui {
class CSVImportDialog;
}
class CSVImportDialog : public QDialog
{
Q_OBJECT
public:
explicit CSVImportDialog(QWidget *parent = 0);
~CSVImportDialog();
private slots:
void on_buttonBox_accepted();
void on_CSVFileSelector_clicked();
void on_knownImports_currentIndexChanged(int index);
void on_CSVTime_valueChanged(int arg1);
void on_CSVDepth_valueChanged(int arg1);
void on_CSVTemperature_valueChanged(int arg1);
void on_CSVFile_textEdited();
private:
void unknownImports();
bool selector;
Ui::CSVImportDialog *ui;
struct CSVAppConfig {
QString name;
int time;
int depth;
int temperature;
QString separator;
};
#define CSVAPPS 4
static const CSVAppConfig CSVApps[CSVAPPS];
};
#endif // CSVIMPORTDIALOG_H