Changeset 102599 in vbox
- Timestamp:
- Dec 14, 2023 4:03:06 PM (12 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r102419 r102599 258 258 { 259 259 return uisession()->acquireUserMachineIcon(icon); 260 } 261 262 bool UIMachine::acquireArchitectureType(KPlatformArchitecture &enmType) 263 { 264 return uisession()->acquireArchitectureType(enmType); 260 265 } 261 266 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r102419 r102599 203 203 void acquireUserMachineIcon(QIcon &icon); 204 204 205 /** Acquires architecture type. */ 206 bool acquireArchitectureType(KPlatformArchitecture &enmType); 205 207 /** Acquires chipset type. */ 206 208 bool acquireChipsetType(KChipsetType &enmType); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r102574 r102599 2666 2666 { 2667 2667 /* Determine how many adapters we should display: */ 2668 KPlatformArchitecture enmArchType = KPlatformArchitecture_None; 2669 uimachine()->acquireArchitectureType(enmArchType); 2668 2670 KChipsetType enmChipsetType = KChipsetType_Null; 2669 2671 uimachine()->acquireChipsetType(enmChipsetType); 2670 CPlatformProperties comProperties = uiCommon().virtualBox().GetPlatformProperties( KPlatformArchitecture_x86);2672 CPlatformProperties comProperties = uiCommon().virtualBox().GetPlatformProperties(enmArchType); 2671 2673 const ulong uCount = qMin((ulong)4, (ulong)comProperties.GetMaxNetworkAdapters(enmChipsetType)); 2672 2674 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r102139 r102599 300 300 } 301 301 302 bool UISession::acquireArchitectureType(KPlatformArchitecture &enmType) 303 { 304 CMachine comMachine = machine(); 305 if (comMachine.isNull()) 306 return false; 307 CPlatform comPlatform = comMachine.GetPlatform(); 308 const KPlatformArchitecture enmArchType = comPlatform.GetArchitecture(); 309 const bool fSuccess = comMachine.isOk(); 310 if (!fSuccess) 311 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 312 else 313 enmType = enmArchType; 314 return fSuccess; 315 } 316 302 317 bool UISession::acquireChipsetType(KChipsetType &enmType) 303 318 { … … 1245 1260 bool UISession::acquireWhetherAtLeastOneNetworkAdapterEnabled(bool &fEnabled) 1246 1261 { 1247 /* Acquire system properties: */ 1248 CVirtualBox comVBox = uiCommon().virtualBox(); 1249 AssertReturn(comVBox.isNotNull(), false); 1250 CPlatformProperties comProperties = comVBox.GetPlatformProperties(KPlatformArchitecture_x86); 1251 if (!comVBox.isOk()) 1252 { 1253 UINotificationMessage::cannotAcquireVirtualBoxParameter(comVBox); 1254 return false; 1255 } 1256 1257 /* Acquire chipset type: */ 1258 KChipsetType enmChipsetType = KChipsetType_Null; 1259 bool fSuccess = acquireChipsetType(enmChipsetType); 1260 if (fSuccess) 1261 { 1262 /* Acquire maximum network adapters count: */ 1263 const ulong uSlots = comProperties.GetMaxNetworkAdapters(enmChipsetType); 1264 fSuccess = comProperties.isOk(); 1262 /* Acquire architecture type: */ 1263 KPlatformArchitecture enmArchType = KPlatformArchitecture_None; 1264 bool fSuccess = acquireArchitectureType(enmArchType); 1265 { 1266 /* Acquire system properties: */ 1267 CVirtualBox comVBox = uiCommon().virtualBox(); 1268 AssertReturn(comVBox.isNotNull(), false); 1269 CPlatformProperties comProperties = comVBox.GetPlatformProperties(enmArchType); 1270 fSuccess = comVBox.isOk(); 1265 1271 if (!fSuccess) 1266 UINotificationMessage::cannotAcquire PlatformPropertiesParameter(comProperties);1272 UINotificationMessage::cannotAcquireVirtualBoxParameter(comVBox); 1267 1273 else 1268 1274 { 1269 /* Search for 1st enabled adapter: */ 1270 for (ulong uSlot = 0; uSlot < uSlots; ++uSlot) 1271 { 1272 bool fAdapterEnabled = false; 1273 fSuccess = acquireWhetherNetworkAdapterEnabled(uSlot, fAdapterEnabled); 1275 /* Acquire chipset type: */ 1276 KChipsetType enmChipsetType = KChipsetType_Null; 1277 fSuccess = acquireChipsetType(enmChipsetType); 1278 if (fSuccess) 1279 { 1280 /* Acquire maximum network adapters count: */ 1281 const ulong cMaxNetworkAdapters = comProperties.GetMaxNetworkAdapters(enmChipsetType); 1282 fSuccess = comProperties.isOk(); 1274 1283 if (!fSuccess) 1275 break; 1276 if (!fAdapterEnabled) 1277 continue; 1278 fEnabled = true; 1279 break; 1284 UINotificationMessage::cannotAcquirePlatformPropertiesParameter(comProperties); 1285 else 1286 { 1287 /* Search for 1st enabled adapter: */ 1288 for (ulong uSlot = 0; uSlot < cMaxNetworkAdapters; ++uSlot) 1289 { 1290 bool fAdapterEnabled = false; 1291 fSuccess = acquireWhetherNetworkAdapterEnabled(uSlot, fAdapterEnabled); 1292 if (!fSuccess) 1293 break; 1294 if (!fAdapterEnabled) 1295 continue; 1296 fEnabled = true; 1297 break; 1298 } 1299 } 1280 1300 } 1281 1301 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r102018 r102599 201 201 void acquireUserMachineIcon(QIcon &icon); 202 202 203 /** Acquires architecture type. */ 204 bool acquireArchitectureType(KPlatformArchitecture &enmType); 203 205 /** Acquires chipset type. */ 204 206 bool acquireChipsetType(KChipsetType &enmType);
Note:
See TracChangeset
for help on using the changeset viewer.