| 5626 | } |
| 5627 | |
| 5628 | void EventBrowser::events_contextMenu(const QPoint &pos) |
| 5629 | { |
| 5630 | QModelIndex index = ui->events->indexAt(pos); |
| 5631 | |
| 5632 | QMenu contextMenu(this); |
| 5633 | |
| 5634 | QAction expandAll(tr("&Expand All"), this); |
| 5635 | QAction collapseAll(tr("&Collapse All"), this); |
| 5636 | QAction toggleBookmark(tr("Toggle &Bookmark"), this); |
| 5637 | QAction selectCols(tr("&Select Columns..."), this); |
| 5638 | QAction rgpSelect(tr("Select &RGP Event"), this); |
| 5639 | rgpSelect.setIcon(Icons::connect()); |
| 5640 | |
| 5641 | contextMenu.addAction(&expandAll); |
| 5642 | contextMenu.addAction(&collapseAll); |
| 5643 | contextMenu.addAction(&toggleBookmark); |
| 5644 | contextMenu.addAction(&selectCols); |
| 5645 | |
| 5646 | expandAll.setIcon(Icons::arrow_out()); |
| 5647 | collapseAll.setIcon(Icons::arrow_in()); |
| 5648 | toggleBookmark.setIcon(Icons::asterisk_orange()); |
| 5649 | selectCols.setIcon(Icons::timeline_marker()); |
| 5650 | |
| 5651 | expandAll.setEnabled(index.isValid() && ui->events->model()->rowCount(index) > 0); |
| 5652 | collapseAll.setEnabled(expandAll.isEnabled()); |
| 5653 | toggleBookmark.setEnabled(m_Ctx.IsCaptureLoaded()); |
| 5654 | |
| 5655 | QObject::connect(&expandAll, &QAction::triggered, |
| 5656 | [this, index]() { ui->events->expandAll(index); }); |
| 5657 | |
| 5658 | QObject::connect(&collapseAll, &QAction::triggered, |
| 5659 | [this, index]() { ui->events->collapseAll(index); }); |
| 5660 | |
| 5661 | QObject::connect(&toggleBookmark, &QAction::triggered, this, &EventBrowser::on_bookmark_clicked); |
| 5662 | |
| 5663 | QObject::connect(&selectCols, &QAction::triggered, this, &EventBrowser::on_colSelect_clicked); |
| 5664 | |
| 5665 | IRGPInterop *rgp = m_Ctx.GetRGPInterop(); |
| 5666 | if(rgp && rgp->HasRGPEvent(m_Ctx.CurEvent())) |
| 5667 | { |
| 5668 | contextMenu.addAction(&rgpSelect); |
| 5669 | QObject::connect(&rgpSelect, &QAction::triggered, |
| 5670 | [this, rgp]() { rgp->SelectRGPEvent(m_Ctx.CurEvent()); }); |
| 5671 | } |
| 5672 | |
| 5673 | contextMenu.addSeparator(); |
| 5674 | |
| 5675 | m_Ctx.Extensions().MenuDisplaying(ContextMenu::EventBrowser_Event, &contextMenu, |
| 5676 | {{"eventId", m_Ctx.CurEvent()}}); |
| 5677 | |
| 5678 | RDDialog::show(&contextMenu, ui->events->viewport()->mapToGlobal(pos)); |
| 5679 | } |
| 5680 | |
| 5681 | static QString GetBookmarkDisplayText(const EventBookmark &bookmark) |
| 5682 | { |
nothing calls this directly
no test coverage detected