VirtualBox

Changeset 85662 in vbox for trunk


Ignore:
Timestamp:
Aug 10, 2020 12:21:50 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9609: Large cleanup for Manager and Runtime action-pool stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r85661 r85662  
    623623};
    624624
    625 /** Menu action extension, used as 'Move to Group' menu class. */
    626 class UIActionMenuManagerCommonMoveToGroup : public UIActionMenu
    627 {
    628     Q_OBJECT;
    629 
    630 public:
    631 
    632     /** Constructs action passing @a pParent to the base-class. */
    633     UIActionMenuManagerCommonMoveToGroup(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 
    646625/** Simple action extension, used as 'Move to Group => New' action class. */
    647626class UIActionSimpleManagerMachineMoveToGroupNew : public UIActionSimple
     
    885864};
    886865
     866
     867/** Menu action extension, used as 'Move to Group' menu class. */
     868class UIActionMenuManagerCommonMoveToGroup : public UIActionMenu
     869{
     870    Q_OBJECT;
     871
     872public:
     873
     874    /** Constructs action passing @a pParent to the base-class. */
     875    UIActionMenuManagerCommonMoveToGroup(UIActionPool *pParent)
     876        : UIActionMenu(pParent, ":/vm_group_create_16px.png", ":/vm_group_create_disabled_16px.png")
     877    {}
     878
     879protected:
     880
     881    /** Handles translation event. */
     882    virtual void retranslateUi() /* override */
     883    {
     884        setName(QApplication::translate("UIActionPool", "Move to Gro&up"));
     885    }
     886};
    887887
    888888/** Menu action extension, used as 'Start or Show' menu class. */
     
    36713671    addMenu(m_mainMenus, action(UIActionIndex_Menu_Help));
    36723672    updateMenuHelp();
    3673 }
    3674 
    3675 void UIActionPoolManager::updateMenuFile()
    3676 {
    3677     /* Get corresponding menu: */
    3678     UIMenu *pMenu = action(UIActionIndexMN_M_File)->menu();
    3679     AssertPtrReturnVoid(pMenu);
    3680     /* Clear contents: */
    3681     pMenu->clear();
    3682 
    3683     /* Check if Ext Pack is ready, some of actions my depend on it: */
    3684     CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    3685     const bool fExtPackAccessible = !extPack.isNull() && extPack.GetUsable();
    3686 
    3687     /* The Application / 'File' menu contents is very different depending on host type. */
    3688 
    3689 #ifdef VBOX_WS_MAC
    3690 
    3691     /* 'About' action goes to Application menu: */
    3692     pMenu->addAction(action(UIActionIndex_M_Application_S_About));
    3693 # ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    3694     /* 'Check for Updates' action goes to Application menu: */
    3695     if (gEDataManager->applicationUpdateEnabled())
    3696         pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
    3697     /* 'Network Access Manager' action goes to Application menu: */
    3698     pMenu->addAction(action(UIActionIndex_M_Application_S_NetworkAccessManager));
    3699 # endif
    3700     /* 'Reset Warnings' action goes to Application menu: */
    3701     pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
    3702     /* 'Preferences' action goes to Application menu: */
    3703     pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
    3704     /* 'Close' action goes to Application menu: */
    3705     pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
    3706 
    3707     /* 'Import Appliance' action goes to 'File' menu: */
    3708     pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
    3709     /* 'Export Appliance' action goes to 'File' menu: */
    3710     pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
    3711     /* 'New Cloud VM' action goes to 'File' menu: */
    3712     pMenu->addAction(action(UIActionIndexMN_M_File_S_NewCloudVM));
    3713 # ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    3714     /* 'Show Extra-data Manager' action goes to 'File' menu for Debug build: */
    3715     pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
    3716 # endif
    3717     /* 'Show Virtual Medium Manager' action goes to 'File' menu: */
    3718     pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowVirtualMediumManager));
    3719     /* 'Show Host Network Manager' action goes to 'File' menu: */
    3720     pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowHostNetworkManager));
    3721     /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
    3722     if (fExtPackAccessible)
    3723         pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowCloudProfileManager));
    3724 
    3725 #else /* !VBOX_WS_MAC */
    3726 
    3727     /* 'Preferences' action goes to 'File' menu: */
    3728     pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
    3729     /* Separator after 'Preferences' action of the 'File' menu: */
    3730     pMenu->addSeparator();
    3731     /* 'Import Appliance' action goes to 'File' menu: */
    3732     pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
    3733     /* 'Export Appliance' action goes to 'File' menu: */
    3734     pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
    3735     /* 'New Cloud VM' action goes to 'File' menu: */
    3736     pMenu->addAction(action(UIActionIndexMN_M_File_S_NewCloudVM));
    3737     /* Separator after 'Export Appliance' action of the 'File' menu: */
    3738     pMenu->addSeparator();
    3739 # ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    3740     /* 'Extra-data Manager' action goes to 'File' menu for Debug build: */
    3741     pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
    3742 # endif
    3743     /* 'Show Virtual Medium Manager' action goes to 'File' menu: */
    3744     pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowVirtualMediumManager));
    3745     /* 'Show Host Network Manager' action goes to 'File' menu: */
    3746     pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowHostNetworkManager));
    3747     /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
    3748     if (fExtPackAccessible)
    3749         pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowCloudProfileManager));
    3750 # ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    3751     /* 'Network Access Manager' action goes to 'File' menu: */
    3752     pMenu->addAction(action(UIActionIndex_M_Application_S_NetworkAccessManager));
    3753     /* 'Check for Updates' action goes to 'File' menu: */
    3754     if (gEDataManager->applicationUpdateEnabled())
    3755         pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
    3756 # endif
    3757     /* Separator after tool actions of the 'File' menu: */
    3758     pMenu->addSeparator();
    3759     /* 'Reset Warnings' action goes 'File' menu: */
    3760     pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
    3761     /* Separator after 'Reset Warnings' action of the 'File' menu: */
    3762     pMenu->addSeparator();
    3763     /* 'Close' action goes to 'File' menu: */
    3764     pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
    3765 
    3766 #endif /* !VBOX_WS_MAC */
    3767 
    3768     /* Mark menu as valid: */
    3769     m_invalidations.remove(UIActionIndexMN_M_File);
    3770 }
    3771 
    3772 void UIActionPoolManager::updateMenuWelcome()
    3773 {
    3774     /* Get corresponding menu: */
    3775     UIMenu *pMenu = action(UIActionIndexMN_M_Welcome)->menu();
    3776     AssertPtrReturnVoid(pMenu);
    3777     /* Clear contents: */
    3778     pMenu->clear();
    3779 
    3780     /* Populate Welcome menu: */
    3781     pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_New));
    3782     pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_Add));
    3783 
    3784     /* Mark menu as valid: */
    3785     m_invalidations.remove(UIActionIndexMN_M_Welcome);
    3786 }
    3787 
    3788 void UIActionPoolManager::updateMenuGroup()
    3789 {
    3790     /* Get corresponding menu: */
    3791     UIMenu *pMenu = action(UIActionIndexMN_M_Group)->menu();
    3792     AssertPtrReturnVoid(pMenu);
    3793     /* Clear contents: */
    3794     pMenu->clear();
    3795 
    3796     /* This menu always remains invalid.. */
    3797 }
    3798 
    3799 void UIActionPoolManager::updateMenuMachine()
    3800 {
    3801     /* Get corresponding menu: */
    3802     UIMenu *pMenu = action(UIActionIndexMN_M_Machine)->menu();
    3803     AssertPtrReturnVoid(pMenu);
    3804     /* Clear contents: */
    3805     pMenu->clear();
    3806 
    3807     /* This menu always remains invalid.. */
    3808 }
    3809 
    3810 void UIActionPoolManager::updateMenuGroupMoveToGroup()
    3811 {
    3812     /* Get corresponding menu: */
    3813     UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_MoveToGroup)->menu();
    3814     AssertPtrReturnVoid(pMenu);
    3815     /* Clear contents: */
    3816     pMenu->clear();
    3817 
    3818     /* This menu always remains invalid.. */
    3819 }
    3820 
    3821 void UIActionPoolManager::updateMenuMachineMoveToGroup()
    3822 {
    3823     /* Get corresponding menu: */
    3824     UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_MoveToGroup)->menu();
    3825     AssertPtrReturnVoid(pMenu);
    3826     /* Clear contents: */
    3827     pMenu->clear();
    3828 
    3829     /* Populate 'Machine' / 'Move to Group' menu: */
    3830     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_MoveToGroup_S_New));
    3831 
    3832     /* This menu always remains invalid.. */
    3833 }
    3834 
    3835 void UIActionPoolManager::updateMenuGroupStartOrShow()
    3836 {
    3837     /* Get corresponding menu: */
    3838     UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_StartOrShow)->menu();
    3839     AssertPtrReturnVoid(pMenu);
    3840     /* Clear contents: */
    3841     pMenu->clear();
    3842 
    3843     /* Populate 'Group' / 'Start or Show' menu: */
    3844     pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal));
    3845     pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless));
    3846     pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable));
    3847 
    3848     /* Mark menu as valid: */
    3849     m_invalidations.remove(UIActionIndexMN_M_Group_M_StartOrShow);
    3850 }
    3851 
    3852 void UIActionPoolManager::updateMenuMachineStartOrShow()
    3853 {
    3854     /* Get corresponding menu: */
    3855     UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_StartOrShow)->menu();
    3856     AssertPtrReturnVoid(pMenu);
    3857     /* Clear contents: */
    3858     pMenu->clear();
    3859 
    3860     /* Populate 'Machine' / 'Start or Show' menu: */
    3861     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal));
    3862     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless));
    3863     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable));
    3864 
    3865     /* Mark menu as valid: */
    3866     m_invalidations.remove(UIActionIndexMN_M_Machine_M_StartOrShow);
    3867 }
    3868 
    3869 void UIActionPoolManager::updateMenuGroupConsole()
    3870 {
    3871     /* Get corresponding menu: */
    3872     UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Console)->menu();
    3873     AssertPtrReturnVoid(pMenu);
    3874     /* Clear contents: */
    3875     pMenu->clear();
    3876 
    3877     /* This menu always remains invalid.. */
    3878 }
    3879 
    3880 void UIActionPoolManager::updateMenuMachineConsole()
    3881 {
    3882     /* Get corresponding menu: */
    3883     UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Console)->menu();
    3884     AssertPtrReturnVoid(pMenu);
    3885     /* Clear contents: */
    3886     pMenu->clear();
    3887 
    3888     /* This menu always remains invalid.. */
    3889 }
    3890 
    3891 void UIActionPoolManager::updateMenuGroupClose()
    3892 {
    3893     /* Get corresponding menu: */
    3894     UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Close)->menu();
    3895     AssertPtrReturnVoid(pMenu);
    3896     /* Clear contents: */
    3897     pMenu->clear();
    3898 
    3899     /* Populate 'Group' / 'Close' menu: */
    3900     // pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_Detach));
    3901     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_SaveState));
    3902     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_Shutdown));
    3903     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_PowerOff));
    3904 
    3905     /* Mark menu as valid: */
    3906     m_invalidations.remove(UIActionIndexMN_M_Group_M_Close);
    3907 }
    3908 
    3909 void UIActionPoolManager::updateMenuMachineClose()
    3910 {
    3911     /* Get corresponding menu: */
    3912     UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Close)->menu();
    3913     AssertPtrReturnVoid(pMenu);
    3914     /* Clear contents: */
    3915     pMenu->clear();
    3916 
    3917     /* Populate 'Machine' / 'Close' menu: */
    3918     // pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_Detach));
    3919     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_SaveState));
    3920     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_Shutdown));
    3921     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_PowerOff));
    3922 
    3923     /* Mark menu as valid: */
    3924     m_invalidations.remove(UIActionIndexMN_M_Machine_M_Close);
    3925 }
    3926 
    3927 void UIActionPoolManager::updateMenuGroupTools()
    3928 {
    3929     /* Get corresponding menu: */
    3930     UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Tools)->menu();
    3931     AssertPtrReturnVoid(pMenu);
    3932     /* Clear contents: */
    3933     pMenu->clear();
    3934 
    3935     /* Populate 'Group' / 'Tools' menu: */
    3936     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Details));
    3937     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Snapshots));
    3938     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Logs));
    3939     pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Performance));
    3940 
    3941     /* Mark menu as valid: */
    3942     m_invalidations.remove(UIActionIndexMN_M_Group_M_Tools);
    3943 }
    3944 
    3945 void UIActionPoolManager::updateMenuMachineTools()
    3946 {
    3947     /* Get corresponding menu: */
    3948     UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Tools)->menu();
    3949     AssertPtrReturnVoid(pMenu);
    3950     /* Clear contents: */
    3951     pMenu->clear();
    3952 
    3953     /* Populate 'Machine' / 'Tools' menu: */
    3954     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Details));
    3955     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots));
    3956     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Logs));
    3957     pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Performance));
    3958 
    3959     /* Mark menu as valid: */
    3960     m_invalidations.remove(UIActionIndexMN_M_Machine_M_Tools);
    3961 }
    3962 
    3963 void UIActionPoolManager::updateMenuMediumWindow()
    3964 {
    3965     /* Update corresponding menu: */
    3966     updateMenuMediumWrapper(action(UIActionIndexMN_M_MediumWindow)->menu());
    3967 
    3968     /* Mark menu as valid: */
    3969     m_invalidations.remove(UIActionIndexMN_M_MediumWindow);
    3970 }
    3971 
    3972 void UIActionPoolManager::updateMenuMedium()
    3973 {
    3974     /* Update corresponding menu: */
    3975     updateMenuMediumWrapper(action(UIActionIndexMN_M_Medium)->menu());
    3976 
    3977     /* Mark menu as valid: */
    3978     m_invalidations.remove(UIActionIndexMN_M_Medium);
    3979 }
    3980 
    3981 void UIActionPoolManager::updateMenuMediumWrapper(UIMenu *pMenu)
    3982 {
    3983     /* Clear contents: */
    3984     pMenu->clear();
    3985 
    3986     /* Separator? */
    3987     bool fSeparator = false;
    3988 
    3989     /* 'Add' action: */
    3990     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Add)) || fSeparator;
    3991     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Create)) || fSeparator;
    3992 
    3993     /* Separator? */
    3994     if (fSeparator)
    3995     {
    3996         pMenu->addSeparator();
    3997         fSeparator = false;
    3998     }
    3999 
    4000     /* 'Copy' action: */
    4001     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Copy)) || fSeparator;
    4002     /* 'Move' action: */
    4003     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Move)) || fSeparator;
    4004     /* 'Remove' action: */
    4005     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Remove)) || fSeparator;
    4006     /* 'Release' action: */
    4007     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Release)) || fSeparator;
    4008     /* 'Search' action: */
    4009     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Search)) || fSeparator;
    4010     /* 'Properties' action: */
    4011     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Details)) || fSeparator;
    4012 
    4013     /* Separator? */
    4014     if (fSeparator)
    4015     {
    4016         pMenu->addSeparator();
    4017         fSeparator = false;
    4018     }
    4019 
    4020     /* 'Refresh' action: */
    4021     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Refresh)) || fSeparator;;
    4022 }
    4023 
    4024 void UIActionPoolManager::updateMenuNetworkWindow()
    4025 {
    4026     /* Update corresponding menu: */
    4027     updateMenuNetworkWrapper(action(UIActionIndexMN_M_NetworkWindow)->menu());
    4028 
    4029     /* Mark menu as valid: */
    4030     m_invalidations.remove(UIActionIndexMN_M_NetworkWindow);
    4031 }
    4032 
    4033 void UIActionPoolManager::updateMenuNetwork()
    4034 {
    4035     /* Update corresponding menu: */
    4036     updateMenuNetworkWrapper(action(UIActionIndexMN_M_Network)->menu());
    4037 
    4038     /* Mark menu as valid: */
    4039     m_invalidations.remove(UIActionIndexMN_M_Network);
    4040 }
    4041 
    4042 void UIActionPoolManager::updateMenuNetworkWrapper(UIMenu *pMenu)
    4043 {
    4044     /* Clear contents: */
    4045     pMenu->clear();
    4046 
    4047     /* Separator? */
    4048     bool fSeparator = false;
    4049 
    4050     /* 'Create' action: */
    4051     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Create)) || fSeparator;
    4052 
    4053     /* Separator? */
    4054     if (fSeparator)
    4055     {
    4056         pMenu->addSeparator();
    4057         fSeparator = false;
    4058     }
    4059 
    4060     /* 'Remove' action: */
    4061     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Remove)) || fSeparator;
    4062     /* 'Properties' action: */
    4063     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_T_Details)) || fSeparator;
    4064 
    4065 //    /* Separator? */
    4066 //    if (fSeparator)
    4067 //    {
    4068 //        pMenu->addSeparator();
    4069 //        fSeparator = false;
    4070 //    }
    4071 
    4072 //    /* 'Refresh' action: */
    4073 //    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Refresh)) || fSeparator;;
    4074 }
    4075 
    4076 void UIActionPoolManager::updateMenuCloudWindow()
    4077 {
    4078     /* Update corresponding menu: */
    4079     updateMenuCloudWrapper(action(UIActionIndexMN_M_CloudWindow)->menu());
    4080 
    4081     /* Mark menu as valid: */
    4082     m_invalidations.remove(UIActionIndexMN_M_CloudWindow);
    4083 }
    4084 
    4085 void UIActionPoolManager::updateMenuCloud()
    4086 {
    4087     /* Update corresponding menu: */
    4088     updateMenuCloudWrapper(action(UIActionIndexMN_M_Cloud)->menu());
    4089 
    4090     /* Mark menu as valid: */
    4091     m_invalidations.remove(UIActionIndexMN_M_Cloud);
    4092 }
    4093 
    4094 void UIActionPoolManager::updateMenuCloudWrapper(UIMenu *pMenu)
    4095 {
    4096     /* Clear contents: */
    4097     pMenu->clear();
    4098 
    4099     /* Separator? */
    4100     bool fSeparator = false;
    4101 
    4102     /* 'Add' action: */
    4103     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Add)) || fSeparator;
    4104     /* 'Import' action: */
    4105     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Import)) || fSeparator;
    4106 
    4107     /* Separator? */
    4108     if (fSeparator)
    4109     {
    4110         pMenu->addSeparator();
    4111         fSeparator = false;
    4112     }
    4113 
    4114     /* 'Remove' action: */
    4115     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Remove)) || fSeparator;
    4116     /* 'Properties' action: */
    4117     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_T_Details)) || fSeparator;
    4118 
    4119     /* Separator? */
    4120     if (fSeparator)
    4121     {
    4122         pMenu->addSeparator();
    4123         fSeparator = false;
    4124     }
    4125 
    4126     /* 'Try Page' action: */
    4127     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_TryPage)) || fSeparator;
    4128     /* 'Help' action: */
    4129     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Help)) || fSeparator;
    4130 }
    4131 
    4132 void UIActionPoolManager::updateMenuCloudConsoleWindow()
    4133 {
    4134     /* Update corresponding menu: */
    4135     updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsoleWindow)->menu());
    4136 
    4137     /* Mark menu as valid: */
    4138     m_invalidations.remove(UIActionIndexMN_M_CloudConsoleWindow);
    4139 }
    4140 
    4141 void UIActionPoolManager::updateMenuCloudConsole()
    4142 {
    4143     /* Update corresponding menu: */
    4144     updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsole)->menu());
    4145 
    4146     /* Mark menu as valid: */
    4147     m_invalidations.remove(UIActionIndexMN_M_CloudConsole);
    4148 }
    4149 
    4150 void UIActionPoolManager::updateMenuCloudConsoleWrapper(UIMenu *pMenu)
    4151 {
    4152     /* Clear contents: */
    4153     pMenu->clear();
    4154 
    4155     /* Separator? */
    4156     bool fSeparator = false;
    4157 
    4158     /* 'Add Application' action: */
    4159     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationAdd)) || fSeparator;
    4160     /* 'Remove Application' action: */
    4161     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationRemove)) || fSeparator;
    4162 
    4163     /* Separator? */
    4164     if (fSeparator)
    4165     {
    4166         pMenu->addSeparator();
    4167         fSeparator = false;
    4168     }
    4169 
    4170     /* 'Add Profile' action: */
    4171     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileAdd)) || fSeparator;
    4172     /* 'Remove Profile' action: */
    4173     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileRemove)) || fSeparator;
    4174 
    4175     /* Separator? */
    4176     if (fSeparator)
    4177     {
    4178         pMenu->addSeparator();
    4179         fSeparator = false;
    4180     }
    4181 
    4182     /* 'Properties' action: */
    4183     fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_T_Details)) || fSeparator;
    4184 }
    4185 
    4186 void UIActionPoolManager::updateMenuVMResourceMonitor()
    4187 {
    4188     /* Update corresponding menu: */
    4189     updateMenuVMResourceMonitorWrapper(action(UIActionIndexMN_M_VMResourceMonitor)->menu());
    4190 
    4191     /* Mark menu as valid: */
    4192     m_invalidations.remove(UIActionIndexMN_M_VMResourceMonitor);
    4193 }
    4194 
    4195 void UIActionPoolManager::updateMenuVMResourceMonitorWrapper(UIMenu *pMenu)
    4196 {
    4197     /* Clear contents: */
    4198     pMenu->clear();
    4199     addAction(pMenu, action(UIActionIndexMN_M_VMResourceMonitor_M_Columns));
    4200     addAction(pMenu, action(UIActionIndexMN_M_VMResourceMonitor_S_SwitchToMachinePerformance));
    4201 }
    4202 
    4203 void UIActionPoolManager::updateMenuSnapshot()
    4204 {
    4205     /* Get corresponding menu: */
    4206     UIMenu *pMenu = action(UIActionIndexMN_M_Snapshot)->menu();
    4207     AssertPtrReturnVoid(pMenu);
    4208     /* Clear contents: */
    4209     pMenu->clear();
    4210 
    4211     /* Populate Snapshot-menu: */
    4212     pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Take));
    4213     pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Delete));
    4214     pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Restore));
    4215     pMenu->addAction(action(UIActionIndexMN_M_Snapshot_T_Properties));
    4216     pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Clone));
    4217 
    4218     /* Mark menu as valid: */
    4219     m_invalidations.remove(UIActionIndexMN_M_Snapshot);
    4220 }
    4221 
    4222 void UIActionPoolManager::updateShortcuts()
    4223 {
    4224     /* Call to base-class: */
    4225     UIActionPool::updateShortcuts();
    4226     /* Create temporary Runtime UI pool to do the same: */
    4227     if (!isTemporary())
    4228         UIActionPool::createTemporary(UIActionPoolType_Runtime);
    42293673}
    42303674
     
    43293773}
    43303774
     3775void UIActionPoolManager::updateShortcuts()
     3776{
     3777    /* Call to base-class: */
     3778    UIActionPool::updateShortcuts();
     3779    /* Create temporary Runtime UI pool to do the same: */
     3780    if (!isTemporary())
     3781        UIActionPool::createTemporary(UIActionPoolType_Runtime);
     3782}
     3783
     3784void UIActionPoolManager::updateMenuFile()
     3785{
     3786    /* Get corresponding menu: */
     3787    UIMenu *pMenu = action(UIActionIndexMN_M_File)->menu();
     3788    AssertPtrReturnVoid(pMenu);
     3789    /* Clear contents: */
     3790    pMenu->clear();
     3791
     3792    /* Check if Ext Pack is ready, some of actions my depend on it: */
     3793    CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
     3794    const bool fExtPackAccessible = !extPack.isNull() && extPack.GetUsable();
     3795
     3796    /* The Application / 'File' menu contents is very different depending on host type. */
     3797
     3798#ifdef VBOX_WS_MAC
     3799
     3800    /* 'About' action goes to Application menu: */
     3801    pMenu->addAction(action(UIActionIndex_M_Application_S_About));
     3802# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     3803    /* 'Check for Updates' action goes to Application menu: */
     3804    if (gEDataManager->applicationUpdateEnabled())
     3805        pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
     3806    /* 'Network Access Manager' action goes to Application menu: */
     3807    pMenu->addAction(action(UIActionIndex_M_Application_S_NetworkAccessManager));
     3808# endif
     3809    /* 'Reset Warnings' action goes to Application menu: */
     3810    pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
     3811    /* 'Preferences' action goes to Application menu: */
     3812    pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
     3813    /* 'Close' action goes to Application menu: */
     3814    pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
     3815
     3816    /* 'Import Appliance' action goes to 'File' menu: */
     3817    pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
     3818    /* 'Export Appliance' action goes to 'File' menu: */
     3819    pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
     3820    /* 'New Cloud VM' action goes to 'File' menu: */
     3821    pMenu->addAction(action(UIActionIndexMN_M_File_S_NewCloudVM));
     3822# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
     3823    /* 'Show Extra-data Manager' action goes to 'File' menu for Debug build: */
     3824    pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
     3825# endif
     3826    /* 'Show Virtual Medium Manager' action goes to 'File' menu: */
     3827    pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowVirtualMediumManager));
     3828    /* 'Show Host Network Manager' action goes to 'File' menu: */
     3829    pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowHostNetworkManager));
     3830    /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
     3831    if (fExtPackAccessible)
     3832        pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowCloudProfileManager));
     3833
     3834#else /* !VBOX_WS_MAC */
     3835
     3836    /* 'Preferences' action goes to 'File' menu: */
     3837    pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
     3838    /* Separator after 'Preferences' action of the 'File' menu: */
     3839    pMenu->addSeparator();
     3840    /* 'Import Appliance' action goes to 'File' menu: */
     3841    pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
     3842    /* 'Export Appliance' action goes to 'File' menu: */
     3843    pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
     3844    /* 'New Cloud VM' action goes to 'File' menu: */
     3845    pMenu->addAction(action(UIActionIndexMN_M_File_S_NewCloudVM));
     3846    /* Separator after 'Export Appliance' action of the 'File' menu: */
     3847    pMenu->addSeparator();
     3848# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
     3849    /* 'Extra-data Manager' action goes to 'File' menu for Debug build: */
     3850    pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
     3851# endif
     3852    /* 'Show Virtual Medium Manager' action goes to 'File' menu: */
     3853    pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowVirtualMediumManager));
     3854    /* 'Show Host Network Manager' action goes to 'File' menu: */
     3855    pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowHostNetworkManager));
     3856    /* 'Show Cloud Profile Manager' action goes to 'File' menu: */
     3857    if (fExtPackAccessible)
     3858        pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowCloudProfileManager));
     3859# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     3860    /* 'Network Access Manager' action goes to 'File' menu: */
     3861    pMenu->addAction(action(UIActionIndex_M_Application_S_NetworkAccessManager));
     3862    /* 'Check for Updates' action goes to 'File' menu: */
     3863    if (gEDataManager->applicationUpdateEnabled())
     3864        pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
     3865# endif
     3866    /* Separator after tool actions of the 'File' menu: */
     3867    pMenu->addSeparator();
     3868    /* 'Reset Warnings' action goes 'File' menu: */
     3869    pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
     3870    /* Separator after 'Reset Warnings' action of the 'File' menu: */
     3871    pMenu->addSeparator();
     3872    /* 'Close' action goes to 'File' menu: */
     3873    pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
     3874
     3875#endif /* !VBOX_WS_MAC */
     3876
     3877    /* Mark menu as valid: */
     3878    m_invalidations.remove(UIActionIndexMN_M_File);
     3879}
     3880
     3881void UIActionPoolManager::updateMenuWelcome()
     3882{
     3883    /* Get corresponding menu: */
     3884    UIMenu *pMenu = action(UIActionIndexMN_M_Welcome)->menu();
     3885    AssertPtrReturnVoid(pMenu);
     3886    /* Clear contents: */
     3887    pMenu->clear();
     3888
     3889    /* Populate Welcome menu: */
     3890    pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_New));
     3891    pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_Add));
     3892
     3893    /* Mark menu as valid: */
     3894    m_invalidations.remove(UIActionIndexMN_M_Welcome);
     3895}
     3896
     3897void UIActionPoolManager::updateMenuGroup()
     3898{
     3899    /* Get corresponding menu: */
     3900    UIMenu *pMenu = action(UIActionIndexMN_M_Group)->menu();
     3901    AssertPtrReturnVoid(pMenu);
     3902    /* Clear contents: */
     3903    pMenu->clear();
     3904
     3905    /* This menu always remains invalid.. */
     3906}
     3907
     3908void UIActionPoolManager::updateMenuMachine()
     3909{
     3910    /* Get corresponding menu: */
     3911    UIMenu *pMenu = action(UIActionIndexMN_M_Machine)->menu();
     3912    AssertPtrReturnVoid(pMenu);
     3913    /* Clear contents: */
     3914    pMenu->clear();
     3915
     3916    /* This menu always remains invalid.. */
     3917}
     3918
     3919void UIActionPoolManager::updateMenuGroupMoveToGroup()
     3920{
     3921    /* Get corresponding menu: */
     3922    UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_MoveToGroup)->menu();
     3923    AssertPtrReturnVoid(pMenu);
     3924    /* Clear contents: */
     3925    pMenu->clear();
     3926
     3927    /* This menu always remains invalid.. */
     3928}
     3929
     3930void UIActionPoolManager::updateMenuMachineMoveToGroup()
     3931{
     3932    /* Get corresponding menu: */
     3933    UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_MoveToGroup)->menu();
     3934    AssertPtrReturnVoid(pMenu);
     3935    /* Clear contents: */
     3936    pMenu->clear();
     3937
     3938    /* Populate 'Machine' / 'Move to Group' menu: */
     3939    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_MoveToGroup_S_New));
     3940
     3941    /* This menu always remains invalid.. */
     3942}
     3943
     3944void UIActionPoolManager::updateMenuGroupStartOrShow()
     3945{
     3946    /* Get corresponding menu: */
     3947    UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_StartOrShow)->menu();
     3948    AssertPtrReturnVoid(pMenu);
     3949    /* Clear contents: */
     3950    pMenu->clear();
     3951
     3952    /* Populate 'Group' / 'Start or Show' menu: */
     3953    pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal));
     3954    pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless));
     3955    pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable));
     3956
     3957    /* Mark menu as valid: */
     3958    m_invalidations.remove(UIActionIndexMN_M_Group_M_StartOrShow);
     3959}
     3960
     3961void UIActionPoolManager::updateMenuMachineStartOrShow()
     3962{
     3963    /* Get corresponding menu: */
     3964    UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_StartOrShow)->menu();
     3965    AssertPtrReturnVoid(pMenu);
     3966    /* Clear contents: */
     3967    pMenu->clear();
     3968
     3969    /* Populate 'Machine' / 'Start or Show' menu: */
     3970    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal));
     3971    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless));
     3972    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable));
     3973
     3974    /* Mark menu as valid: */
     3975    m_invalidations.remove(UIActionIndexMN_M_Machine_M_StartOrShow);
     3976}
     3977
     3978void UIActionPoolManager::updateMenuGroupConsole()
     3979{
     3980    /* Get corresponding menu: */
     3981    UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Console)->menu();
     3982    AssertPtrReturnVoid(pMenu);
     3983    /* Clear contents: */
     3984    pMenu->clear();
     3985
     3986    /* This menu always remains invalid.. */
     3987}
     3988
     3989void UIActionPoolManager::updateMenuMachineConsole()
     3990{
     3991    /* Get corresponding menu: */
     3992    UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Console)->menu();
     3993    AssertPtrReturnVoid(pMenu);
     3994    /* Clear contents: */
     3995    pMenu->clear();
     3996
     3997    /* This menu always remains invalid.. */
     3998}
     3999
     4000void UIActionPoolManager::updateMenuGroupClose()
     4001{
     4002    /* Get corresponding menu: */
     4003    UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Close)->menu();
     4004    AssertPtrReturnVoid(pMenu);
     4005    /* Clear contents: */
     4006    pMenu->clear();
     4007
     4008    /* Populate 'Group' / 'Close' menu: */
     4009    // pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_Detach));
     4010    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_SaveState));
     4011    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_Shutdown));
     4012    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Close_S_PowerOff));
     4013
     4014    /* Mark menu as valid: */
     4015    m_invalidations.remove(UIActionIndexMN_M_Group_M_Close);
     4016}
     4017
     4018void UIActionPoolManager::updateMenuMachineClose()
     4019{
     4020    /* Get corresponding menu: */
     4021    UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Close)->menu();
     4022    AssertPtrReturnVoid(pMenu);
     4023    /* Clear contents: */
     4024    pMenu->clear();
     4025
     4026    /* Populate 'Machine' / 'Close' menu: */
     4027    // pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_Detach));
     4028    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_SaveState));
     4029    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_Shutdown));
     4030    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Close_S_PowerOff));
     4031
     4032    /* Mark menu as valid: */
     4033    m_invalidations.remove(UIActionIndexMN_M_Machine_M_Close);
     4034}
     4035
     4036void UIActionPoolManager::updateMenuGroupTools()
     4037{
     4038    /* Get corresponding menu: */
     4039    UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Tools)->menu();
     4040    AssertPtrReturnVoid(pMenu);
     4041    /* Clear contents: */
     4042    pMenu->clear();
     4043
     4044    /* Populate 'Group' / 'Tools' menu: */
     4045    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Details));
     4046    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Snapshots));
     4047    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Logs));
     4048    pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Performance));
     4049
     4050    /* Mark menu as valid: */
     4051    m_invalidations.remove(UIActionIndexMN_M_Group_M_Tools);
     4052}
     4053
     4054void UIActionPoolManager::updateMenuMachineTools()
     4055{
     4056    /* Get corresponding menu: */
     4057    UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Tools)->menu();
     4058    AssertPtrReturnVoid(pMenu);
     4059    /* Clear contents: */
     4060    pMenu->clear();
     4061
     4062    /* Populate 'Machine' / 'Tools' menu: */
     4063    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Details));
     4064    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots));
     4065    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Logs));
     4066    pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Performance));
     4067
     4068    /* Mark menu as valid: */
     4069    m_invalidations.remove(UIActionIndexMN_M_Machine_M_Tools);
     4070}
     4071
     4072void UIActionPoolManager::updateMenuMediumWindow()
     4073{
     4074    /* Update corresponding menu: */
     4075    updateMenuMediumWrapper(action(UIActionIndexMN_M_MediumWindow)->menu());
     4076
     4077    /* Mark menu as valid: */
     4078    m_invalidations.remove(UIActionIndexMN_M_MediumWindow);
     4079}
     4080
     4081void UIActionPoolManager::updateMenuMedium()
     4082{
     4083    /* Update corresponding menu: */
     4084    updateMenuMediumWrapper(action(UIActionIndexMN_M_Medium)->menu());
     4085
     4086    /* Mark menu as valid: */
     4087    m_invalidations.remove(UIActionIndexMN_M_Medium);
     4088}
     4089
     4090void UIActionPoolManager::updateMenuMediumWrapper(UIMenu *pMenu)
     4091{
     4092    /* Clear contents: */
     4093    pMenu->clear();
     4094
     4095    /* Separator? */
     4096    bool fSeparator = false;
     4097
     4098    /* 'Add' action: */
     4099    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Add)) || fSeparator;
     4100    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Create)) || fSeparator;
     4101
     4102    /* Separator? */
     4103    if (fSeparator)
     4104    {
     4105        pMenu->addSeparator();
     4106        fSeparator = false;
     4107    }
     4108
     4109    /* 'Copy' action: */
     4110    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Copy)) || fSeparator;
     4111    /* 'Move' action: */
     4112    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Move)) || fSeparator;
     4113    /* 'Remove' action: */
     4114    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Remove)) || fSeparator;
     4115    /* 'Release' action: */
     4116    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Release)) || fSeparator;
     4117    /* 'Search' action: */
     4118    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Search)) || fSeparator;
     4119    /* 'Properties' action: */
     4120    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Details)) || fSeparator;
     4121
     4122    /* Separator? */
     4123    if (fSeparator)
     4124    {
     4125        pMenu->addSeparator();
     4126        fSeparator = false;
     4127    }
     4128
     4129    /* 'Refresh' action: */
     4130    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Refresh)) || fSeparator;;
     4131}
     4132
     4133void UIActionPoolManager::updateMenuNetworkWindow()
     4134{
     4135    /* Update corresponding menu: */
     4136    updateMenuNetworkWrapper(action(UIActionIndexMN_M_NetworkWindow)->menu());
     4137
     4138    /* Mark menu as valid: */
     4139    m_invalidations.remove(UIActionIndexMN_M_NetworkWindow);
     4140}
     4141
     4142void UIActionPoolManager::updateMenuNetwork()
     4143{
     4144    /* Update corresponding menu: */
     4145    updateMenuNetworkWrapper(action(UIActionIndexMN_M_Network)->menu());
     4146
     4147    /* Mark menu as valid: */
     4148    m_invalidations.remove(UIActionIndexMN_M_Network);
     4149}
     4150
     4151void UIActionPoolManager::updateMenuNetworkWrapper(UIMenu *pMenu)
     4152{
     4153    /* Clear contents: */
     4154    pMenu->clear();
     4155
     4156    /* Separator? */
     4157    bool fSeparator = false;
     4158
     4159    /* 'Create' action: */
     4160    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Create)) || fSeparator;
     4161
     4162    /* Separator? */
     4163    if (fSeparator)
     4164    {
     4165        pMenu->addSeparator();
     4166        fSeparator = false;
     4167    }
     4168
     4169    /* 'Remove' action: */
     4170    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Remove)) || fSeparator;
     4171    /* 'Properties' action: */
     4172    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_T_Details)) || fSeparator;
     4173
     4174//    /* Separator? */
     4175//    if (fSeparator)
     4176//    {
     4177//        pMenu->addSeparator();
     4178//        fSeparator = false;
     4179//    }
     4180
     4181//    /* 'Refresh' action: */
     4182//    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Refresh)) || fSeparator;;
     4183}
     4184
     4185void UIActionPoolManager::updateMenuCloudWindow()
     4186{
     4187    /* Update corresponding menu: */
     4188    updateMenuCloudWrapper(action(UIActionIndexMN_M_CloudWindow)->menu());
     4189
     4190    /* Mark menu as valid: */
     4191    m_invalidations.remove(UIActionIndexMN_M_CloudWindow);
     4192}
     4193
     4194void UIActionPoolManager::updateMenuCloud()
     4195{
     4196    /* Update corresponding menu: */
     4197    updateMenuCloudWrapper(action(UIActionIndexMN_M_Cloud)->menu());
     4198
     4199    /* Mark menu as valid: */
     4200    m_invalidations.remove(UIActionIndexMN_M_Cloud);
     4201}
     4202
     4203void UIActionPoolManager::updateMenuCloudWrapper(UIMenu *pMenu)
     4204{
     4205    /* Clear contents: */
     4206    pMenu->clear();
     4207
     4208    /* Separator? */
     4209    bool fSeparator = false;
     4210
     4211    /* 'Add' action: */
     4212    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Add)) || fSeparator;
     4213    /* 'Import' action: */
     4214    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Import)) || fSeparator;
     4215
     4216    /* Separator? */
     4217    if (fSeparator)
     4218    {
     4219        pMenu->addSeparator();
     4220        fSeparator = false;
     4221    }
     4222
     4223    /* 'Remove' action: */
     4224    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Remove)) || fSeparator;
     4225    /* 'Properties' action: */
     4226    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_T_Details)) || fSeparator;
     4227
     4228    /* Separator? */
     4229    if (fSeparator)
     4230    {
     4231        pMenu->addSeparator();
     4232        fSeparator = false;
     4233    }
     4234
     4235    /* 'Try Page' action: */
     4236    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_TryPage)) || fSeparator;
     4237    /* 'Help' action: */
     4238    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Help)) || fSeparator;
     4239}
     4240
     4241void UIActionPoolManager::updateMenuCloudConsoleWindow()
     4242{
     4243    /* Update corresponding menu: */
     4244    updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsoleWindow)->menu());
     4245
     4246    /* Mark menu as valid: */
     4247    m_invalidations.remove(UIActionIndexMN_M_CloudConsoleWindow);
     4248}
     4249
     4250void UIActionPoolManager::updateMenuCloudConsole()
     4251{
     4252    /* Update corresponding menu: */
     4253    updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsole)->menu());
     4254
     4255    /* Mark menu as valid: */
     4256    m_invalidations.remove(UIActionIndexMN_M_CloudConsole);
     4257}
     4258
     4259void UIActionPoolManager::updateMenuCloudConsoleWrapper(UIMenu *pMenu)
     4260{
     4261    /* Clear contents: */
     4262    pMenu->clear();
     4263
     4264    /* Separator? */
     4265    bool fSeparator = false;
     4266
     4267    /* 'Add Application' action: */
     4268    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationAdd)) || fSeparator;
     4269    /* 'Remove Application' action: */
     4270    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationRemove)) || fSeparator;
     4271
     4272    /* Separator? */
     4273    if (fSeparator)
     4274    {
     4275        pMenu->addSeparator();
     4276        fSeparator = false;
     4277    }
     4278
     4279    /* 'Add Profile' action: */
     4280    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileAdd)) || fSeparator;
     4281    /* 'Remove Profile' action: */
     4282    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileRemove)) || fSeparator;
     4283
     4284    /* Separator? */
     4285    if (fSeparator)
     4286    {
     4287        pMenu->addSeparator();
     4288        fSeparator = false;
     4289    }
     4290
     4291    /* 'Properties' action: */
     4292    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_T_Details)) || fSeparator;
     4293}
     4294
     4295void UIActionPoolManager::updateMenuVMResourceMonitor()
     4296{
     4297    /* Update corresponding menu: */
     4298    updateMenuVMResourceMonitorWrapper(action(UIActionIndexMN_M_VMResourceMonitor)->menu());
     4299
     4300    /* Mark menu as valid: */
     4301    m_invalidations.remove(UIActionIndexMN_M_VMResourceMonitor);
     4302}
     4303
     4304void UIActionPoolManager::updateMenuVMResourceMonitorWrapper(UIMenu *pMenu)
     4305{
     4306    /* Clear contents: */
     4307    pMenu->clear();
     4308    addAction(pMenu, action(UIActionIndexMN_M_VMResourceMonitor_M_Columns));
     4309    addAction(pMenu, action(UIActionIndexMN_M_VMResourceMonitor_S_SwitchToMachinePerformance));
     4310}
     4311
     4312void UIActionPoolManager::updateMenuSnapshot()
     4313{
     4314    /* Get corresponding menu: */
     4315    UIMenu *pMenu = action(UIActionIndexMN_M_Snapshot)->menu();
     4316    AssertPtrReturnVoid(pMenu);
     4317    /* Clear contents: */
     4318    pMenu->clear();
     4319
     4320    /* Populate Snapshot-menu: */
     4321    pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Take));
     4322    pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Delete));
     4323    pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Restore));
     4324    pMenu->addAction(action(UIActionIndexMN_M_Snapshot_T_Properties));
     4325    pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Clone));
     4326
     4327    /* Mark menu as valid: */
     4328    m_invalidations.remove(UIActionIndexMN_M_Snapshot);
     4329}
     4330
    43314331
    43324332#include "UIActionPoolManager.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r85644 r85662  
    2222#endif
    2323
    24 /* Qt includes: */
    25 #include <QList>
    26 
    2724/* GUI includes: */
    2825#include "UIActionPool.h"
     
    3532  * 2. Every simple-action index prepended with 'S',
    3633  * 3. Every toggle-action index presended with 'T',
    37   * 4. Every polymorphic-action index presended with 'P',
    3834  * 5. Every sub-index contains full parent-index name. */
    3935enum UIActionIndexMN
     
    190186    UIActionIndexMN_M_CloudConsole_T_Details,
    191187
    192     /* VM resource Monitor actions: */
     188    /* VM Resource Monitor actions: */
    193189    UIActionIndexMN_M_VMResourceMonitor,
    194190    UIActionIndexMN_M_VMResourceMonitor_M_Columns,
     
    222218    /** Updates menus. */
    223219    virtual void updateMenus() /* override */;
     220
     221    /** Defines whether shortcuts of menu actions with specified @a iIndex should be visible. */
     222    virtual void setShortcutsVisible(int iIndex, bool fVisible) /* override */;
     223    /** Returns extra-data ID to save keyboard shortcuts under. */
     224    virtual QString shortcutsExtraDataID() const /* override */;
     225    /** Updates shortcuts. */
     226    virtual void updateShortcuts() /* override */;
     227
     228private:
    224229
    225230    /** Updates 'File' menu. */
     
    280285    void updateMenuCloudConsoleWrapper(UIMenu *pMenu);
    281286
    282    /** Updates 'VM Resource Monitor' menu. */
     287    /** Updates 'VM Resource Monitor' menu. */
    283288    void updateMenuVMResourceMonitor();
    284289    /** Updates 'VM Resource Monitor' @a pMenu. */
     
    288293    void updateMenuSnapshot();
    289294
    290     /** Updates shortcuts. */
    291     virtual void updateShortcuts() /* override */;
    292 
    293     /** Defines whether shortcuts of menu actions with specified @a iIndex should be visible. */
    294     virtual void setShortcutsVisible(int iIndex, bool fVisible) /* override */;
    295 
    296     /** Returns extra-data ID to save keyboard shortcuts under. */
    297     virtual QString shortcutsExtraDataID() const /* override */;
    298 
    299 private:
    300 
    301295    /** Enables factory in base-class. */
    302296    friend class UIActionPool;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r85661 r85662  
    31743174}
    31753175
    3176 void UIActionPoolRuntime::setRestrictionForMenuMachine(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuMachineActionType restriction)
     3176void UIActionPoolRuntime::setRestrictionForMenuMachine(UIActionRestrictionLevel level,
     3177                                                       UIExtraDataMetaDefs::RuntimeMenuMachineActionType restriction)
    31773178{
    31783179    m_restrictedActionsMenuMachine[level] = restriction;
     
    31883189}
    31893190
    3190 void UIActionPoolRuntime::setRestrictionForMenuView(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuViewActionType restriction)
     3191void UIActionPoolRuntime::setRestrictionForMenuView(UIActionRestrictionLevel level,
     3192                                                    UIExtraDataMetaDefs::RuntimeMenuViewActionType restriction)
    31913193{
    31923194    m_restrictedActionsMenuView[level] = restriction;
     
    32023204}
    32033205
    3204 void UIActionPoolRuntime::setRestrictionForMenuInput(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuInputActionType restriction)
     3206void UIActionPoolRuntime::setRestrictionForMenuInput(UIActionRestrictionLevel level,
     3207                                                     UIExtraDataMetaDefs::RuntimeMenuInputActionType restriction)
    32053208{
    32063209    m_restrictedActionsMenuInput[level] = restriction;
     
    32163219}
    32173220
    3218 void UIActionPoolRuntime::setRestrictionForMenuDevices(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restriction)
     3221void UIActionPoolRuntime::setRestrictionForMenuDevices(UIActionRestrictionLevel level,
     3222                                                       UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restriction)
    32193223{
    32203224    m_restrictedActionsMenuDevices[level] = restriction;
     
    32313235}
    32323236
    3233 void UIActionPoolRuntime::setRestrictionForMenuDebugger(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restriction)
     3237void UIActionPoolRuntime::setRestrictionForMenuDebugger(UIActionRestrictionLevel level,
     3238                                                        UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restriction)
    32343239{
    32353240    m_restrictedActionsMenuDebug[level] = restriction;
     
    32373242}
    32383243#endif /* VBOX_WITH_DEBUGGER_GUI */
    3239 
    3240 void UIActionPoolRuntime::sltHandleConfigurationChange(const QUuid &uMachineID)
    3241 {
    3242     /* Skip unrelated machine IDs: */
    3243     if (uiCommon().managedVMUuid() != uMachineID)
    3244         return;
    3245 
    3246     /* Update configuration: */
    3247     updateConfiguration();
    3248 }
    3249 
    3250 void UIActionPoolRuntime::sltPrepareMenuViewScreen()
    3251 {
    3252     /* Make sure sender is valid: */
    3253     QMenu *pMenu = qobject_cast<QMenu*>(sender());
    3254     AssertPtrReturnVoid(pMenu);
    3255 
    3256     /* Do we have to show resize, remap or rescale actions? */
    3257     const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize);
    3258     const bool fAllowToShowActionRemap = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap);
    3259     const bool fAllowToShowActionRescale = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale);
    3260 
    3261     /* Clear contents: */
    3262     pMenu->clear();
    3263 
    3264     /* Separator: */
    3265     bool fSeparator = false;
    3266 
    3267     /* Resize actions: */
    3268     if (fAllowToShowActionResize)
    3269     {
    3270         updateMenuViewResize(pMenu);
    3271         fSeparator = true;
    3272     }
    3273 
    3274     /* Separator: */
    3275     if (fSeparator)
    3276     {
    3277         pMenu->addSeparator();
    3278         fSeparator = false;
    3279     }
    3280 
    3281     /* Remap actions: */
    3282     if (fAllowToShowActionRemap && (m_cHostScreens > 1 || m_cGuestScreens > 1))
    3283     {
    3284         updateMenuViewRemap(pMenu);
    3285         fSeparator = true;
    3286     }
    3287 
    3288     /* Separator: */
    3289     if (fSeparator)
    3290     {
    3291         pMenu->addSeparator();
    3292         fSeparator = false;
    3293     }
    3294 
    3295     /* Rescale actions: */
    3296     if (fAllowToShowActionRescale)
    3297     {
    3298         updateMenuViewRescale(pMenu);
    3299         fSeparator = true;
    3300     }
    3301 }
    3302 
    3303 void UIActionPoolRuntime::sltHandleActionTriggerViewScreenToggle()
    3304 {
    3305     /* Make sure sender is valid: */
    3306     QAction *pAction = qobject_cast<QAction*>(sender());
    3307     AssertPtrReturnVoid(pAction);
    3308 
    3309     /* Send request to enable/disable guest-screen: */
    3310     const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
    3311     const bool fScreenEnabled = pAction->isChecked();
    3312     emit sigNotifyAboutTriggeringViewScreenToggle(iGuestScreenIndex, fScreenEnabled);
    3313 }
    3314 
    3315 void UIActionPoolRuntime::sltHandleActionTriggerViewScreenResize(QAction *pAction)
    3316 {
    3317     /* Make sure sender is valid: */
    3318     AssertPtrReturnVoid(pAction);
    3319 
    3320     /* Send request to resize guest-screen to required size: */
    3321     const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
    3322     const QSize size = pAction->property("Requested Size").toSize();
    3323     emit sigNotifyAboutTriggeringViewScreenResize(iGuestScreenIndex, size);
    3324 }
    3325 
    3326 void UIActionPoolRuntime::sltHandleActionTriggerViewScreenRemap(QAction *pAction)
    3327 {
    3328     /* Make sure sender is valid: */
    3329     AssertPtrReturnVoid(pAction);
    3330 
    3331     /* Send request to remap guest-screen to required host-screen: */
    3332     const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
    3333     const int iHostScreenIndex = pAction->property("Host Screen Index").toInt();
    3334     emit sigNotifyAboutTriggeringViewScreenRemap(iGuestScreenIndex, iHostScreenIndex);
    3335 }
    3336 
    3337 void UIActionPoolRuntime::sltHandleActionTriggerViewScreenRescale(QAction *pAction)
    3338 {
    3339     /* Make sure sender is valid: */
    3340     AssertPtrReturnVoid(pAction);
    3341 
    3342     /* Change scale-factor directly: */
    3343     const double dScaleFactor = pAction->property("Requested Scale Factor").toDouble();
    3344     const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
    3345     gEDataManager->setScaleFactor(dScaleFactor, uiCommon().managedVMUuid(), iGuestScreenIndex);
    3346 }
    33473244
    33483245void UIActionPoolRuntime::preparePool()
     
    36403537    /* 'File Manager' menu: */
    36413538    updateMenuFileManager();
     3539}
     3540
     3541QString UIActionPoolRuntime::shortcutsExtraDataID() const
     3542{
     3543    return GUI_Input_MachineShortcuts;
     3544}
     3545
     3546void UIActionPoolRuntime::updateShortcuts()
     3547{
     3548    /* Call to base-class: */
     3549    UIActionPool::updateShortcuts();
     3550    /* Create temporary Manager UI pool to do the same: */
     3551    if (!isTemporary())
     3552        UIActionPool::createTemporary(UIActionPoolType_Manager);
     3553}
     3554
     3555void UIActionPoolRuntime::sltHandleConfigurationChange(const QUuid &uMachineID)
     3556{
     3557    /* Skip unrelated machine IDs: */
     3558    if (uiCommon().managedVMUuid() != uMachineID)
     3559        return;
     3560
     3561    /* Update configuration: */
     3562    updateConfiguration();
     3563}
     3564
     3565void UIActionPoolRuntime::sltPrepareMenuViewScreen()
     3566{
     3567    /* Make sure sender is valid: */
     3568    QMenu *pMenu = qobject_cast<QMenu*>(sender());
     3569    AssertPtrReturnVoid(pMenu);
     3570
     3571    /* Do we have to show resize, remap or rescale actions? */
     3572    const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize);
     3573    const bool fAllowToShowActionRemap = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap);
     3574    const bool fAllowToShowActionRescale = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale);
     3575
     3576    /* Clear contents: */
     3577    pMenu->clear();
     3578
     3579    /* Separator: */
     3580    bool fSeparator = false;
     3581
     3582    /* Resize actions: */
     3583    if (fAllowToShowActionResize)
     3584    {
     3585        updateMenuViewResize(pMenu);
     3586        fSeparator = true;
     3587    }
     3588
     3589    /* Separator: */
     3590    if (fSeparator)
     3591    {
     3592        pMenu->addSeparator();
     3593        fSeparator = false;
     3594    }
     3595
     3596    /* Remap actions: */
     3597    if (fAllowToShowActionRemap && (m_cHostScreens > 1 || m_cGuestScreens > 1))
     3598    {
     3599        updateMenuViewRemap(pMenu);
     3600        fSeparator = true;
     3601    }
     3602
     3603    /* Separator: */
     3604    if (fSeparator)
     3605    {
     3606        pMenu->addSeparator();
     3607        fSeparator = false;
     3608    }
     3609
     3610    /* Rescale actions: */
     3611    if (fAllowToShowActionRescale)
     3612    {
     3613        updateMenuViewRescale(pMenu);
     3614        fSeparator = true;
     3615    }
     3616}
     3617
     3618void UIActionPoolRuntime::sltHandleActionTriggerViewScreenToggle()
     3619{
     3620    /* Make sure sender is valid: */
     3621    QAction *pAction = qobject_cast<QAction*>(sender());
     3622    AssertPtrReturnVoid(pAction);
     3623
     3624    /* Send request to enable/disable guest-screen: */
     3625    const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
     3626    const bool fScreenEnabled = pAction->isChecked();
     3627    emit sigNotifyAboutTriggeringViewScreenToggle(iGuestScreenIndex, fScreenEnabled);
     3628}
     3629
     3630void UIActionPoolRuntime::sltHandleActionTriggerViewScreenResize(QAction *pAction)
     3631{
     3632    /* Make sure sender is valid: */
     3633    AssertPtrReturnVoid(pAction);
     3634
     3635    /* Send request to resize guest-screen to required size: */
     3636    const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
     3637    const QSize size = pAction->property("Requested Size").toSize();
     3638    emit sigNotifyAboutTriggeringViewScreenResize(iGuestScreenIndex, size);
     3639}
     3640
     3641void UIActionPoolRuntime::sltHandleActionTriggerViewScreenRemap(QAction *pAction)
     3642{
     3643    /* Make sure sender is valid: */
     3644    AssertPtrReturnVoid(pAction);
     3645
     3646    /* Send request to remap guest-screen to required host-screen: */
     3647    const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
     3648    const int iHostScreenIndex = pAction->property("Host Screen Index").toInt();
     3649    emit sigNotifyAboutTriggeringViewScreenRemap(iGuestScreenIndex, iHostScreenIndex);
     3650}
     3651
     3652void UIActionPoolRuntime::sltHandleActionTriggerViewScreenRescale(QAction *pAction)
     3653{
     3654    /* Make sure sender is valid: */
     3655    AssertPtrReturnVoid(pAction);
     3656
     3657    /* Change scale-factor directly: */
     3658    const double dScaleFactor = pAction->property("Requested Scale Factor").toDouble();
     3659    const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
     3660    gEDataManager->setScaleFactor(dScaleFactor, uiCommon().managedVMUuid(), iGuestScreenIndex);
    36423661}
    36433662
     
    43564375#endif /* VBOX_WITH_DEBUGGER_GUI */
    43574376
    4358 void UIActionPoolRuntime::updateShortcuts()
    4359 {
    4360     /* Call to base-class: */
    4361     UIActionPool::updateShortcuts();
    4362     /* Create temporary Manager UI pool to do the same: */
    4363     if (!isTemporary())
    4364         UIActionPool::createTemporary(UIActionPoolType_Manager);
    4365 }
    4366 
    4367 QString UIActionPoolRuntime::shortcutsExtraDataID() const
    4368 {
    4369     return GUI_Input_MachineShortcuts;
    4370 }
    4371 
    43724377
    43734378#include "UIActionPoolRuntime.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h

    r85597 r85662  
    2323
    2424/* Qt includes: */
    25 #include <QList>
    2625#include <QMap>
    2726
     
    3736  * 2. Every simple-action index prepended with 'S',
    3837  * 3. Every toggle-action index presended with 'T',
    39   * 4. Every polymorphic-action index presended with 'P',
    4038  * 5. Every sub-index contains full parent-index name. */
    4139enum UIActionIndexRT
     
    178176    bool isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType type) const;
    179177    /** Defines 'Machine' menu @a restriction for passed @a level. */
    180     void setRestrictionForMenuMachine(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuMachineActionType restriction);
     178    void setRestrictionForMenuMachine(UIActionRestrictionLevel level,
     179                                      UIExtraDataMetaDefs::RuntimeMenuMachineActionType restriction);
    181180
    182181    /** Returns whether the action with passed @a type is allowed in the 'View' menu. */
    183182    bool isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType type) const;
    184183    /** Defines 'View' menu @a restriction for passed @a level. */
    185     void setRestrictionForMenuView(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuViewActionType restriction);
     184    void setRestrictionForMenuView(UIActionRestrictionLevel level,
     185                                   UIExtraDataMetaDefs::RuntimeMenuViewActionType restriction);
    186186
    187187    /** Returns whether the action with passed @a type is allowed in the 'Input' menu. */
    188188    bool isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType type) const;
    189189    /** Defines 'Input' menu @a restriction for passed @a level. */
    190     void setRestrictionForMenuInput(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuInputActionType restriction);
     190    void setRestrictionForMenuInput(UIActionRestrictionLevel level,
     191                                    UIExtraDataMetaDefs::RuntimeMenuInputActionType restriction);
    191192
    192193    /** Returns whether the action with passed @a type is allowed in the 'Devices' menu. */
    193194    bool isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType type) const;
    194195    /** Defines 'Devices' menu @a restriction for passed @a level. */
    195     void setRestrictionForMenuDevices(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restriction);
     196    void setRestrictionForMenuDevices(UIActionRestrictionLevel level,
     197                                      UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restriction);
    196198
    197199#ifdef VBOX_WITH_DEBUGGER_GUI
     
    199201    bool isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType type) const;
    200202    /** Defines 'Debug' menu @a restriction for passed @a level. */
    201     void setRestrictionForMenuDebugger(UIActionRestrictionLevel level, UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restriction);
    202 #endif
    203 
    204 protected slots:
     203    void setRestrictionForMenuDebugger(UIActionRestrictionLevel level,
     204                                       UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restriction);
     205#endif
     206
     207protected:
     208
     209    /** Constructs action-pool.
     210      * @param  fTemporary  Brings whether this action-pool is temporary,
     211      *                     used to (re-)initialize shortcuts-pool. */
     212    UIActionPoolRuntime(bool fTemporary = false);
     213
     214    /** Prepares pool. */
     215    virtual void preparePool() /* override */;
     216    /** Prepares connections. */
     217    virtual void prepareConnections() /* override */;
     218
     219    /** Updates configuration. */
     220    virtual void updateConfiguration() /* override */;
     221
     222    /** Updates menu. */
     223    virtual void updateMenu(int iIndex) /* override */;
     224    /** Updates menus. */
     225    virtual void updateMenus() /* override */;
     226
     227    /** Returns extra-data ID to save keyboard shortcuts under. */
     228    virtual QString shortcutsExtraDataID() const /* override */;
     229    /** Updates shortcuts. */
     230    virtual void updateShortcuts() /* override */;
     231
     232private slots:
    205233
    206234    /** Handles configuration-change. */
     
    219247    void sltHandleActionTriggerViewScreenRescale(QAction *pAction);
    220248
    221 protected:
    222 
    223     /** Constructs action-pool.
    224       * @param  fTemporary  Brings whether this action-pool is temporary,
    225       *                     used to (re-)initialize shortcuts-pool. */
    226     UIActionPoolRuntime(bool fTemporary = false);
    227 
    228     /** Prepares pool. */
    229     virtual void preparePool() /* override */;
    230     /** Prepares connections. */
    231     virtual void prepareConnections() /* override */;
    232 
    233     /** Updates configuration. */
    234     virtual void updateConfiguration() /* override */;
    235 
    236     /** Updates menu. */
    237     virtual void updateMenu(int iIndex) /* override */;
    238     /** Updates menus. */
    239     virtual void updateMenus() /* override */;
     249private:
    240250
    241251    /** Updates 'Machine' menu. */
     
    280290#endif
    281291
    282     /** Updates shortcuts. */
    283     virtual void updateShortcuts() /* override */;
    284 
    285     /** Returns extra-data ID to save keyboard shortcuts under. */
    286     virtual QString shortcutsExtraDataID() const /* override */;
    287 
    288 private:
    289 
    290292    /** Holds the host-screen count. */
    291293    int  m_cHostScreens;
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