VirtualBox

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


Ignore:
Timestamp:
Aug 6, 2020 1:11:52 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: A fix for Start/Show action, it has menu only in one of states (which is Start); This menu is reflected in tool-bar which needs to be updated accordingly on state-change else menu behavior there will be broken.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
3 edited

Legend:

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

    r85620 r85636  
    30423042        actionPool()->action(UIActionIndexMN_M_Group_M_StartOrShow)->setState(pItem->isItemPoweredOff() ? 0 : 1);
    30433043        actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)->setState(pItem->isItemPoweredOff() ? 0 : 1);
    3044         /// @todo Hmm, fix it?
    3045 //        QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)));
    3046 //        if (pButton)
    3047 //            pButton->setPopupMode(pItem->isItemPoweredOff() ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
     3044        m_pWidget->updateToolBarMenuButtons(pItem->isItemPoweredOff());
    30483045    }
    30493046    else
     
    30513048        actionPool()->action(UIActionIndexMN_M_Group_M_StartOrShow)->setState(0);
    30523049        actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)->setState(0);
    3053         /// @todo Hmm, fix it?
    3054 //        QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)));
    3055 //        if (pButton)
    3056 //            pButton->setPopupMode(pItem->isItemPoweredOff() ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
     3050        m_pWidget->updateToolBarMenuButtons(true /* separate menu section? */);
    30573051    }
    30583052
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r85597 r85636  
    229229{
    230230    return m_pPaneToolsMachine->isCurrentStateItemSelected();
     231}
     232
     233void UIVirtualBoxManagerWidget::updateToolBarMenuButtons(bool fSeparateMenuSection)
     234{
     235    QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)));
     236    if (pButton)
     237        pButton->setPopupMode(fSeparateMenuSection ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
    231238}
    232239
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r85508 r85636  
    197197    /** @} */
    198198
     199    /** @name Tool-bar stuff.
     200      * @{ */
     201        /** Updates tool-bar menu buttons. */
     202        void updateToolBarMenuButtons(bool fSeparateMenuSection);
     203    /** @} */
     204
    199205public slots:
    200206
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