VirtualBox

Changeset 89946 in vbox


Ignore:
Timestamp:
Jun 29, 2021 9:22:12 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10049. Connecting the help button to help viewer startup code.

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

Legend:

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

    r89945 r89946  
    3333#include "UICommon.h"
    3434#include "UIIconPool.h"
     35#include "UIMessageCenter.h"
    3536
    3637/* Other VBox includes: */
     
    5556    , m_pButton2(0)
    5657    , m_pButton3(0)
     58    , m_pButtonHelp(0)
    5759    , m_pButtonBox(0)
     60    , m_strHelpKeyword(strHelpKeyword)
    5861    , m_fDone(false)
    5962{
    60     if (!strHelpKeyword.isEmpty())
    61         uiCommon().setHelpKeyword(this, strHelpKeyword);
    6263    /* Prepare: */
    6364    prepare();
     
    261262            if (m_pButton3)
    262263                connect(m_pButton3, &QPushButton::clicked, this, &QIMessageBox::sltDone3);
     264            /* Create the help button and connect it to relevant slot in case a help word is supplied: */
     265            if (!m_strHelpKeyword.isEmpty())
     266            {
     267                m_pButtonHelp = createButton(AlertButton_Help);
     268                if (m_pButtonHelp)
     269                {
     270                    uiCommon().setHelpKeyword(m_pButtonHelp, m_strHelpKeyword);
     271                    connect(m_pButtonHelp, &QPushButton::clicked, &msgCenter(), &UIMessageCenter::sltHandleHelpRequest);
     272                }
     273            }
     274
    263275            /* Make sure Escape button always set: */
    264276            Assert(m_iButtonEsc);
     
    316328        case AlertButton_Choice2: strText = tr("No");     role = QDialogButtonBox::NoRole; break;
    317329        case AlertButton_Copy:    strText = tr("Copy");   role = QDialogButtonBox::ActionRole; break;
     330        case AlertButton_Help:    strText = tr("Help");   role = QDialogButtonBox::HelpRole; break;
    318331        default:
    319332            AssertMsgFailed(("Type %d is not supported!", iButton));
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h

    r89945 r89946  
    4747    AlertButton_Choice2       =  0x8,  /* 00000000 00001000 */
    4848    AlertButton_Copy          = 0x10,  /* 00000000 00010000 */
     49    AlertButton_Help          = 0x11,  /* 00000000 00010001 */
    4950    AlertButtonMask           = 0xFF   /* 00000000 11111111 */
    5051};
     
    193194    /** Holds the 3rd button instance. */
    194195    QPushButton *m_pButton3;
     196    /** Holds the help-button instance. */
     197    QPushButton  *m_pButtonHelp;
     198
    195199    /** Holds the button-box instance. */
    196200    QIDialogButtonBox *m_pButtonBox;
    197201
     202    /** Holds the help keyword string. */
     203    QString m_strHelpKeyword;
     204
    198205    /** Defines whether message was accepted. */
    199206    bool m_fDone : 1;
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