Changeset 76776 in vbox
- Timestamp:
- Jan 11, 2019 1:21:59 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r76757 r76776 1294 1294 1295 1295 /** Simple action extension, used as 'Show Machine Details' action class. */ 1296 class UIActionSimpleSelectorToolsMachineShowDetails : public UIActionSimple 1297 { 1298 Q_OBJECT; 1299 1300 public: 1301 1302 /** Constructs action passing @a pParent to the base-class. */ 1303 UIActionSimpleSelectorToolsMachineShowDetails(UIActionPool *pParent) 1304 : UIActionSimple(pParent, 1305 ":/machine_details_manager_24px.png", ":/machine_details_manager_16px.png", 1306 ":/machine_details_manager_disabled_24px.png", ":/machine_details_manager_disabled_16px.png") 1307 {} 1296 class UIActionToggleSelectorToolsMachineShowDetails : public UIActionToggle 1297 { 1298 Q_OBJECT; 1299 1300 public: 1301 1302 /** Constructs action passing @a pParent to the base-class. */ 1303 UIActionToggleSelectorToolsMachineShowDetails(UIActionPool *pParent) 1304 : UIActionToggle(pParent) 1305 { 1306 setProperty("UIToolType", QVariant::fromValue(UIToolType_Details)); 1307 /// @todo use icons with check-boxes 1308 setIcon(UIIconPool::iconSetFull(":/machine_details_manager_24px.png", ":/machine_details_manager_16px.png", 1309 ":/machine_details_manager_disabled_24px.png", ":/machine_details_manager_disabled_16px.png")); 1310 } 1308 1311 1309 1312 protected: … … 1324 1327 1325 1328 /** Simple action extension, used as 'Show Machine Snapshots' action class. */ 1326 class UIActionSimpleSelectorToolsMachineShowSnapshots : public UIActionSimple 1327 { 1328 Q_OBJECT; 1329 1330 public: 1331 1332 /** Constructs action passing @a pParent to the base-class. */ 1333 UIActionSimpleSelectorToolsMachineShowSnapshots(UIActionPool *pParent) 1334 : UIActionSimple(pParent, 1335 ":/snapshot_manager_24px.png", ":/snapshot_manager_16px.png", 1336 ":/snapshot_manager_disabled_24px.png", ":/snapshot_manager_disabled_16px.png") 1337 {} 1329 class UIActionToggleSelectorToolsMachineShowSnapshots : public UIActionToggle 1330 { 1331 Q_OBJECT; 1332 1333 public: 1334 1335 /** Constructs action passing @a pParent to the base-class. */ 1336 UIActionToggleSelectorToolsMachineShowSnapshots(UIActionPool *pParent) 1337 : UIActionToggle(pParent) 1338 { 1339 setProperty("UIToolType", QVariant::fromValue(UIToolType_Snapshots)); 1340 /// @todo use icons with check-boxes 1341 setIcon(UIIconPool::iconSetFull(":/snapshot_manager_24px.png", ":/snapshot_manager_16px.png", 1342 ":/snapshot_manager_disabled_24px.png", ":/snapshot_manager_disabled_16px.png")); 1343 } 1338 1344 1339 1345 protected: … … 1354 1360 1355 1361 /** Simple action extension, used as 'Show Machine Logs' action class. */ 1356 class UIActionSimpleSelectorToolsMachineShowLogs : public UIActionSimple 1357 { 1358 Q_OBJECT; 1359 1360 public: 1361 1362 /** Constructs action passing @a pParent to the base-class. */ 1363 UIActionSimpleSelectorToolsMachineShowLogs(UIActionPool *pParent) 1364 : UIActionSimple(pParent, 1365 ":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png", 1366 ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png") 1367 {} 1362 class UIActionToggleSelectorToolsMachineShowLogs : public UIActionToggle 1363 { 1364 Q_OBJECT; 1365 1366 public: 1367 1368 /** Constructs action passing @a pParent to the base-class. */ 1369 UIActionToggleSelectorToolsMachineShowLogs(UIActionPool *pParent) 1370 : UIActionToggle(pParent) 1371 { 1372 setProperty("UIToolType", QVariant::fromValue(UIToolType_Logs)); 1373 /// @todo use icons with check-boxes 1374 setIcon(UIIconPool::iconSetFull(":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png", 1375 ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png")); 1376 } 1368 1377 1369 1378 protected: … … 2534 2543 m_pool[UIActionIndexST_M_Group_M_Close_S_PowerOff] = new UIActionSimpleSelectorClosePerformPowerOff(this); 2535 2544 m_pool[UIActionIndexST_M_Group_M_Tools] = new UIActionMenuSelectorToolsMachine(this); 2536 m_pool[UIActionIndexST_M_Group_M_Tools_ S_Details] = new UIActionSimpleSelectorToolsMachineShowDetails(this);2537 m_pool[UIActionIndexST_M_Group_M_Tools_ S_Snapshots] = new UIActionSimpleSelectorToolsMachineShowSnapshots(this);2538 m_pool[UIActionIndexST_M_Group_M_Tools_ S_Logs] = new UIActionSimpleSelectorToolsMachineShowLogs(this);2545 m_pool[UIActionIndexST_M_Group_M_Tools_T_Details] = new UIActionToggleSelectorToolsMachineShowDetails(this); 2546 m_pool[UIActionIndexST_M_Group_M_Tools_T_Snapshots] = new UIActionToggleSelectorToolsMachineShowSnapshots(this); 2547 m_pool[UIActionIndexST_M_Group_M_Tools_T_Logs] = new UIActionToggleSelectorToolsMachineShowLogs(this); 2539 2548 m_pool[UIActionIndexST_M_Group_S_Discard] = new UIActionSimpleSelectorCommonPerformDiscard(this); 2540 2549 m_pool[UIActionIndexST_M_Group_S_ShowLogDialog] = new UIActionSimpleSelectorCommonShowMachineLogs(this); … … 2565 2574 m_pool[UIActionIndexST_M_Machine_M_Close_S_PowerOff] = new UIActionSimpleSelectorClosePerformPowerOff(this); 2566 2575 m_pool[UIActionIndexST_M_Machine_M_Tools] = new UIActionMenuSelectorToolsMachine(this); 2567 m_pool[UIActionIndexST_M_Machine_M_Tools_ S_Details] = new UIActionSimpleSelectorToolsMachineShowDetails(this);2568 m_pool[UIActionIndexST_M_Machine_M_Tools_ S_Snapshots] = new UIActionSimpleSelectorToolsMachineShowSnapshots(this);2569 m_pool[UIActionIndexST_M_Machine_M_Tools_ S_Logs] = new UIActionSimpleSelectorToolsMachineShowLogs(this);2576 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Details] = new UIActionToggleSelectorToolsMachineShowDetails(this); 2577 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Snapshots] = new UIActionToggleSelectorToolsMachineShowSnapshots(this); 2578 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Logs] = new UIActionToggleSelectorToolsMachineShowLogs(this); 2570 2579 m_pool[UIActionIndexST_M_Machine_S_Discard] = new UIActionSimpleSelectorCommonPerformDiscard(this); 2571 2580 m_pool[UIActionIndexST_M_Machine_S_ShowLogDialog] = new UIActionSimpleSelectorCommonShowMachineLogs(this); … … 2616 2625 m_pool[UIActionIndexST_M_Cloud_T_Details] = new UIActionMenuSelectorCloudToggleProperties(this); 2617 2626 m_pool[UIActionIndexST_M_Cloud_S_Help] = new UIActionMenuSelectorCloudShowHelp(this); 2627 2628 /* 'Group' action groups: */ 2629 m_groupPool[UIActionIndexST_M_Group_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexST_M_Group_M_Tools)); 2630 m_groupPool[UIActionIndexST_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Group_M_Tools_T_Details)); 2631 m_groupPool[UIActionIndexST_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Group_M_Tools_T_Snapshots)); 2632 m_groupPool[UIActionIndexST_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Group_M_Tools_T_Logs)); 2633 2634 /* 'Machine' action groups: */ 2635 m_groupPool[UIActionIndexST_M_Machine_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexST_M_Machine_M_Tools)); 2636 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Details)); 2637 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Snapshots)); 2638 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Logs)); 2618 2639 2619 2640 /* Prepare update-handlers for known menus: */ … … 2983 3004 2984 3005 /* Populate 'Group' / 'Tools' menu: */ 2985 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_ S_Details));2986 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_ S_Snapshots));2987 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_ S_Logs));3006 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_T_Details)); 3007 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_T_Snapshots)); 3008 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_T_Logs)); 2988 3009 2989 3010 /* Mark menu as valid: */ … … 3000 3021 3001 3022 /* Populate 'Machine' / 'Tools' menu: */ 3002 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_ S_Details));3003 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_ S_Snapshots));3004 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_ S_Logs));3023 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Details)); 3024 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Snapshots)); 3025 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Logs)); 3005 3026 3006 3027 /* Mark menu as valid: */ … … 3236 3257 << action(UIActionIndexST_M_Group_M_Close_S_Shutdown) 3237 3258 << action(UIActionIndexST_M_Group_M_Close_S_PowerOff) 3238 << action(UIActionIndexST_M_Group_M_Tools_ S_Details)3239 << action(UIActionIndexST_M_Group_M_Tools_ S_Snapshots)3240 << action(UIActionIndexST_M_Group_M_Tools_ S_Logs);3259 << action(UIActionIndexST_M_Group_M_Tools_T_Details) 3260 << action(UIActionIndexST_M_Group_M_Tools_T_Snapshots) 3261 << action(UIActionIndexST_M_Group_M_Tools_T_Logs); 3241 3262 break; 3242 3263 } … … 3267 3288 << action(UIActionIndexST_M_Machine_M_Close_S_Shutdown) 3268 3289 << action(UIActionIndexST_M_Machine_M_Close_S_PowerOff) 3269 << action(UIActionIndexST_M_Machine_M_Tools_ S_Details)3270 << action(UIActionIndexST_M_Machine_M_Tools_ S_Snapshots)3271 << action(UIActionIndexST_M_Machine_M_Tools_ S_Logs);3290 << action(UIActionIndexST_M_Machine_M_Tools_T_Details) 3291 << action(UIActionIndexST_M_Machine_M_Tools_T_Snapshots) 3292 << action(UIActionIndexST_M_Machine_M_Tools_T_Logs); 3272 3293 break; 3273 3294 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r76757 r76776 74 74 UIActionIndexST_M_Group_M_Close_S_PowerOff, 75 75 UIActionIndexST_M_Group_M_Tools, 76 UIActionIndexST_M_Group_M_Tools_ S_Details,77 UIActionIndexST_M_Group_M_Tools_ S_Snapshots,78 UIActionIndexST_M_Group_M_Tools_ S_Logs,76 UIActionIndexST_M_Group_M_Tools_T_Details, 77 UIActionIndexST_M_Group_M_Tools_T_Snapshots, 78 UIActionIndexST_M_Group_M_Tools_T_Logs, 79 79 UIActionIndexST_M_Group_S_Discard, 80 80 UIActionIndexST_M_Group_S_ShowLogDialog, … … 105 105 UIActionIndexST_M_Machine_M_Close_S_PowerOff, 106 106 UIActionIndexST_M_Machine_M_Tools, 107 UIActionIndexST_M_Machine_M_Tools_ S_Details,108 UIActionIndexST_M_Machine_M_Tools_ S_Snapshots,109 UIActionIndexST_M_Machine_M_Tools_ S_Logs,107 UIActionIndexST_M_Machine_M_Tools_T_Details, 108 UIActionIndexST_M_Machine_M_Tools_T_Snapshots, 109 UIActionIndexST_M_Machine_M_Tools_T_Logs, 110 110 UIActionIndexST_M_Machine_S_Discard, 111 111 UIActionIndexST_M_Machine_S_ShowLogDialog, -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r76757 r76776 1048 1048 } 1049 1049 1050 void UIVirtualBoxManager::sltPerformShowMachineToolDetails() 1051 { 1052 m_pWidget->setToolsType(UIToolType_Details); 1053 } 1054 1055 void UIVirtualBoxManager::sltPerformShowMachineToolSnapshots() 1056 { 1057 m_pWidget->setToolsType(UIToolType_Snapshots); 1058 } 1059 1060 void UIVirtualBoxManager::sltPerformShowMachineToolLogs() 1061 { 1062 m_pWidget->setToolsType(UIToolType_Logs); 1050 void UIVirtualBoxManager::sltPerformShowMachineTool(QAction *pAction) 1051 { 1052 AssertPtrReturnVoid(pAction); 1053 AssertPtrReturnVoid(m_pWidget); 1054 m_pWidget->setToolsType(pAction->property("UIToolType").value<UIToolType>()); 1063 1055 } 1064 1056 … … 1461 1453 1462 1454 /* 'Group/Tools' menu connections: */ 1463 connect(actionPool()->action(UIActionIndexST_M_Group_M_Tools_S_Details), &UIAction::triggered, 1464 this, &UIVirtualBoxManager::sltPerformShowMachineToolDetails); 1465 connect(actionPool()->action(UIActionIndexST_M_Group_M_Tools_S_Snapshots), &UIAction::triggered, 1466 this, &UIVirtualBoxManager::sltPerformShowMachineToolSnapshots); 1467 connect(actionPool()->action(UIActionIndexST_M_Group_M_Tools_S_Logs), &UIAction::triggered, 1468 this, &UIVirtualBoxManager::sltPerformShowMachineToolLogs); 1455 connect(actionPool()->actionGroup(UIActionIndexST_M_Group_M_Tools), &QActionGroup::triggered, 1456 this, &UIVirtualBoxManager::sltPerformShowMachineTool); 1469 1457 1470 1458 /* 'Machine/Tools' menu connections: */ 1471 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Tools_S_Details), &UIAction::triggered, 1472 this, &UIVirtualBoxManager::sltPerformShowMachineToolDetails); 1473 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Tools_S_Snapshots), &UIAction::triggered, 1474 this, &UIVirtualBoxManager::sltPerformShowMachineToolSnapshots); 1475 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Tools_S_Logs), &UIAction::triggered, 1476 this, &UIVirtualBoxManager::sltPerformShowMachineToolLogs); 1459 connect(actionPool()->actionGroup(UIActionIndexST_M_Machine_M_Tools), &QActionGroup::triggered, 1460 this, &UIVirtualBoxManager::sltPerformShowMachineTool); 1477 1461 } 1478 1462 … … 1758 1742 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->retranslateUi(); 1759 1743 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->blockSignals(false); 1744 1745 /* Update action toggle states: */ 1746 if (m_pWidget) 1747 { 1748 switch (m_pWidget->currentMachineTool()) 1749 { 1750 case UIToolType_Details: 1751 { 1752 actionPool()->action(UIActionIndexST_M_Group_M_Tools_T_Details)->setChecked(true); 1753 actionPool()->action(UIActionIndexST_M_Machine_M_Tools_T_Details)->setChecked(true); 1754 break; 1755 } 1756 case UIToolType_Snapshots: 1757 { 1758 actionPool()->action(UIActionIndexST_M_Group_M_Tools_T_Snapshots)->setChecked(true); 1759 actionPool()->action(UIActionIndexST_M_Machine_M_Tools_T_Snapshots)->setChecked(true); 1760 break; 1761 } 1762 case UIToolType_Logs: 1763 { 1764 actionPool()->action(UIActionIndexST_M_Group_M_Tools_T_Logs)->setChecked(true); 1765 actionPool()->action(UIActionIndexST_M_Machine_M_Tools_T_Logs)->setChecked(true); 1766 break; 1767 } 1768 default: 1769 break; 1770 } 1771 } 1760 1772 } 1761 1773 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r76757 r76776 223 223 void sltPerformPowerOffMachine(); 224 224 225 /** Handles call to show machine Details tool. */ 226 void sltPerformShowMachineToolDetails(); 227 /** Handles call to show machine Snapshots tool. */ 228 void sltPerformShowMachineToolSnapshots(); 229 /** Handles call to show machine Logs tool. */ 230 void sltPerformShowMachineToolLogs(); 225 /** Handles call to show machine tool corresponding to passed @a pAction. */ 226 void sltPerformShowMachineTool(QAction *pAction); 231 227 232 228 /** Handles call to open machine Log Viewer window. */
Note:
See TracChangeset
for help on using the changeset viewer.