diff options
| author | 2014-12-06 17:33:25 -0500 | |
|---|---|---|
| committer | 2014-12-06 17:33:25 -0500 | |
| commit | 7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch) | |
| tree | a35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h | |
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h new file mode 100644 index 0000000..1f9d1f8 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h @@ -0,0 +1,72 @@ +#ifndef INDEXDIALOG_H +#define INDEXDIALOG_H + +#include "db/db.h" +#include "guiSQLiteStudio_global.h" +#include "parser/ast/sqlitecreateindex.h" +#include <QDialog> +#include <QStringListModel> + +namespace Ui { + class IndexDialog; +} + +class QGridLayout; +class QSignalMapper; +class QCheckBox; +class QComboBox; + +class GUI_API_EXPORT IndexDialog : public QDialog +{ + Q_OBJECT + + public: + IndexDialog(Db* db, QWidget *parent = 0); + IndexDialog(Db* db, const QString& index, QWidget *parent = 0); + ~IndexDialog(); + + void setTable(const QString& value); + + protected: + void changeEvent(QEvent *e); + + private: + void init(); + void readIndex(); + void readCollations(); + void buildColumn(const QString& name, int row); + void applyColumnValues(); + void applyIndex(); + SqliteIndexedColumn* addIndexedColumn(const QString& name); + void rebuildCreateIndex(); + void queryDuplicates(); + + bool existingIndex = false; + Db* db = nullptr; + QString table; + QString index; + SqliteCreateIndexPtr createIndex; + SqliteCreateIndexPtr originalCreateIndex; + QStringList tableColumns; + QSignalMapper* columnStateSignalMapping = nullptr; + QStringListModel collations; + QList<QCheckBox*> columnCheckBoxes; + QList<QComboBox*> sortComboBoxes; + QList<QComboBox*> collateComboBoxes; + int totalColumns = 0; + Ui::IndexDialog *ui = nullptr; + + private slots: + void updateValidation(); + void buildColumns(); + void updateTable(const QString& value); + void updateColumnState(int row); + void updatePartialConditionState(); + void updateDdl(); + void tabChanged(int tab); + + public slots: + void accept(); +}; + +#endif // INDEXDIALOG_H |
