From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/export-import/CsvImportDialog.h | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/export-import/CsvImportDialog.h (limited to 'src/export-import/CsvImportDialog.h') diff --git a/src/export-import/CsvImportDialog.h b/src/export-import/CsvImportDialog.h new file mode 100644 index 0000000..bc3a9d1 --- /dev/null +++ b/src/export-import/CsvImportDialog.h @@ -0,0 +1,64 @@ +#ifndef CSVIMPORTDIALOG_H +#define CSVIMPORTDIALOG_H + +#include +#include + +#include "CsvData.h" +#include "CsvDialog.h" + +class DictTableView; +class Dictionary; +class DicCsvReader; +class DictTableModel; +class AppModel; + +class CsvImportDialog: public CsvDialog +{ + Q_OBJECT + +public: + CsvImportDialog(QWidget* parent, QString filePath, const AppModel* appModel ); + ~CsvImportDialog(); + + Dictionary* getDictionary() { return dictionary; } + +protected: + QLayout* createLeftGroupLayout(); + QString getLeftGroupTitle() { return tr("Input"); } + QLayout* createSeparatorsLayout(); + QLayout* createPreviewLt(); + +protected slots: + void updatePreview(); + +private slots: + void UpdateCommentCharacterCombo(); + void DeleteDictionary(); + +private: + QWidget* createFromLineSpin(); + QWidget* createColsToImportSpin(); + QWidget* createFirstLineIsHeaderCB(); + void createSeparationRadioButtons(); + FieldSeparationMode getSeparationMode(); + QWidget* createCommentCharBox(); + QWidget* createPreview(); + +private: + QString filePath; + Dictionary* dictionary; // not own, created here + const AppModel* appModel; + DicCsvReader* dicReader; + DictTableModel* iPreviewModel; + QSpinBox* fromLineSpin; // 1-based + QSpinBox* colsToImportSpin; // 1-based; 0 = all + QCheckBox* firstLineIsHeaderCB; + QRadioButton* anyCharacterRB; + QRadioButton* anyCombinationRB; + QRadioButton* exactStringRB; + QCheckBox* commentCharCB; + DictTableView* previewTable; +}; + +#endif -- cgit