Make double clicking on table in CatalogInspector open crud for selected table/view.
This commit is contained in:
parent
1a2ec6a224
commit
6fdf631fac
8 changed files with 53 additions and 47 deletions
|
|
@ -14,13 +14,14 @@
|
|||
#include <set>
|
||||
|
||||
|
||||
CrudTab::CrudTab(std::shared_ptr<OpenDatabase> open_database, QWidget *parent)
|
||||
CrudTab::CrudTab(IDatabaseWindow *context, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_context(context)
|
||||
, ui(new Ui::CrudTab)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_db = open_database;
|
||||
m_db = context->openDatabase();
|
||||
|
||||
SetTableViewDefault(ui->tableView);
|
||||
|
||||
|
|
@ -50,6 +51,7 @@ void CrudTab::setConfig(Oid oid) //std::shared_ptr<OpenDatabase> db, const PgCla
|
|||
{
|
||||
m_table = *m_db->catalog()->classes()->getByKey(oid);
|
||||
m_crudModel->setConfig(m_db, *m_table);
|
||||
m_context->setTitleForWidget(this, m_table->objectName(), "");
|
||||
}
|
||||
|
||||
void CrudTab::refresh()
|
||||
|
|
@ -116,33 +118,4 @@ void CrudTab::initActions()
|
|||
}
|
||||
}
|
||||
|
||||
//QList<QAction *> CrudTab::actions()
|
||||
//{
|
||||
// return { m_refreshAction };
|
||||
//}
|
||||
|
||||
|
||||
//void CrudPageModule::init()
|
||||
//{
|
||||
// registerModuleAction("open",
|
||||
// [this] (IPluginContentWidgetContext* context,
|
||||
// const ModuleActionParameters ¶ms)
|
||||
// {
|
||||
// moduleAction_open(context, params);
|
||||
// });
|
||||
//}
|
||||
|
||||
//void CrudPageModule::moduleAction_open(
|
||||
// IPluginContentWidgetContext* context,
|
||||
// const ModuleActionParameters ¶ms
|
||||
// )
|
||||
//{
|
||||
// // 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")
|
||||
// TODO refresh action
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue