Allow registering window, panel and context menu items with callbacks

This commit is contained in:
baldurk
2018-10-22 16:50:51 +01:00
parent 67fc971cd9
commit 94dfb9890b
24 changed files with 963 additions and 67 deletions
+14
View File
@@ -189,6 +189,15 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
QObject::connect(ui->events->header(), &QHeaderView::customContextMenuRequested, this,
&EventBrowser::events_contextMenu);
{
QMenu *extensionsMenu = new QMenu(this);
QObject::connect(extensionsMenu, &QMenu::aboutToShow, [this, extensionsMenu]() {
extensionsMenu->clear();
m_Ctx.Extensions().MenuDisplaying(PanelMenu::EventBrowser, ui->extensions, {});
});
}
OnCaptureClosed();
m_redPalette = palette();
@@ -1009,6 +1018,11 @@ void EventBrowser::events_contextMenu(const QPoint &pos)
[this, rgp]() { rgp->SelectRGPEvent(m_Ctx.CurEvent()); });
}
contextMenu.addSeparator();
m_Ctx.Extensions().MenuDisplaying(ContextMenu::EventBrowser_Event, &contextMenu,
{{"eventId", m_Ctx.CurEvent()}});
RDDialog::show(&contextMenu, ui->events->viewport()->mapToGlobal(pos));
}