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:
Martin Kleusberg
2013-01-08 20:55:18 +01:00
parent b38ea3c6bf
commit 32ab512f08
7 changed files with 362 additions and 377 deletions

View File

@@ -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();
}
}