Changeset 51054 in vbox
- Timestamp:
- Apr 11, 2014 4:51:13 PM (11 years ago)
- 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 25 25 #include "VBoxGlobalSettings.h" 26 26 #include "UIActionPool.h" 27 #include "UIConverter.h" 27 28 28 29 /* COM includes: */ … … 196 197 } 197 198 199 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 200 bool 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 207 bool UIExtraDataManager::shouldWeShowMachine(const QString &strID) const 208 { 209 /* Show unless 'forbidden' flag is set: */ 210 return !isFeatureAllowed(GUI_HideFromManager, strID); 211 } 212 213 bool UIExtraDataManager::shouldWeShowMachineDetails(const QString &strID) const 214 { 215 /* Show unless 'forbidden' flag is set: */ 216 return !isFeatureAllowed(GUI_HideDetails, strID); 217 } 218 219 bool UIExtraDataManager::shouldWeAllowMachineReconfiguration(const QString &strID) const 220 { 221 /* Show unless 'forbidden' flag is set: */ 222 return !isFeatureAllowed(GUI_PreventReconfiguration, strID); 223 } 224 225 bool UIExtraDataManager::shouldWeAllowMachineSnapshotOperations(const QString &strID) const 226 { 227 /* Show unless 'forbidden' flag is set: */ 228 return !isFeatureAllowed(GUI_PreventSnapshotOperations, strID); 229 } 230 231 bool UIExtraDataManager::shouldWeAutoMountGuestScreens(const QString &strID) const 232 { 233 /* Show only if 'allowed' flag is set: */ 234 return isFeatureAllowed(GUI_AutomountGuestScreens, strID); 235 } 236 237 RuntimeMenuType 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 253 RuntimeMenuApplicationActionType 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 269 RuntimeMenuMachineActionType 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 284 RuntimeMenuViewActionType 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 299 RuntimeMenuDevicesActionType 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 315 RuntimeMenuDebuggerActionType 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 331 RuntimeMenuHelpActionType 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 346 UIVisualStateType 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 361 MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QString &strID) const 362 { 363 return gpConverter->fromInternalString<MachineCloseAction>(extraDataString(GUI_DefaultCloseAction, strID)); 364 } 365 366 MachineCloseAction 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 381 QList<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 396 QList<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 411 QList<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 427 QStringList UIExtraDataManager::machineWindowIconNames(const QString &strID) const 428 { 429 return extraDataStringList(GUI_MachineWindowIcons, strID); 430 } 431 #endif /* !Q_WS_MAC */ 432 433 GuruMeditationHandlerType UIExtraDataManager::guruMeditationHandlerType(const QString &strID) const 434 { 435 return gpConverter->fromInternalString<GuruMeditationHandlerType>(extraDataString(GUI_GuruMeditationHandler, strID)); 436 } 437 198 438 UIExtraDataManager::UIExtraDataManager() 199 439 : m_pHandler(new UIExtraDataEventHandler(this)) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51053 r51054 21 21 #include <QObject> 22 22 #include <QMap> 23 24 /* GUI includes: */ 25 #include "UIDefs.h" 23 26 24 27 /* COM includes: */ … … 64 67 /** Static Extra-data Manager destructor. */ 65 68 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; 66 130 67 131 private: -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r51038 r51054 3694 3694 } 3695 3695 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) == 03708 || strExtraDataValue.compare("yes", Qt::CaseInsensitive) == 03709 || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 03710 || 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) == 03725 || strExtraDataValue.compare("yes", Qt::CaseInsensitive) == 03726 || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 03727 || strExtraDataValue == "1";3728 }3729 3730 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER3731 /* 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_MAC3874 /* 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_GUI3952 /* 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_MAC4087 /* 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 4102 3696 #ifdef RT_OS_LINUX 4103 3697 /* static */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r51021 r51054 366 366 static QString fullMediumFormatName(const QString &strBaseMediumFormatName); 367 367 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_MANAGER372 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_MAC385 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_GUI391 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_MAC400 /** 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);405 368 406 369 #ifdef RT_OS_LINUX -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
r50985 r51054 30 30 #include "UIConverter.h" 31 31 #include "UIMessageCenter.h" 32 #include "UIExtraDataManager.h" 32 33 33 34 /* COM includes: */ … … 276 277 277 278 /* Finally, we are checking if current machine overrides this flag: */ 278 if (m_fAttachedToHiddenMachinesOnly && vboxGlobal().shouldWeShowMachine(machine))279 if (m_fAttachedToHiddenMachinesOnly && gEDataManager->shouldWeShowMachine(strMachineID)) 279 280 m_fAttachedToHiddenMachinesOnly = false; 280 281 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r50978 r51054 32 32 #include "VBoxGlobal.h" 33 33 #include "UIMessageCenter.h" 34 #include "UIExtraDataManager.h" 34 35 #include "UIModalWindowManager.h" 35 36 #include "VBoxUtils.h" … … 459 460 #ifdef VBOX_WITH_UPDATE_REQUEST 460 461 /* Ask updater to check for the first time: */ 461 CVirtualBox vbox = vboxGlobal().virtualBox(); 462 if (VBoxGlobal::shouldWeAllowApplicationUpdate(vbox) && 462 if (gEDataManager->shouldWeAllowApplicationUpdate() && 463 463 !vboxGlobal().isVMConsoleProcess()) 464 464 QTimer::singleShot(0, this, SLOT(sltCheckIfUpdateIsNecessary())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r48950 r51054 25 25 #include "UIIndicatorsPool.h" 26 26 #include "VBoxGlobal.h" 27 #include "UIExtraDataManager.h" 27 28 #include "UIMachineDefs.h" 28 29 #include "UIConverter.h" … … 809 810 { 810 811 /* 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()); 813 813 814 814 /* Populate indicator-pool: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r50681 r51054 18 18 /* Local includes: */ 19 19 #include "VBoxGlobal.h" 20 #include "UIExtraDataManager.h" 20 21 #include "UIMachine.h" 21 22 #include "UISession.h" … … 197 198 /* Load machine settings: */ 198 199 CMachine machine = uisession()->session().GetMachine(); 199 UIVisualStateType restrictedVisualStateTypes = VBoxGlobal::restrictedVisualStateTypes(machine);200 UIVisualStateType restrictedVisualStateTypes = gEDataManager->restrictedVisualStateTypes(vboxGlobal().managedVMUuid()); 200 201 m_allowedVisualStateTypes = static_cast<UIVisualStateType>(UIVisualStateType_All ^ restrictedVisualStateTypes); 201 202 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r49698 r51054 31 31 #include "UISession.h" 32 32 #include "UIMessageCenter.h" 33 #include "UIExtraDataManager.h" 33 34 #include "VBoxGlobal.h" 34 35 … … 80 81 CMachine machine = m_pMachineLogic->session().GetMachine(); 81 82 CDisplay display = m_pMachineLogic->session().GetConsole().GetDisplay(); 82 bool fShouldWeAutoMountGuestScreens = VBoxGlobal::shouldWeAutoMountGuestScreens(machine, false);83 bool fShouldWeAutoMountGuestScreens = gEDataManager->shouldWeAutoMountGuestScreens(vboxGlobal().managedVMUuid()); 83 84 LogRelFlow(("UIMultiScreenLayout::update: GUI/AutomountGuestScreens is %s.\n", fShouldWeAutoMountGuestScreens ? "enabled" : "disabled")); 84 85 QDesktopWidget *pDW = QApplication::desktop(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r51051 r51054 26 26 /* GUI includes: */ 27 27 #include "VBoxGlobal.h" 28 #include "UIExtraDataManager.h" 28 29 #include "UISession.h" 29 30 #include "UIMachine.h" … … 1094 1095 #ifdef Q_WS_MAC 1095 1096 m_allowedActionsMenuApplication = (RuntimeMenuApplicationActionType) 1096 ( vboxGlobal().restrictedRuntimeMenuApplicationActionTypes(machine) ^1097 (gEDataManager->restrictedRuntimeMenuApplicationActionTypes(vboxGlobal().managedVMUuid()) ^ 1097 1098 RuntimeMenuApplicationActionType_All); 1098 1099 #endif /* Q_WS_MAC */ 1099 1100 m_allowedActionsMenuMachine = (RuntimeMenuMachineActionType) 1100 ( vboxGlobal().restrictedRuntimeMenuMachineActionTypes(machine) ^1101 (gEDataManager->restrictedRuntimeMenuMachineActionTypes(vboxGlobal().managedVMUuid()) ^ 1101 1102 RuntimeMenuMachineActionType_All); 1102 1103 m_allowedActionsMenuView = (RuntimeMenuViewActionType) 1103 ( vboxGlobal().restrictedRuntimeMenuViewActionTypes(machine) ^1104 (gEDataManager->restrictedRuntimeMenuViewActionTypes(vboxGlobal().managedVMUuid()) ^ 1104 1105 RuntimeMenuViewActionType_All); 1105 1106 m_allowedActionsMenuDevices = (RuntimeMenuDevicesActionType) 1106 ( vboxGlobal().restrictedRuntimeMenuDevicesActionTypes(machine) ^1107 (gEDataManager->restrictedRuntimeMenuDevicesActionTypes(vboxGlobal().managedVMUuid()) ^ 1107 1108 RuntimeMenuDevicesActionType_All); 1108 1109 #ifdef VBOX_WITH_DEBUGGER_GUI 1109 1110 m_allowedActionsMenuDebugger = (RuntimeMenuDebuggerActionType) 1110 ( vboxGlobal().restrictedRuntimeMenuDebuggerActionTypes(machine) ^1111 (gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(vboxGlobal().managedVMUuid()) ^ 1111 1112 RuntimeMenuDebuggerActionType_All); 1112 1113 #endif /* VBOX_WITH_DEBUGGER_GUI */ 1113 1114 m_allowedActionsMenuHelp = (RuntimeMenuHelpActionType) 1114 ( vboxGlobal().restrictedRuntimeMenuHelpActionTypes(machine) ^1115 (gEDataManager->restrictedRuntimeMenuHelpActionTypes(vboxGlobal().managedVMUuid()) ^ 1115 1116 RuntimeMenuHelpActionType_All); 1116 1117 … … 1121 1122 /* Load/prepare user's machine-window icon: */ 1122 1123 QIcon icon; 1123 foreach (const QString &strIconName, VBoxGlobal::machineWindowIconNames(machine))1124 foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(vboxGlobal().managedVMUuid())) 1124 1125 if (!strIconName.isEmpty()) 1125 1126 icon.addFile(strIconName); … … 1129 1130 1130 1131 /* Determine Guru Meditation handler type: */ 1131 m_guruMeditationHandlerType = VBoxGlobal::guruMeditationHandlerType(machine);1132 m_guruMeditationHandlerType = gEDataManager->guruMeditationHandlerType(vboxGlobal().managedVMUuid()); 1132 1133 1133 1134 /* Is there should be First RUN Wizard? */ … … 1147 1148 1148 1149 /* Should we allow reconfiguration? */ 1149 m_fReconfigurable = VBoxGlobal::shouldWeAllowMachineReconfiguration(machine);1150 m_fReconfigurable = gEDataManager->shouldWeAllowMachineReconfiguration(vboxGlobal().managedVMUuid()); 1150 1151 /* Should we allow snapshot operations? */ 1151 m_fSnapshotOperationsAllowed = vboxGlobal().shouldWeAllowSnapshotOperations(machine);1152 m_fSnapshotOperationsAllowed = gEDataManager->shouldWeAllowMachineSnapshotOperations(vboxGlobal().managedVMUuid()); 1152 1153 1153 1154 /* 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()); 1156 1157 m_fAllCloseActionsRestricted = (m_restrictedCloseActions & MachineCloseAction_SaveState) 1157 1158 && (m_restrictedCloseActions & MachineCloseAction_Shutdown) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r50916 r51054 25 25 /* GUI includes: */ 26 26 #include "VBoxGlobal.h" 27 #include "UIExtraDataManager.h" 27 28 #include "UISession.h" 28 29 #include "UIActionPoolRuntime.h" … … 177 178 178 179 /* Prepare menu: */ 179 CMachine machine = session().GetMachine(); 180 RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine); 180 RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid()); 181 181 RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus); 182 182 m_pMainMenu = uisession()->newMenu(allowedMenus); … … 241 241 fIsAutoHide); 242 242 QList<QMenu*> menus; 243 RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(m);243 RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid()); 244 244 RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus); 245 245 QList<QAction*> actions = uisession()->newMenu(allowedMenus)->actions(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r50631 r51054 27 27 /* GUI includes: */ 28 28 #include "VBoxGlobal.h" 29 #include "UIExtraDataManager.h" 29 30 #include "UISession.h" 30 31 #include "UIActionPoolRuntime.h" … … 231 232 #ifndef Q_WS_MAC 232 233 /* Prepare application menu-bar: */ 233 CMachine machine = session().GetMachine(); 234 RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine); 234 RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid()); 235 235 RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus); 236 236 setMenuBar(uisession()->newMenuBar(allowedMenus)); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
r50796 r51054 27 27 /* GUI includes: */ 28 28 #include "VBoxGlobal.h" 29 #include "UIExtraDataManager.h" 29 30 #include "UISession.h" 30 31 #include "UIMachineLogic.h" … … 72 73 73 74 /* Prepare menu: */ 74 CMachine machine = session().GetMachine(); 75 RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine); 75 RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid()); 76 76 RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus); 77 77 m_pMainMenu = uisession()->newMenu(allowedMenus); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r50916 r51054 25 25 /* GUI includes: */ 26 26 #include "VBoxGlobal.h" 27 #include "UIExtraDataManager.h" 27 28 #include "UISession.h" 28 29 #include "UIActionPoolRuntime.h" … … 83 84 84 85 /* Prepare menu: */ 85 CMachine machine = session().GetMachine(); 86 RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(machine); 86 RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid()); 87 87 RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus); 88 88 m_pMainMenu = uisession()->newMenu(allowedMenus); … … 147 147 m_pMiniToolBar->show(); 148 148 QList<QMenu*> menus; 149 RuntimeMenuType restrictedMenus = VBoxGlobal::restrictedRuntimeMenuTypes(m);149 RuntimeMenuType restrictedMenus = gEDataManager->restrictedRuntimeMenuTypes(vboxGlobal().managedVMUuid()); 150 150 RuntimeMenuType allowedMenus = static_cast<RuntimeMenuType>(RuntimeMenuType_All ^ restrictedMenus); 151 151 QList<QAction*> actions = uisession()->newMenu(allowedMenus)->actions(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r50968 r51054 61 61 #include "UIGDetails.h" 62 62 #include "UIVMItem.h" 63 #include "UIExtraDataManager.h" 63 64 #include "VBoxGlobal.h" 64 65 … … 1334 1335 pMenu->addAction(m_pNetworkAccessManager); 1335 1336 m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_CheckForUpdates); 1336 CVirtualBox vbox = vboxGlobal().virtualBox(); 1337 if (VBoxGlobal::shouldWeAllowApplicationUpdate(vbox)) 1337 if (gEDataManager->shouldWeAllowApplicationUpdate()) 1338 1338 pMenu->addAction(m_pUpdateAction); 1339 1339 else -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp
r50934 r51054 30 30 #include "VBoxGlobal.h" 31 31 #include "UIConverter.h" 32 #include "UIExtraDataManager.h" 32 33 #ifdef Q_WS_MAC 33 34 # include <ApplicationServices/ApplicationServices.h> … … 261 262 /* Also take restrictions into account: */ 262 263 if ( m_configurationAccessLevel != ConfigurationAccessLevel_Null 263 && ! VBoxGlobal::shouldWeAllowMachineReconfiguration(m_machine))264 && !gEDataManager->shouldWeAllowMachineReconfiguration(m_strId)) 264 265 m_configurationAccessLevel = ConfigurationAccessLevel_Null; 265 266 266 267 /* Should we show details for this item? */ 267 m_fHasDetails = VBoxGlobal::shouldWeShowDetails(m_machine);268 m_fHasDetails = gEDataManager->shouldWeShowMachineDetails(m_strId); 268 269 } 269 270 else -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r49687 r51054 42 42 #include "UIConverter.h" 43 43 #include "UIModalWindowManager.h" 44 #include "UIExtraDataManager.h" 44 45 45 46 /* COM includes: */ … … 449 450 mMachineId = aMachine.GetId(); 450 451 mSessionState = aMachine.GetSessionState(); 451 m_fShapshotOperationsAllowed = vboxGlobal().shouldWeAllowSnapshotOperations(mMachine);452 m_fShapshotOperationsAllowed = gEDataManager->shouldWeAllowMachineSnapshotOperations(mMachineId); 452 453 } 453 454 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r49851 r51054 36 36 #include "VBoxGlobal.h" 37 37 #include "UIMessageCenter.h" 38 #include "UIExtraDataManager.h" 38 39 #include "UIActionPoolSelector.h" 39 40 #include "UIGChooserHandlerMouse.h" … … 597 598 CMachine machine = vboxGlobal().virtualBox().FindMachine(strId); 598 599 /* Should we show this machine? */ 599 if ( VBoxGlobal::shouldWeShowMachine(machine))600 if (gEDataManager->shouldWeShowMachine(strId)) 600 601 { 601 602 /* Add new machine-item: */ … … 883 884 /* Show machine if we should: */ 884 885 CMachine machine = vboxGlobal().virtualBox().FindMachine(strId); 885 if ( VBoxGlobal::shouldWeShowMachine(machine))886 if (gEDataManager->shouldWeShowMachine(strId)) 886 887 addMachineIntoTheTree(machine); 887 888 … … 1611 1612 LogRelFlow(("UIGChooserModel: Loading VMs...\n")); 1612 1613 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1613 if ( VBoxGlobal::shouldWeShowMachine(machine))1614 if (gEDataManager->shouldWeShowMachine(machine.GetId())) 1614 1615 addMachineIntoTheTree(machine); 1615 1616 LogRelFlow(("UIGChooserModel: VMs loaded.\n")); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r50906 r51054 30 30 #include "VBoxGlobal.h" 31 31 #include "UIMessageCenter.h" 32 #include "UIExtraDataManager.h" 32 33 #include "QIWidgetValidator.h" 33 34 #include "VBoxSettingsSelector.h" … … 324 325 325 326 /* Creating settings pages: */ 326 CVirtualBox vbox = vboxGlobal().virtualBox(); 327 QList<GlobalSettingsPageType> restrictedGlobalSettingsPages = vboxGlobal().restrictedGlobalSettingsPages(vbox); 327 QList<GlobalSettingsPageType> restrictedGlobalSettingsPages = gEDataManager->restrictedGlobalSettingsPages(); 328 328 for (int iPageIndex = GlobalSettingsPageType_General; iPageIndex < GlobalSettingsPageType_Max; ++iPageIndex) 329 329 { … … 564 564 565 565 /* Creating settings pages: */ 566 QList<MachineSettingsPageType> restrictedMachineSettingsPages = vboxGlobal().restrictedMachineSettingsPages(m_machine);566 QList<MachineSettingsPageType> restrictedMachineSettingsPages = gEDataManager->restrictedMachineSettingsPages(m_strMachineId); 567 567 for (int iPageIndex = MachineSettingsPageType_General; iPageIndex < MachineSettingsPageType_Max; ++iPageIndex) 568 568 {
Note:
See TracChangeset
for help on using the changeset viewer.