List of databases and roles moved to a "Server tab" within the database window.

Opened by selecting "Inspect Server" from the menu.
This commit is contained in:
eelke 2021-04-10 14:27:04 +02:00
parent 50cd865b1a
commit f0e5488ce0
12 changed files with 271 additions and 2 deletions

View file

@ -21,6 +21,7 @@
#include "EditTableWidget.h"
#include "CodeGenerator.h"
#include "QueryTool.h"
#include <serverinspector/ServerInspector.h>
namespace pg = Pgsql;
@ -202,6 +203,12 @@ void DatabaseWindow::createActions()
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 = actionServerInspector = new QAction(icon, tr("Inspect server"), this);
action->setObjectName("actionServerInspector");
}
{
QIcon icon;
icon.addFile(QString::fromUtf8(":/icons/page_white_add.png"), QSize(), QIcon::Normal, QIcon::On);
@ -320,6 +327,7 @@ void DatabaseWindow::initMenus()
actionInspectUserSchemas,
actionInspectPgCatalog,
actionInspectInformationSchema,
actionServerInspector,
seperator(),
actionShowConnectionManager
});
@ -363,7 +371,15 @@ void DatabaseWindow::newCatalogInspectorPage(QString caption, NamespaceFilter fi
addPage(ct, caption);
ct->setNamespaceFilter(filter);
connect(ct->tablesPage(), &CatalogTablesPage::tableSelected, this, &DatabaseWindow::tableSelected);
connect(ct->tablesPage(), &CatalogTablesPage::tableSelected, this, &DatabaseWindow::tableSelected);
}
void DatabaseWindow::newServerInspectorPage()
{
auto si = new ServerInspector(m_database, this);
// si->addAction(actionRefreshCatalog);
addPage(si, tr("Server"));
}
void DatabaseWindow::closeTab(int index)
@ -520,7 +536,12 @@ void DatabaseWindow::on_actionInspectPgCatalog_triggered()
void DatabaseWindow::on_actionInspectUserSchemas_triggered()
{
newCatalogInspectorPage("Schema", NamespaceFilter::User);
newCatalogInspectorPage("Schema", NamespaceFilter::User);
}
void DatabaseWindow::on_actionServerInspector_triggered()
{
newServerInspectorPage();
}
void DatabaseWindow::on_actionNewSql_triggered()