Changeset 98999 in vbox
- Timestamp:
- Mar 16, 2023 10:40:45 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156349
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r98335 r98999 92 92 template<> SHARED_LIBRARY_STUFF bool canConvert<SizeSuffix>(); 93 93 template<> SHARED_LIBRARY_STUFF bool canConvert<StorageSlot>(); 94 template<> SHARED_LIBRARY_STUFF bool canConvert<DesktopWatchdogPolicy_SynthTest>(); 94 95 template<> SHARED_LIBRARY_STUFF bool canConvert<UIExtraDataMetaDefs::DialogType>(); 95 96 template<> SHARED_LIBRARY_STUFF bool canConvert<UIExtraDataMetaDefs::MenuType>(); … … 183 184 template<> SHARED_LIBRARY_STUFF QString toString(const StorageSlot &storageSlot); 184 185 template<> SHARED_LIBRARY_STUFF StorageSlot fromString<StorageSlot>(const QString &strStorageSlot); 186 template<> SHARED_LIBRARY_STUFF DesktopWatchdogPolicy_SynthTest fromInternalString<DesktopWatchdogPolicy_SynthTest>(const QString &strPolicyType); 185 187 template<> SHARED_LIBRARY_STUFF QString toInternalString(const UIExtraDataMetaDefs::DialogType &enmDialogType); 186 188 template<> SHARED_LIBRARY_STUFF UIExtraDataMetaDefs::DialogType fromInternalString<UIExtraDataMetaDefs::DialogType>(const QString &strDialogType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r98524 r98999 47 47 template<> bool canConvert<SizeSuffix>() { return true; } 48 48 template<> bool canConvert<StorageSlot>() { return true; } 49 template<> bool canConvert<DesktopWatchdogPolicy_SynthTest>() { return true; } 49 50 template<> bool canConvert<UIExtraDataMetaDefs::DialogType>() { return true; } 50 51 template<> bool canConvert<UIExtraDataMetaDefs::MenuType>() { return true; } … … 453 454 } 454 455 456 /* DesktopWatchdogPolicy_SynthTest <= QString: */ 457 template<> DesktopWatchdogPolicy_SynthTest fromInternalString<DesktopWatchdogPolicy_SynthTest>(const QString &strPolicyType) 458 { 459 if (strPolicyType.compare("Disabled", Qt::CaseInsensitive) == 0) 460 return DesktopWatchdogPolicy_SynthTest_Disabled; 461 if (strPolicyType.compare("ManagerOnly", Qt::CaseInsensitive) == 0) 462 return DesktopWatchdogPolicy_SynthTest_ManagerOnly; 463 if (strPolicyType.compare("MachineOnly", Qt::CaseInsensitive) == 0) 464 return DesktopWatchdogPolicy_SynthTest_MachineOnly; 465 if (strPolicyType.compare("Both", Qt::CaseInsensitive) == 0) 466 return DesktopWatchdogPolicy_SynthTest_Both; 467 return DesktopWatchdogPolicy_SynthTest_Both; 468 } 469 455 470 /* QString <= UIExtraDataMetaDefs::DialogType: */ 456 471 template<> QString toInternalString(const UIExtraDataMetaDefs::DialogType &enmDialogType) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r98103 r98999 38 38 QStringList UIDefs::VBoxExtPackFileExts = QStringList() << "vbox-extpack"; 39 39 QStringList UIDefs::OVFFileExts = QStringList() << "ovf" << "ova"; 40 41 /** Environment variable names: */ 42 const char *UIDefs::VBox_DesktopWatchdogPolicy_SynthTest = "VBOX_DESKTOPWATCHDOGPOLICY_SYNTHTEST"; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r98885 r98999 94 94 /** Allowed OVF file extensions. */ 95 95 SHARED_LIBRARY_STUFF extern QStringList OVFFileExts; 96 97 /** Holds environment variable name for Desktop Watchdog / Synthetic Test policy type. */ 98 SHARED_LIBRARY_STUFF extern const char *VBox_DesktopWatchdogPolicy_SynthTest; 96 99 } 97 100 using namespace UIDefs /* if header included */; … … 154 157 155 158 159 /** Desktop Watchdog / Synthetic Test policy type. */ 160 enum DesktopWatchdogPolicy_SynthTest 161 { 162 DesktopWatchdogPolicy_SynthTest_Disabled, 163 DesktopWatchdogPolicy_SynthTest_ManagerOnly, 164 DesktopWatchdogPolicy_SynthTest_MachineOnly, 165 DesktopWatchdogPolicy_SynthTest_Both 166 }; 167 Q_DECLARE_METATYPE(DesktopWatchdogPolicy_SynthTest); 168 169 156 170 #endif /* !FEQT_INCLUDED_SRC_globals_UIDefs_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
r98103 r98999 51 51 # include "UICommon.h" 52 52 # include "VBoxUtils-x11.h" 53 # ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1 54 # include "UIConverter.h" 55 # endif 53 56 #endif 54 57 … … 284 287 285 288 UIDesktopWidgetWatchdog::UIDesktopWidgetWatchdog() 289 #if defined(VBOX_WS_X11) && !defined(VBOX_GUI_WITH_CUSTOMIZATIONS1) 290 : m_enmSynthTestPolicy(DesktopWatchdogPolicy_SynthTest_Both) 291 #endif 286 292 { 287 293 /* Initialize instance: */ … … 996 1002 997 1003 #if defined(VBOX_WS_X11) && !defined(VBOX_GUI_WITH_CUSTOMIZATIONS1) 1004 /* Load Synthetic Test policy: */ 1005 const QString strSynthTestPolicy = qEnvironmentVariable(VBox_DesktopWatchdogPolicy_SynthTest); 1006 m_enmSynthTestPolicy = gpConverter->fromInternalString<DesktopWatchdogPolicy_SynthTest>(strSynthTestPolicy); 1007 998 1008 /* Update host-screen configuration: */ 999 1009 updateHostScreenConfiguration(); … … 1051 1061 1052 1062 #if defined(VBOX_WS_X11) && !defined(VBOX_GUI_WITH_CUSTOMIZATIONS1) 1063 bool UIDesktopWidgetWatchdog::isSynchTestRestricted() const 1064 { 1065 return m_enmSynthTestPolicy == DesktopWatchdogPolicy_SynthTest_Disabled 1066 || ( m_enmSynthTestPolicy == DesktopWatchdogPolicy_SynthTest_ManagerOnly 1067 && uiCommon().uiType() == UICommon::UIType_RuntimeUI) 1068 || ( m_enmSynthTestPolicy == DesktopWatchdogPolicy_SynthTest_MachineOnly 1069 && uiCommon().uiType() == UICommon::UIType_SelectorUI); 1070 } 1071 1053 1072 void UIDesktopWidgetWatchdog::updateHostScreenConfiguration(int cHostScreenCount /* = -1 */) 1054 1073 { 1074 /* Check the policy: */ 1075 if (isSynchTestRestricted()) 1076 return; 1077 1055 1078 /* Acquire new host-screen count: */ 1056 1079 if (cHostScreenCount == -1) … … 1071 1094 void UIDesktopWidgetWatchdog::updateHostScreenAvailableGeometry(int iHostScreenIndex) 1072 1095 { 1096 /* Check the policy: */ 1097 if (isSynchTestRestricted()) 1098 return; 1099 1073 1100 /* Make sure index is valid: */ 1074 1101 if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount()) … … 1103 1130 void UIDesktopWidgetWatchdog::cleanupExistingWorkers() 1104 1131 { 1132 /* Check the policy: */ 1133 if (isSynchTestRestricted()) 1134 return; 1135 1105 1136 /* Destroy existing workers: */ 1106 1137 qDeleteAll(m_availableGeometryWorkers); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h
r98103 r98999 42 42 /* GUI includes: */ 43 43 #include "UILibraryDefs.h" 44 #if defined(VBOX_WS_X11) && !defined(VBOX_GUI_WITH_CUSTOMIZATIONS1) 45 # include "UIDefs.h" 46 #endif 44 47 45 48 /* Forward declarations: */ … … 194 197 195 198 #if defined(VBOX_WS_X11) && !defined(VBOX_GUI_WITH_CUSTOMIZATIONS1) 199 /** Returns whether Synthetic Test is restricted according to cached policy. */ 200 bool isSynchTestRestricted() const; 201 196 202 /** Updates host-screen configuration according to new @a cHostScreenCount. 197 203 * @note If cHostScreenCount is equal to -1 we have to acquire it ourselves. */ … … 203 209 /** Cleanups existing workers. */ 204 210 void cleanupExistingWorkers(); 211 212 /** Holds the cached Synthetic Test policy. */ 213 DesktopWatchdogPolicy_SynthTest m_enmSynthTestPolicy; 205 214 206 215 /** Holds current host-screen available-geometries. */
Note:
See TracChangeset
for help on using the changeset viewer.