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:
parent
f996703937
commit
b0cd47ef46
17 changed files with 209 additions and 55 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "catalog/PgClass.h"
|
||||
#include <QWidget>
|
||||
#include "plugin_support/PluginContentWidget.h"
|
||||
#include "plugin_support/PluginModule.h"
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ public:
|
|||
explicit CrudTab(IPluginContentWidgetContext *context, QWidget *parent = nullptr);
|
||||
~CrudTab() override;
|
||||
|
||||
void setConfig(std::shared_ptr<OpenDatabase> db, const PgClass &table);
|
||||
void setConfig(Oid oid);
|
||||
|
||||
void refresh();
|
||||
|
||||
|
|
@ -41,4 +42,17 @@ private slots:
|
|||
void headerCustomContextMenu(const QPoint &pos);
|
||||
};
|
||||
|
||||
class CrudPageModule: public PluginModule {
|
||||
Q_OBJECT
|
||||
public:
|
||||
using PluginModule::PluginModule;
|
||||
|
||||
void init();
|
||||
private slots:
|
||||
|
||||
private:
|
||||
void moduleAction_open(IPluginContentWidgetContext* context, const ModuleActionParameters ¶ms);
|
||||
};
|
||||
|
||||
|
||||
#endif // CRUDTAB_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue