aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
commit7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch)
treea35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
new file mode 100644
index 0000000..0ecc318
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
@@ -0,0 +1,76 @@
+#ifndef POPULATEDIALOG_H
+#define POPULATEDIALOG_H
+
+#include "guiSQLiteStudio_global.h"
+#include <QDialog>
+
+namespace Ui {
+ class PopulateDialog;
+}
+
+class PopulatePlugin;
+class PopulateEngine;
+class QGridLayout;
+class DbListModel;
+class DbObjListModel;
+class Db;
+class QComboBox;
+class QCheckBox;
+class QToolButton;
+class QSignalMapper;
+class WidgetCover;
+
+class GUI_API_EXPORT PopulateDialog : public QDialog
+{
+ Q_OBJECT
+
+ public:
+ explicit PopulateDialog(QWidget *parent = 0);
+ ~PopulateDialog();
+ void setDbAndTable(Db* db, const QString& table);
+
+ private:
+ struct GUI_API_EXPORT ColumnEntry
+ {
+ ColumnEntry(QCheckBox* check, QComboBox* combo, QToolButton* button);
+ ~ColumnEntry();
+
+ QCheckBox* check = nullptr;
+ QComboBox* combo = nullptr;
+ QToolButton* button = nullptr;
+ PopulateEngine* engine = nullptr;
+ };
+
+ void init();
+ PopulateEngine* getEngine(int selectedPluginIndex);
+ void deleteEngines(const QList<PopulateEngine*>& engines);
+ void rebuildEngines();
+
+ Ui::PopulateDialog *ui = nullptr;
+ QGridLayout* columnsGrid = nullptr;
+ DbListModel* dbListModel = nullptr;
+ DbObjListModel* tablesModel = nullptr;
+ Db* db = nullptr;
+ QStringList pluginTitles;
+ QList<PopulatePlugin*> plugins;
+ QList<ColumnEntry> columnEntries;
+ QSignalMapper* checkMapper = nullptr;
+ QSignalMapper* buttonMapper = nullptr;
+ QHash<int,bool> columnsValid;
+ WidgetCover* widgetCover = nullptr;
+
+ private slots:
+ void refreshTables();
+ void refreshColumns();
+ void pluginSelected(int index);
+ void pluginSelected(QComboBox* combo, int index);
+ void configurePlugin(int index);
+ void updateColumnState(int index, bool updateGlobalState = true);
+ void updateState();
+ void finished();
+
+ public:
+ void accept();
+};
+
+#endif // POPULATEDIALOG_H