Changeset 87215 in vbox for trunk/src/VBox
- Timestamp:
- Jan 11, 2021 2:27:23 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r87208 r87215 160 160 161 161 void sltDeleteSelectedBookmark(); 162 void sltDeleteAllBookmarks(); 162 163 163 164 protected: … … 166 167 167 168 private slots: 168 169 void sltHandleContextMenuRequest(const QPoint &listWidgetLocalPos);170 169 171 170 private: … … 498 497 return; 499 498 QListWidgetItem *pCurrentItem = m_pListWidget->takeItem(m_pListWidget->currentRow()); 500 501 499 delete pCurrentItem; 502 503 500 } 501 502 void UIBookmarksListContainer::sltDeleteAllBookmarks() 503 { 504 if (m_pListWidget) 505 m_pListWidget->clear(); 504 506 } 505 507 … … 521 523 this, &UIBookmarksListContainer::sigBookmarkDoubleClick); 522 524 connect(m_pListWidget, &UIBookmarksListWidget::customContextMenuRequested, 523 this, &UIBookmarksListContainer::sltHandleContextMenuRequest); 524 } 525 526 void UIBookmarksListContainer::sltHandleContextMenuRequest(const QPoint &listWidgetLocalPos) 527 { 528 if (!m_pListWidget || !m_pListWidget->currentItem()) 529 return; 530 emit sigListWidgetContextMenuRequest(listWidgetLocalPos); 525 this, &UIBookmarksListContainer::sigListWidgetContextMenuRequest); 531 526 } 532 527 … … 1750 1745 return; 1751 1746 1752 if (!url.isValid()) 1753 return; 1747 bool fURLValid = url.isValid(); 1754 1748 1755 1749 QMenu menu; … … 1762 1756 pCopyLink->setData(url); 1763 1757 1758 pOpen->setEnabled(fURLValid); 1759 pOpenInNewTab->setEnabled(fURLValid); 1760 pCopyLink->setEnabled(fURLValid); 1761 1764 1762 connect(pOpenInNewTab, &QAction::triggered, this, &UIHelpBrowserWidget::sltOpenLinkInNewTab); 1765 1763 connect(pOpen, &QAction::triggered, this, &UIHelpBrowserWidget::sltOpenLink); … … 1770 1768 menu.addSeparator(); 1771 1769 QAction *pDeleteBookmark = menu.addAction(tr("Delete Bookmark")); 1770 QAction *pDeleteAllBookmarks = menu.addAction(tr("Delete All Bookmarks")); 1771 pDeleteBookmark->setEnabled(fURLValid); 1772 1772 1773 connect(pDeleteBookmark, &QAction::triggered, m_pBookmarksWidget, &UIBookmarksListContainer::sltDeleteSelectedBookmark); 1774 connect(pDeleteAllBookmarks, &QAction::triggered, m_pBookmarksWidget, &UIBookmarksListContainer::sltDeleteAllBookmarks); 1773 1775 } 1774 1776
Note:
See TracChangeset
for help on using the changeset viewer.