From 7167ce41b61d2ba2cdb526777a4233eb84a3b66a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 6 Dec 2014 17:33:25 -0500 Subject: Imported Upstream version 2.99.6 --- .../guiSQLiteStudio/dialogs/indexdialog.h | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.h') 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 +#include + +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 columnCheckBoxes; + QList sortComboBoxes; + QList 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 -- cgit v1.2.3