| 5694 | } |
| 5695 | |
| 5696 | void EventBrowser::repopulateBookmarks() |
| 5697 | { |
| 5698 | const rdcarray<EventBookmark> bookmarks = m_Ctx.GetBookmarks(); |
| 5699 | |
| 5700 | // add any bookmark markers that we don't have |
| 5701 | for(const EventBookmark &mark : bookmarks) |
| 5702 | { |
| 5703 | if(!m_BookmarkButtons.contains(mark.eventId)) |
| 5704 | { |
| 5705 | uint32_t EID = mark.eventId; |
| 5706 | |
| 5707 | QRClickToolButton *but = new QRClickToolButton(this); |
| 5708 | |
| 5709 | but->setText(GetBookmarkDisplayText(mark)); |
| 5710 | but->setCheckable(true); |
| 5711 | but->setAutoRaise(true); |
| 5712 | but->setProperty("eid", EID); |
| 5713 | QObject::connect(but, &QRClickToolButton::clicked, [this, but, EID]() { |
| 5714 | but->setChecked(true); |
| 5715 | if(!SelectEvent(EID)) |
| 5716 | ui->events->setCurrentIndex(QModelIndex()); |
| 5717 | highlightBookmarks(); |
| 5718 | }); |
| 5719 | QObject::connect(but, &QRClickToolButton::rightClicked, |
| 5720 | [this, but, EID]() { bookmarkContextMenu(but, EID); }); |
| 5721 | |
| 5722 | m_BookmarkButtons[EID] = but; |
| 5723 | |
| 5724 | highlightBookmarks(); |
| 5725 | |
| 5726 | m_BookmarkStripLayout->removeItem(m_BookmarkSpacer); |
| 5727 | m_BookmarkStripLayout->addWidget(but); |
| 5728 | m_BookmarkStripLayout->addItem(m_BookmarkSpacer); |
| 5729 | } |
| 5730 | } |
| 5731 | |
| 5732 | // remove any bookmark markers we shouldn't have |
| 5733 | for(uint32_t EID : m_BookmarkButtons.keys()) |
| 5734 | { |
| 5735 | if(!bookmarks.contains(EventBookmark(EID))) |
| 5736 | { |
| 5737 | delete m_BookmarkButtons[EID]; |
| 5738 | m_BookmarkButtons.remove(EID); |
| 5739 | } |
| 5740 | } |
| 5741 | |
| 5742 | ui->bookmarkStrip->setVisible(!bookmarks.isEmpty()); |
| 5743 | |
| 5744 | m_Model->RefreshCache(); |
| 5745 | } |
| 5746 | |
| 5747 | void EventBrowser::jumpToBookmark(int idx) |
| 5748 | { |
nothing calls this directly
no test coverage detected