- Timestamp:
- Apr 29, 2022 9:40:45 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151139
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r93901 r94757 692 692 UIErrorString::formatErrorInfo(machine)); 693 693 return false; 694 } 695 696 void UIMessageCenter::cannotSetHostSettings(const CHost &comHost, QWidget *pParent /* = 0 */) const 697 { 698 error(pParent, MessageType_Critical, 699 tr("Failed to set global host settings."), 700 UIErrorString::formatErrorInfo(comHost)); 694 701 } 695 702 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r93901 r94757 283 283 bool fMount, bool fRetry, QWidget *pParent = 0) const; 284 284 285 void cannotSetHostSettings(const CHost &comHost, QWidget *pParent = 0) const; 285 286 void cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent = 0) const; 286 287 void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r93115 r94757 124 124 void UISettingsDialogGlobal::loadOwnData() 125 125 { 126 /* Get properties: */ 126 /* Get host & properties: */ 127 CHost comHost = uiCommon().host(); 127 128 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties(); 128 129 /* Prepare global data: */ 129 130 qRegisterMetaType<UISettingsDataGlobal>(); 130 UISettingsDataGlobal data(com Properties);131 UISettingsDataGlobal data(comHost, comProperties); 131 132 QVariant varData = QVariant::fromValue(data); 132 133 … … 137 138 void UISettingsDialogGlobal::saveOwnData() 138 139 { 139 /* Get properties: */ 140 /* Get host & properties: */ 141 CHost comHost = uiCommon().host(); 140 142 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties(); 141 143 /* Prepare global data: */ 142 144 qRegisterMetaType<UISettingsDataGlobal>(); 143 UISettingsDataGlobal data(com Properties);145 UISettingsDataGlobal data(comHost, comProperties); 144 146 QVariant varData = QVariant::fromValue(data); 145 147 146 148 /* Call to base-class: */ 147 149 UISettingsDialog::saveData(varData); 150 151 /* Get updated host: */ 152 CHost comNewHost = varData.value<UISettingsDataGlobal>().m_host; 153 /* If host is not OK => show the error: */ 154 if (!comNewHost.isOk()) 155 msgCenter().cannotSetHostSettings(comNewHost, this); 148 156 149 157 /* Get updated properties: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r93115 r94757 95 95 void UISettingsPageGlobal::fetchData(const QVariant &data) 96 96 { 97 /* Fetch data to m_properties: */ 97 /* Fetch data to m_host & m_properties: */ 98 m_host = data.value<UISettingsDataGlobal>().m_host; 98 99 m_properties = data.value<UISettingsDataGlobal>().m_properties; 99 100 } … … 101 102 void UISettingsPageGlobal::uploadData(QVariant &data) const 102 103 { 103 /* Upload m_ properties to data: */104 data = QVariant::fromValue(UISettingsDataGlobal(m_ properties));104 /* Upload m_host & m_properties to data: */ 105 data = QVariant::fromValue(UISettingsDataGlobal(m_host, m_properties)); 105 106 } 106 107 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r93990 r94757 34 34 #include "COMEnums.h" 35 35 #include "CConsole.h" 36 #include "CHost.h" 36 37 #include "CMachine.h" 37 38 #include "CSystemProperties.h" … … 53 54 /** Constructs NULL global settings data struct. */ 54 55 UISettingsDataGlobal() {} 55 /** Constructs global settings data struct on the basis of @a comProperties. */ 56 UISettingsDataGlobal(const CSystemProperties &comProperties) 57 : m_properties(comProperties) {} 58 /** Holds the global VirtualBox properties. */ 59 CSystemProperties m_properties; 56 /** Constructs global settings data struct on the basis of @a comHost and @a comProperties. */ 57 UISettingsDataGlobal(const CHost &comHost, const CSystemProperties &comProperties) 58 : m_host(comHost), m_properties(comProperties) {} 59 /** Holds the host reference. */ 60 CHost m_host; 61 /** Holds the properties reference. */ 62 CSystemProperties m_properties; 60 63 }; 61 64 Q_DECLARE_METATYPE(UISettingsDataGlobal); … … 71 74 : m_machine(comMachine), m_console(comConsole) {} 72 75 /** Holds the machine reference. */ 73 CMachine m_machine;76 CMachine m_machine; 74 77 /** Holds the console reference. */ 75 CConsole m_console;78 CConsole m_console; 76 79 }; 77 80 Q_DECLARE_METATYPE(UISettingsDataMachine); … … 234 237 void uploadData(QVariant &data) const; 235 238 239 /** Holds the source of host preferences. */ 240 CHost m_host; 236 241 /** Holds the source of global preferences. */ 237 CSystemProperties m_properties;242 CSystemProperties m_properties; 238 243 }; 239 244 … … 264 269 265 270 /** Holds the source of machine settings. */ 266 CMachine m_machine;271 CMachine m_machine; 267 272 /** Holds the source of console settings. */ 268 CConsole m_console;273 CConsole m_console; 269 274 }; 270 275
Note:
See TracChangeset
for help on using the changeset viewer.