VirtualBox

Changeset 87215 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 11, 2021 2:27:23 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Some bookmarks fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r87208 r87215  
    160160
    161161    void sltDeleteSelectedBookmark();
     162    void sltDeleteAllBookmarks();
    162163
    163164protected:
     
    166167
    167168private slots:
    168 
    169     void sltHandleContextMenuRequest(const QPoint &listWidgetLocalPos);
    170169
    171170private:
     
    498497        return;
    499498    QListWidgetItem *pCurrentItem = m_pListWidget->takeItem(m_pListWidget->currentRow());
    500 
    501499    delete pCurrentItem;
    502 
    503 
     500}
     501
     502void UIBookmarksListContainer::sltDeleteAllBookmarks()
     503{
     504    if (m_pListWidget)
     505        m_pListWidget->clear();
    504506}
    505507
     
    521523            this, &UIBookmarksListContainer::sigBookmarkDoubleClick);
    522524    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);
    531526}
    532527
     
    17501745        return;
    17511746
    1752     if (!url.isValid())
    1753         return;
     1747    bool fURLValid = url.isValid();
    17541748
    17551749    QMenu menu;
     
    17621756    pCopyLink->setData(url);
    17631757
     1758    pOpen->setEnabled(fURLValid);
     1759    pOpenInNewTab->setEnabled(fURLValid);
     1760    pCopyLink->setEnabled(fURLValid);
     1761
    17641762    connect(pOpenInNewTab, &QAction::triggered, this, &UIHelpBrowserWidget::sltOpenLinkInNewTab);
    17651763    connect(pOpen, &QAction::triggered, this, &UIHelpBrowserWidget::sltOpenLink);
     
    17701768        menu.addSeparator();
    17711769        QAction *pDeleteBookmark = menu.addAction(tr("Delete Bookmark"));
     1770        QAction *pDeleteAllBookmarks = menu.addAction(tr("Delete All Bookmarks"));
     1771        pDeleteBookmark->setEnabled(fURLValid);
     1772
    17721773        connect(pDeleteBookmark, &QAction::triggered, m_pBookmarksWidget, &UIBookmarksListContainer::sltDeleteSelectedBookmark);
     1774        connect(pDeleteAllBookmarks, &QAction::triggered, m_pBookmarksWidget, &UIBookmarksListContainer::sltDeleteAllBookmarks);
    17731775    }
    17741776
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette