VirtualBox

Ignore:
Timestamp:
Oct 2, 2018 4:03:51 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Chooser pane: Global item context menu.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

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

    r74483 r74586  
    7474    , m_pMouseHandler(0)
    7575    , m_pKeyboardHandler(0)
     76    , m_pContextMenuGlobal(0)
    7677    , m_pContextMenuGroup(0)
    7778    , m_pContextMenuMachine(0)
     
    13231324void UIChooserModel::prepareContextMenu()
    13241325{
     1326    /* Context menu for global(s): */
     1327    m_pContextMenuGlobal = new QMenu;
     1328    if (m_pContextMenuGlobal)
     1329    {
     1330#ifdef VBOX_WS_MAC
     1331        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_About));
     1332# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     1333        if (gEDataManager->applicationUpdateEnabled())
     1334            m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_CheckForUpdates));
     1335        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager));
     1336# endif
     1337        m_pContextMenuGlobal->addSeparator();
     1338        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences));
     1339        m_pContextMenuGlobal->addSeparator();
     1340        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
     1341        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
     1342# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
     1343        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager));
     1344# endif
     1345        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager));
     1346        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1347
     1348#else /* !VBOX_WS_MAC */
     1349
     1350        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences));
     1351        m_pContextMenuGlobal->addSeparator();
     1352        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
     1353        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
     1354        m_pContextMenuGlobal->addSeparator();
     1355# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
     1356        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager));
     1357# endif
     1358        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowVirtualMediumManager));
     1359        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowHostNetworkManager));
     1360# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     1361        m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager));
     1362        if (gEDataManager->applicationUpdateEnabled())
     1363            m_pContextMenuGlobal->addAction(actionPool()->action(UIActionIndex_M_Application_S_CheckForUpdates));
     1364# endif
     1365#endif /* !VBOX_WS_MAC */
     1366    }
     1367
    13251368    /* Context menu for group(s): */
    13261369    m_pContextMenuGroup = new QMenu;
     
    14621505void UIChooserModel::cleanupContextMenu()
    14631506{
     1507    delete m_pContextMenuGlobal;
     1508    m_pContextMenuGlobal = 0;
    14641509    delete m_pContextMenuGroup;
    14651510    m_pContextMenuGroup = 0;
     
    15271572                switch (pItem->type())
    15281573                {
     1574                    case UIChooserItemType_Global:
     1575                    {
     1576                        /* Global context menu for global item cases: */
     1577                        popupContextMenu(UIGraphicsSelectorContextMenuType_Global, pEvent->screenPos());
     1578                        return true;
     1579                    }
    15291580                    case UIChooserItemType_Group:
    15301581                    {
     
    15631614                switch (pItem->type())
    15641615                {
     1616                    case UIChooserItemType_Global:
     1617                    {
     1618                        /* Global context menu for global item cases: */
     1619                        popupContextMenu(UIGraphicsSelectorContextMenuType_Machine, pEvent->screenPos());
     1620                        return true;
     1621                    }
    15651622                    case UIChooserItemType_Group:
    15661623                    {
     
    15981655    switch (enmType)
    15991656    {
     1657        /* For global item? */
     1658        case UIGraphicsSelectorContextMenuType_Global:
     1659        {
     1660            m_pContextMenuGlobal->exec(point);
     1661            break;
     1662        }
    16001663        /* For group? */
    16011664        case UIGraphicsSelectorContextMenuType_Group:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r74483 r74586  
    5252enum UIGraphicsSelectorContextMenuType
    5353{
     54    UIGraphicsSelectorContextMenuType_Global,
    5455    UIGraphicsSelectorContextMenuType_Group,
    5556    UIGraphicsSelectorContextMenuType_Machine
     
    469470        UIChooserHandlerKeyboard *m_pKeyboardHandler;
    470471
     472        /** Holds the global item context menu instance. */
     473        QMenu *m_pContextMenuGlobal;
    471474        /** Holds the group item context menu instance. */
    472475        QMenu *m_pContextMenuGroup;
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