VirtualBox

Changeset 99946 in vbox for trunk


Ignore:
Timestamp:
May 24, 2023 6:53:04 AM (20 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10451. Refactoring the code which kicks of the help browser and navigates to the selected keyword in case it is there.

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

Legend:

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

    r98779 r99946  
    3939#include "UICommon.h"
    4040#include "UIDesktopWidgetWatchdog.h"
    41 #include "UIMessageCenter.h"
     41#include "UIHelpBrowserDialog.h"
    4242#include "UITakeSnapshotDialog.h"
    4343
     
    302302                    this, &UITakeSnapshotDialog::reject);
    303303            connect(m_pButtonBox->button(QIDialogButtonBox::Help), &QPushButton::pressed,
    304                     &(msgCenter()), &UIMessageCenter::sltHandleHelpRequest);
     304                    m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    305305            m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
    306306            uiCommon().setHelpKeyword(m_pButtonBox->button(QIDialogButtonBox::Help), "snapshots");
     307
    307308            /* Add into layout: */
    308309            pLayout->addWidget(m_pButtonBox, 3, 0, 1, 2);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogButtonBox.cpp

    r98103 r99946  
    3232/* GUI includes: */
    3333#include "QIDialogButtonBox.h"
     34#include "UIHelpBrowserDialog.h"
    3435#include "UISpecialControls.h"
    3536
     
    168169    return i;
    169170}
     171
     172void QIDialogButtonBox::sltHandleHelpRequest()
     173{
     174    AssertReturnVoid(sender());
     175    UIHelpBrowserDialog::findManualFileAndShow(uiCommon().helpKeyword(sender()));
     176}
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogButtonBox.h

    r98103 r99946  
    8181    void setDoNotPickDefaultButton(bool fDoNotPickDefaultButton);
    8282
     83public slots:
     84
     85    /** Handles help request. */
     86    void sltHandleHelpRequest();
     87
    8388protected:
    8489
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp

    r98103 r99946  
    3737#include "UICommon.h"
    3838#include "UIDesktopWidgetWatchdog.h"
     39#include "UIHelpBrowserDialog.h"
    3940#include "UIMessageCenter.h"
    4041#ifdef VBOX_WS_MAC
     
    9192void QIManagerDialog::sltHandleHelpRequested()
    9293{
    93     emit sigHelpRequested(uiCommon().helpKeyword(m_pWidget));
     94    UIHelpBrowserDialog::findManualFileAndShow(uiCommon().helpKeyword(m_pWidget));
    9495}
    9596
     
    197198        /* Connections to enable the context sensitive help: */
    198199        connect(m_pButtonBox, &QDialogButtonBox::helpRequested, this, &QIManagerDialog::sltHandleHelpRequested);
    199         connect(this, &QIManagerDialog::sigHelpRequested, &msgCenter(), &UIMessageCenter::sltHandleHelpRequestWithKeyword);
    200200
    201201        /* Configure button-box: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.h

    r98103 r99946  
    105105    /** Notifies listeners about dialog should be closed. */
    106106    void sigClose();
    107     /** Notifies listeners about help requested.
    108       * @param  strHelpKeyword  Brings the tag to find related section in the manual. */
    109     void sigHelpRequested(const QString &strHelpKeyword);
    110107
    111108protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp

    r98103 r99946  
    4545#include "UICommon.h"
    4646#include "UIIconPool.h"
     47#include "UIHelpBrowserDialog.h"
    4748#include "UIMessageCenter.h"
    4849
     
    290291                {
    291292                    uiCommon().setHelpKeyword(m_pButtonHelp, m_strHelpKeyword);
    292                     connect(m_pButtonHelp, &QPushButton::clicked, &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     293                    connect(m_pButtonHelp, &QPushButton::clicked, m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    293294                }
    294295            }
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r99929 r99946  
    16891689        m_pButtonBox->setStandardButtons(QDialogButtonBox::Help | QDialogButtonBox::Close);
    16901690        m_pButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape);
    1691         connect(m_pButtonBox, &QIDialogButtonBox::helpRequested, &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     1691        connect(m_pButtonBox, &QIDialogButtonBox::helpRequested, m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    16921692        connect(m_pButtonBox, &QIDialogButtonBox::rejected,      this, &UIExtraDataManagerWindow::close);
    16931693        /* Add button-box into main layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r99929 r99946  
    21032103}
    21042104
    2105 void UIMessageCenter::sltShowUserManual(const QString &strHelpFilePath)
    2106 {
    2107     if (!QFileInfo(strHelpFilePath).exists())
    2108     {
    2109         UINotificationMessage::cannotFindHelpFile(strHelpFilePath);
    2110         return;
    2111     }
    2112     if (!m_pHelpBrowserDialog)
    2113     {
    2114         m_pHelpBrowserDialog = new UIHelpBrowserDialog(0 /* parent */, 0 /* Center Widget */, strHelpFilePath);
    2115         AssertReturnVoid(m_pHelpBrowserDialog);
    2116         connect(m_pHelpBrowserDialog, &QMainWindow::destroyed, this, &UIMessageCenter::sltHelpBrowserClosed);
    2117     }
    2118 
    2119     m_pHelpBrowserDialog->show();
    2120     m_pHelpBrowserDialog->setWindowState(m_pHelpBrowserDialog->windowState() & ~Qt::WindowMinimized);
    2121     m_pHelpBrowserDialog->activateWindow();
    2122 }
    2123 
    2124 void UIMessageCenter::sltHelpBrowserClosed()
    2125 {
    2126     m_pHelpBrowserDialog = 0;
    2127 }
    2128 
    2129 void UIMessageCenter::sltHandleHelpRequest()
    2130 {
    2131     sltHandleHelpRequestWithKeyword(uiCommon().helpKeyword(sender()));
    2132 }
    2133 
    2134 void UIMessageCenter::sltHandleHelpRequestWithKeyword(const QString &strHelpKeyword)
    2135 {
    2136     /* First open or show the help browser: */
    2137     checkManualFileAndShow();
    2138     /* Show the help page for the @p strHelpKeyword: */
    2139     if (m_pHelpBrowserDialog && !strHelpKeyword.isEmpty())
    2140         m_pHelpBrowserDialog->showHelpForKeyword(strHelpKeyword);
    2141 }
    2142 
    2143 void UIMessageCenter::checkManualFileAndShow()
    2144 {
    2145 #ifndef VBOX_OSE
    2146     /* For non-OSE version we just open it: */
    2147     sltShowUserManual(uiCommon().helpFile());
    2148 #else /* #ifndef VBOX_OSE */
    2149     /* For OSE version we have to check if it present first: */
    2150     QString strUserManualFileName1 = uiCommon().helpFile();
    2151     QString strShortFileName = QFileInfo(strUserManualFileName1).fileName();
    2152     QString strUserManualFileName2 = QDir(uiCommon().homeFolder()).absoluteFilePath(strShortFileName);
    2153     /* Show if user manual already present: */
    2154     if (QFile::exists(strUserManualFileName1))
    2155         sltShowUserManual(strUserManualFileName1);
    2156     else if (QFile::exists(strUserManualFileName2))
    2157         sltShowUserManual(strUserManualFileName2);
    2158 # ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    2159     /* If downloader is running already: */
    2160     else if (UINotificationDownloaderUserManual::exists())
    2161         gpNotificationCenter->invoke();
    2162     /* Else propose to download user manual: */
    2163     else if (confirmLookingForUserManual(strUserManualFileName1))
    2164     {
    2165         /* Download user manual: */
    2166         UINotificationDownloaderUserManual *pNotification = UINotificationDownloaderUserManual::instance(UICommon::helpFile());
    2167         /* After downloading finished => show User Manual: */
    2168         connect(pNotification, &UINotificationDownloaderUserManual::sigUserManualDownloaded,
    2169                 this, &UIMessageCenter::sltShowUserManual);
    2170         /* Append and start notification: */
    2171         gpNotificationCenter->append(pNotification);
    2172     }
    2173 # endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    2174 #endif /* #ifdef VBOX_OSE */
    2175 }
    2176 
    21772105void UIMessageCenter::sltShowMessageBox(QWidget *pParent, MessageType enmType,
    21782106                                        const QString &strMessage, const QString &strDetails,
     
    21902118
    21912119UIMessageCenter::UIMessageCenter()
    2192     : m_pHelpBrowserDialog(0)
    21932120{
    21942121    /* Assign instance: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r99929 r99946  
    4444
    4545/* Forward declarations: */
    46 class UIHelpBrowserDialog;
    4746class UIMedium;
    4847struct StorageSlot;
     
    466465    void sltShowHelpAboutDialog();
    467466    void sltResetSuppressedMessages();
    468     void sltShowUserManual(const QString &strHelpFilePath);
    469 
    470     /// @todo move it away ..
    471     void sltHelpBrowserClosed();
    472     void sltHandleHelpRequest();
    473     void sltHandleHelpRequestWithKeyword(const QString &strHelpKeyword);
    474467
    475468private slots:
     
    525518                       const QString &strAutoConfirmId, const QString &strHelpKeyword) const;
    526519
    527     /// @todo move it away ..
    528     void checkManualFileAndShow();
    529 
    530520    /** Holds the list of shown warnings. */
    531521    mutable QStringList m_warnings;
    532 
    533     /** Holds UIHelpBrowserDialog instance. */
    534     UIHelpBrowserDialog *m_pHelpBrowserDialog;
    535522
    536523    /** Holds the singleton message-center instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserDialog.cpp

    r99910 r99946  
    4040#include "UIHelpBrowserDialog.h"
    4141#include "UIHelpBrowserWidget.h"
     42#include "UINotificationObjects.h"
    4243#ifdef VBOX_WS_MAC
    4344# include "VBoxUtils-darwin.h"
     
    4546
    4647#include <iprt/assert.h>
     48
     49QPointer<UIHelpBrowserDialog> UIHelpBrowserDialog::m_pInstance;
    4750
    4851
     
    168171        m_pZoomLabel->setText(QString("%1%").arg(QString::number(iPercentage)));
    169172}
     173
     174/* static */
     175void UIHelpBrowserDialog::findManualFileAndShow(const QString &strKeyword /*= QString() */)
     176{
     177#ifndef VBOX_OSE
     178    /* For non-OSE version we just open it: */
     179    showUserManual(uiCommon().helpFile(), strKeyword);
     180#else /* #ifndef VBOX_OSE */
     181    /* For OSE version we have to check if it present first: */
     182    QString strUserManualFileName1 = uiCommon().helpFile();
     183    QString strShortFileName = QFileInfo(strUserManualFileName1).fileName();
     184    QString strUserManualFileName2 = QDir(uiCommon().homeFolder()).absoluteFilePath(strShortFileName);
     185    /* Show if user manual already present: */
     186    if (QFile::exists(strUserManualFileName1))
     187        showUserManual(strUserManualFileName1, strKeyword);
     188    else if (QFile::exists(strUserManualFileName2))
     189        showUserManual(strUserManualFileName2, strKeyword);
     190# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     191    /* If downloader is running already: */
     192    if (UINotificationDownloaderUserManual::exists())
     193        gpNotificationCenter->invoke();
     194    /* Else propose to download user manual: */
     195    else if (confirmLookingForUserManual(strUserManualFileName1))
     196    {
     197        /* Download user manual: */
     198        UINotificationDownloaderUserManual *pNotification = UINotificationDownloaderUserManual::instance(UICommon::helpFile());
     199        /* After downloading finished => show User Manual: */
     200        /// @todo
     201        // connect(pNotification, &UINotificationDownloaderUserManual::sigUserManualDownloaded,
     202        //         this, &UIMessageCenter::showUserManual);
     203        /* Append and start notification: */
     204        gpNotificationCenter->append(pNotification);
     205    }
     206# endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     207#endif /* #ifdef VBOX_OSE */
     208}
     209
     210/* static */
     211void UIHelpBrowserDialog::showUserManual(const QString &strHelpFilePath, const QString &strKeyword)
     212{
     213    if (!QFileInfo(strHelpFilePath).exists())
     214    {
     215        UINotificationMessage::cannotFindHelpFile(strHelpFilePath);
     216        return;
     217    }
     218    if (!m_pInstance)
     219    {
     220        m_pInstance = new UIHelpBrowserDialog(0 /* parent */, 0 /* Center Widget */, strHelpFilePath);
     221        AssertReturnVoid(m_pInstance);
     222    }
     223
     224    if (!strKeyword.isEmpty())
     225        m_pInstance->showHelpForKeyword(strKeyword);
     226    m_pInstance->show();
     227    m_pInstance->setWindowState(m_pInstance->windowState() & ~Qt::WindowMinimized);
     228    m_pInstance->activateWindow();
     229}
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserDialog.h

    r98103 r99946  
    3232#endif
    3333
     34/* Qt includes: */
     35#include <QPointer>
     36
    3437/* GUI includes: */
    3538#include "QIWithRestorableGeometry.h"
    3639#include "QIWithRetranslateUI.h"
     40
    3741
    3842/* Forward declarations: */
     
    4650public:
    4751
    48     UIHelpBrowserDialog(QWidget *pParent, QWidget *pCenterWidget, const QString &strHelpFilePath);
     52
    4953    /** A passthru function for QHelpIndexWidget::showHelpForKeyword. */
    5054    void showHelpForKeyword(const QString &strKeyword);
     55
     56    static void findManualFileAndShow(const QString &strKeyword = QString());
     57
     58    /** @name Remove default ctor, and copying.
     59     * @{ */
     60       UIHelpBrowserDialog() = delete;
     61       UIHelpBrowserDialog(const UIHelpBrowserDialog &other) = delete;
     62       void operator=(const UIHelpBrowserDialog &other) = delete;
     63    /** @} */
    5164
    5265protected:
     
    5871    /** @name Prepare/cleanup cascade.
    5972     * @{ */
    60     virtual void prepareCentralWidget();
    61     virtual void loadSettings();
    62     virtual void saveDialogGeometry();
     73       virtual void prepareCentralWidget();
     74       virtual void loadSettings();
     75       virtual void saveDialogGeometry();
    6376    /** @} */
    6477
     
    7487private:
    7588
     89    UIHelpBrowserDialog(QWidget *pParent, QWidget *pCenterWidget, const QString &strHelpFilePath);
     90    static void showUserManual(const QString &strHelpFilePath, const QString &strKeyword);
     91
    7692    QString m_strHelpFilePath;
    7793    UIHelpBrowserWidget *m_pWidget;
     
    7995    int m_iGeometrySaveTimerId;
    8096    QLabel *m_pZoomLabel;
     97    static QPointer<UIHelpBrowserDialog> m_pInstance;
    8198};
    8299
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r99438 r99946  
    5858#include "UIExtensionPackManager.h"
    5959#include "UIExtraDataManager.h"
     60#include "UIHelpBrowserDialog.h"
    6061#include "UIIconPool.h"
    6162#include "UIMedium.h"
     
    21402141void UIVirtualBoxManager::sltPerformShowHelpBrowser()
    21412142{
    2142     m_pWidget->showHelpBrowser();
     2143    QString strHelpKeyword;
     2144    if (m_pWidget)
     2145        strHelpKeyword = m_pWidget->currentHelpKeyword();
     2146    UIHelpBrowserDialog::findManualFileAndShow(strHelpKeyword);
    21432147}
    21442148
     
    23062310    connect(m_pWidget, &UIVirtualBoxManagerWidget::sigCurrentSnapshotItemChange,
    23072311            this, &UIVirtualBoxManager::sltCurrentSnapshotItemChange);
     2312
    23082313    connect(menuBar(), &QMenuBar::customContextMenuRequested,
    23092314            m_pWidget, &UIVirtualBoxManagerWidget::sltHandleToolBarContextMenuRequest);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r99628 r99946  
    288288}
    289289
    290 void UIVirtualBoxManagerWidget::showHelpBrowser()
     290QString UIVirtualBoxManagerWidget::currentHelpKeyword() const
    291291{
    292292    QString strHelpKeyword;
     
    295295    else if (isMachineItemSelected())
    296296        strHelpKeyword = m_pPaneToolsMachine->currentHelpKeyword();
    297 
    298     msgCenter().sltHandleHelpRequestWithKeyword(strHelpKeyword);
     297    return strHelpKeyword;
    299298}
    300299
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r99390 r99946  
    236236    /** @name Help browser stuff.
    237237      * @{ */
    238         /** Shpws the help browser. */
    239         void showHelpBrowser();
     238        /** Returns the current help key word. */
     239        QString currentHelpKeyword() const;
    240240    /** @} */
    241241
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.cpp

    r98103 r99946  
    271271            connect(m_pButtonBox, &QDialogButtonBox::rejected, this, &UIFDCreationDialog::reject);
    272272            connect(m_pButtonBox->button(QDialogButtonBox::Help), &QPushButton::pressed,
    273                     &(msgCenter()), &UIMessageCenter::sltHandleHelpRequest);
     273                    m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    274274            pLayoutMain->addWidget(m_pButtonBox, 3, 0, 1, 3);
    275275        }
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r98103 r99946  
    3838#include "UIExtraDataManager.h"
    3939#include "UIIconPool.h"
    40 #include "UIMessageCenter.h"
    4140#include "UIModalWindowManager.h"
    4241#include "QIToolBar.h"
     
    688687
    689688        connect(m_pButtonBox->button(QIDialogButtonBox::Help), &QPushButton::pressed,
    690                 &(msgCenter()), &UIMessageCenter::sltHandleHelpRequest);
     689                m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    691690        m_pButtonBox->button(QDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
    692691
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.cpp

    r98103 r99946  
    3939#include "QIRichTextLabel.h"
    4040#include "QIToolButton.h"
     41#include "UIHelpBrowserDialog.h"
    4142#include "UIIconPool.h"
    4243#include "UIMessageCenter.h"
     
    9091                m_pButtonHelp->setProperty("helpkeyword", m_pObject->helpKeyword());
    9192                connect(m_pButtonHelp, &QIToolButton::clicked,
    92                         &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     93                        this, &UINotificationObjectItem::sltHandleHelpRequest);
    9394
    9495                m_pLayoutUpper->addWidget(m_pButtonHelp);
     
    443444    return new UINotificationObjectItem(pParent, pObject);
    444445}
     446
     447void UINotificationObjectItem::sltHandleHelpRequest()
     448{
     449    UIHelpBrowserDialog::findManualFileAndShow("helpkeyword");
     450}
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.h

    r98103 r99946  
    9292    /** Holds whether item is toggled. */
    9393    bool  m_fToggled;
     94
     95private slots:
     96
     97    /** Handles help request. */
     98    void sltHandleHelpRequest();
    9499};
    95100
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r99929 r99946  
    5252#include "UIFrameBuffer.h"
    5353#include "UIGuestProcessControlDialog.h"
     54#include "UIHelpBrowserDialog.h"
    5455#include "UIHostComboEditor.h"
    5556#include "UIIconPool.h"
     
    749750}
    750751
     752void UIMachineLogic::sltHandleHelpRequest()
     753{
     754    UIHelpBrowserDialog::findManualFileAndShow();
     755}
     756
    751757UIMachineLogic::UIMachineLogic(UIMachine *pMachine)
    752758    : QIWithRetranslateUI3<QObject>(pMachine)
     
    10871093     * in manager and runtime UI: */
    10881094    connect(actionPool()->action(UIActionIndex_Simple_Contents), &UIAction::triggered,
    1089             &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     1095            this, &UIMachineLogic::sltHandleHelpRequest);
    10901096
    10911097#ifdef VBOX_WITH_DEBUGGER_GUI
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r99561 r99946  
    159159    /** Handles host-screen available-area change. */
    160160    virtual void sltHostScreenAvailableAreaChange();
     161    /* Handles Help Request. */
     162    virtual void sltHandleHelpRequest();
    161163
    162164protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp

    r98675 r99946  
    4242#include "UIConverter.h"
    4343#include "UIExtraDataManager.h"
     44#include "UIHelpBrowserDialog.h"
    4445#include "UIIconPool.h"
    4546#include "UIMachine.h"
     
    525526        connect(pButtonBox, &QIDialogButtonBox::accepted, this, &UIVMCloseDialog::accept);
    526527        connect(pButtonBox, &QIDialogButtonBox::rejected, this, &UIVMCloseDialog::reject);
     528        uiCommon().setHelpKeyword(pButtonBox->button(QIDialogButtonBox::Help), "intro-save-machine-state");
    527529        connect(pButtonBox->button(QIDialogButtonBox::Help), &QPushButton::pressed,
    528                 &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     530                pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    529531        pButtonBox->button(QIDialogButtonBox::Help)->setShortcut(QKeySequence::HelpContents);
    530         uiCommon().setHelpKeyword(pButtonBox->button(QIDialogButtonBox::Help), "intro-save-machine-state");
    531532
    532533        /* Add into layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r98874 r99946  
    265265        connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIVMInformationDialog::sigClose);
    266266        connect(m_pButtonBox->button(QDialogButtonBox::Help), &QPushButton::pressed,
    267                 &(msgCenter()), &UIMessageCenter::sltHandleHelpRequest);
     267                m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    268268        /* add button-box into main-layout: */
    269269        centralWidget()->layout()->addWidget(m_pButtonBox);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp

    r98103 r99946  
    875875#ifndef VBOX_WS_MAC
    876876                connect(m_pButtonBox->button(QDialogButtonBox::Help), &QAbstractButton::pressed,
    877                         &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     877                        m_pButtonBox, &QIDialogButtonBox::sltHandleHelpRequest);
    878878#endif
    879879
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r98996 r99946  
    5353#include "UIDesktopWidgetWatchdog.h"
    5454#include "UIExtraDataManager.h"
     55#include "UIHelpBrowserDialog.h"
    5556#include "UIIconPool.h"
    5657#include "UIMachine.h"
     
    42434244void UISoftKeyboard::sltHandleHelpRequest()
    42444245{
    4245     emit sigHelpRequested(uiCommon().helpKeyword(this));
     4246    UIHelpBrowserDialog::findManualFileAndShow(uiCommon().helpKeyword(this));
    42464247}
    42474248
     
    43274328    connect(m_pSettingsWidget, &UISoftKeyboardSettingsWidget::sigColorThemeSelectionChanged, this, &UISoftKeyboard::sltHandleColorThemeListSelection);
    43284329
    4329     connect(this, &UISoftKeyboard::sigHelpRequested, &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
    43304330    connect(&uiCommon(), &UICommon::sigAskToCommitData, this, &UISoftKeyboard::sltReleaseKeys);
    43314331}
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h

    r98500 r99946  
    6565signals:
    6666
    67     void sigHelpRequested(const QString &strHelpKeyword);
    6867    void sigClose();
    6968
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp

    r99265 r99946  
    4141#include "UIDesktopWidgetWatchdog.h"
    4242#include "UIExtraDataManager.h"
     43#include "UIHelpBrowserDialog.h"
    4344#include "UIIconPool.h"
    44 #include "UIMessageCenter.h"
    4545#include "UINativeWizard.h"
    4646#include "UINativeWizardPage.h"
     
    9292                               WizardType enmType,
    9393                               WizardMode enmMode /* = WizardMode_Auto */,
    94                                const QString &strHelpTag /* = QString() */)
     94                               const QString &strHelpKeyword /* = QString() */)
    9595    : QIWithRetranslateUI2<QDialog>(pParent, Qt::Window)
    9696    , m_enmType(enmType)
    9797    , m_enmMode(enmMode == WizardMode_Auto ? gEDataManager->modeForWizardType(m_enmType) : enmMode)
    98     , m_strHelpHashtag(strHelpTag)
     98    , m_strHelpKeyword(strHelpKeyword)
    9999    , m_iLastIndex(-1)
    100100    , m_fClosed(false)
     
    425425            accept();
    426426    }
     427}
     428
     429void UINativeWizard::sltHandleHelpRequest()
     430{
     431    UIHelpBrowserDialog::findManualFileAndShow(uiCommon().helpKeyword(this));
    427432}
    428433
     
    555560                {
    556561                    const WizardButtonType enmType = (WizardButtonType)i;
    557                     /* Create Help button only if help hash tag is set.
     562                    /* Create Help button only if help keyword is set.
    558563                     * Create other buttons in any case: */
    559                     if (enmType != WizardButtonType_Help || !m_strHelpHashtag.isEmpty())
     564                    if (enmType != WizardButtonType_Help || !m_strHelpKeyword.isEmpty())
    560565                        m_buttons[enmType] = new QPushButton(pWidgetBottom);
    561566                    QPushButton *pButton = wizardButton(enmType);
     
    572577                {
    573578                    connect(wizardButton(WizardButtonType_Help), &QPushButton::clicked,
    574                             &(msgCenter()), &UIMessageCenter::sltHandleHelpRequest);
     579                            this, &UINativeWizard::sltHandleHelpRequest);
    575580                    wizardButton(WizardButtonType_Help)->setShortcut(QKeySequence::HelpContents);
    576                     uiCommon().setHelpKeyword(wizardButton(WizardButtonType_Help), m_strHelpHashtag);
     581                    uiCommon().setHelpKeyword(this, m_strHelpKeyword);
    577582                }
    578583                connect(wizardButton(WizardButtonType_Expert), &QPushButton::clicked,
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h

    r99194 r99946  
    9797      * @param  enmType         Brings the wizard type.
    9898      * @param  enmMode         Brings the wizard mode.
    99       * @param  strHelpHashtag  Brings the wizard help hashtag. */
     99      * @param  strHelpKeyword  Brings the wizard help keyword. */
    100100    UINativeWizard(QWidget *pParent,
    101101                   WizardType enmType,
    102102                   WizardMode enmMode = WizardMode_Auto,
    103                    const QString &strHelpHashtag = QString());
     103                   const QString &strHelpKeyword = QString());
    104104    /** Destructs wizard. */
    105105    virtual ~UINativeWizard() RT_OVERRIDE;
     
    172172    /** Switches to next page. */
    173173    void sltNext();
     174
     175    /** Handle help request*/
     176    void sltHandleHelpRequest();
    174177
    175178private:
     
    204207    /** Holds the wizard mode. */
    205208    WizardMode  m_enmMode;
    206     /** Holds the wizard help hashtag. */
    207     QString     m_strHelpHashtag;
     209    /** Holds the wizard help keyword. */
     210    QString     m_strHelpKeyword;
    208211    /** Holds the pixmap name. */
    209212    QString     m_strPixmapName;
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