CatalogInspector is normal QWidget now
added actions to open the inspector
This commit is contained in:
parent
edb789ca4a
commit
09ef4cdf6b
4 changed files with 62 additions and 57 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <QTableView>
|
||||
|
||||
#include "EditTableWidget.h"
|
||||
#include "CatalogInspector.h"
|
||||
#include "CodeGenerator.h"
|
||||
#include "QueryTool.h"
|
||||
|
||||
|
|
@ -98,24 +99,46 @@ void DatabaseWindow::createActions()
|
|||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/about.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
actionAbout = new QAction(icon, tr("About"), this);
|
||||
auto action = actionAbout = new QAction(icon, tr("About"), this);
|
||||
action->setObjectName("actionAbout");
|
||||
}
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/page_white_delete.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
auto action = actionClose = new QAction(icon, tr("Close"), this);
|
||||
action->setObjectName("actionClose");
|
||||
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W));
|
||||
}
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/page_white_add.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
auto action = actionInspectInformationSchema = new QAction(icon, tr("Inspect information_schema"), this);
|
||||
action->setObjectName("actionInspectInformationSchema");
|
||||
}
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/page_white_add.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
auto action = actionInspectPgCatalog = new QAction(icon, tr("Inspect pg_catalog"), this);
|
||||
action->setObjectName("actionInspectPgCatalog");
|
||||
}
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/page_white_add.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
auto action = actionInspectUserSchemas = new QAction(icon, tr("Inspect user schemas"), this);
|
||||
action->setObjectName("actionInspectUserSchemas");
|
||||
}
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/new_query_tab.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
auto action = actionNewSql = new QAction(icon, tr("New Query"), this);
|
||||
action->setObjectName("actionNewSql");
|
||||
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
|
||||
}
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/icons/folder.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
auto action = actionOpenSql = new QAction(icon, tr("Open Query"), this);
|
||||
action->setObjectName("actionOpenSql");
|
||||
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +169,6 @@ void DatabaseWindow::createActions()
|
|||
|
||||
void DatabaseWindow::initMenus()
|
||||
{
|
||||
// TODO construct menubar
|
||||
auto seperator = new QAction(this);
|
||||
seperator->setSeparator(true);
|
||||
|
||||
|
|
@ -156,6 +178,9 @@ void DatabaseWindow::initMenus()
|
|||
actionNewSql,
|
||||
actionOpenSql,
|
||||
seperator,
|
||||
actionInspectUserSchemas,
|
||||
actionInspectPgCatalog,
|
||||
actionInspectInformationSchema,
|
||||
seperator,
|
||||
actionClose
|
||||
});
|
||||
|
|
@ -166,9 +191,6 @@ void DatabaseWindow::initMenus()
|
|||
actionAbout
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
setMenuBar(mb);
|
||||
}
|
||||
|
||||
|
|
@ -181,10 +203,31 @@ void DatabaseWindow::on_actionClose_triggered()
|
|||
void DatabaseWindow::on_actionNewSql_triggered()
|
||||
{
|
||||
auto *ct = new QueryTool(m_database, this);
|
||||
addPage(ct, "");
|
||||
addPage(ct, "query");
|
||||
ct->newdoc();
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspectInformationSchema_triggered()
|
||||
{
|
||||
auto ct = new CatalogInspector(m_database, this);
|
||||
addPage(ct, "information_schema");
|
||||
ct->setNamespaceFilter(NamespaceFilter::InformationSchema);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspectPgCatalog_triggered()
|
||||
{
|
||||
auto ct = new CatalogInspector(m_database, this);
|
||||
addPage(ct, "pg_catalog");
|
||||
ct->setNamespaceFilter(NamespaceFilter::PgCatalog);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspectUserSchemas_triggered()
|
||||
{
|
||||
auto ct = new CatalogInspector(m_database, this);
|
||||
addPage(ct, "Schema");
|
||||
ct->setNamespaceFilter(NamespaceFilter::User);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionOpenSql_triggered()
|
||||
{
|
||||
QString home_dir = QStandardPaths::locate(QStandardPaths::HomeLocation, "", QStandardPaths::LocateDirectory);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue