Changeset 47264 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 19, 2013 2:16:54 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r47255 r47264 40 40 , m_fOHCIEnabled(false) 41 41 { 42 /* Apply UI decorations */43 Ui::UIMachineSettingsSystem::setupUi 44 45 /* Setup constants */42 /* Apply UI decorations: */ 43 Ui::UIMachineSettingsSystem::setupUi(this); 44 45 /* Setup constants: */ 46 46 CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties(); 47 47 uint hostCPUs = vboxGlobal().host().GetProcessorCount(); … … 197 197 UIDataSettingsMachineSystem systemData; 198 198 199 /* Load support flags: */ 200 systemData.m_fSupportedPAE = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_PAE); 201 systemData.m_fSupportedHwVirtEx = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx); 202 203 /* Load motherboard data: */ 204 systemData.m_iRAMSize = m_machine.GetMemorySize(); 199 205 /* Load boot-items of current VM: */ 200 206 QList<KDeviceType> usedBootItems; … … 223 229 } 224 230 } 225 /* Gather other system data: */ 226 systemData.m_fPFHwVirtExSupported = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx); 227 systemData.m_fPFPAESupported = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_PAE); 228 systemData.m_fIoApicEnabled = m_machine.GetBIOSSettings().GetIOAPICEnabled(); 229 systemData.m_fEFIEnabled = m_machine.GetFirmwareType() >= KFirmwareType_EFI && m_machine.GetFirmwareType() <= KFirmwareType_EFIDUAL; 230 systemData.m_fUTCEnabled = m_machine.GetRTCUseUTC(); 231 systemData.m_fUseAbsHID = m_machine.GetPointingHIDType() == KPointingHIDType_USBTablet; 232 systemData.m_fPAEEnabled = m_machine.GetCPUProperty(KCPUPropertyType_PAE); 233 systemData.m_fHwVirtExEnabled = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled); 234 systemData.m_fNestedPagingEnabled = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging); 235 systemData.m_iRAMSize = m_machine.GetMemorySize(); 236 systemData.m_cCPUCount = systemData.m_fPFHwVirtExSupported ? m_machine.GetCPUCount() : 1; 237 systemData.m_cCPUExecCap = m_machine.GetCPUExecutionCap(); 231 /* Load other motherboard data: */ 238 232 systemData.m_chipsetType = m_machine.GetChipsetType(); 233 systemData.m_fEnabledIoApic = m_machine.GetBIOSSettings().GetIOAPICEnabled(); 234 systemData.m_fEnabledEFI = m_machine.GetFirmwareType() >= KFirmwareType_EFI && m_machine.GetFirmwareType() <= KFirmwareType_EFIDUAL; 235 systemData.m_fEnabledUTC = m_machine.GetRTCUseUTC(); 236 systemData.m_fEnabledAbsoluteHID = m_machine.GetPointingHIDType() == KPointingHIDType_USBTablet; 237 238 /* Load CPU data: */ 239 systemData.m_cCPUCount = systemData.m_fSupportedHwVirtEx ? m_machine.GetCPUCount() : 1; 240 systemData.m_iCPUExecCap = m_machine.GetCPUExecutionCap(); 241 systemData.m_fEnabledPAE = m_machine.GetCPUProperty(KCPUPropertyType_PAE); 242 243 /* Load acceleration data: */ 244 systemData.m_fEnabledHwVirtEx = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled); 245 systemData.m_fEnabledNestedPaging = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging); 239 246 240 247 /* Cache system data: */ … … 252 259 const UIDataSettingsMachineSystem &systemData = m_cache.base(); 253 260 261 /* Load motherboard data to page: */ 262 mSlMemory->setValue(systemData.m_iRAMSize); 254 263 /* Remove any old data in the boot view: */ 255 264 QAbstractItemView *iv = qobject_cast <QAbstractItemView*> (mTwBootOrder); … … 263 272 mTwBootOrder->addItem(pItem); 264 273 } 265 /* Load other system data to page: */ 266 mCbApic->setChecked(systemData.m_fIoApicEnabled); 267 mCbEFI->setChecked(systemData.m_fEFIEnabled); 268 mCbTCUseUTC->setChecked(systemData.m_fUTCEnabled); 269 mCbUseAbsHID->setChecked(systemData.m_fUseAbsHID); 270 mCbPae->setChecked(systemData.m_fPAEEnabled); 271 mCbVirt->setChecked(systemData.m_fHwVirtExEnabled); 272 mCbNestedPaging->setChecked(systemData.m_fNestedPagingEnabled); 273 mSlMemory->setValue(systemData.m_iRAMSize); 274 mSlCPU->setValue(systemData.m_cCPUCount); 275 mSlCPUExecCap->setValue(systemData.m_cCPUExecCap); 274 /* Load other motherboard data to page: */ 276 275 int iChipsetPosition = mCbChipset->findData(systemData.m_chipsetType); 277 276 mCbChipset->setCurrentIndex(iChipsetPosition == -1 ? 0 : iChipsetPosition); 277 mCbApic->setChecked(systemData.m_fEnabledIoApic); 278 mCbEFI->setChecked(systemData.m_fEnabledEFI); 279 mCbTCUseUTC->setChecked(systemData.m_fEnabledUTC); 280 mCbUseAbsHID->setChecked(systemData.m_fEnabledAbsoluteHID); 281 282 /* Load CPU data to page: */ 283 mSlCPU->setValue(systemData.m_cCPUCount); 284 mSlCPUExecCap->setValue(systemData.m_iCPUExecCap); 285 mCbPae->setChecked(systemData.m_fEnabledPAE); 286 287 /* Load acceleration data to page: */ 288 mCbVirt->setChecked(systemData.m_fEnabledHwVirtEx); 289 mCbNestedPaging->setChecked(systemData.m_fEnabledNestedPaging); 278 290 279 291 /* Polish page finally: */ … … 292 304 UIDataSettingsMachineSystem systemData = m_cache.base(); 293 305 294 /* Gather system data: */ 306 /* Gather motherboard data: */ 307 systemData.m_iRAMSize = mSlMemory->value(); 308 /* Gather boot-table data: */ 295 309 systemData.m_bootItems.clear(); 296 310 for (int i = 0; i < mTwBootOrder->count(); ++i) … … 302 316 systemData.m_bootItems << data; 303 317 } 304 systemData.m_fIoApicEnabled = mCbApic->isChecked() || mSlCPU->value() > 1 || 318 /* Gather other motherboard data: */ 319 systemData.m_chipsetType = (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt(); 320 systemData.m_fEnabledIoApic = mCbApic->isChecked() || mSlCPU->value() > 1 || 305 321 (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9; 306 systemData.m_fEFIEnabled = mCbEFI->isChecked(); 307 systemData.m_fUTCEnabled = mCbTCUseUTC->isChecked(); 308 systemData.m_fUseAbsHID = mCbUseAbsHID->isChecked(); 309 systemData.m_fPAEEnabled = mCbPae->isChecked(); 310 systemData.m_fHwVirtExEnabled = mCbVirt->checkState() == Qt::Checked || mSlCPU->value() > 1; 311 systemData.m_fNestedPagingEnabled = mCbNestedPaging->isChecked(); 312 systemData.m_iRAMSize = mSlMemory->value(); 322 systemData.m_fEnabledEFI = mCbEFI->isChecked(); 323 systemData.m_fEnabledUTC = mCbTCUseUTC->isChecked(); 324 systemData.m_fEnabledAbsoluteHID = mCbUseAbsHID->isChecked(); 325 326 /* Gather CPU data: */ 313 327 systemData.m_cCPUCount = mSlCPU->value(); 314 systemData.m_cCPUExecCap = mSlCPUExecCap->value(); 315 systemData.m_chipsetType = (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt(); 328 systemData.m_iCPUExecCap = mSlCPUExecCap->value(); 329 systemData.m_fEnabledPAE = mCbPae->isChecked(); 330 331 /* Gather acceleration data: */ 332 systemData.m_fEnabledHwVirtEx = mCbVirt->checkState() == Qt::Checked || mSlCPU->value() > 1; 333 systemData.m_fEnabledNestedPaging = mCbNestedPaging->isChecked(); 316 334 317 335 /* Cache system data: */ … … 337 355 /* Motherboard tab: */ 338 356 m_machine.SetMemorySize(systemData.m_iRAMSize); 357 /* Save boot-items of current VM: */ 339 358 int iBootIndex = 0; 340 /* Save boot-items of current VM: */341 359 for (int i = 0; i < systemData.m_bootItems.size(); ++i) 342 360 { … … 351 369 } 352 370 m_machine.SetChipsetType(systemData.m_chipsetType); 353 m_machine.GetBIOSSettings().SetIOAPICEnabled(systemData.m_fIoApicEnabled); 354 m_machine.SetFirmwareType(systemData.m_fEFIEnabled ? KFirmwareType_EFI : KFirmwareType_BIOS); 355 m_machine.SetRTCUseUTC(systemData.m_fUTCEnabled); 356 m_machine.SetPointingHIDType(systemData.m_fUseAbsHID ? KPointingHIDType_USBTablet : KPointingHIDType_PS2Mouse); 371 m_machine.GetBIOSSettings().SetIOAPICEnabled(systemData.m_fEnabledIoApic); 372 m_machine.SetFirmwareType(systemData.m_fEnabledEFI ? KFirmwareType_EFI : KFirmwareType_BIOS); 373 m_machine.SetRTCUseUTC(systemData.m_fEnabledUTC); 374 m_machine.SetPointingHIDType(systemData.m_fEnabledAbsoluteHID ? KPointingHIDType_USBTablet : KPointingHIDType_PS2Mouse); 375 357 376 /* Processor tab: */ 358 377 m_machine.SetCPUCount(systemData.m_cCPUCount); 359 m_machine.SetCPUProperty(KCPUPropertyType_PAE, systemData.m_fPAEEnabled); 378 m_machine.SetCPUProperty(KCPUPropertyType_PAE, systemData.m_fEnabledPAE); 379 360 380 /* Acceleration tab: */ 361 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, systemData.m_f HwVirtExEnabled);362 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, systemData.m_f NestedPagingEnabled);381 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, systemData.m_fEnabledHwVirtEx); 382 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, systemData.m_fEnabledNestedPaging); 363 383 } 364 384 if (isMachineInValidMode()) 365 385 { 366 386 /* Processor tab: */ 367 m_machine.SetCPUExecutionCap(systemData.m_ cCPUExecCap);387 m_machine.SetCPUExecutionCap(systemData.m_iCPUExecCap); 368 388 } 369 389 } … … 616 636 mLbCPUMin->setEnabled(isMachineOffline()); 617 637 mLbCPUMax->setEnabled(isMachineOffline()); 618 mSlCPU->setEnabled(isMachineOffline() && systemData.m_f PFHwVirtExSupported);619 mLeCPU->setEnabled(isMachineOffline() && systemData.m_f PFHwVirtExSupported);638 mSlCPU->setEnabled(isMachineOffline() && systemData.m_fSupportedHwVirtEx); 639 mLeCPU->setEnabled(isMachineOffline() && systemData.m_fSupportedHwVirtEx); 620 640 mLbCPUExecCap->setEnabled(isMachineInValidMode()); 621 641 mLbCPUExecCapMin->setEnabled(isMachineInValidMode()); … … 624 644 mLeCPUExecCap->setEnabled(isMachineInValidMode()); 625 645 mLbProcessorExtended->setEnabled(isMachineOffline()); 626 mCbPae->setEnabled(isMachineOffline() && systemData.m_f PFPAESupported);646 mCbPae->setEnabled(isMachineOffline() && systemData.m_fSupportedPAE); 627 647 628 648 /* Acceleration tab: */ 629 mTwSystem->setTabEnabled(2, systemData.m_f PFHwVirtExSupported);649 mTwSystem->setTabEnabled(2, systemData.m_fSupportedHwVirtEx); 630 650 mLbVirt->setEnabled(isMachineOffline()); 631 651 mCbVirt->setEnabled(isMachineOffline()); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r47255 r47264 27 27 struct UIBootItemData 28 28 { 29 /* Default constructor: */29 /* Constructor: */ 30 30 UIBootItemData() : m_type(KDeviceType_Null), m_fEnabled(false) {} 31 31 … … 45 45 struct UIDataSettingsMachineSystem 46 46 { 47 /* Default constructor: */47 /* Constructor: */ 48 48 UIDataSettingsMachineSystem() 49 : m_bootItems(QList<UIBootItemData>()) 49 /* Support flags: */ 50 : m_fSupportedPAE(false) 51 , m_fSupportedHwVirtEx(false) 52 /* Motherboard data: */ 53 , m_iRAMSize(-1) 54 , m_bootItems(QList<UIBootItemData>()) 50 55 , m_chipsetType(KChipsetType_Null) 51 , m_fPFHwVirtExSupported(false) 52 , m_fPFPAESupported(false) 53 , m_fIoApicEnabled(false) 54 , m_fEFIEnabled(false) 55 , m_fUTCEnabled(false) 56 , m_fUseAbsHID(false) 57 , m_fPAEEnabled(false) 58 , m_fHwVirtExEnabled(false) 59 , m_fNestedPagingEnabled(false) 60 , m_iRAMSize(-1) 56 , m_fEnabledIoApic(false) 57 , m_fEnabledEFI(false) 58 , m_fEnabledUTC(false) 59 , m_fEnabledAbsoluteHID(false) 60 /* CPU data: */ 61 61 , m_cCPUCount(-1) 62 , m_cCPUExecCap(-1) {} 62 , m_iCPUExecCap(-1) 63 , m_fEnabledPAE(false) 64 /* Acceleration data: */ 65 , m_fEnabledHwVirtEx(false) 66 , m_fEnabledNestedPaging(false) 67 {} 63 68 64 69 /* Functions: */ 65 70 bool equal(const UIDataSettingsMachineSystem &other) const 66 71 { 67 return (m_bootItems == other.m_bootItems) && 72 return /* Support flags: */ 73 (m_fSupportedPAE == other.m_fSupportedPAE) && 74 (m_fSupportedHwVirtEx == other.m_fSupportedHwVirtEx) && 75 /* Motherboard data: */ 76 (m_iRAMSize == other.m_iRAMSize) && 77 (m_bootItems == other.m_bootItems) && 68 78 (m_chipsetType == other.m_chipsetType) && 69 (m_fPFHwVirtExSupported == other.m_fPFHwVirtExSupported) && 70 (m_fPFPAESupported == other.m_fPFPAESupported) && 71 (m_fIoApicEnabled == other.m_fIoApicEnabled) && 72 (m_fEFIEnabled == other.m_fEFIEnabled) && 73 (m_fUTCEnabled == other.m_fUTCEnabled) && 74 (m_fUseAbsHID == other.m_fUseAbsHID) && 75 (m_fPAEEnabled == other.m_fPAEEnabled) && 76 (m_fHwVirtExEnabled == other.m_fHwVirtExEnabled) && 77 (m_fNestedPagingEnabled == other.m_fNestedPagingEnabled) && 78 (m_iRAMSize == other.m_iRAMSize) && 79 (m_fEnabledIoApic == other.m_fEnabledIoApic) && 80 (m_fEnabledEFI == other.m_fEnabledEFI) && 81 (m_fEnabledUTC == other.m_fEnabledUTC) && 82 (m_fEnabledAbsoluteHID == other.m_fEnabledAbsoluteHID) && 83 /* CPU data: */ 79 84 (m_cCPUCount == other.m_cCPUCount) && 80 (m_cCPUExecCap == other.m_cCPUExecCap); 85 (m_iCPUExecCap == other.m_iCPUExecCap) && 86 (m_fEnabledPAE == other.m_fEnabledPAE) && 87 /* Acceleration data: */ 88 (m_fEnabledHwVirtEx == other.m_fEnabledHwVirtEx) && 89 (m_fEnabledNestedPaging == other.m_fEnabledNestedPaging); 81 90 } 82 91 … … 85 94 bool operator!=(const UIDataSettingsMachineSystem &other) const { return !equal(other); } 86 95 87 /* Variables: */ 96 /* Variables: Support flags: */ 97 bool m_fSupportedPAE; 98 bool m_fSupportedHwVirtEx; 99 100 /* Variables: Motherboard data: */ 101 int m_iRAMSize; 88 102 QList<UIBootItemData> m_bootItems; 89 103 KChipsetType m_chipsetType; 90 bool m_fPFHwVirtExSupported; 91 bool m_fPFPAESupported; 92 bool m_fIoApicEnabled; 93 bool m_fEFIEnabled; 94 bool m_fUTCEnabled; 95 bool m_fUseAbsHID; 96 bool m_fPAEEnabled; 97 bool m_fHwVirtExEnabled; 98 bool m_fNestedPagingEnabled; 99 int m_iRAMSize; 104 bool m_fEnabledIoApic; 105 bool m_fEnabledEFI; 106 bool m_fEnabledUTC; 107 bool m_fEnabledAbsoluteHID; 108 /* Variables: CPU data: */ 100 109 int m_cCPUCount; 101 int m_cCPUExecCap; 110 int m_iCPUExecCap; 111 bool m_fEnabledPAE; 112 /* Variables: Acceleration data: */ 113 bool m_fEnabledHwVirtEx; 114 bool m_fEnabledNestedPaging; 102 115 }; 103 116 typedef UISettingsCache<UIDataSettingsMachineSystem> UICacheSettingsMachineSystem; … … 178 191 QIWidgetValidator *m_pValidator; 179 192 193 /* Variable: Boot-table stuff: */ 194 QList<KDeviceType> m_possibleBootItems; 195 180 196 /* Variables: CPU stuff: */ 181 197 uint m_uMinGuestCPU; … … 185 201 uint m_uMaxGuestCPUExecCap; 186 202 187 /* Variable: Boot-table stuff: */188 QList<KDeviceType> m_possibleBootItems;189 190 203 /* Variable: Correlation stuff: */ 191 204 bool m_fOHCIEnabled;
Note:
See TracChangeset
for help on using the changeset viewer.