pgLab/pglab/serverinspector/RolesPage.cpp
eelke f0e5488ce0 List of databases and roles moved to a "Server tab" within the database window.
Opened by selecting "Inspect Server" from the menu.
2021-04-10 14:27:04 +02:00

23 lines
620 B
C++

#include "RolesPage.h"
#include "catalog/PgDatabaseCatalog.h"
#include "RolesTableModel.h"
RolesPage::RolesPage(QWidget * parent)
: QSplitter(Qt::Horizontal, parent)
, m_rolesTableView(this)
{
auto tv = m_rolesTableView.tableView();
tv->setSelectionMode(QAbstractItemView::SingleSelection);
m_detailsTabs = new QTabWidget(this);
addWidget(tv);
addWidget(m_detailsTabs);
}
void RolesPage::setCatalog(std::shared_ptr<PgDatabaseCatalog> cat)
{
m_catalog = cat;
m_rolesTableView.dataModel()->setRoleList(cat->authIds());
m_rolesTableView.tableView()->resizeColumnsToContents();
}