VirtualBox

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


Ignore:
Timestamp:
May 31, 2021 5:53:35 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Enabling/disabling backward/forward menu actions depending of history change

Location:
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
Files:
2 edited

Legend:

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

    r89409 r89410  
    190190    void sigZoomPercentageChanged(int iPercentage);
    191191    void sigFindInPageWidgetVisibilityChanged(bool fVisible);
     192    void sigHistoryChanged(bool fBackwardAvailable, bool fForwardAvailable);
    192193
    193194public:
     
    269270    void sigCopyAvailableChanged(bool fAvailable);
    270271    void sigFindInPageWidgetVisibilityChanged(bool fVisible);
     272    void sigHistoryChanged(bool fBackwardAvailable, bool fForwardAvailable);
    271273
    272274public:
     
    839841
    840842    emit sigTitleUpdate(m_pContentViewer->historyTitle(0));
     843    emit sigHistoryChanged(m_pContentViewer->isBackwardAvailable(), m_pContentViewer->isForwardAvailable());
    841844}
    842845
     
    926929    connect(pTabWidget, &UIHelpBrowserTab::sigFindInPageWidgetVisibilityChanged,
    927930            this, &UIHelpBrowserTabManager::sigFindInPageWidgetVisibilityChanged);
     931    connect(pTabWidget, &UIHelpBrowserTab::sigHistoryChanged,
     932            this, &UIHelpBrowserTabManager::sigHistoryChanged);
     933
     934
    928935
    929936    pTabWidget->setZoomPercentage(zoomPercentage());
     
    14641471    connect(m_pBackwardAction, &QAction::triggered,
    14651472            this, &UIHelpBrowserWidget::sigGoBackward);
     1473    m_pBackwardAction->setEnabled(false);
    14661474
    14671475    m_pForwardAction = new QAction(this);
    14681476    connect(m_pForwardAction, &QAction::triggered,
    14691477            this, &UIHelpBrowserWidget::sigGoForward);
     1478    m_pForwardAction->setEnabled(false);
    14701479
    14711480    m_pHomeAction = new QAction(this);
     
    15521561    connect(m_pTabManager, &UIHelpBrowserTabManager::sigFindInPageWidgetVisibilityChanged,
    15531562            this, &UIHelpBrowserWidget::sltFindInPageWidgetVisibilityChanged);
     1563    connect(m_pTabManager, &UIHelpBrowserTabManager::sigHistoryChanged,
     1564            this, &UIHelpBrowserWidget::sltHistoryChanged);
     1565
    15541566
    15551567    connect(m_pHelpEngine, &QHelpEngine::setupFinished,
     
    18791891}
    18801892
     1893void UIHelpBrowserWidget::sltHistoryChanged(bool fBackwardAvailable, bool fForwardAvailable)
     1894{
     1895    if (m_pBackwardAction)
     1896        m_pBackwardAction->setEnabled(fBackwardAvailable);
     1897    if (m_pForwardAction)
     1898        m_pForwardAction->setEnabled(fForwardAvailable);
     1899}
     1900
    18811901void UIHelpBrowserWidget::sltCopyAvailableChanged(bool fAvailable)
    18821902{
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r89409 r89410  
    110110    void sltFindNextInPage();
    111111    void sltFindPreviousInPage();
     112    void sltHistoryChanged(bool fBackwardAvailable, bool fForwardAvailable);
    112113
    113114private:
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