Changeset 89515 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 4, 2021 6:39:07 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r89248 r89515 706 706 // These menus are dynamical since local and cloud VMs have different menu contents. 707 707 // Yet .. we have to prepare Machine/Group menus beforehand, they contains shortcuts. 708 if (currentItem()) 709 { 710 updateMenuGroup(actionPool()->action(UIActionIndexMN_M_Group)->menu()); 711 updateMenuMachine(actionPool()->action(UIActionIndexMN_M_Machine)->menu()); 712 } 708 updateMenuGroup(actionPool()->action(UIActionIndexMN_M_Group)->menu()); 709 updateMenuMachine(actionPool()->action(UIActionIndexMN_M_Machine)->menu()); 713 710 714 711 updateActionsVisibility(); … … 2578 2575 } 2579 2576 2577 bool UIVirtualBoxManager::isSingleCloudProviderGroupSelected() const 2578 { 2579 return m_pWidget->isSingleCloudProviderGroupSelected(); 2580 } 2581 2580 2582 bool UIVirtualBoxManager::isSingleCloudProfileGroupSelected() const 2581 2583 { … … 2819 2821 void UIVirtualBoxManager::updateMenuGroup(QMenu *pMenu) 2820 2822 { 2821 /* For single local group selected: */ 2822 if (isSingleLocalGroupSelected()) 2823 /* For single cloud provider/profile: */ 2824 if ( isSingleCloudProviderGroupSelected() 2825 || isSingleCloudProfileGroupSelected()) 2826 { 2827 /* Populate Group-menu: */ 2828 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_New)); 2829 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Add)); 2830 pMenu->addSeparator(); 2831 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_M_StartOrShow)); 2832 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Group_M_Console)->menu()); 2833 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Group_M_Close)->menu()); 2834 pMenu->addSeparator(); 2835 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Refresh)); 2836 pMenu->addSeparator(); 2837 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort)); 2838 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search)); 2839 } 2840 /* For other cases, like local group or no group at all: */ 2841 else 2823 2842 { 2824 2843 /* Populate Group-menu: */ … … 2847 2866 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search)); 2848 2867 } 2849 else2850 {2851 /* Populate Group-menu: */2852 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_New));2853 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Add));2854 pMenu->addSeparator();2855 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_M_StartOrShow));2856 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Group_M_Console)->menu());2857 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Group_M_Close)->menu());2858 pMenu->addSeparator();2859 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Refresh));2860 pMenu->addSeparator();2861 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort));2862 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search));2863 }2864 2868 } 2865 2869 … … 2868 2872 /* Get first selected item: */ 2869 2873 UIVirtualMachineItem *pItem = currentItem(); 2870 AssertPtrReturnVoid(pItem); 2871 2872 /* For local machine: */ 2873 if (pItem->itemType() == UIVirtualMachineItemType_Local) 2874 2875 /* For cloud machine(s): */ 2876 if ( pItem 2877 && ( pItem->itemType() == UIVirtualMachineItemType_CloudFake 2878 || pItem->itemType() == UIVirtualMachineItemType_CloudReal)) 2879 { 2880 /* Populate Machine-menu: */ 2881 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_New)); 2882 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Add)); 2883 pMenu->addSeparator(); 2884 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 2885 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Remove)); 2886 pMenu->addSeparator(); 2887 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 2888 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Machine_M_Console)->menu()); 2889 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Machine_M_Close)->menu()); 2890 pMenu->addSeparator(); 2891 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh)); 2892 pMenu->addSeparator(); 2893 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_SortParent)); 2894 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_T_Search)); 2895 } 2896 /* For other cases, like local machine(s) or no machine at all: */ 2897 else 2874 2898 { 2875 2899 /* Populate Machine-menu: */ … … 2897 2921 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_ShowInFileManager)); 2898 2922 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_CreateShortcut)); 2899 pMenu->addSeparator();2900 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_SortParent));2901 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_T_Search));2902 }2903 else2904 {2905 /* Populate Machine-menu: */2906 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_New));2907 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Add));2908 pMenu->addSeparator();2909 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings));2910 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Remove));2911 pMenu->addSeparator();2912 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow));2913 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Machine_M_Console)->menu());2914 pMenu->addMenu(actionPool()->action(UIActionIndexMN_M_Machine_M_Close)->menu());2915 pMenu->addSeparator();2916 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh));2917 2923 pMenu->addSeparator(); 2918 2924 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_SortParent)); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r88519 r89515 346 346 /** Returns whether single local group is selected. */ 347 347 bool isSingleLocalGroupSelected() const; 348 /** Returns whether single cloud provider group is selected. */ 349 bool isSingleCloudProviderGroupSelected() const; 348 350 /** Returns whether single cloud profile group is selected. */ 349 351 bool isSingleCloudProfileGroupSelected() const;
Note:
See TracChangeset
for help on using the changeset viewer.