Restructuring catalog tabs

- Moved detail tabs of table to their own components
- Table list has become seperate component on seperate tab
- Table list does not use designer anymore
- Moved sequences and functions tabs into the catalog inspector
This commit is contained in:
eelke 2019-02-09 09:49:27 +01:00
parent a704332342
commit 42432b06a9
31 changed files with 598 additions and 472 deletions

View file

@ -3,32 +3,17 @@
#include <QWidget>
#include <memory>
#include <optional>
#include <QItemSelection>
#include "TablesTableModel.h"
#include "plugin_support/PluginContentWidget.h"
#include "plugin_support/PluginModule.h"
namespace Ui {
class TablesPage;
}
class CatalogFunctionsPage;
class CatalogSequencesPage;
class CatalogTablesPage;
class QTabWidget;
class TablesTableModel;
class ColumnPage;
class ColumnTableModel;
class ConstraintModel;
class PgDatabaseCatalog;
class NamespaceFilterWidget;
class IndexModel;
class PropertiesPage;
class TriggerPage;
class PgClass;
class SqlCodePreview;
class CatalogInspector : public PluginContentWidget
{
class CatalogInspector : public PluginContentWidget {
Q_OBJECT
public:
explicit CatalogInspector(IPluginContentWidgetContext *context, QWidget *parent = nullptr);
~CatalogInspector();
@ -36,30 +21,15 @@ public:
void setCatalog(std::shared_ptr<PgDatabaseCatalog> cat);
void setNamespaceFilter(TablesTableModel::NamespaceFilter filter);
private:
Ui::TablesPage *ui;
ColumnPage *m_columnsPage;
PropertiesPage *m_propertiesPage;
TriggerPage *m_triggerPage;
SqlCodePreview *m_sqlCodePreview;
QTabWidget *m_tabWidget = nullptr;
CatalogTablesPage *m_tablesPage = nullptr;
CatalogFunctionsPage *m_functionsPage = nullptr;
CatalogSequencesPage *m_sequencesPage = nullptr;
std::shared_ptr<PgDatabaseCatalog> m_catalog;
TablesTableModel* m_tablesModel = nullptr;
ColumnTableModel* m_columnsModel = nullptr;
ConstraintModel* m_constraintModel = nullptr;
IndexModel* m_indexModel = nullptr;
void retranslateUi(bool all = true);
void selectedTableChanged(const std::optional<PgClass> &table);
void updateSqlTab(const std::optional<PgClass> &table);
private slots:
void tableListTable_currentRowChanged(const QModelIndex &current, const QModelIndex &previous);
void tableListTable_layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
void constraintsTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void constraintsTable_modelReset();
void indexesTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void indexesTable_modelReset();
void on_tableListTable_doubleClicked(const QModelIndex &index);
};
class CatalogInspectorModule: public PluginModule {