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
|
|
@ -21,7 +21,7 @@
|
|||
#include "util.h"
|
||||
#include "GlobalIoService.h"
|
||||
#include "UserConfiguration.h"
|
||||
#include "IPluginContentWidgetContext.h"
|
||||
#include "plugin_support/IPluginContentWidgetContext.h"
|
||||
#include "plugin_support/PluginRegister.h"
|
||||
|
||||
QueryTab::QueryTab(IPluginContentWidgetContext *context_, QWidget *parent)
|
||||
|
|
@ -687,16 +687,7 @@ void QueryToolModule::new_triggered()
|
|||
|
||||
namespace {
|
||||
|
||||
|
||||
std::shared_ptr<PluginModule> createModule()
|
||||
{
|
||||
auto module = std::make_shared<QueryToolModule>("Query tool", "pglab.querytool");
|
||||
module->init();
|
||||
|
||||
PluginRegister::getInstance()->registerModule(module);
|
||||
return std::move(module);
|
||||
}
|
||||
|
||||
std::weak_ptr<PluginModule> register_variable = createModule();
|
||||
std::weak_ptr<PluginModule> register_variable = createPluginModule<QueryToolModule>
|
||||
("Query tool", "pglab.querytool");
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue