summaryrefslogtreecommitdiff
path: root/src/export-import/CsvImportDialog.h
diff options
context:
space:
mode:
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