Changeset 84435 in vbox
- Timestamp:
- May 21, 2020 3:39:16 PM (5 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
r84305 r84435 623 623 }; 624 624 625 /** Simple action extension, used as 'Perform Group Machines' action class. */ 626 class UIActionSimpleSelectorMachinePerformGroup : public UIActionSimple 627 { 628 Q_OBJECT; 629 630 public: 631 632 /** Constructs action passing @a pParent to the base-class. */ 633 UIActionSimpleSelectorMachinePerformGroup(UIActionPool *pParent) 625 /** Menu action extension, used as 'Move to Group' menu class. */ 626 class UIActionMenuSelectorMachineMoveToGroup : public UIActionMenu 627 { 628 Q_OBJECT; 629 630 public: 631 632 /** Constructs action passing @a pParent to the base-class. */ 633 UIActionMenuSelectorMachineMoveToGroup(UIActionPool *pParent) 634 : UIActionMenu(pParent, ":/vm_group_create_16px.png", ":/vm_group_create_disabled_16px.png") 635 {} 636 637 protected: 638 639 /** Handles translation event. */ 640 virtual void retranslateUi() /* override */ 641 { 642 setName(QApplication::translate("UIActionPool", "Move to Gro&up")); 643 } 644 }; 645 646 /** Simple action extension, used as 'Move to Group => New' action class. */ 647 class UIActionSimpleSelectorMachineMoveToGroupNew : public UIActionSimple 648 { 649 Q_OBJECT; 650 651 public: 652 653 /** Constructs action passing @a pParent to the base-class. */ 654 UIActionSimpleSelectorMachineMoveToGroupNew(UIActionPool *pParent) 634 655 : UIActionSimple(pParent, ":/vm_group_create_16px.png", ":/vm_group_create_disabled_16px.png") 635 656 {} … … 646 667 virtual void retranslateUi() /* override */ 647 668 { 648 setName(QApplication::translate("UIActionPool", " Gro&up"));669 setName(QApplication::translate("UIActionPool", "&New")); 649 670 setStatusTip(QApplication::translate("UIActionPool", "Add new group based on selected virtual machines")); 650 671 } … … 2942 2963 m_pool[UIActionIndexST_M_Machine_S_ExportToOCI] = new UIActionSimpleSelectorMachinePerformExportToOCI(this); 2943 2964 m_pool[UIActionIndexST_M_Machine_S_Remove] = new UIActionSimpleSelectorMachinePerformRemove(this); 2944 m_pool[UIActionIndexST_M_Machine_S_AddGroup] = new UIActionSimpleSelectorMachinePerformGroup(this); 2965 m_pool[UIActionIndexST_M_Machine_M_MoveToGroup] = new UIActionMenuSelectorMachineMoveToGroup(this); 2966 m_pool[UIActionIndexST_M_Machine_M_MoveToGroup_S_New] = new UIActionSimpleSelectorMachineMoveToGroupNew(this); 2945 2967 m_pool[UIActionIndexST_M_Machine_M_StartOrShow] = new UIActionStateSelectorCommonStartOrShow(this); 2946 2968 m_pool[UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal] = new UIActionSimpleSelectorCommonPerformStartNormal(this); … … 3033 3055 m_menuUpdateHandlers[UIActionIndexST_M_Group].ptfm = &UIActionPoolManager::updateMenuGroup; 3034 3056 m_menuUpdateHandlers[UIActionIndexST_M_Machine].ptfm = &UIActionPoolManager::updateMenuMachine; 3057 m_menuUpdateHandlers[UIActionIndexST_M_Machine_M_MoveToGroup].ptfm = &UIActionPoolManager::updateMenuMachineMoveToGroup; 3035 3058 m_menuUpdateHandlers[UIActionIndexST_M_Group_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuGroupStartOrShow; 3036 3059 m_menuUpdateHandlers[UIActionIndexST_M_Machine_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuMachineStartOrShow; … … 3095 3118 updateMenuMachine(); 3096 3119 3120 /* 'Machine' / 'Move to Group' menu: */ 3121 updateMenuMachineMoveToGroup(); 3097 3122 /* 'Group' / 'Start or Show' menu: */ 3098 3123 updateMenuGroupStartOrShow(); … … 3303 3328 pMenu->addAction(action(UIActionIndexST_M_Machine_S_ExportToOCI)); 3304 3329 pMenu->addAction(action(UIActionIndexST_M_Machine_S_Remove)); 3305 pMenu->addAction(action(UIActionIndexST_M_Machine_ S_AddGroup));3330 pMenu->addAction(action(UIActionIndexST_M_Machine_M_MoveToGroup)); 3306 3331 pMenu->addSeparator(); 3307 3332 pMenu->addAction(action(UIActionIndexST_M_Machine_M_StartOrShow)); … … 3324 3349 /* Mark menu as valid: */ 3325 3350 m_invalidations.remove(UIActionIndexST_M_Machine); 3351 } 3352 3353 void UIActionPoolManager::updateMenuMachineMoveToGroup() 3354 { 3355 /* Get corresponding menu: */ 3356 UIMenu *pMenu = action(UIActionIndexST_M_Machine_M_MoveToGroup)->menu(); 3357 AssertPtrReturnVoid(pMenu); 3358 /* Clear contents: */ 3359 pMenu->clear(); 3360 3361 /* Populate 'Machine' / 'Move to Group' menu: */ 3362 pMenu->addAction(action(UIActionIndexST_M_Machine_M_MoveToGroup_S_New)); 3363 3364 /* Mark menu as valid (for now): */ 3365 m_invalidations.remove(UIActionIndexST_M_Machine_M_MoveToGroup); 3326 3366 } 3327 3367 … … 3693 3733 << action(UIActionIndexST_M_Machine_S_ExportToOCI) 3694 3734 << action(UIActionIndexST_M_Machine_S_Remove) 3695 << action(UIActionIndexST_M_Machine_ S_AddGroup)3735 << action(UIActionIndexST_M_Machine_M_MoveToGroup) 3696 3736 << action(UIActionIndexST_M_Machine_M_StartOrShow) 3697 3737 << action(UIActionIndexST_M_Machine_T_Pause) … … 3703 3743 << action(UIActionIndexST_M_Machine_S_CreateShortcut) 3704 3744 << action(UIActionIndexST_M_Machine_S_SortParent) 3745 << action(UIActionIndexST_M_Machine_M_MoveToGroup_S_New) 3705 3746 << action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal) 3706 3747 << action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r83616 r84435 94 94 UIActionIndexST_M_Machine_S_ExportToOCI, 95 95 UIActionIndexST_M_Machine_S_Remove, 96 UIActionIndexST_M_Machine_S_AddGroup, 96 UIActionIndexST_M_Machine_M_MoveToGroup, 97 UIActionIndexST_M_Machine_M_MoveToGroup_S_New, 97 98 UIActionIndexST_M_Machine_M_StartOrShow, 98 99 UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal, … … 204 205 /** Updates 'Machine' menu. */ 205 206 void updateMenuMachine(); 207 /** Updates 'Machine' / 'Move to Group' menu. */ 208 void updateMenuMachineMoveToGroup(); 206 209 /** Updates 'Group' / 'Start or Show' menu. */ 207 210 void updateMenuGroupStartOrShow(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r84337 r84435 1889 1889 actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_ExportToOCI, items)); 1890 1890 actionPool()->action(UIActionIndexST_M_Machine_S_Remove)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Remove, items)); 1891 actionPool()->action(UIActionIndexST_M_Machine_S_AddGroup)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_AddGroup, items)); 1891 actionPool()->action(UIActionIndexST_M_Machine_M_MoveToGroup)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_MoveToGroup, items)); 1892 actionPool()->action(UIActionIndexST_M_Machine_M_MoveToGroup_S_New)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_MoveToGroup_S_New, items)); 1892 1893 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_T_Pause, items)); 1893 1894 actionPool()->action(UIActionIndexST_M_Machine_S_Reset)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Reset, items)); … … 2097 2098 isAtLeastOneItemRemovable(items); 2098 2099 } 2099 case UIActionIndexST_M_Machine_S_AddGroup: 2100 case UIActionIndexST_M_Machine_M_MoveToGroup: 2101 case UIActionIndexST_M_Machine_M_MoveToGroup_S_New: 2100 2102 { 2101 2103 return !isGroupSavingInProgress() && -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r84420 r84435 976 976 { 977 977 /* Check if action is enabled: */ 978 if (!actionPool()->action(UIActionIndexST_M_Machine_ S_AddGroup)->isEnabled())978 if (!actionPool()->action(UIActionIndexST_M_Machine_M_MoveToGroup_S_New)->isEnabled()) 979 979 return; 980 980 … … 1355 1355 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI)); 1356 1356 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Remove)); 1357 m_pContextMenuMachine->add Action(actionPool()->action(UIActionIndexST_M_Machine_S_AddGroup));1357 m_pContextMenuMachine->addMenu(actionPool()->action(UIActionIndexST_M_Machine_M_MoveToGroup)->menu()); 1358 1358 m_pContextMenuMachine->addSeparator(); 1359 1359 m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)); … … 1395 1395 connect(actionPool()->action(UIActionIndexST_M_Machine_S_Remove), &UIAction::triggered, 1396 1396 this, &UIChooserModel::sltRemoveSelectedMachine); 1397 connect(actionPool()->action(UIActionIndexST_M_Machine_ S_AddGroup), &UIAction::triggered,1397 connect(actionPool()->action(UIActionIndexST_M_Machine_M_MoveToGroup_S_New), &UIAction::triggered, 1398 1398 this, &UIChooserModel::sltGroupSelectedMachines); 1399 1399 connect(actionPool()->action(UIActionIndexST_M_Group_S_Refresh), &UIAction::triggered,
Note:
See TracChangeset
for help on using the changeset viewer.