summaryrefslogtreecommitdiff
path: root/src/export-import/CsvImportDialog.h
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
commitd24f813f3f2a05c112e803e4256b53535895fc98 (patch)
tree601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/export-import/CsvImportDialog.h
Initial mirror commitHEADmaster
Diffstat (limited to 'src/export-import/CsvImportDialog.h')
-rw-r--r--src/export-import/CsvImportDialog.h64
1 files changed, 64 insertions, 0 deletions
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 <QtCore>
+#include <QtWidgets>
+
+#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