Remove all of plugin_support

This commit is contained in:
eelke 2019-08-15 18:00:19 +02:00
parent 09ef4cdf6b
commit b0fa02455c
25 changed files with 46 additions and 1007 deletions

View file

@ -12,16 +12,16 @@
#include <QMessageBox>
#include <iterator>
#include <set>
#include "plugin_support/PluginRegister.h"
#include "plugin_support/IPluginContentWidgetContext.h"
CrudTab::CrudTab(IPluginContentWidgetContext *context, PluginModule *module, QWidget *parent)
: PluginContentWidget(context, module, parent)
CrudTab::CrudTab(std::shared_ptr<OpenDatabase> open_database, QWidget *parent)
: QWidget(parent)
, ui(new Ui::CrudTab)
{
ui->setupUi(this);
m_db = open_database;
SetTableViewDefault(ui->tableView);
auto delegate = new PgLabItemDelegate(ui->tableView);
@ -48,7 +48,6 @@ CrudTab::~CrudTab()
void CrudTab::setConfig(Oid oid) //std::shared_ptr<OpenDatabase> db, const PgClass &table)
{
m_db = context()->getObject<OpenDatabase>(); // getDatabase();;
m_table = *m_db->catalog()->classes()->getByKey(oid);
m_crudModel->setConfig(m_db, *m_table);
}
@ -117,33 +116,33 @@ void CrudTab::initActions()
}
}
QList<QAction *> CrudTab::actions()
{
return { m_refreshAction };
}
//QList<QAction *> CrudTab::actions()
//{
// return { m_refreshAction };
//}
void CrudPageModule::init()
{
registerModuleAction("open",
[this] (IPluginContentWidgetContext* context,
const ModuleActionParameters &params)
{
moduleAction_open(context, params);
});
}
//void CrudPageModule::init()
//{
// registerModuleAction("open",
// [this] (IPluginContentWidgetContext* context,
// const ModuleActionParameters &params)
// {
// moduleAction_open(context, params);
// });
//}
void CrudPageModule::moduleAction_open(
IPluginContentWidgetContext* context,
const ModuleActionParameters &params
)
{
// create new widget for specified table
// hand widget to context for display
CrudTab *ct = new CrudTab(context, this);
context->addContentWidget(ct); // maybe CrudTab should do this
ct->setConfig(params.at("oid").toUInt());
//void CrudPageModule::moduleAction_open(
// IPluginContentWidgetContext* context,
// const ModuleActionParameters &params
// )
//{
// // create new widget for specified table
// // hand widget to context for display
// CrudTab *ct = new CrudTab(context, this);
// context->addContentWidget(ct); // maybe CrudTab should do this
// ct->setConfig(params.at("oid").toUInt());
}
//}
REGISTER_PLUGIN_MODULE_CAT(CrudPageModule, "CRUD tool", "pglab.crudpage", "database")
//REGISTER_PLUGIN_MODULE_CAT(CrudPageModule, "CRUD tool", "pglab.crudpage", "database")