2019-02-09 09:49:27 +01:00
|
|
|
|
#ifndef CATALOGTABLESPAGE_H
|
|
|
|
|
|
#define CATALOGTABLESPAGE_H
|
|
|
|
|
|
|
2019-02-09 20:37:34 +01:00
|
|
|
|
#include "NamespaceFilter.h"
|
2021-12-30 18:54:26 +01:00
|
|
|
|
#include "TablesTableModel.h"
|
|
|
|
|
|
#include "PgLabTableViewHelper.h"
|
2019-02-09 09:49:27 +01:00
|
|
|
|
#include <QSplitter>
|
|
|
|
|
|
#include <memory>
|
2019-02-09 20:37:34 +01:00
|
|
|
|
#include <optional>
|
|
|
|
|
|
#include <QAbstractItemModel>
|
2019-08-16 10:49:38 +02:00
|
|
|
|
#include "Pgsql_oids.h"
|
2019-02-09 09:49:27 +01:00
|
|
|
|
|
|
|
|
|
|
class CatalogConstraintPage;
|
|
|
|
|
|
class CatalogIndexPage;
|
|
|
|
|
|
class ColumnPage;
|
|
|
|
|
|
class ColumnTableModel;
|
|
|
|
|
|
class ConstraintModel;
|
2019-11-17 10:27:11 +01:00
|
|
|
|
class DependantsPage;
|
2019-02-09 09:49:27 +01:00
|
|
|
|
class PgClass;
|
|
|
|
|
|
class PgDatabaseCatalog;
|
|
|
|
|
|
class PgLabTableView;
|
|
|
|
|
|
class PropertiesPage;
|
|
|
|
|
|
class QTabWidget;
|
|
|
|
|
|
class SqlCodePreview;
|
2019-02-09 14:59:33 +01:00
|
|
|
|
class QSortFilterProxyModel;
|
2019-02-09 09:49:27 +01:00
|
|
|
|
class TriggerPage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CatalogTablesPage: public QSplitter {
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
2022-01-17 17:12:07 +01:00
|
|
|
|
explicit CatalogTablesPage(std::shared_ptr<OpenDatabase> opendatabase, QWidget * parent = nullptr);
|
2019-02-09 09:49:27 +01:00
|
|
|
|
|
|
|
|
|
|
void setCatalog(std::shared_ptr<PgDatabaseCatalog> cat);
|
2019-02-09 20:37:34 +01:00
|
|
|
|
void setNamespaceFilter(NamespaceFilter filter);
|
2019-02-09 09:49:27 +01:00
|
|
|
|
|
|
|
|
|
|
void retranslateUi(bool all = true);
|
2019-08-16 10:49:38 +02:00
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
void tableSelected(Oid tableoid);
|
2019-02-09 09:49:27 +01:00
|
|
|
|
private:
|
2021-12-30 18:54:26 +01:00
|
|
|
|
PgLabTableViewHelper<TablesTableModel> m_tablesTableView;
|
2019-02-09 09:49:27 +01:00
|
|
|
|
|
|
|
|
|
|
// Details
|
|
|
|
|
|
QTabWidget *m_detailsTabs = nullptr;
|
|
|
|
|
|
ColumnPage *m_columnsPage = nullptr;
|
|
|
|
|
|
CatalogConstraintPage *m_constraintPage = nullptr;
|
|
|
|
|
|
CatalogIndexPage *m_indexPage = nullptr;
|
2022-01-16 18:43:09 +01:00
|
|
|
|
// PropertiesPage *m_propertiesPage = nullptr;
|
2019-02-09 09:49:27 +01:00
|
|
|
|
TriggerPage *m_triggerPage = nullptr;
|
2019-11-17 10:27:11 +01:00
|
|
|
|
DependantsPage *m_dependentsPage = nullptr;
|
2019-02-09 09:49:27 +01:00
|
|
|
|
SqlCodePreview *m_tableSql = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<PgDatabaseCatalog> m_catalog;
|
|
|
|
|
|
|
|
|
|
|
|
void selectedTableChanged(const std::optional<PgClass> &table);
|
|
|
|
|
|
void updateSqlTab(const std::optional<PgClass> &table);
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
|
|
|
|
void tableListTable_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
|
|
|
|
|
void tableListTable_layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
|
|
|
|
|
|
void on_tableListTable_doubleClicked(const QModelIndex &index);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // CATALOGTABLESPAGE_H
|