VirtualBox

Changeset 86928 in vbox


Ignore:
Timestamp:
Nov 20, 2020 9:22:25 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Adding context sensitive help button to dialogs. take 2

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/profilemanager/UICloudProfileManager.cpp

    r86696 r86928  
    10081008    button(ButtonType_Apply)->setVisible(gEDataManager->cloudProfileManagerDetailsExpanded());
    10091009    button(ButtonType_Reset)->setVisible(gEDataManager->cloudProfileManagerDetailsExpanded());
     1010
     1011    configureButtonBoxHelpButton("ovf-cloud-profile-manager");
    10101012}
    10111013
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp

    r86833 r86928  
    2727#include "UICommon.h"
    2828#include "UIDesktopWidgetWatchdog.h"
     29#include "UIMessageCenter.h"
    2930#ifdef VBOX_WS_MAC
    3031# include "QIToolBar.h"
     
    7576        m_fCloseEmitted = true;
    7677        emit sigClose();
     78    }
     79}
     80
     81void QIManagerDialog::configureButtonBoxHelpButton(const QString &strHelpTag)
     82{
     83    QPushButton *pHelpButton = m_pButtonBox->button(QDialogButtonBox::Help);
     84    if (pHelpButton)
     85    {
     86        pHelpButton->setProperty("helptag", strHelpTag);
     87        connect(pHelpButton, &QPushButton::pressed,
     88               &(msgCenter()), &UIMessageCenter::sltHandleDialogHelpButtonPress);
    7789    }
    7890}
     
    155167        /* Configure button-box: */
    156168#ifdef VBOX_WS_WIN
    157         m_pButtonBox->setStandardButtons(QDialogButtonBox::Reset | QDialogButtonBox::Save |  QDialogButtonBox::Close);
     169        m_pButtonBox->setStandardButtons(QDialogButtonBox::Reset | QDialogButtonBox::Save |  QDialogButtonBox::Close | QDialogButtonBox::Help);
    158170#else
    159         m_pButtonBox->setStandardButtons(QDialogButtonBox::Reset | QDialogButtonBox::Apply |  QDialogButtonBox::Close);
     171        m_pButtonBox->setStandardButtons(QDialogButtonBox::Reset | QDialogButtonBox::Apply |  QDialogButtonBox::Close | QDialogButtonBox::Help);
    160172#endif
    161173        m_buttons[ButtonType_Reset] = m_pButtonBox->button(QDialogButtonBox::Reset);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.h

    r86833 r86928  
    150150        virtual void closeEvent(QCloseEvent *pEvent) /* override */;
    151151    /** @} */
     152    /** Sets the property 'helptag' of the button box's help button to @param strHelpTag and
     153      * sets up the appropirate connection. */
     154    void configureButtonBoxHelpButton(const QString &strHelpTag);
    152155
    153156private:
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r86913 r86928  
    32363236#elif defined (VBOX_WS_X11)
    32373237# if defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
    3238     showHelpBrowser(strLocation, QString());
     3238    showHelpBrowser(strLocation);
    32393239# elif !defined(VBOX_OSE)
    32403240    char szViewerPath[RTPATH_MAX];
     
    34353435}
    34363436
    3437 void UIMessageCenter::showHelpBrowser(const QString &strHelpFilePath, const QString &strKeyword, QWidget *pParent /* = 0 */)
     3437void UIMessageCenter::showHelpBrowser(const QString &strHelpFilePath, QWidget *pParent /* = 0 */)
    34383438{
    34393439    Q_UNUSED(pParent);
     
    34503450        connect(m_pHelpBrowserDialog, &QIManagerDialog::sigClose,
    34513451                this, &UIMessageCenter::sltCloseHelpBrowser);
    3452     }
    3453     if (!strKeyword.isEmpty())
    3454     {
    3455         UIHelpBrowserDialog *pWidget = qobject_cast<UIHelpBrowserDialog*>(m_pHelpBrowserDialog);
    3456         if (pWidget)
    3457             pWidget->showHelpForKeyword(strKeyword);
    34583452    }
    34593453
     
    34943488    }
    34953489
    3496     showHelpBrowser(uiCommon().helpFile(), strKeyword);
     3490    showHelpBrowser(uiCommon().helpFile());
     3491
     3492    UIHelpBrowserDialog *pWidget = qobject_cast<UIHelpBrowserDialog*>(m_pHelpBrowserDialog);
     3493    if (pWidget)
     3494        pWidget->showHelpForKeyword(strKeyword);
    34973495# endif /* #if defined(VBOX_WITH_DOCS_QHELP) && (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))&& (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) */
    34983496}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r86913 r86928  
    605605                       const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
    606606                       const QString &strAutoConfirmId) const;
    607     /** @param strKeyword is passed possbily from a hrlp button and used by QHelpEngine infrastructure to find a
    608       * corresponding Url. */
    609     void showHelpBrowser(const QString &strHelpFilePath, const QString &strKeyword, QWidget *pParent = 0);
     607    void showHelpBrowser(const QString &strHelpFilePath, QWidget *pParent = 0);
    610608
    611609    /** Holds the list of shown warnings. */
  • trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp

    r86233 r86928  
    10491049    button(ButtonType_Apply)->setVisible(gEDataManager->hostNetworkManagerDetailsExpanded());
    10501050    button(ButtonType_Reset)->setVisible(gEDataManager->hostNetworkManagerDetailsExpanded());
     1051
     1052    configureButtonBoxHelpButton("networkingdetails");
    10511053}
    10521054
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r86233 r86928  
    17221722        widget()->setProgressBar(m_pProgressBar);
    17231723    }
     1724    configureButtonBoxHelpButton("vdis");
    17241725}
    17251726
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r86924 r86928  
    238238        }
    239239    }
    240     enableHelpButton("ovf");
     240
     241    if (!m_fFastTraverToExportOCI)
     242        enableHelpButton("ovf");
     243    else
     244        enableHelpButton("cloud-export-oci");
     245
    241246    /* Call to base-class: */
    242247    UIWizard::prepare();
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