mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Rewrite the create index dialog
Use Qt Designer for the create index dialog. Change the layout of the create index dialog completely to be easier to use and more powerful. Rewrite most of the index creation code to be easier to understand and more flexible.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <QStandardItemModel>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QScrollBar>
|
||||
#include "CreateIndexForm.h"
|
||||
#include "CreateIndexDialog.h"
|
||||
#include "DialogAbout.h"
|
||||
#include "EditTableForm.h"
|
||||
#include "EditFieldForm.h"
|
||||
@@ -566,18 +566,11 @@ void MainWindow::createIndex()
|
||||
QMessageBox::information( this, QApplication::applicationName(), "There is no database opened. Please open or create a new database file." );
|
||||
return;
|
||||
}
|
||||
createIndexForm dialog(this);
|
||||
dialog.populateTable(db.objMap.values("table"));
|
||||
CreateIndexDialog dialog(&db, this);
|
||||
if(dialog.exec())
|
||||
{
|
||||
if (!db.executeSQL(dialog.createStatement)){
|
||||
QString error = "Error: could not create the index. Message from database engine: ";
|
||||
error.append(db.lastErrorMessage);
|
||||
QMessageBox::warning( this, QApplication::applicationName(), error );
|
||||
} else {
|
||||
populateStructure();
|
||||
resetBrowser();
|
||||
}
|
||||
populateStructure();
|
||||
resetBrowser();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user