mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-28 06:49:57 -06:00
Update CreateIndex dialog and actions (#704)
This commit is contained in:
committed by
Justin Clift
parent
4fc164493a
commit
a39554fd11
@@ -20,6 +20,14 @@ CreateIndexDialog::CreateIndexDialog(DBBrowserDB* db, QWidget* parent)
|
||||
dbobjs.insert((*it).getname(), (*it));
|
||||
for(QMultiMap<QString, DBBrowserObject>::ConstIterator it=dbobjs.begin(); it != dbobjs.end(); ++it)
|
||||
ui->comboTableName->addItem(QIcon(QString(":icons/table")), (*it).getname());
|
||||
|
||||
QHeaderView *tableHeaderView = ui->tableIndexColumns->horizontalHeader();
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
tableHeaderView->setResizeMode(0, QHeaderView::Stretch);
|
||||
#else
|
||||
tableHeaderView->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
#endif
|
||||
}
|
||||
|
||||
CreateIndexDialog::~CreateIndexDialog()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>610</width>
|
||||
<height>342</height>
|
||||
<height>403</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -20,6 +20,12 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelIndexName">
|
||||
<property name="text">
|
||||
@@ -45,6 +51,12 @@
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QTableWidget" name="tableIndexColumns">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
|
||||
@@ -732,6 +732,7 @@ void MainWindow::createIndex()
|
||||
QMessageBox::information( this, QApplication::applicationName(), tr("There is no database opened. Please open or create a new database file."));
|
||||
return;
|
||||
}
|
||||
|
||||
CreateIndexDialog dialog(&db, this);
|
||||
if(dialog.exec())
|
||||
{
|
||||
@@ -1199,7 +1200,14 @@ void MainWindow::changeTreeSelection()
|
||||
|
||||
// Change the text of the actions
|
||||
QString type = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 1)).toString();
|
||||
ui->editDeleteObjectAction->setIcon(QIcon(QString(":icons/%1_delete").arg(type)));
|
||||
|
||||
if (type.isEmpty())
|
||||
{
|
||||
ui->editDeleteObjectAction->setIcon(QIcon(":icons/table_delete"));
|
||||
} else {
|
||||
ui->editDeleteObjectAction->setIcon(QIcon(QString(":icons/%1_delete").arg(type)));
|
||||
}
|
||||
|
||||
if(type == "view")
|
||||
ui->editDeleteObjectAction->setText(tr("Delete View"));
|
||||
else if(type == "trigger")
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<addaction name="editCreateTableAction"/>
|
||||
<addaction name="editCreateIndexAction"/>
|
||||
<addaction name="editModifyTableAction"/>
|
||||
<addaction name="editDeleteObjectAction"/>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user