CSV import: make predefined imports work again

We need to reparse the file when the known type changes and want to make
sure that we only try to guess the separator and the columns if the user
hasn't told us otherwise.

For the predefined imports this then looks up the correct columns and
places the correct headings there - and then allows the user to modify
them if needed.

This has been lightly tested, there may be dragons.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-01-07 17:02:42 -08:00
parent db988aa62b
commit 5f4770a5bd
2 changed files with 103 additions and 44 deletions

View file

@ -80,11 +80,14 @@ class DiveLogImportDialog : public QDialog {
public:
explicit DiveLogImportDialog(QStringList fn, QWidget *parent = 0);
~DiveLogImportDialog();
enum whatChanged { INITIAL, SEPARATOR, KNOWNTYPES };
private
slots:
void on_buttonBox_accepted();
void loadFileContents();
void loadFileContentsSeperatorSelected(int value);
void loadFileContentsKnownTypesSelected(int value);
void loadFileContents(int value, enum whatChanged triggeredBy);
private:
bool selector;
QStringList fileNames;