VirtualBox

Ignore:
Timestamp:
Apr 15, 2021 4:45:15 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143840
Message:

FE/Qt: bugref:9831. more menu stuff

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

Legend:

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

    r88526 r88550  
    208208    bool hasSelectedText() const;
    209209    bool isFindInPageWidgetVisible() const;
     210    void findNext();
     211    void findPrevious();
    210212
    211213public slots:
     
    291293    bool isFindInPageWidgetVisible() const;
    292294    void toggleFindInPage(bool fTrigger);
     295    void findNext();
     296    void findPrevious();
    293297
    294298public slots:
     
    632636        return m_pContentViewer->isFindInPageWidgetVisible();
    633637    return false;
     638}
     639
     640void UIHelpBrowserTab::findNext()
     641{
     642    if (m_pContentViewer)
     643        return m_pContentViewer->sltSelectNextMatch();
     644}
     645
     646void UIHelpBrowserTab::findPrevious()
     647{
     648    if (m_pContentViewer)
     649        return m_pContentViewer->sltSelectPreviousMatch();
    634650}
    635651
     
    704720                     m_pFindInPageAction);
    705721    m_pFindInPageAction->setCheckable(true);
    706     m_pFindInPageAction->setShortcut(QKeySequence::Find);
    707722
    708723    connect(m_pHomeAction, &QAction::triggered, this, &UIHelpBrowserTab::sltHomeAction);
     
    10831098    if (pTab)
    10841099        pTab->sltFindInPageAction(fTrigger);
     1100}
     1101
     1102void UIHelpBrowserTabManager::findNext()
     1103{
     1104    UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget());
     1105    if (pTab)
     1106        pTab->findNext();
     1107}
     1108
     1109void UIHelpBrowserTabManager::findPrevious()
     1110{
     1111    UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget());
     1112    if (pTab)
     1113        pTab->findPrevious();
    10851114}
    10861115
     
    12501279    , m_pCopySelectedTextAction(0)
    12511280    , m_pFindInPageAction(0)
     1281    , m_pFindNextInPageAction(0)
     1282    , m_pFindPreviousInPageAction(0)
    12521283    , m_pZoomMenuAction(0)
    12531284    , m_fModelContentCreated(false)
     
    13361367    connect(m_pFindInPageAction, &QAction::triggered,
    13371368            this, &UIHelpBrowserWidget::sltFindInPage);
    1338     m_pFindInPageAction->setShortcut(QString("Ctrl+F"));
     1369    m_pFindInPageAction->setShortcut(QKeySequence::Find);
     1370
     1371    m_pFindNextInPageAction = new QAction(this);
     1372    m_pFindNextInPageAction->setEnabled(false);
     1373    connect(m_pFindNextInPageAction, &QAction::triggered,
     1374            this, &UIHelpBrowserWidget::sltFindNextInPage);
     1375    m_pFindNextInPageAction->setShortcut(QKeySequence::FindNext);
     1376
     1377    m_pFindPreviousInPageAction = new QAction(this);
     1378    m_pFindPreviousInPageAction->setEnabled(false);
     1379    connect(m_pFindPreviousInPageAction, &QAction::triggered,
     1380            this, &UIHelpBrowserWidget::sltFindPreviousInPage);
     1381    m_pFindPreviousInPageAction->setShortcut(QKeySequence::FindPrevious);
    13391382
    13401383    m_pPrintAction = new QAction(this);
     
    15051548    if(m_pFindInPageAction)
    15061549        m_pEditMenu->addAction(m_pFindInPageAction);
     1550    if(m_pFindNextInPageAction)
     1551        m_pEditMenu->addAction(m_pFindNextInPageAction);
     1552    if(m_pFindPreviousInPageAction)
     1553        m_pEditMenu->addAction(m_pFindPreviousInPageAction);
    15071554
    15081555    if (m_pZoomMenuAction)
     
    16461693    if (m_pFindInPageAction)
    16471694        m_pFindInPageAction->setText(tr("&Find in Page"));
     1695    if (m_pFindNextInPageAction)
     1696        m_pFindNextInPageAction->setText(tr("&Find Next"));
     1697    if (m_pFindPreviousInPageAction)
     1698        m_pFindPreviousInPageAction->setText(tr("&Find Previous"));
    16481699}
    16491700
     
    17011752}
    17021753
     1754void UIHelpBrowserWidget::sltFindNextInPage()
     1755{
     1756    if (m_pTabManager)
     1757        m_pTabManager->findNext();
     1758}
     1759
     1760void UIHelpBrowserWidget::sltFindPreviousInPage()
     1761{
     1762    if (m_pTabManager)
     1763        m_pTabManager->findPrevious();
     1764}
     1765
    17031766void UIHelpBrowserWidget::sltCopyAvailableChanged(bool fAvailable)
    17041767{
     
    17151778        m_pFindInPageAction->blockSignals(false);
    17161779    }
     1780    if (m_pFindNextInPageAction)
     1781        m_pFindNextInPageAction->setEnabled(fVisible);
     1782
     1783    if (m_pFindPreviousInPageAction)
     1784        m_pFindPreviousInPageAction->setEnabled(fVisible);
    17171785}
    17181786
     
    19842052        if (m_pFindInPageAction)
    19852053            m_pFindInPageAction->setChecked(m_pTabManager->isFindInPageWidgetVisible());
     2054        if (m_pFindNextInPageAction)
     2055            m_pFindNextInPageAction->setEnabled(m_pTabManager->isFindInPageWidgetVisible());
     2056        if (m_pFindPreviousInPageAction)
     2057            m_pFindPreviousInPageAction->setEnabled(m_pTabManager->isFindInPageWidgetVisible());
    19862058    }
    19872059}
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r88526 r88550  
    101101    void sltFindInPage(bool fChecked);
    102102    void sltFindInPageWidgetVisibilityChanged(bool fVisible);
     103    void sltFindNextInPage();
     104    void sltFindPreviousInPage();
    103105
    104106private:
     
    175177    QAction             *m_pCopySelectedTextAction;
    176178    QAction             *m_pFindInPageAction;
     179    QAction             *m_pFindNextInPageAction;
     180    QAction             *m_pFindPreviousInPageAction;
    177181    UIZoomMenuAction    *m_pZoomMenuAction;
    178182
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h

    r88526 r88550  
    7777    void toggleFindInPageWidget(bool fVisible);
    7878
     79public slots:
     80
     81    void sltSelectPreviousMatch();
     82    void sltSelectNextMatch();
     83
    7984protected:
    8085
     
    97102    void sltFindWidgetDrag(const QPoint &delta);
    98103    void sltFindInPageSearchTextChange(const QString &strSearchText);
    99     void sltSelectPreviousMatch();
    100     void sltSelectNextMatch();
    101104    void sltToggleFindInPageWidget(bool fVisible);
    102105    void sltCloseFindInPageWidget();
Note: See TracChangeset for help on using the changeset viewer.

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