#ifndef IMPORTDIALOG_H #define IMPORTDIALOG_H #include #include #include #include #include #include #include #include #include #include "transaction.h" #include "database.h" class ImportDialog : public QDialog { Q_OBJECT public: explicit ImportDialog(Database *db, QWidget *parent = nullptr); ~ImportDialog(); QList getImportedTransactions() const; private slots: void onBrowseFile(); void onColumnMappingChanged(); void onImport(); void onSelectAll(); void onDeselectAll(); private: Database *database; QTableWidget *previewTable; QPushButton *browseBtn; QPushButton *importBtn; QPushButton *selectAllBtn; QPushButton *deselectAllBtn; QComboBox *dateColumnCombo; QComboBox *amountColumnCombo; QComboBox *withdrawalColumnCombo; QComboBox *depositColumnCombo; QComboBox *descriptionColumnCombo; QComboBox *accountCombo; QComboBox *categoryCombo; QStringList csvHeaders; QList csvRows; QList importedTransactions; void loadCsvFile(const QString &filePath); void updatePreview(); Transaction parseRow(int rowIndex); }; #endif // IMPORTDIALOG_H