Work on plugin mechanism
Context actions have become normal actions in the pluginwidget so the widget knows abot them and can easily do things like enable/disable.
This commit is contained in:
parent
eca8841427
commit
a704332342
24 changed files with 239 additions and 267 deletions
|
|
@ -106,6 +106,22 @@ void CrudTab::headerCustomContextMenu(const QPoint &pos)
|
|||
menu->popup(horizontal_header->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void CrudTab::initActions()
|
||||
{
|
||||
|
||||
{
|
||||
auto ac = new QAction(QIcon(":/icons/script_go.png"), tr("Refresh"), this);
|
||||
ac->setShortcut(QKeySequence(Qt::Key_F5));
|
||||
connect(ac, &QAction::triggered, this, &CrudTab::refresh);
|
||||
m_refreshAction = ac;
|
||||
}
|
||||
}
|
||||
|
||||
QList<QAction *> CrudTab::actions()
|
||||
{
|
||||
return { m_refreshAction };
|
||||
}
|
||||
|
||||
|
||||
void CrudPageModule::init()
|
||||
{
|
||||
|
|
@ -115,14 +131,6 @@ void CrudPageModule::init()
|
|||
{
|
||||
moduleAction_open(context, params);
|
||||
});
|
||||
|
||||
{
|
||||
LContextAction wa("Refresh", SLOT(refresh()));
|
||||
wa.setMenuLocation(MenuPath("Window/1"));
|
||||
wa.setIcon(QIcon(":/icons/script_go.png"));
|
||||
wa.setShortcut(QKeySequence(Qt::Key_F5));
|
||||
registerContextAction(wa);
|
||||
}
|
||||
}
|
||||
|
||||
void CrudPageModule::moduleAction_open(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue