VirtualBox

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


Ignore:
Timestamp:
Oct 19, 2020 8:20:16 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Adding the dialo menu

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

Legend:

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

    r86620 r86622  
    109109    , m_pHelpEngine(0)
    110110#endif
    111     , m_pTextBrowser(0)
     111    , m_pContentViewer(0)
    112112    , m_pSplitter(0)
    113 {
    114     /* Prepare VM Log-Viewer: */
     113    , m_pMenu(0)
     114{
    115115    prepare();
    116116}
     
    124124QMenu *UIHelpBrowserWidget::menu() const
    125125{
    126     return 0;//m_pActionPool->action(UIActionIndex_M_LogWindow)->menu();
     126    return m_pMenu;
    127127}
    128128
     
    139139    prepareActions();
    140140    prepareWidgets();
    141 
    142 
     141    prepareMenuAndMenuActions();
    143142    retranslateUi();
    144143}
     
    168167    m_pTabWidget->addTab(m_pHelpEngine->indexWidget(), tr("Index"));
    169168
    170     m_pTextBrowser = new UIHelpBrowserViewer(m_pHelpEngine);
    171     AssertReturnVoid(m_pTextBrowser);
    172     m_pSplitter->addWidget(m_pTextBrowser);
     169    m_pContentViewer = new UIHelpBrowserViewer(m_pHelpEngine);
     170    AssertReturnVoid(m_pContentViewer);
     171    m_pSplitter->addWidget(m_pContentViewer);
    173172
    174173    m_pSplitter->setStretchFactor(0, 1);
     
    180179
    181180    connect(m_pHelpEngine->contentWidget(), &QHelpContentWidget::linkActivated,
    182             m_pTextBrowser, &UIHelpBrowserViewer::setSource);
     181            m_pContentViewer, &UIHelpBrowserViewer::setSource);
    183182    connect(m_pHelpEngine->contentWidget(), &QHelpContentWidget::clicked,
    184183            this, &UIHelpBrowserWidget::sltHandleContentWidgetItemClicked);
     
    186185
    187186    connect(m_pHelpEngine->indexWidget(), &QHelpIndexWidget::linkActivated,
    188             m_pTextBrowser, &UIHelpBrowserViewer::setSource);
     187            m_pContentViewer, &UIHelpBrowserViewer::setSource);
    189188
    190189    if (QFile(m_strHelpFilePath).exists() && m_pHelpEngine)
     
    219218}
    220219
     220void UIHelpBrowserWidget::prepareMenuAndMenuActions()
     221{
     222    m_pMenu = new QMenu(tr("View"), this);
     223    AssertReturnVoid(m_pMenu);
     224    m_pMenu->addAction(tr("View"));
     225}
     226
    221227void UIHelpBrowserWidget::loadOptions()
    222228{
     
    272278{
    273279#ifdef RT_OS_LINUX
    274     AssertReturnVoid(m_pTextBrowser && m_pHelpEngine);
     280    AssertReturnVoid(m_pContentViewer && m_pHelpEngine);
    275281    QList<QUrl> files = m_pHelpEngine->files(m_pHelpEngine->namespaceName(m_strHelpFilePath), QStringList());
    276282    if (!files.empty())
    277         m_pTextBrowser->setSource(files[0]);
     283        m_pContentViewer->setSource(files[0]);
    278284    /** @todo show some kind of error maybe. */
    279285#endif
     
    283289{
    284290#ifdef RT_OS_LINUX
    285     AssertReturnVoid(m_pTextBrowser && m_pHelpEngine && m_pHelpEngine->contentWidget());
     291    AssertReturnVoid(m_pContentViewer && m_pHelpEngine && m_pHelpEngine->contentWidget());
    286292    QHelpContentModel *pContentModel =
    287293        qobject_cast<QHelpContentModel*>(m_pHelpEngine->contentWidget()->model());
     
    292298        return;
    293299    const QUrl &url = pItem->url();
    294     m_pTextBrowser->setSource(url);
     300    m_pContentViewer->setSource(url);
     301#else
     302    Q_UNUSED(index);
    295303#endif
    296304}
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h

    r86620 r86622  
    9393    void prepareWidgets();
    9494    void prepareToolBar();
     95    void prepareMenuAndMenuActions();
    9596    void loadOptions();
    9697
     
    131132    QHelpEngine  *m_pHelpEngine;
    132133#endif
    133     UIHelpBrowserViewer *m_pTextBrowser;
     134    UIHelpBrowserViewer *m_pContentViewer;
    134135    QSplitter           *m_pSplitter;
     136    QMenu               *m_pMenu;
    135137};
    136138
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