VirtualBox

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


Ignore:
Timestamp:
Dec 1, 2020 1:33:04 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Preparing context sensitive related help browser start for the manager UI

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r86996 r87022  
    25792579            &msgCenter(), &UIMessageCenter::sltResetSuppressedMessages, Qt::UniqueConnection);
    25802580
    2581     /* 'Help' menu connections: */
    2582     connect(action(UIActionIndex_Simple_Contents), &UIAction::triggered,
    2583             &msgCenter(), &UIMessageCenter::sltShowHelpHelpDialog, Qt::UniqueConnection);
     2581    /* 'Help' menu connections. Note that connections for UIActionIndex_Simple_Contents is done
     2582     *   in manager and runtime uis separately in their respective classes: */
    25842583    connect(action(UIActionIndex_Simple_WebSite), &UIAction::triggered,
    25852584            &msgCenter(), &UIMessageCenter::sltShowHelpWebDialog, Qt::UniqueConnection);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp

    r86997 r87022  
    242242}
    243243
     244QString UIToolPaneGlobal::currentHelpKeyword() const
     245{
     246    QWidget *pCurrentToolWidget = 0;
     247    //UIToolType currentTool() const;
     248    switch (currentTool())
     249    {
     250        case UIToolType_Welcome:
     251            pCurrentToolWidget = m_pPaneWelcome;
     252            break;
     253        case UIToolType_Media:
     254            pCurrentToolWidget = m_pPaneMedia;
     255            break;
     256        case UIToolType_Network:
     257            pCurrentToolWidget = m_pPaneNetwork;
     258            break;
     259        case UIToolType_Cloud:
     260            pCurrentToolWidget = m_pPaneCloud;
     261            break;
     262        case UIToolType_Resources:
     263            pCurrentToolWidget = m_pPaneResourceMonitor;
     264            break;
     265        default:
     266            break;
     267    }
     268    return uiCommon().helpKeyword(pCurrentToolWidget);
     269}
     270
    244271void UIToolPaneGlobal::prepare()
    245272{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.h

    r86997 r87022  
    7272    /** Closes tool of passed @a enmType, deletes one if exists. */
    7373    void closeTool(UIToolType enmType);
     74    /** Returns the help keyword of the current tool's widget. */
     75    QString currentHelpKeyword() const;
    7476
    7577private:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp

    r85571 r87022  
    311311}
    312312
     313QString UIToolPaneMachine::currentHelpKeyword() const
     314{
     315    QWidget *pCurrentToolWidget = 0;
     316    switch (currentTool())
     317    {
     318        case UIToolType_Error:
     319            pCurrentToolWidget = m_pPaneError;
     320            break;
     321        case UIToolType_Details:
     322            pCurrentToolWidget = m_pPaneDetails;
     323            break;
     324        case UIToolType_Snapshots:
     325            pCurrentToolWidget = m_pPaneSnapshots;
     326            break;
     327        case UIToolType_Logs:
     328            pCurrentToolWidget = m_pPaneLogViewer;
     329            break;
     330        case UIToolType_Performance:
     331            pCurrentToolWidget = m_pPanePerformanceMonitor;
     332            break;
     333        default:
     334            break;
     335    }
     336    return uiCommon().helpKeyword(pCurrentToolWidget);
     337}
     338
    313339void UIToolPaneMachine::prepare()
    314340{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h

    r85396 r87022  
    9898    bool isCurrentStateItemSelected() const;
    9999
     100    /** Returns the help keyword of the current tool's widget. */
     101    QString currentHelpKeyword() const;
     102
    100103private:
    101104
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r86997 r87022  
    21392139}
    21402140
     2141void UIVirtualBoxManager::sltPerformShowHelpBrowser()
     2142{
     2143    m_pWidget->showHelpBrowser();
     2144}
     2145
    21412146void UIVirtualBoxManager::prepare()
    21422147{
     
    24762481    connect(actionPool()->actionGroup(UIActionIndexMN_M_Machine_M_Tools), &QActionGroup::triggered,
    24772482            this, &UIVirtualBoxManager::sltPerformShowMachineTool);
     2483
     2484    /* 'Help' menu contents action connection. It is done here since we need different behaviour in
     2485     * the manager and runtime UIs: */
     2486    connect(actionPool()->action(UIActionIndex_Simple_Contents), &UIAction::triggered,
     2487        this, &UIVirtualBoxManager::sltPerformShowHelpBrowser);
     2488
    24782489}
    24792490
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r86925 r87022  
    309309        /** Handles call to toggle machine search widget visibility to be @a fVisible. */
    310310        void sltPerformMachineSearchWidgetVisibilityToggling(bool fVisible);
     311
     312        /** Handles call to show help viewer. */
     313        void sltPerformShowHelpBrowser();
    311314    /** @} */
    312315
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r86925 r87022  
    2828#include "UIExtraDataManager.h"
    2929#include "UIChooser.h"
     30#include "UIMessageCenter.h"
    3031#include "UIVirtualBoxManager.h"
    3132#include "UIVirtualBoxManagerWidget.h"
     
    256257    if (pButton)
    257258        pButton->setPopupMode(fSeparateMenuSection ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
     259}
     260
     261void UIVirtualBoxManagerWidget::showHelpBrowser()
     262{
     263    QString strHelpKeyword;
     264    if (isGlobalItemSelected())
     265        strHelpKeyword = m_pPaneToolsGlobal->currentHelpKeyword();
     266    else if (isMachineItemSelected())
     267        strHelpKeyword = m_pPaneToolsMachine->currentHelpKeyword();
     268
     269    msgCenter().sltHandleHelpRequestWithKeyword(strHelpKeyword);
    258270}
    259271
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r86923 r87022  
    209209    /** @} */
    210210
     211    /** @name Help browser stuff.
     212      * @{ */
     213        /** Shpws the help browser. */
     214        void showHelpBrowser();
     215    /** @} */
     216
    211217public slots:
    212218
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.cpp

    r82968 r87022  
    2424/* GUI includes */
    2525#include "QIWithRetranslateUI.h"
     26#include "UICommon.h"
    2627#include "UIIconPool.h"
    2728#include "UIWelcomePane.h"
     
    214215    }
    215216
     217    uiCommon().setHelpKeyword(this, "intro-starting");
     218
    216219    /* Translate finally: */
    217220    retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r86233 r87022  
    12051205    loadSettings();
    12061206
     1207
     1208    uiCommon().setHelpKeyword(this, "snapshots");
     1209
    12071210    /* Apply language settings: */
    12081211    retranslateUi();
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