Extended the plugin system to allow for dynamic runtime bindings between modules.

As a test implementation, this allows the TablesPage to open a CrudTab for a table/view without
the need for TablesPage, CrudTab and DatabaseWindow to know anything about each other.
This commit is contained in:
eelke 2018-12-31 15:20:55 +01:00
parent f996703937
commit b0cd47ef46
17 changed files with 209 additions and 55 deletions

View file

@ -21,11 +21,11 @@
#include "SqlCodePreview.h"
#include <QStringBuilder>
#include <unordered_set>
#include "plugin_support/IPluginContentWidgetContext.h"
TablesPage::TablesPage(DatabaseWindow *parent)
: QWidget(parent)
TablesPage::TablesPage(IPluginContentWidgetContext *context_, QWidget *parent)
: PluginContentWidget(context_, parent)
, ui(new Ui::TablesPage)
, m_window(parent)
{
ui->setupUi(this);
@ -239,9 +239,10 @@ void TablesPage::on_tableListTable_doubleClicked(const QModelIndex &index)
{
PgClass table = m_tablesModel->getTable(index.row());
if (table.oid() != InvalidOid) {
m_window->newCrudPage(table);
context()->moduleAction("pglab.crudpage", "open", {
{ "oid", table.oid() }
});
}
}
void TablesPage::updateSqlTab(const std::optional<PgClass> &table)