Changeset 66549 in vbox
- Timestamp:
- Apr 13, 2017 8:25:22 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
-
globals/UIMessageCenter.cpp (modified) (1 diff)
-
globals/UIMessageCenter.h (modified) (1 diff)
-
settings/machine/UIMachineSettingsSystem.cpp (modified) (3 diffs)
-
settings/machine/UIMachineSettingsSystem.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r66543 r66549 1309 1309 tr("Cannot save storage controller settings."), 1310 1310 formatErrorInfo(comController)); 1311 } 1312 1313 void UIMessageCenter::cannotSaveSystemSettings(const CMachine &comMachine, QWidget *pParent /* = 0 */) 1314 { 1315 error(pParent, MessageType_Error, 1316 tr("Cannot save system settings."), 1317 formatErrorInfo(comMachine)); 1311 1318 } 1312 1319 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r66543 r66549 261 261 void cannotSaveStorageSettings(const CMachine &comMachine, QWidget *pParent = 0); 262 262 void cannotSaveStorageControllerSettings(const CStorageController &comController, QWidget *pParent = 0); 263 void cannotSaveSystemSettings(const CMachine &comMachine, QWidget *pParent = 0); 263 264 void cannotAttachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0); 264 265 bool warnAboutIncorrectPort(QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r66514 r66549 28 28 # include "UIIconPool.h" 29 29 # include "UIMachineSettingsSystem.h" 30 # include "UIMessageCenter.h" 30 31 # include "VBoxGlobal.h" 31 32 … … 368 369 UISettingsPageMachine::fetchData(data); 369 370 370 /* Make sure machine is in valid mode & system data was changed: */ 371 if (isMachineInValidMode() && m_pCache->wasChanged()) 372 { 373 /* Get old system data from the cache: */ 374 const UIDataSettingsMachineSystem &oldSystemData = m_pCache->base(); 375 /* Get new system data from the cache: */ 376 const UIDataSettingsMachineSystem &newSystemData = m_pCache->data(); 377 378 /* Store new 'Motherboard' data: */ 379 if (isMachineOffline() && newSystemData.m_iMemorySize != oldSystemData.m_iMemorySize) 380 m_machine.SetMemorySize(newSystemData.m_iMemorySize); 381 if (isMachineOffline() && newSystemData.m_chipsetType != oldSystemData.m_chipsetType) 382 m_machine.SetChipsetType(newSystemData.m_chipsetType); 383 if (isMachineOffline() && newSystemData.m_pointingHIDType != oldSystemData.m_pointingHIDType) 384 m_machine.SetPointingHIDType(newSystemData.m_pointingHIDType); 385 if (isMachineOffline() && newSystemData.m_fEnabledIoApic != oldSystemData.m_fEnabledIoApic) 386 m_machine.GetBIOSSettings().SetIOAPICEnabled(newSystemData.m_fEnabledIoApic); 387 if (isMachineOffline() && newSystemData.m_fEnabledEFI != oldSystemData.m_fEnabledEFI) 388 m_machine.SetFirmwareType(newSystemData.m_fEnabledEFI ? KFirmwareType_EFI : KFirmwareType_BIOS); 389 if (isMachineOffline() && newSystemData.m_fEnabledUTC != oldSystemData.m_fEnabledUTC) 390 m_machine.SetRTCUseUTC(newSystemData.m_fEnabledUTC); 391 if (isMachineOffline() && newSystemData.m_bootItems != oldSystemData.m_bootItems) 392 { 393 int iBootIndex = 0; 394 for (int i = 0; i < newSystemData.m_bootItems.size(); ++i) 395 { 396 if (newSystemData.m_bootItems.at(i).m_fEnabled) 397 m_machine.SetBootOrder(++iBootIndex, newSystemData.m_bootItems.at(i).m_type); 398 } 399 for (int i = 0; i < newSystemData.m_bootItems.size(); ++i) 400 { 401 if (!newSystemData.m_bootItems.at(i).m_fEnabled) 402 m_machine.SetBootOrder(++iBootIndex, KDeviceType_Null); 403 } 404 } 405 406 /* Store new 'Processor' data: */ 407 if (isMachineOffline() && newSystemData.m_cCPUCount != oldSystemData.m_cCPUCount) 408 m_machine.SetCPUCount(newSystemData.m_cCPUCount); 409 if (isMachineOffline() && newSystemData.m_fEnabledPAE != oldSystemData.m_fEnabledPAE) 410 m_machine.SetCPUProperty(KCPUPropertyType_PAE, newSystemData.m_fEnabledPAE); 411 if (newSystemData.m_iCPUExecCap != oldSystemData.m_iCPUExecCap) 412 m_machine.SetCPUExecutionCap(newSystemData.m_iCPUExecCap); 413 414 /* Store new 'Acceleration' data: */ 415 if (isMachineOffline() && newSystemData.m_paravirtProvider != oldSystemData.m_paravirtProvider) 416 m_machine.SetParavirtProvider(newSystemData.m_paravirtProvider); 417 if (isMachineOffline() && newSystemData.m_fEnabledHwVirtEx != oldSystemData.m_fEnabledHwVirtEx) 418 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, newSystemData.m_fEnabledHwVirtEx); 419 if (isMachineOffline() && newSystemData.m_fEnabledNestedPaging != oldSystemData.m_fEnabledNestedPaging) 420 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, newSystemData.m_fEnabledNestedPaging); 421 } 371 /* Update system data and failing state: */ 372 setFailed(!saveSystemData()); 422 373 423 374 /* Upload machine to data: */ … … 1095 1046 } 1096 1047 1048 bool UIMachineSettingsSystem::saveSystemData() 1049 { 1050 /* Prepare result: */ 1051 bool fSuccess = true; 1052 /* Save general settings from the cache: */ 1053 if (fSuccess && isMachineInValidMode() && m_pCache->wasChanged()) 1054 { 1055 /* Save 'Motherboard' data from the cache: */ 1056 if (fSuccess) 1057 fSuccess = saveMotherboardData(); 1058 /* Save 'Processor' data from the cache: */ 1059 if (fSuccess) 1060 fSuccess = saveProcessorData(); 1061 /* Save 'Acceleration' data from the cache: */ 1062 if (fSuccess) 1063 fSuccess = saveAccelerationData(); 1064 } 1065 /* Return result: */ 1066 return fSuccess; 1067 } 1068 1069 bool UIMachineSettingsSystem::saveMotherboardData() 1070 { 1071 /* Prepare result: */ 1072 bool fSuccess = true; 1073 /* Save 'Motherboard' settings from the cache: */ 1074 if (fSuccess) 1075 { 1076 /* Get old system data from the cache: */ 1077 const UIDataSettingsMachineSystem &oldSystemData = m_pCache->base(); 1078 /* Get new system data from the cache: */ 1079 const UIDataSettingsMachineSystem &newSystemData = m_pCache->data(); 1080 1081 /* Save memory size: */ 1082 if (fSuccess && isMachineOffline() && newSystemData.m_iMemorySize != oldSystemData.m_iMemorySize) 1083 { 1084 m_machine.SetMemorySize(newSystemData.m_iMemorySize); 1085 fSuccess = m_machine.isOk(); 1086 } 1087 /* Save chipset type: */ 1088 if (fSuccess && isMachineOffline() && newSystemData.m_chipsetType != oldSystemData.m_chipsetType) 1089 { 1090 m_machine.SetChipsetType(newSystemData.m_chipsetType); 1091 fSuccess = m_machine.isOk(); 1092 } 1093 /* Save pointing HID type: */ 1094 if (fSuccess && isMachineOffline() && newSystemData.m_pointingHIDType != oldSystemData.m_pointingHIDType) 1095 { 1096 m_machine.SetPointingHIDType(newSystemData.m_pointingHIDType); 1097 fSuccess = m_machine.isOk(); 1098 } 1099 /* Save whether IO APIC is enabled: */ 1100 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledIoApic != oldSystemData.m_fEnabledIoApic) 1101 { 1102 m_machine.GetBIOSSettings().SetIOAPICEnabled(newSystemData.m_fEnabledIoApic); 1103 fSuccess = m_machine.isOk(); 1104 } 1105 /* Save firware type (whether EFI is enabled): */ 1106 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledEFI != oldSystemData.m_fEnabledEFI) 1107 { 1108 m_machine.SetFirmwareType(newSystemData.m_fEnabledEFI ? KFirmwareType_EFI : KFirmwareType_BIOS); 1109 fSuccess = m_machine.isOk(); 1110 } 1111 /* Save whether UTC is enabled: */ 1112 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledUTC != oldSystemData.m_fEnabledUTC) 1113 { 1114 m_machine.SetRTCUseUTC(newSystemData.m_fEnabledUTC); 1115 fSuccess = m_machine.isOk(); 1116 } 1117 /* Save boot items: */ 1118 if (fSuccess && isMachineOffline() && newSystemData.m_bootItems != oldSystemData.m_bootItems) 1119 { 1120 int iBootIndex = 0; 1121 for (int i = 0; fSuccess && i < newSystemData.m_bootItems.size(); ++i) 1122 { 1123 if (newSystemData.m_bootItems.at(i).m_fEnabled) 1124 { 1125 m_machine.SetBootOrder(++iBootIndex, newSystemData.m_bootItems.at(i).m_type); 1126 fSuccess = m_machine.isOk(); 1127 } 1128 } 1129 for (int i = 0; fSuccess && i < newSystemData.m_bootItems.size(); ++i) 1130 { 1131 if (!newSystemData.m_bootItems.at(i).m_fEnabled) 1132 { 1133 m_machine.SetBootOrder(++iBootIndex, KDeviceType_Null); 1134 fSuccess = m_machine.isOk(); 1135 } 1136 } 1137 } 1138 /* Show error message if necessary: */ 1139 if (!fSuccess) 1140 msgCenter().cannotSaveSystemSettings(m_machine, this); 1141 } 1142 /* Return result: */ 1143 return fSuccess; 1144 } 1145 1146 bool UIMachineSettingsSystem::saveProcessorData() 1147 { 1148 /* Prepare result: */ 1149 bool fSuccess = true; 1150 /* Save 'Processor' settings from the cache: */ 1151 if (fSuccess) 1152 { 1153 /* Get old system data from the cache: */ 1154 const UIDataSettingsMachineSystem &oldSystemData = m_pCache->base(); 1155 /* Get new system data from the cache: */ 1156 const UIDataSettingsMachineSystem &newSystemData = m_pCache->data(); 1157 1158 /* Save CPU count: */ 1159 if (fSuccess && isMachineOffline() && newSystemData.m_cCPUCount != oldSystemData.m_cCPUCount) 1160 { 1161 m_machine.SetCPUCount(newSystemData.m_cCPUCount); 1162 fSuccess = m_machine.isOk(); 1163 } 1164 /* Save whether PAE is enabled: */ 1165 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledPAE != oldSystemData.m_fEnabledPAE) 1166 { 1167 m_machine.SetCPUProperty(KCPUPropertyType_PAE, newSystemData.m_fEnabledPAE); 1168 fSuccess = m_machine.isOk(); 1169 } 1170 /* Save CPU execution cap: */ 1171 if (fSuccess && newSystemData.m_iCPUExecCap != oldSystemData.m_iCPUExecCap) 1172 { 1173 m_machine.SetCPUExecutionCap(newSystemData.m_iCPUExecCap); 1174 fSuccess = m_machine.isOk(); 1175 } 1176 /* Show error message if necessary: */ 1177 if (!fSuccess) 1178 msgCenter().cannotSaveSystemSettings(m_machine, this); 1179 } 1180 /* Return result: */ 1181 return fSuccess; 1182 } 1183 1184 bool UIMachineSettingsSystem::saveAccelerationData() 1185 { 1186 /* Prepare result: */ 1187 bool fSuccess = true; 1188 /* Save 'Acceleration' settings from the cache: */ 1189 if (fSuccess) 1190 { 1191 /* Get old system data from the cache: */ 1192 const UIDataSettingsMachineSystem &oldSystemData = m_pCache->base(); 1193 /* Get new system data from the cache: */ 1194 const UIDataSettingsMachineSystem &newSystemData = m_pCache->data(); 1195 1196 /* Save paravirtualization provider: */ 1197 if (fSuccess && isMachineOffline() && newSystemData.m_paravirtProvider != oldSystemData.m_paravirtProvider) 1198 { 1199 m_machine.SetParavirtProvider(newSystemData.m_paravirtProvider); 1200 fSuccess = m_machine.isOk(); 1201 } 1202 /* Save whether the hardware virtualization extension is enabled: */ 1203 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledHwVirtEx != oldSystemData.m_fEnabledHwVirtEx) 1204 { 1205 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, newSystemData.m_fEnabledHwVirtEx); 1206 fSuccess = m_machine.isOk(); 1207 } 1208 /* Save whether the nested paging is enabled: */ 1209 if (fSuccess && isMachineOffline() && newSystemData.m_fEnabledNestedPaging != oldSystemData.m_fEnabledNestedPaging) 1210 { 1211 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, newSystemData.m_fEnabledNestedPaging); 1212 fSuccess = m_machine.isOk(); 1213 } 1214 /* Show error message if necessary: */ 1215 if (!fSuccess) 1216 msgCenter().cannotSaveSystemSettings(m_machine, this); 1217 } 1218 /* Return result: */ 1219 return fSuccess; 1220 } 1221 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r66345 r66549 134 134 void adjustBootOrderTWSize(); 135 135 136 /** Saves existing system data from the cache. */ 137 bool saveSystemData(); 138 /** Saves existing 'Motherboard' data from the cache. */ 139 bool saveMotherboardData(); 140 /** Saves existing 'Processor' data from the cache. */ 141 bool saveProcessorData(); 142 /** Saves existing 'Acceleration' data from the cache. */ 143 bool saveAccelerationData(); 144 136 145 /** Holds the list of all possible boot items. */ 137 146 QList<KDeviceType> m_possibleBootItems;
Note:
See TracChangeset
for help on using the changeset viewer.

