VirtualBox

Changeset 51054 in vbox


Ignore:
Timestamp:
Apr 11, 2014 4:51:13 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6660: Advanced extra-data management framework: Taking extra-data stuff from VBoxGlobal.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r51053 r51054  
    2525#include "VBoxGlobalSettings.h"
    2626#include "UIActionPool.h"
     27#include "UIConverter.h"
    2728
    2829/* COM includes: */
     
    196197}
    197198
     199#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     200bool UIExtraDataManager::shouldWeAllowApplicationUpdate() const
     201{
     202    /* Allow unless 'forbidden' flag is set: */
     203    return !isFeatureAllowed(GUI_PreventApplicationUpdate);
     204}
     205#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     206
     207bool UIExtraDataManager::shouldWeShowMachine(const QString &strID) const
     208{
     209    /* Show unless 'forbidden' flag is set: */
     210    return !isFeatureAllowed(GUI_HideFromManager, strID);
     211}
     212
     213bool UIExtraDataManager::shouldWeShowMachineDetails(const QString &strID) const
     214{
     215    /* Show unless 'forbidden' flag is set: */
     216    return !isFeatureAllowed(GUI_HideDetails, strID);
     217}
     218
     219bool UIExtraDataManager::shouldWeAllowMachineReconfiguration(const QString &strID) const
     220{
     221    /* Show unless 'forbidden' flag is set: */
     222    return !isFeatureAllowed(GUI_PreventReconfiguration, strID);
     223}
     224
     225bool UIExtraDataManager::shouldWeAllowMachineSnapshotOperations(const QString &strID) const
     226{
     227    /* Show unless 'forbidden' flag is set: */
     228    return !isFeatureAllowed(GUI_PreventSnapshotOperations, strID);
     229}
     230
     231bool UIExtraDataManager::shouldWeAutoMountGuestScreens(const QString &strID) const
     232{
     233    /* Show only if 'allowed' flag is set: */
     234    return isFeatureAllowed(GUI_AutomountGuestScreens, strID);
     235}
     236
     237RuntimeMenuType UIExtraDataManager::restrictedRuntimeMenuTypes(const QString &strID) const
     238{
     239    /* Prepare result: */
     240    RuntimeMenuType result = RuntimeMenuType_Invalid;
     241    /* Load restricted runtime-menu-types: */
     242    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMenus, strID))
     243    {
     244        RuntimeMenuType value = gpConverter->fromInternalString<RuntimeMenuType>(strValue);
     245        if (value != RuntimeMenuType_Invalid)
     246            result = static_cast<RuntimeMenuType>(result | value);
     247    }
     248    /* Return result: */
     249    return result;
     250}
     251
     252#ifdef Q_WS_MAC
     253RuntimeMenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const QString &strID) const
     254{
     255    /* Prepare result: */
     256    RuntimeMenuApplicationActionType result = RuntimeMenuApplicationActionType_Invalid;
     257    /* Load restricted runtime-application-menu action-types: */
     258    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, strID))
     259    {
     260        RuntimeMenuApplicationActionType value = gpConverter->fromInternalString<RuntimeMenuApplicationActionType>(strValue);
     261        if (value != RuntimeMenuApplicationActionType_Invalid)
     262            result = static_cast<RuntimeMenuApplicationActionType>(result | value);
     263    }
     264    /* Return result: */
     265    return result;
     266}
     267#endif /* Q_WS_MAC */
     268
     269RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const QString &strID) const
     270{
     271    /* Prepare result: */
     272    RuntimeMenuMachineActionType result = RuntimeMenuMachineActionType_Invalid;
     273    /* Load restricted runtime-machine-menu action-types: */
     274    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeMachineMenuActions, strID))
     275    {
     276        RuntimeMenuMachineActionType value = gpConverter->fromInternalString<RuntimeMenuMachineActionType>(strValue);
     277        if (value != RuntimeMenuMachineActionType_Invalid)
     278            result = static_cast<RuntimeMenuMachineActionType>(result | value);
     279    }
     280    /* Return result: */
     281    return result;
     282}
     283
     284RuntimeMenuViewActionType UIExtraDataManager::restrictedRuntimeMenuViewActionTypes(const QString &strID) const
     285{
     286    /* Prepare result: */
     287    RuntimeMenuViewActionType result = RuntimeMenuViewActionType_Invalid;
     288    /* Load restricted runtime-view-menu action-types: */
     289    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeViewMenuActions, strID))
     290    {
     291        RuntimeMenuViewActionType value = gpConverter->fromInternalString<RuntimeMenuViewActionType>(strValue);
     292        if (value != RuntimeMenuViewActionType_Invalid)
     293            result = static_cast<RuntimeMenuViewActionType>(result | value);
     294    }
     295    /* Return result: */
     296    return result;
     297}
     298
     299RuntimeMenuDevicesActionType UIExtraDataManager::restrictedRuntimeMenuDevicesActionTypes(const QString &strID) const
     300{
     301    /* Prepare result: */
     302    RuntimeMenuDevicesActionType result = RuntimeMenuDevicesActionType_Invalid;
     303    /* Load restricted runtime-devices-menu action-types: */
     304    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeDevicesMenuActions, strID))
     305    {
     306        RuntimeMenuDevicesActionType value = gpConverter->fromInternalString<RuntimeMenuDevicesActionType>(strValue);
     307        if (value != RuntimeMenuDevicesActionType_Invalid)
     308            result = static_cast<RuntimeMenuDevicesActionType>(result | value);
     309    }
     310    /* Return result: */
     311    return result;
     312}
     313
     314#ifdef VBOX_WITH_DEBUGGER_GUI
     315RuntimeMenuDebuggerActionType UIExtraDataManager::restrictedRuntimeMenuDebuggerActionTypes(const QString &strID) const
     316{
     317    /* Prepare result: */
     318    RuntimeMenuDebuggerActionType result = RuntimeMenuDebuggerActionType_Invalid;
     319    /* Load restricted runtime-debugger-menu action-types: */
     320    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeDebuggerMenuActions, strID))
     321    {
     322        RuntimeMenuDebuggerActionType value = gpConverter->fromInternalString<RuntimeMenuDebuggerActionType>(strValue);
     323        if (value != RuntimeMenuDebuggerActionType_Invalid)
     324            result = static_cast<RuntimeMenuDebuggerActionType>(result | value);
     325    }
     326    /* Return result: */
     327    return result;
     328}
     329#endif /* VBOX_WITH_DEBUGGER_GUI */
     330
     331RuntimeMenuHelpActionType UIExtraDataManager::restrictedRuntimeMenuHelpActionTypes(const QString &strID) const
     332{
     333    /* Prepare result: */
     334    RuntimeMenuHelpActionType result = RuntimeMenuHelpActionType_Invalid;
     335    /* Load restricted runtime-help-menu action-types: */
     336    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedRuntimeHelpMenuActions, strID))
     337    {
     338        RuntimeMenuHelpActionType value = gpConverter->fromInternalString<RuntimeMenuHelpActionType>(strValue);
     339        if (value != RuntimeMenuHelpActionType_Invalid)
     340            result = static_cast<RuntimeMenuHelpActionType>(result | value);
     341    }
     342    /* Return result: */
     343    return result;
     344}
     345
     346UIVisualStateType UIExtraDataManager::restrictedVisualStateTypes(const QString &strID) const
     347{
     348    /* Prepare result: */
     349    UIVisualStateType result = UIVisualStateType_Invalid;
     350    /* Load restricted visual-state-types: */
     351    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedVisualStates, strID))
     352    {
     353        UIVisualStateType value = gpConverter->fromInternalString<UIVisualStateType>(strValue);
     354        if (value != UIVisualStateType_Invalid)
     355            result = static_cast<UIVisualStateType>(result | value);
     356    }
     357    /* Return result: */
     358    return result;
     359}
     360
     361MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QString &strID) const
     362{
     363    return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_DefaultCloseAction, strID));
     364}
     365
     366MachineCloseAction UIExtraDataManager::restrictedMachineCloseActions(const QString &strID) const
     367{
     368    /* Prepare result: */
     369    MachineCloseAction result = MachineCloseAction_Invalid;
     370    /* Load restricted machine-close-actions: */
     371    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedCloseActions, strID))
     372    {
     373        MachineCloseAction value = gpConverter->fromInternalString<MachineCloseAction>(strValue);
     374        if (value != MachineCloseAction_Invalid)
     375            result = static_cast<MachineCloseAction>(result | value);
     376    }
     377    /* Return result: */
     378    return result;
     379}
     380
     381QList<IndicatorType> UIExtraDataManager::restrictedStatusBarIndicators(const QString &strID) const
     382{
     383    /* Prepare result: */
     384    QList<IndicatorType> result;
     385    /* Load restricted status-bar-indicators: */
     386    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedStatusBarIndicators, strID))
     387    {
     388        IndicatorType value = gpConverter->fromInternalString<IndicatorType>(strValue);
     389        if (value != IndicatorType_Invalid)
     390            result << value;
     391    }
     392    /* Return result: */
     393    return result;
     394}
     395
     396QList<GlobalSettingsPageType> UIExtraDataManager::restrictedGlobalSettingsPages() const
     397{
     398    /* Prepare result: */
     399    QList<GlobalSettingsPageType> result;
     400    /* Load restricted global-settings-pages: */
     401    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedGlobalSettingsPages))
     402    {
     403        GlobalSettingsPageType value = gpConverter->fromInternalString<GlobalSettingsPageType>(strValue);
     404        if (value != GlobalSettingsPageType_Invalid)
     405            result << value;
     406    }
     407    /* Return result: */
     408    return result;
     409}
     410
     411QList<MachineSettingsPageType> UIExtraDataManager::restrictedMachineSettingsPages(const QString &strID) const
     412{
     413    /* Prepare result: */
     414    QList<MachineSettingsPageType> result;
     415    /* Load restricted machine-settings-pages: */
     416    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedMachineSettingsPages, strID))
     417    {
     418        MachineSettingsPageType value = gpConverter->fromInternalString<MachineSettingsPageType>(strValue);
     419        if (value != MachineSettingsPageType_Invalid)
     420            result << value;
     421    }
     422    /* Return result: */
     423    return result;
     424}
     425
     426#ifndef Q_WS_MAC
     427QStringList UIExtraDataManager::machineWindowIconNames(const QString &strID) const
     428{
     429    return extraDataStringList(GUI_MachineWindowIcons, strID);
     430}
     431#endif /* !Q_WS_MAC */
     432
     433GuruMeditationHandlerType UIExtraDataManager::guruMeditationHandlerType(const QString &strID) const
     434{
     435    return gpConverter->fromInternalString<GuruMeditationHandlerType>(extraDataString(GUI_GuruMeditationHandler, strID));
     436}
     437
    198438UIExtraDataManager::UIExtraDataManager()
    199439    : m_pHandler(new UIExtraDataEventHandler(this))
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r51053 r51054  
    2121#include <QObject>
    2222#include <QMap>
     23
     24/* GUI includes: */
     25#include "UIDefs.h"
    2326
    2427/* COM includes: */
     
    6467    /** Static Extra-data Manager destructor. */
    6568    static void destroy();
     69
     70#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     71    /** Returns whether we should allow Application Update. */
     72    bool shouldWeAllowApplicationUpdate() const;
     73#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     74
     75    /** Returns whether we should show machine. */
     76    bool shouldWeShowMachine(const QString &strID) const;
     77    /** Returns whether we should show machine details. */
     78    bool shouldWeShowMachineDetails(const QString &strID) const;
     79
     80    /** Returns whether we should allow machine reconfiguration. */
     81    bool shouldWeAllowMachineReconfiguration(const QString &strID) const;
     82    /** Returns whether we should allow machine snapshot operations. */
     83    bool shouldWeAllowMachineSnapshotOperations(const QString &strID) const;
     84
     85    /** Returns whether we should automatically mount/unmount guest-screens. */
     86    bool shouldWeAutoMountGuestScreens(const QString &strID) const;
     87
     88    /** Returns restricted Runtime UI menu types. */
     89    RuntimeMenuType restrictedRuntimeMenuTypes(const QString &strID) const;
     90#ifdef Q_WS_MAC
     91    /** Mac OS X: Returns restricted Runtime UI action types for Application menu. */
     92    RuntimeMenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QString &strID) const;
     93#endif /* Q_WS_MAC */
     94    /** Returns restricted Runtime UI action types for Machine menu. */
     95    RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(const QString &strID) const;
     96    /** Returns restricted Runtime UI action types for View menu. */
     97    RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(const QString &strID) const;
     98    /** Returns restricted Runtime UI action types for Devices menu. */
     99    RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(const QString &strID) const;
     100#ifdef VBOX_WITH_DEBUGGER_GUI
     101    /** Returns restricted Runtime UI action types for Debugger menu. */
     102    RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(const QString &strID) const;
     103#endif /* VBOX_WITH_DEBUGGER_GUI */
     104    /** Returns restricted Runtime UI action types for Help menu. */
     105    RuntimeMenuHelpActionType restrictedRuntimeMenuHelpActionTypes(const QString &strID) const;
     106
     107    /** Returns restricted Runtime UI visual-state types. */
     108    UIVisualStateType restrictedVisualStateTypes(const QString &strID) const;
     109
     110    /** Returns default machine close action. */
     111    MachineCloseAction defaultMachineCloseAction(const QString &strID) const;
     112    /** Returns restricted machine close actions. */
     113    MachineCloseAction restrictedMachineCloseActions(const QString &strID) const;
     114
     115    /** Returns restricted Runtime UI status-bar indicators. */
     116    QList<IndicatorType> restrictedStatusBarIndicators(const QString &strID) const;
     117
     118    /** Returns global settings pages. */
     119    QList<GlobalSettingsPageType> restrictedGlobalSettingsPages() const;
     120    /** Returns machine settings pages. */
     121    QList<MachineSettingsPageType> restrictedMachineSettingsPages(const QString &strID) const;
     122
     123#ifndef Q_WS_MAC
     124    /** Except Mac OS X: Returns redefined machine-window icon names. */
     125    QStringList machineWindowIconNames(const QString &strID) const;
     126#endif /* !Q_WS_MAC */
     127
     128    /** Returns redefined guru-meditation handler type. */
     129    GuruMeditationHandlerType guruMeditationHandlerType(const QString &strID) const;
    66130
    67131private:
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r51038 r51054  
    36943694}
    36953695
    3696 /* static */
    3697 bool VBoxGlobal::isApprovedByExtraData(CVirtualBox &vbox, const QString &strExtraDataKey)
    3698 {
    3699     /* Load corresponding extra-data value: */
    3700     QString strExtraDataValue(vbox.GetExtraData(strExtraDataKey));
    3701 
    3702     /* 'false' if value was not set: */
    3703     if (strExtraDataValue.isEmpty())
    3704         return false;
    3705 
    3706     /* Handle particular values: */
    3707     return    strExtraDataValue.compare("true", Qt::CaseInsensitive) == 0
    3708            || strExtraDataValue.compare("yes", Qt::CaseInsensitive) == 0
    3709            || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 0
    3710            || strExtraDataValue == "1";
    3711 }
    3712 
    3713 /* static */
    3714 bool VBoxGlobal::isApprovedByExtraData(CMachine &machine, const QString &strExtraDataKey)
    3715 {
    3716     /* Load corresponding extra-data value: */
    3717     QString strExtraDataValue(machine.GetExtraData(strExtraDataKey));
    3718 
    3719     /* 'false' if value was not set: */
    3720     if (strExtraDataValue.isEmpty())
    3721         return false;
    3722 
    3723     /* Handle particular values: */
    3724     return    strExtraDataValue.compare("true", Qt::CaseInsensitive) == 0
    3725            || strExtraDataValue.compare("yes", Qt::CaseInsensitive) == 0
    3726            || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 0
    3727            || strExtraDataValue == "1";
    3728 }
    3729 
    3730 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    3731 /* static */
    3732 bool VBoxGlobal::shouldWeAllowApplicationUpdate(CVirtualBox &vbox)
    3733 {
    3734     /* 'true' if disabling is not approved by the extra-data: */
    3735     return !isApprovedByExtraData(vbox, GUI_PreventApplicationUpdate);
    3736 }
    3737 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    3738 
    3739 /* static */
    3740 bool VBoxGlobal::shouldWeShowMachine(CMachine &machine)
    3741 {
    3742     /* 'false' for null machines: */
    3743     if (machine.isNull())
    3744         return false;
    3745 
    3746     /* 'true' for inaccessible machines,
    3747      * because we can't verify anything in that case: */
    3748     if (!machine.GetAccessible())
    3749         return true;
    3750 
    3751     /* 'true' if hiding is not approved by the extra-data: */
    3752     return !isApprovedByExtraData(machine, GUI_HideFromManager);
    3753 }
    3754 
    3755 /* static */
    3756 bool VBoxGlobal::shouldWeAllowMachineReconfiguration(CMachine &machine,
    3757                                                      bool fIncludingMachineGeneralCheck /* = false*/,
    3758                                                      bool fIncludingMachineStateCheck /* = false*/)
    3759 {
    3760     /* Should we perform machine general check? */
    3761     if (fIncludingMachineGeneralCheck)
    3762     {
    3763         /* 'false' for null machines: */
    3764         if (machine.isNull())
    3765             return false;
    3766 
    3767         /* 'false' for inaccessible machines,
    3768          * because we can't configure anything in that case: */
    3769         if (!machine.GetAccessible())
    3770             return true;
    3771     }
    3772 
    3773     /* Should we perform machine state check? */
    3774     if (fIncludingMachineStateCheck)
    3775     {
    3776         /* 'false' for machines in [stuck] state: */
    3777         if (machine.GetState() == KMachineState_Stuck)
    3778             return false;
    3779     }
    3780 
    3781     /* 'true' if reconfiguration is not restricted by the extra-data: */
    3782     return !isApprovedByExtraData(machine, GUI_PreventReconfiguration);
    3783 }
    3784 
    3785 /* static */
    3786 bool VBoxGlobal::shouldWeShowDetails(CMachine &machine,
    3787                                      bool fIncludingMachineGeneralCheck /* = false*/)
    3788 {
    3789     /* Should we perform machine general check? */
    3790     if (fIncludingMachineGeneralCheck)
    3791     {
    3792         /* 'false' for null machines: */
    3793         if (machine.isNull())
    3794             return false;
    3795 
    3796         /* 'true' for inaccessible machines,
    3797          * because we can't verify anything in that case: */
    3798         if (!machine.GetAccessible())
    3799             return true;
    3800     }
    3801 
    3802     /* 'true' if hiding is not approved by the extra-data: */
    3803     return !isApprovedByExtraData(machine, GUI_HideDetails);
    3804 }
    3805 
    3806 /* static */
    3807 bool VBoxGlobal::shouldWeAutoMountGuestScreens(CMachine &machine,
    3808                                                bool fIncludingSanityCheck /* = true*/)
    3809 {
    3810     if (fIncludingSanityCheck)
    3811     {
    3812         /* 'false' for null machines,
    3813          * there is nothing to start anyway: */
    3814         if (machine.isNull())
    3815             return false;
    3816 
    3817         /* 'false' for inaccessible machines,
    3818          * we can't start them anyway: */
    3819         if (!machine.GetAccessible())
    3820             return false;
    3821     }
    3822 
    3823     /* 'true' if guest-screen auto-mounting approved by the extra-data: */
    3824     return isApprovedByExtraData(machine, GUI_AutomountGuestScreens);
    3825 }
    3826 
    3827 /* static */
    3828 bool VBoxGlobal::shouldWeAllowSnapshotOperations(CMachine &machine,
    3829                                                  bool fIncludingSanityCheck /* = true*/)
    3830 {
    3831     if (fIncludingSanityCheck)
    3832     {
    3833         /* 'false' for null machines,
    3834          * we can't operate snapshot in that case: */
    3835         if (machine.isNull())
    3836             return false;
    3837 
    3838         /* 'false' for inaccessible machines,
    3839          * we can't operate snapshot in that case: */
    3840         if (!machine.GetAccessible())
    3841             return false;
    3842     }
    3843 
    3844     /* 'true' if snapshot operations are not restricted by the extra-data: */
    3845     return !isApprovedByExtraData(machine, GUI_PreventSnapshotOperations);
    3846 }
    3847 
    3848 /** Returns default machine close action for passed @a machine. */
    3849 MachineCloseAction VBoxGlobal::defaultMachineCloseAction(CMachine &machine)
    3850 {
    3851     return gpConverter->fromInternalString<MachineCloseAction>(machine.GetExtraData(GUI_DefaultCloseAction));
    3852 }
    3853 
    3854 /* static */
    3855 RuntimeMenuType VBoxGlobal::restrictedRuntimeMenuTypes(CMachine &machine)
    3856 {
    3857     /* Prepare result: */
    3858     RuntimeMenuType result = RuntimeMenuType_Invalid;
    3859     /* Load restricted runtime-menu-types: */
    3860     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeMenus));
    3861     QStringList list = strList.split(',');
    3862     /* Convert list into appropriate values: */
    3863     foreach (const QString &strValue, list)
    3864     {
    3865         RuntimeMenuType value = gpConverter->fromInternalString<RuntimeMenuType>(strValue);
    3866         if (value != RuntimeMenuType_Invalid)
    3867             result = static_cast<RuntimeMenuType>(result | value);
    3868     }
    3869     /* Return result: */
    3870     return result;
    3871 }
    3872 
    3873 #ifdef Q_WS_MAC
    3874 /* static */
    3875 RuntimeMenuApplicationActionType VBoxGlobal::restrictedRuntimeMenuApplicationActionTypes(CMachine &machine)
    3876 {
    3877     /* Prepare result: */
    3878     RuntimeMenuApplicationActionType result = RuntimeMenuApplicationActionType_Invalid;
    3879     /* Load restricted runtime-application-menu action-types: */
    3880     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeApplicationMenuActions));
    3881     QStringList list = strList.split(',');
    3882     /* Convert list into appropriate values: */
    3883     foreach (const QString &strValue, list)
    3884     {
    3885         RuntimeMenuApplicationActionType value = gpConverter->fromInternalString<RuntimeMenuApplicationActionType>(strValue);
    3886         if (value != RuntimeMenuApplicationActionType_Invalid)
    3887             result = static_cast<RuntimeMenuApplicationActionType>(result | value);
    3888     }
    3889     /* Return result: */
    3890     return result;
    3891 }
    3892 #endif /* Q_WS_MAC */
    3893 
    3894 /* static */
    3895 RuntimeMenuMachineActionType VBoxGlobal::restrictedRuntimeMenuMachineActionTypes(CMachine &machine)
    3896 {
    3897     /* Prepare result: */
    3898     RuntimeMenuMachineActionType result = RuntimeMenuMachineActionType_Invalid;
    3899     /* Load restricted runtime-machine-menu action-types: */
    3900     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeMachineMenuActions));
    3901     QStringList list = strList.split(',');
    3902     /* Convert list into appropriate values: */
    3903     foreach (const QString &strValue, list)
    3904     {
    3905         RuntimeMenuMachineActionType value = gpConverter->fromInternalString<RuntimeMenuMachineActionType>(strValue);
    3906         if (value != RuntimeMenuMachineActionType_Invalid)
    3907             result = static_cast<RuntimeMenuMachineActionType>(result | value);
    3908     }
    3909     /* Return result: */
    3910     return result;
    3911 }
    3912 
    3913 /* static */
    3914 RuntimeMenuViewActionType VBoxGlobal::restrictedRuntimeMenuViewActionTypes(CMachine &machine)
    3915 {
    3916     /* Prepare result: */
    3917     RuntimeMenuViewActionType result = RuntimeMenuViewActionType_Invalid;
    3918     /* Load restricted runtime-view-menu action-types: */
    3919     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeViewMenuActions));
    3920     QStringList list = strList.split(',');
    3921     /* Convert list into appropriate values: */
    3922     foreach (const QString &strValue, list)
    3923     {
    3924         RuntimeMenuViewActionType value = gpConverter->fromInternalString<RuntimeMenuViewActionType>(strValue);
    3925         if (value != RuntimeMenuViewActionType_Invalid)
    3926             result = static_cast<RuntimeMenuViewActionType>(result | value);
    3927     }
    3928     /* Return result: */
    3929     return result;
    3930 }
    3931 
    3932 /* static */
    3933 RuntimeMenuDevicesActionType VBoxGlobal::restrictedRuntimeMenuDevicesActionTypes(CMachine &machine)
    3934 {
    3935     /* Prepare result: */
    3936     RuntimeMenuDevicesActionType result = RuntimeMenuDevicesActionType_Invalid;
    3937     /* Load restricted runtime-devices-menu action-types: */
    3938     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeDevicesMenuActions));
    3939     QStringList list = strList.split(',');
    3940     /* Convert list into appropriate values: */
    3941     foreach (const QString &strValue, list)
    3942     {
    3943         RuntimeMenuDevicesActionType value = gpConverter->fromInternalString<RuntimeMenuDevicesActionType>(strValue);
    3944         if (value != RuntimeMenuDevicesActionType_Invalid)
    3945             result = static_cast<RuntimeMenuDevicesActionType>(result | value);
    3946     }
    3947     /* Return result: */
    3948     return result;
    3949 }
    3950 
    3951 #ifdef VBOX_WITH_DEBUGGER_GUI
    3952 /* static */
    3953 RuntimeMenuDebuggerActionType VBoxGlobal::restrictedRuntimeMenuDebuggerActionTypes(CMachine &machine)
    3954 {
    3955     /* Prepare result: */
    3956     RuntimeMenuDebuggerActionType result = RuntimeMenuDebuggerActionType_Invalid;
    3957     /* Load restricted runtime-debugger-menu action-types: */
    3958     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeDebuggerMenuActions));
    3959     QStringList list = strList.split(',');
    3960     /* Convert list into appropriate values: */
    3961     foreach (const QString &strValue, list)
    3962     {
    3963         RuntimeMenuDebuggerActionType value = gpConverter->fromInternalString<RuntimeMenuDebuggerActionType>(strValue);
    3964         if (value != RuntimeMenuDebuggerActionType_Invalid)
    3965             result = static_cast<RuntimeMenuDebuggerActionType>(result | value);
    3966     }
    3967     /* Return result: */
    3968     return result;
    3969 }
    3970 #endif /* VBOX_WITH_DEBUGGER_GUI */
    3971 
    3972 /* static */
    3973 RuntimeMenuHelpActionType VBoxGlobal::restrictedRuntimeMenuHelpActionTypes(CMachine &machine)
    3974 {
    3975     /* Prepare result: */
    3976     RuntimeMenuHelpActionType result = RuntimeMenuHelpActionType_Invalid;
    3977     /* Load restricted runtime-help-menu action-types: */
    3978     QString strList(machine.GetExtraData(GUI_RestrictedRuntimeHelpMenuActions));
    3979     QStringList list = strList.split(',');
    3980     /* Convert list into appropriate values: */
    3981     foreach (const QString &strValue, list)
    3982     {
    3983         RuntimeMenuHelpActionType value = gpConverter->fromInternalString<RuntimeMenuHelpActionType>(strValue);
    3984         if (value != RuntimeMenuHelpActionType_Invalid)
    3985             result = static_cast<RuntimeMenuHelpActionType>(result | value);
    3986     }
    3987     /* Return result: */
    3988     return result;
    3989 }
    3990 
    3991 /* static */
    3992 UIVisualStateType VBoxGlobal::restrictedVisualStateTypes(CMachine &machine)
    3993 {
    3994     /* Prepare result: */
    3995     UIVisualStateType result = UIVisualStateType_Invalid;
    3996     /* Load restricted visual-state-types: */
    3997     QString strList(machine.GetExtraData(GUI_RestrictedVisualStates));
    3998     QStringList list = strList.split(',');
    3999     /* Convert list into appropriate values: */
    4000     foreach (const QString &strValue, list)
    4001     {
    4002         UIVisualStateType value = gpConverter->fromInternalString<UIVisualStateType>(strValue);
    4003         if (value != UIVisualStateType_Invalid)
    4004             result = static_cast<UIVisualStateType>(result | value);
    4005     }
    4006     /* Return result: */
    4007     return result;
    4008 }
    4009 
    4010 /* static */
    4011 QList<IndicatorType> VBoxGlobal::restrictedStatusBarIndicators(CMachine &machine)
    4012 {
    4013     /* Prepare result: */
    4014     QList<IndicatorType> result;
    4015     /* Load restricted status-bar-indicators: */
    4016     QString strList(machine.GetExtraData(GUI_RestrictedStatusBarIndicators));
    4017     QStringList list = strList.split(',');
    4018     /* Convert list into appropriate values: */
    4019     foreach (const QString &strValue, list)
    4020     {
    4021         IndicatorType value = gpConverter->fromInternalString<IndicatorType>(strValue);
    4022         if (value != IndicatorType_Invalid)
    4023             result << value;
    4024     }
    4025     /* Return result: */
    4026     return result;
    4027 }
    4028 
    4029 /** Returns merged restricted machine close actions for passed @a machine. */
    4030 MachineCloseAction VBoxGlobal::restrictedMachineCloseActions(CMachine &machine)
    4031 {
    4032     /* Prepare result: */
    4033     MachineCloseAction result = MachineCloseAction_Invalid;
    4034     /* Load restricted machine-close-actions: */
    4035     QString strList(machine.GetExtraData(GUI_RestrictedCloseActions));
    4036     QStringList list = strList.split(',');
    4037     /* Convert list into appropriate values: */
    4038     foreach (const QString &strValue, list)
    4039     {
    4040         MachineCloseAction value = gpConverter->fromInternalString<MachineCloseAction>(strValue);
    4041         if (value != MachineCloseAction_Invalid)
    4042             result = static_cast<MachineCloseAction>(result | value);
    4043     }
    4044     /* Return result: */
    4045     return result;
    4046 }
    4047 
    4048 /* static */
    4049 QList<GlobalSettingsPageType> VBoxGlobal::restrictedGlobalSettingsPages(CVirtualBox &vbox)
    4050 {
    4051     /* Prepare result: */
    4052     QList<GlobalSettingsPageType> result;
    4053     /* Load restricted global-settings-pages: */
    4054     QString strList(vbox.GetExtraData(GUI_RestrictedGlobalSettingsPages));
    4055     QStringList list = strList.split(',');
    4056     /* Convert list into appropriate values: */
    4057     foreach (const QString &strValue, list)
    4058     {
    4059         GlobalSettingsPageType value = gpConverter->fromInternalString<GlobalSettingsPageType>(strValue);
    4060         if (value != GlobalSettingsPageType_Invalid)
    4061             result << value;
    4062     }
    4063     /* Return result: */
    4064     return result;
    4065 }
    4066 
    4067 /* static */
    4068 QList<MachineSettingsPageType> VBoxGlobal::restrictedMachineSettingsPages(CMachine &machine)
    4069 {
    4070     /* Prepare result: */
    4071     QList<MachineSettingsPageType> result;
    4072     /* Load restricted machine-settings-pages: */
    4073     QString strList(machine.GetExtraData(GUI_RestrictedMachineSettingsPages));
    4074     QStringList list = strList.split(',');
    4075     /* Convert list into appropriate values: */
    4076     foreach (const QString &strValue, list)
    4077     {
    4078         MachineSettingsPageType value = gpConverter->fromInternalString<MachineSettingsPageType>(strValue);
    4079         if (value != MachineSettingsPageType_Invalid)
    4080             result << value;
    4081     }
    4082     /* Return result: */
    4083     return result;
    4084 }
    4085 
    4086 #ifndef Q_WS_MAC
    4087 /* static */
    4088 QStringList VBoxGlobal::machineWindowIconNames(CMachine &machine)
    4089 {
    4090     /* Return result: */
    4091     return machine.GetExtraDataStringList(GUI_MachineWindowIcons);
    4092 }
    4093 #endif /* !Q_WS_MAC */
    4094 
    4095 /* static */
    4096 GuruMeditationHandlerType VBoxGlobal::guruMeditationHandlerType(CMachine &machine)
    4097 {
    4098     /* Return result: */
    4099     return gpConverter->fromInternalString<GuruMeditationHandlerType>(machine.GetExtraData(GUI_GuruMeditationHandler));
    4100 }
    4101 
    41023696#ifdef RT_OS_LINUX
    41033697/* static */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r51021 r51054  
    366366    static QString fullMediumFormatName(const QString &strBaseMediumFormatName);
    367367
    368     /* Extra-data settings stuff: */
    369     static bool isApprovedByExtraData(CVirtualBox &vbox, const QString &strExtraDataKey);
    370     static bool isApprovedByExtraData(CMachine &machine, const QString &strExtraDataKey);
    371 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    372     static bool shouldWeAllowApplicationUpdate(CVirtualBox &vbox);
    373 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    374     static bool shouldWeShowMachine(CMachine &machine);
    375     static bool shouldWeAllowMachineReconfiguration(CMachine &machine,
    376                                                     bool fIncludingMachineGeneralCheck = false,
    377                                                     bool fIncludingMachineStateCheck = false);
    378     static bool shouldWeShowDetails(CMachine &machine,
    379                                     bool fIncludingMachineGeneralCheck = false);
    380     static bool shouldWeAutoMountGuestScreens(CMachine &machine, bool fIncludingSanityCheck = true);
    381     static bool shouldWeAllowSnapshotOperations(CMachine &machine, bool fIncludingSanityCheck = true);
    382     static MachineCloseAction defaultMachineCloseAction(CMachine &machine);
    383     static RuntimeMenuType restrictedRuntimeMenuTypes(CMachine &machine);
    384 #ifdef Q_WS_MAC
    385     static RuntimeMenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(CMachine &machine);
    386 #endif /* Q_WS_MAC */
    387     static RuntimeMenuMachineActionType restrictedRuntimeMenuMachineActionTypes(CMachine &machine);
    388     static RuntimeMenuViewActionType restrictedRuntimeMenuViewActionTypes(CMachine &machine);
    389     static RuntimeMenuDevicesActionType restrictedRuntimeMenuDevicesActionTypes(CMachine &machine);
    390 #ifdef VBOX_WITH_DEBUGGER_GUI
    391     static RuntimeMenuDebuggerActionType restrictedRuntimeMenuDebuggerActionTypes(CMachine &machine);
    392 #endif /* VBOX_WITH_DEBUGGER_GUI */
    393     static RuntimeMenuHelpActionType restrictedRuntimeMenuHelpActionTypes(CMachine &machine);
    394     static UIVisualStateType restrictedVisualStateTypes(CMachine &machine);
    395     static QList<IndicatorType> restrictedStatusBarIndicators(CMachine &machine);
    396     static MachineCloseAction restrictedMachineCloseActions(CMachine &machine);
    397     static QList<GlobalSettingsPageType> restrictedGlobalSettingsPages(CVirtualBox &vbox);
    398     static QList<MachineSettingsPageType> restrictedMachineSettingsPages(CMachine &machine);
    399 #ifndef Q_WS_MAC
    400     /** Loads redefined machine-window icon names. */
    401     static QStringList machineWindowIconNames(CMachine &machine);
    402 #endif /* !Q_WS_MAC */
    403     /** Loads redefined guru-meditation handler type. */
    404     static GuruMeditationHandlerType guruMeditationHandlerType(CMachine &machine);
    405368
    406369#ifdef RT_OS_LINUX
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp

    r50985 r51054  
    3030#include "UIConverter.h"
    3131#include "UIMessageCenter.h"
     32#include "UIExtraDataManager.h"
    3233
    3334/* COM includes: */
     
    276277
    277278                /* Finally, we are checking if current machine overrides this flag: */
    278                 if (m_fAttachedToHiddenMachinesOnly && vboxGlobal().shouldWeShowMachine(machine))
     279                if (m_fAttachedToHiddenMachinesOnly && gEDataManager->shouldWeShowMachine(strMachineID))
    279280                    m_fAttachedToHiddenMachinesOnly = false;
    280281
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r50978 r51054  
    3232#include "VBoxGlobal.h"
    3333#include "UIMessageCenter.h"
     34#include "UIExtraDataManager.h"
    3435#include "UIModalWindowManager.h"
    3536#include "VBoxUtils.h"
     
    459460#ifdef VBOX_WITH_UPDATE_REQUEST
    460461    /* Ask updater to check for the first time: */
    461     CVirtualBox vbox = vboxGlobal().virtualBox();
    462     if (VBoxGlobal::shouldWeAllowApplicationUpdate(vbox) &&
     462    if (gEDataManager->shouldWeAllowApplicationUpdate() &&
    463463        !vboxGlobal().isVMConsoleProcess())
    464464        QTimer::singleShot(0, this, SLOT(sltCheckIfUpdateIsNecessary()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r48950 r51054  
    2525#include "UIIndicatorsPool.h"
    2626#include "VBoxGlobal.h"
     27#include "UIExtraDataManager.h"
    2728#include "UIMachineDefs.h"
    2829#include "UIConverter.h"
     
    809810{
    810811    /* Get the list of restricted indicators: */
    811     CMachine machine = m_session.GetMachine();
    812     QList<IndicatorType> restrictedIndicators = vboxGlobal().restrictedStatusBarIndicators(machine);
     812    QList<IndicatorType> restrictedIndicators = gEDataManager->restrictedStatusBarIndicators(vboxGlobal().managedVMUuid());
    813813
    814814    /* Populate indicator-pool: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r50681 r51054  
    1818/* Local includes: */
    1919#include "VBoxGlobal.h"
     20#include "UIExtraDataManager.h"
    2021#include "UIMachine.h"
    2122#include "UISession.h"
     
    197198    /* Load machine settings: */
    198199    CMachine machine = uisession()->session().GetMachine();
    199     UIVisualStateType restrictedVisualStateTypes = VBoxGlobal::restrictedVisualStateTypes(machine);
     200    UIVisualStateType restrictedVisualStateTypes = gEDataManager->restrictedVisualStateTypes(vboxGlobal().managedVMUuid());
    200201    m_allowedVisualStateTypes = static_cast<UIVisualStateType>(UIVisualStateType_All ^ restrictedVisualStateTypes);
    201202
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r49698 r51054  
    3131#include "UISession.h"
    3232#include "UIMessageCenter.h"
     33#include "UIExtraDataManager.h"
    3334#include "VBoxGlobal.h"
    3435
     
    8081    CMachine machine = m_pMachineLogic->session().GetMachine();
    8182    CDisplay display = m_pMachineLogic->session().GetConsole().GetDisplay();
    82     bool fShouldWeAutoMountGuestScreens = VBoxGlobal::shouldWeAutoMountGuestScreens(machine, false);
     83    bool fShouldWeAutoMountGuestScreens = gEDataManager->shouldWeAutoMountGuestScreens(vboxGlobal().managedVMUuid());
    8384    LogRelFlow(("UIMultiScreenLayout::update: GUI/AutomountGuestScreens is %s.\n", fShouldWeAutoMountGuestScreens ? "enabled" : "disabled"));
    8485    QDesktopWidget *pDW = QApplication::desktop();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r51051 r51054  
    2626/* GUI includes: */
    2727#include "VBoxGlobal.h"
     28#include "UIExtraDataManager.h"
    2829#include "UISession.h"
    2930#include "UIMachine.h"
     
    10941095#ifdef Q_WS_MAC
    10951096        m_allowedActionsMenuApplication = (RuntimeMenuApplicationActionType)
    1096                                           (vboxGlobal().restrictedRuntimeMenuApplicationActionTypes(machine) ^
     1097                                          (gEDataManager->restrictedRuntimeMenuApplicationActionTypes(vboxGlobal().managedVMUuid()) ^
    10971098                                           RuntimeMenuApplicationActionType_All);
    10981099#endif /* Q_WS_MAC */
    10991100        m_allowedActionsMenuMachine     = (RuntimeMenuMachineActionType)
    1100                                           (vboxGlobal().restrictedRuntimeMenuMachineActionTypes(machine) ^
     1101                                          (gEDataManager->restrictedRuntimeMenuMachineActionTypes(vboxGlobal().managedVMUuid()) ^
    11011102                                           RuntimeMenuMachineActionType_All);
    11021103        m_allowedActionsMenuView        = (RuntimeMenuViewActionType)
    1103                                           (vboxGlobal().restrictedRuntimeMenuViewActionTypes(machine) ^
     1104                                          (gEDataManager->restrictedRuntimeMenuViewActionTypes(vboxGlobal().managedVMUuid()) ^
    11041105                                           RuntimeMenuViewActionType_All);
    11051106        m_allowedActionsMenuDevices     = (RuntimeMenuDevicesActionType)
    1106                                           (vboxGlobal().restrictedRuntimeMenuDevicesActionTypes(machine) ^
     1107                                          (gEDataManager->restrictedRuntimeMenuDevicesActionTypes(vboxGlobal().managedVMUuid()) ^
    11071108                                           RuntimeMenuDevicesActionType_All);
    11081109#ifdef VBOX_WITH_DEBUGGER_GUI
    11091110        m_allowedActionsMenuDebugger    = (RuntimeMenuDebuggerActionType)
    1110                                           (vboxGlobal().restrictedRuntimeMenuDebuggerActionTypes(machine) ^
     1111                                          (gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(vboxGlobal().managedVMUuid()) ^
    11111112                                           RuntimeMenuDebuggerActionType_All);
    11121113#endif /* VBOX_WITH_DEBUGGER_GUI */
    11131114        m_allowedActionsMenuHelp        = (RuntimeMenuHelpActionType)
    1114                                           (vboxGlobal().restrictedRuntimeMenuHelpActionTypes(machine) ^
     1115                                          (gEDataManager->restrictedRuntimeMenuHelpActionTypes(vboxGlobal().managedVMUuid()) ^
    11151116                                           RuntimeMenuHelpActionType_All);
    11161117
     
    11211122        /* Load/prepare user's machine-window icon: */
    11221123        QIcon icon;
    1123         foreach (const QString &strIconName, VBoxGlobal::machineWindowIconNames(machine))
     1124        foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(vboxGlobal().managedVMUuid()))
    11241125            if (!strIconName.isEmpty())
    11251126                icon.addFile(strIconName);
     
    11291130
    11301131        /* Determine Guru Meditation handler type: */
    1131         m_guruMeditationHandlerType = VBoxGlobal::guruMeditationHandlerType(machine);
     1132        m_guruMeditationHandlerType = gEDataManager->guruMeditationHandlerType(vboxGlobal().managedVMUuid());
    11321133
    11331134        /* Is there should be First RUN Wizard? */
     
    11471148
    11481149        /* Should we allow reconfiguration? */
    1149         m_fReconfigurable =  VBoxGlobal::shouldWeAllowMachineReconfiguration(machine);
     1150        m_fReconfigurable = gEDataManager->shouldWeAllowMachineReconfiguration(vboxGlobal().managedVMUuid());
    11501151        /* Should we allow snapshot operations? */
    1151         m_fSnapshotOperationsAllowed = vboxGlobal().shouldWeAllowSnapshotOperations(machine);
     1152        m_fSnapshotOperationsAllowed = gEDataManager->shouldWeAllowMachineSnapshotOperations(vboxGlobal().managedVMUuid());
    11521153
    11531154        /* What is the default close action and the restricted are? */
    1154         m_defaultCloseAction = vboxGlobal().defaultMachineCloseAction(machine);
    1155         m_restrictedCloseActions = vboxGlobal().restrictedMachineCloseActions(machine);
     1155        m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(vboxGlobal().managedVMUuid());
     1156        m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(vboxGlobal().managedVMUuid());
    11561157        m_fAllCloseActionsRestricted =  (m_restrictedCloseActions & MachineCloseAction_SaveState)
    11571158                                     && (m_restrictedCloseActions & MachineCloseAction_Shutdown)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r50916 r51054  
    2525/* GUI includes: */
    2626#include "VBoxGlobal.h"
     27#include "UIExtraDataManager.h"
    2728#include "UISession.h"
    2829#include "UIActionPoolRuntime.h"
     
    177178
    178179    /* Prepare menu: */
    179     CMachine machine = session().GetMachine();
    180     RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine);
     180    RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid());
    181181    RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus);
    182182    m_pMainMenu = uisession()->newMenu(allowedMenus);
     
    241241                                              fIsAutoHide);
    242242    QList<QMenu*> menus;
    243     RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(m);
     243    RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid());
    244244    RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus);
    245245    QList<QAction*> actions = uisession()->newMenu(allowedMenus)->actions();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r50631 r51054  
    2727/* GUI includes: */
    2828#include "VBoxGlobal.h"
     29#include "UIExtraDataManager.h"
    2930#include "UISession.h"
    3031#include "UIActionPoolRuntime.h"
     
    231232#ifndef Q_WS_MAC
    232233    /* Prepare application menu-bar: */
    233     CMachine machine = session().GetMachine();
    234     RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine);
     234    RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid());
    235235    RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus);
    236236    setMenuBar(uisession()->newMenuBar(allowedMenus));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r50796 r51054  
    2727/* GUI includes: */
    2828#include "VBoxGlobal.h"
     29#include "UIExtraDataManager.h"
    2930#include "UISession.h"
    3031#include "UIMachineLogic.h"
     
    7273
    7374    /* Prepare menu: */
    74     CMachine machine = session().GetMachine();
    75     RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine);
     75    RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid());
    7676    RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus);
    7777    m_pMainMenu = uisession()->newMenu(allowedMenus);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r50916 r51054  
    2525/* GUI includes: */
    2626#include "VBoxGlobal.h"
     27#include "UIExtraDataManager.h"
    2728#include "UISession.h"
    2829#include "UIActionPoolRuntime.h"
     
    8384
    8485    /* Prepare menu: */
    85     CMachine machine = session().GetMachine();
    86     RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine);
     86    RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid());
    8787    RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus);
    8888    m_pMainMenu = uisession()->newMenu(allowedMenus);
     
    147147    m_pMiniToolBar->show();
    148148    QList<QMenu*> menus;
    149     RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(m);
     149    RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid());
    150150    RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus);
    151151    QList<QAction*> actions = uisession()->newMenu(allowedMenus)->actions();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r50968 r51054  
    6161#include "UIGDetails.h"
    6262#include "UIVMItem.h"
     63#include "UIExtraDataManager.h"
    6364#include "VBoxGlobal.h"
    6465
     
    13341335    pMenu->addAction(m_pNetworkAccessManager);
    13351336    m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_CheckForUpdates);
    1336     CVirtualBox vbox = vboxGlobal().virtualBox();
    1337     if (VBoxGlobal::shouldWeAllowApplicationUpdate(vbox))
     1337    if (gEDataManager->shouldWeAllowApplicationUpdate())
    13381338        pMenu->addAction(m_pUpdateAction);
    13391339    else
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp

    r50934 r51054  
    3030#include "VBoxGlobal.h"
    3131#include "UIConverter.h"
     32#include "UIExtraDataManager.h"
    3233#ifdef Q_WS_MAC
    3334# include <ApplicationServices/ApplicationServices.h>
     
    261262        /* Also take restrictions into account: */
    262263        if (   m_configurationAccessLevel != ConfigurationAccessLevel_Null
    263             && !VBoxGlobal::shouldWeAllowMachineReconfiguration(m_machine))
     264            && !gEDataManager->shouldWeAllowMachineReconfiguration(m_strId))
    264265            m_configurationAccessLevel = ConfigurationAccessLevel_Null;
    265266
    266267        /* Should we show details for this item? */
    267         m_fHasDetails = VBoxGlobal::shouldWeShowDetails(m_machine);
     268        m_fHasDetails = gEDataManager->shouldWeShowMachineDetails(m_strId);
    268269    }
    269270    else
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r49687 r51054  
    4242#include "UIConverter.h"
    4343#include "UIModalWindowManager.h"
     44#include "UIExtraDataManager.h"
    4445
    4546/* COM includes: */
     
    449450        mMachineId = aMachine.GetId();
    450451        mSessionState = aMachine.GetSessionState();
    451         m_fShapshotOperationsAllowed = vboxGlobal().shouldWeAllowSnapshotOperations(mMachine);
     452        m_fShapshotOperationsAllowed = gEDataManager->shouldWeAllowMachineSnapshotOperations(mMachineId);
    452453    }
    453454
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r49851 r51054  
    3636#include "VBoxGlobal.h"
    3737#include "UIMessageCenter.h"
     38#include "UIExtraDataManager.h"
    3839#include "UIActionPoolSelector.h"
    3940#include "UIGChooserHandlerMouse.h"
     
    597598        CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);
    598599        /* Should we show this machine? */
    599         if (VBoxGlobal::shouldWeShowMachine(machine))
     600        if (gEDataManager->shouldWeShowMachine(strId))
    600601        {
    601602            /* Add new machine-item: */
     
    883884    /* Show machine if we should: */
    884885    CMachine machine = vboxGlobal().virtualBox().FindMachine(strId);
    885     if (VBoxGlobal::shouldWeShowMachine(machine))
     886    if (gEDataManager->shouldWeShowMachine(strId))
    886887        addMachineIntoTheTree(machine);
    887888
     
    16111612    LogRelFlow(("UIGChooserModel: Loading VMs...\n"));
    16121613    foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines())
    1613         if (VBoxGlobal::shouldWeShowMachine(machine))
     1614        if (gEDataManager->shouldWeShowMachine(machine.GetId()))
    16141615            addMachineIntoTheTree(machine);
    16151616    LogRelFlow(("UIGChooserModel: VMs loaded.\n"));
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r50906 r51054  
    3030#include "VBoxGlobal.h"
    3131#include "UIMessageCenter.h"
     32#include "UIExtraDataManager.h"
    3233#include "QIWidgetValidator.h"
    3334#include "VBoxSettingsSelector.h"
     
    324325
    325326    /* Creating settings pages: */
    326     CVirtualBox vbox = vboxGlobal().virtualBox();
    327     QList<GlobalSettingsPageType> restrictedGlobalSettingsPages = vboxGlobal().restrictedGlobalSettingsPages(vbox);
     327    QList<GlobalSettingsPageType> restrictedGlobalSettingsPages = gEDataManager->restrictedGlobalSettingsPages();
    328328    for (int iPageIndex = GlobalSettingsPageType_General; iPageIndex < GlobalSettingsPageType_Max; ++iPageIndex)
    329329    {
     
    564564
    565565    /* Creating settings pages: */
    566     QList<MachineSettingsPageType> restrictedMachineSettingsPages = vboxGlobal().restrictedMachineSettingsPages(m_machine);
     566    QList<MachineSettingsPageType> restrictedMachineSettingsPages = gEDataManager->restrictedMachineSettingsPages(m_strMachineId);
    567567    for (int iPageIndex = MachineSettingsPageType_General; iPageIndex < MachineSettingsPageType_Max; ++iPageIndex)
    568568    {
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