Add tab with namespaces (schema's)

This commit is contained in:
eelke 2019-11-20 19:09:22 +01:00
parent 8dd13d103e
commit 1df8455af5
7 changed files with 171 additions and 18 deletions

View file

@ -2,6 +2,7 @@
#include "OpenDatabase.h"
#include "UserConfiguration.h"
#include "widgets/CatalogFunctionsPage.h"
#include "widgets/CatalogNamespacePage.h"
#include "widgets/CatalogSequencesPage.h"
#include "widgets/CatalogTablesPage.h"
@ -15,6 +16,7 @@ CatalogInspector::CatalogInspector(std::shared_ptr<OpenDatabase> open_database,
: QWidget(parent)
{
m_tabWidget = new QTabWidget(this);
m_namespacePage = new CatalogNamespacePage(this);
m_tablesPage = new CatalogTablesPage(this);
m_functionsPage = new CatalogFunctionsPage(this);
m_sequencesPage = new CatalogSequencesPage(this);
@ -22,6 +24,7 @@ CatalogInspector::CatalogInspector(std::shared_ptr<OpenDatabase> open_database,
auto layout = new QVBoxLayout(this);
setLayout(layout);
layout->addWidget(m_tabWidget);
m_tabWidget->addTab(m_namespacePage, "");
m_tabWidget->addTab(m_tablesPage, "");
m_tabWidget->addTab(m_functionsPage, "");
m_tabWidget->addTab(m_sequencesPage, "");
@ -34,6 +37,8 @@ void CatalogInspector::retranslateUi(bool all)
{
m_tablesPage->retranslateUi(all);
m_tabWidget->setTabText(m_tabWidget->indexOf(m_namespacePage),
QApplication::translate("CatalogInspector", "Schemas", nullptr));
m_tabWidget->setTabText(m_tabWidget->indexOf(m_tablesPage),
QApplication::translate("CatalogInspector", "Tables", nullptr));
m_tabWidget->setTabText(m_tabWidget->indexOf(m_functionsPage),
@ -49,6 +54,7 @@ CatalogInspector::~CatalogInspector()
void CatalogInspector::setCatalog(std::shared_ptr<PgDatabaseCatalog> cat)
{
m_catalog = cat;
m_namespacePage->setCatalog(cat);
m_tablesPage->setCatalog(cat);
m_functionsPage->setCatalog(cat);
m_sequencesPage->setCatalog(cat);