Changeset 74586 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 2, 2018 4:03:51 PM (6 years ago)
- 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 74 74 , m_pMouseHandler(0) 75 75 , m_pKeyboardHandler(0) 76 , m_pContextMenuGlobal(0) 76 77 , m_pContextMenuGroup(0) 77 78 , m_pContextMenuMachine(0) … … 1323 1324 void UIChooserModel::prepareContextMenu() 1324 1325 { 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 1325 1368 /* Context menu for group(s): */ 1326 1369 m_pContextMenuGroup = new QMenu; … … 1462 1505 void UIChooserModel::cleanupContextMenu() 1463 1506 { 1507 delete m_pContextMenuGlobal; 1508 m_pContextMenuGlobal = 0; 1464 1509 delete m_pContextMenuGroup; 1465 1510 m_pContextMenuGroup = 0; … … 1527 1572 switch (pItem->type()) 1528 1573 { 1574 case UIChooserItemType_Global: 1575 { 1576 /* Global context menu for global item cases: */ 1577 popupContextMenu(UIGraphicsSelectorContextMenuType_Global, pEvent->screenPos()); 1578 return true; 1579 } 1529 1580 case UIChooserItemType_Group: 1530 1581 { … … 1563 1614 switch (pItem->type()) 1564 1615 { 1616 case UIChooserItemType_Global: 1617 { 1618 /* Global context menu for global item cases: */ 1619 popupContextMenu(UIGraphicsSelectorContextMenuType_Machine, pEvent->screenPos()); 1620 return true; 1621 } 1565 1622 case UIChooserItemType_Group: 1566 1623 { … … 1598 1655 switch (enmType) 1599 1656 { 1657 /* For global item? */ 1658 case UIGraphicsSelectorContextMenuType_Global: 1659 { 1660 m_pContextMenuGlobal->exec(point); 1661 break; 1662 } 1600 1663 /* For group? */ 1601 1664 case UIGraphicsSelectorContextMenuType_Group: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r74483 r74586 52 52 enum UIGraphicsSelectorContextMenuType 53 53 { 54 UIGraphicsSelectorContextMenuType_Global, 54 55 UIGraphicsSelectorContextMenuType_Group, 55 56 UIGraphicsSelectorContextMenuType_Machine … … 469 470 UIChooserHandlerKeyboard *m_pKeyboardHandler; 470 471 472 /** Holds the global item context menu instance. */ 473 QMenu *m_pContextMenuGlobal; 471 474 /** Holds the group item context menu instance. */ 472 475 QMenu *m_pContextMenuGroup;
Note:
See TracChangeset
for help on using the changeset viewer.