VirtualBox

Changeset 52686 in vbox


Ignore:
Timestamp:
Sep 10, 2014 6:16:52 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 7462: Mac OS X: Runtime UI: Prevent Machine menu sub-menus being consumed by the Dock menu.

File:
1 edited

Legend:

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

    r52645 r52686  
    10081008    QMenu *pDockMenu = actionPool()->action(UIActionIndexRT_M_Dock)->menu();
    10091009
    1010     /* Add all VM menu entries to the dock menu. Leave out close and stuff like
    1011      * this. */
     1010    /* Add all the 'Machine' menu entries to the 'Dock' menu: */
    10121011    QList<QAction*> actions = actionPool()->action(UIActionIndexRT_M_Machine)->menu()->actions();
    10131012    for (int i=0; i < actions.size(); ++i)
    1014         if (actions.at(i)->menuRole() == QAction::NoRole)
    1015             pDockMenu->addAction(actions.at(i));
     1013    {
     1014        /* Check if we really have correct action: */
     1015        UIAction *pAction = qobject_cast<UIAction*>(actions.at(i));
     1016        /* Skip incorrect actions: */
     1017        if (!pAction)
     1018            continue;
     1019        /* Skip actions which have 'role' (to prevent consuming): */
     1020        if (pAction->menuRole() != QAction::NoRole)
     1021            continue;
     1022        /* Skip actions which have menu (to prevent consuming): */
     1023        if (qobject_cast<UIActionMenu*>(pAction))
     1024            continue;
     1025        pDockMenu->addAction(actions.at(i));
     1026    }
    10161027    pDockMenu->addSeparator();
    10171028
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