Changeset 80042 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 29, 2019 11:40:41 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132478
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r79365 r80042 45 45 : m_iCurrentVRAM(0) 46 46 , m_cGuestScreenCount(0) 47 , m_graphicsControllerType(KGraphicsControllerType_Null) 48 #ifdef VBOX_WITH_CRHGSMI 47 49 , m_f3dAccelerationEnabled(false) 50 #endif 48 51 #ifdef VBOX_WITH_VIDEOHWACCEL 49 , m_f2dAccelerationEnabled(false) 50 #endif /* VBOX_WITH_VIDEOHWACCEL */ 51 , m_graphicsControllerType(KGraphicsControllerType_Null) 52 , m_f2dVideoAccelerationEnabled(false) 53 #endif 52 54 , m_fRemoteDisplayServerSupported(false) 53 55 , m_fRemoteDisplayServerEnabled(false) … … 73 75 && (m_cGuestScreenCount == other.m_cGuestScreenCount) 74 76 && (m_scaleFactors == other.m_scaleFactors) 77 && (m_graphicsControllerType == other.m_graphicsControllerType) 78 #ifdef VBOX_WITH_CRHGSMI 75 79 && (m_f3dAccelerationEnabled == other.m_f3dAccelerationEnabled) 80 #endif 76 81 #ifdef VBOX_WITH_VIDEOHWACCEL 77 && (m_f2dAccelerationEnabled == other.m_f2dAccelerationEnabled) 78 #endif /* VBOX_WITH_VIDEOHWACCEL */ 79 && (m_graphicsControllerType == other.m_graphicsControllerType) 82 && (m_f2dVideoAccelerationEnabled == other.m_f2dVideoAccelerationEnabled) 83 #endif 80 84 && (m_fRemoteDisplayServerSupported == other.m_fRemoteDisplayServerSupported) 81 85 && (m_fRemoteDisplayServerEnabled == other.m_fRemoteDisplayServerEnabled) … … 237 241 /** Holds the guest screen scale-factor. */ 238 242 QList<double> m_scaleFactors; 243 /** Holds the graphics controller type. */ 244 KGraphicsControllerType m_graphicsControllerType; 245 #ifdef VBOX_WITH_CRHGSMI 239 246 /** Holds whether the 3D acceleration is enabled. */ 240 247 bool m_f3dAccelerationEnabled; 248 #endif 241 249 #ifdef VBOX_WITH_VIDEOHWACCEL 242 250 /** Holds whether the 2D video acceleration is enabled. */ 243 bool m_f2dAccelerationEnabled; 244 #endif /* VBOX_WITH_VIDEOHWACCEL */ 245 /** Holds the graphics controller type. */ 246 KGraphicsControllerType m_graphicsControllerType; 251 bool m_f2dVideoAccelerationEnabled; 252 #endif 247 253 /** Holds whether the remote display server is supported. */ 248 254 bool m_fRemoteDisplayServerSupported; … … 280 286 281 287 UIMachineSettingsDisplay::UIMachineSettingsDisplay() 282 : m_iMinVRAM(0) 288 : m_comGuestOSType(CGuestOSType()) 289 , m_iMinVRAM(0) 283 290 , m_iMaxVRAM(0) 284 291 , m_iMaxVRAMVisible(0) 285 292 , m_iInitialVRAM(0) 293 #ifdef VBOX_WITH_CRHGSMI 294 , m_fWddmModeSupported(false) 295 #endif 286 296 #ifdef VBOX_WITH_VIDEOHWACCEL 287 297 , m_f2DVideoAccelerationSupported(false) 288 #endif /* VBOX_WITH_VIDEOHWACCEL */ 289 #ifdef VBOX_WITH_CRHGSMI 290 , m_fWddmModeSupported(false) 291 #endif /* VBOX_WITH_CRHGSMI */ 298 #endif 292 299 , m_pCache(0) 293 300 { … … 304 311 void UIMachineSettingsDisplay::setGuestOSType(CGuestOSType comGuestOSType) 305 312 { 306 /* Check if guest ostype changed: */313 /* Check if guest OS type changed: */ 307 314 if (m_comGuestOSType == comGuestOSType) 308 315 return; 309 316 310 /* Remember new guest ostype: */317 /* Remember new guest OS type: */ 311 318 m_comGuestOSType = comGuestOSType; 312 319 320 #ifdef VBOX_WITH_CRHGSMI 321 /* Check if WDDM mode supported by the guest OS type: */ 322 const QString strGuestOSTypeId = m_comGuestOSType.isNotNull() ? m_comGuestOSType.GetId() : QString(); 323 m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(strGuestOSTypeId); 324 #endif 313 325 #ifdef VBOX_WITH_VIDEOHWACCEL 314 326 /* Check if 2D video acceleration supported by the guest OS type: */ … … 316 328 m_f2DVideoAccelerationSupported = strGuestOSTypeFamily == "Windows"; 317 329 #endif 318 #ifdef VBOX_WITH_CRHGSMI319 /* Check if WDDM mode supported by the guest OS type: */320 const QString strGuestOSTypeId = m_comGuestOSType.isNotNull() ? m_comGuestOSType.GetId() : QString();321 m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(strGuestOSTypeId);322 #endif323 330 324 331 /* Recheck video RAM requirement: */ … … 356 363 oldDisplayData.m_cGuestScreenCount = m_machine.GetMonitorCount(); 357 364 oldDisplayData.m_scaleFactors = gEDataManager->scaleFactors(m_machine.GetId()); 365 oldDisplayData.m_graphicsControllerType = m_machine.GetGraphicsControllerType(); 366 #ifdef VBOX_WITH_CRHGSMI 358 367 oldDisplayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled(); 368 #endif 359 369 #ifdef VBOX_WITH_VIDEOHWACCEL 360 oldDisplayData.m_f2dAccelerationEnabled = m_machine.GetAccelerate2DVideoEnabled(); 361 #endif 362 oldDisplayData.m_graphicsControllerType = m_machine.GetGraphicsControllerType(); 370 oldDisplayData.m_f2dVideoAccelerationEnabled = m_machine.GetAccelerate2DVideoEnabled(); 371 #endif 363 372 /* Check whether remote display server is valid: */ 364 373 const CVRDEServer &vrdeServer = m_machine.GetVRDEServer(); … … 420 429 m_pScaleFactorEditor->setScaleFactors(oldDisplayData.m_scaleFactors); 421 430 m_pScaleFactorEditor->setMonitorCount(oldDisplayData.m_cGuestScreenCount); 431 m_pComboGraphicsControllerType->setCurrentIndex(m_pComboGraphicsControllerType->findText(gpConverter->toString(oldDisplayData.m_graphicsControllerType))); 432 #ifdef VBOX_WITH_CRHGSMI 422 433 m_pCheckbox3D->setChecked(oldDisplayData.m_f3dAccelerationEnabled); 434 #endif 423 435 #ifdef VBOX_WITH_VIDEOHWACCEL 424 m_pCheckbox2DVideo->setChecked(oldDisplayData.m_f2dAccelerationEnabled); 425 #endif 426 m_pComboGraphicsControllerType->setCurrentIndex(m_pComboGraphicsControllerType->findText(gpConverter->toString(oldDisplayData.m_graphicsControllerType))); 427 // Should be the last one for this tab: 436 m_pCheckbox2DVideo->setChecked(oldDisplayData.m_f2dVideoAccelerationEnabled); 437 #endif 438 // Should be the last one for this tab, since it depends on some of others: 428 439 m_pEditorVideoMemorySize->setValue(oldDisplayData.m_iCurrentVRAM); 429 440 … … 479 490 newDisplayData.m_cGuestScreenCount = m_pEditorVideoScreenCount->value(); 480 491 newDisplayData.m_scaleFactors = m_pScaleFactorEditor->scaleFactors(); 492 newDisplayData.m_graphicsControllerType = gpConverter->fromString<KGraphicsControllerType>(m_pComboGraphicsControllerType->currentText()); 493 #ifdef VBOX_WITH_CRHGSMI 481 494 newDisplayData.m_f3dAccelerationEnabled = m_pCheckbox3D->isChecked(); 495 #endif 482 496 #ifdef VBOX_WITH_VIDEOHWACCEL 483 newDisplayData.m_f2dAccelerationEnabled = m_pCheckbox2DVideo->isChecked(); 484 #endif 485 newDisplayData.m_graphicsControllerType = gpConverter->fromString<KGraphicsControllerType>(m_pComboGraphicsControllerType->currentText()); 497 newDisplayData.m_f2dVideoAccelerationEnabled = m_pCheckbox2DVideo->isChecked(); 498 #endif 486 499 /* If remote display server is supported: */ 487 500 newDisplayData.m_fRemoteDisplayServerSupported = m_pCache->base().m_fRemoteDisplayServerSupported; … … 565 578 message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(0)); 566 579 567 /* 3D acceleration test: */568 if (m_pCheckbox3D->isChecked() && !uiCommon().is3DAvailable())569 {570 message.second << tr("The virtual machine is set up to use hardware graphics acceleration. "571 "However the host system does not currently provide this, "572 "so you will not be able to start the machine.");573 }574 575 580 /* Video RAM amount test: */ 576 581 if (shouldWeWarnAboutLowVRAM() && !m_comGuestOSType.isNull()) … … 585 590 .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp)); 586 591 } 587 #ifdef VBOX_WITH_VIDEOHWACCEL588 /* 2D acceleration video RAM amount test: */589 else if (m_pCheckbox2DVideo->isChecked() && m_f2DVideoAccelerationSupported)590 {591 uNeedBytes += VBox2DHelpers::required2DOffscreenVideoMemory();592 if ((quint64)m_pEditorVideoMemorySize->value() * _1M < uNeedBytes)593 {594 message.second << tr("The virtual machine is currently assigned less than <b>%1</b> of video memory "595 "which is the minimum amount required for High Definition Video to be played efficiently.")596 .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp));597 }598 }599 #endif /* VBOX_WITH_VIDEOHWACCEL */600 592 #ifdef VBOX_WITH_CRHGSMI 601 593 /* 3D acceleration video RAM amount test: */ … … 612 604 } 613 605 #endif /* VBOX_WITH_CRHGSMI */ 614 } 606 #ifdef VBOX_WITH_VIDEOHWACCEL 607 /* 2D acceleration video RAM amount test: */ 608 else if (m_pCheckbox2DVideo->isChecked() && m_f2DVideoAccelerationSupported) 609 { 610 uNeedBytes += VBox2DHelpers::required2DOffscreenVideoMemory(); 611 if ((quint64)m_pEditorVideoMemorySize->value() * _1M < uNeedBytes) 612 { 613 message.second << tr("The virtual machine is currently assigned less than <b>%1</b> of video memory " 614 "which is the minimum amount required for High Definition Video to be played efficiently.") 615 .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp)); 616 } 617 } 618 #endif /* VBOX_WITH_VIDEOHWACCEL */ 619 } 620 621 #ifdef VBOX_WITH_CRHGSMI 622 /* 3D acceleration test: */ 623 if (m_pCheckbox3D->isChecked() && !uiCommon().is3DAvailable()) 624 { 625 message.second << tr("The virtual machine is set up to use hardware graphics acceleration. " 626 "However the host system does not currently provide this, " 627 "so you will not be able to start the machine."); 628 } 629 #endif /* VBOX_WITH_CRHGSMI */ 615 630 616 631 #ifdef VBOX_WITH_VIDEOHWACCEL … … 678 693 setTabOrder(m_pEditorVideoMemorySize, m_pSliderVideoScreenCount); 679 694 setTabOrder(m_pSliderVideoScreenCount, m_pEditorVideoScreenCount); 680 #ifdef VBOX_WITH_VIDEOHWACCEL 681 setTabOrder(m_pCheckbox3D, m_pCheckbox2DVideo); 682 setTabOrder(m_pCheckbox2DVideo, m_pComboGraphicsControllerType); 683 #else /* VBOX_WITH_VIDEOHWACCEL */ 684 setTabOrder(m_pCheckbox3D, m_pComboGraphicsControllerType); 685 #endif /* !VBOX_WITH_VIDEOHWACCEL */ 686 setTabOrder(m_pComboGraphicsControllerType, m_pCheckboxRemoteDisplay); 695 setTabOrder(m_pEditorVideoScreenCount, m_pScaleFactorEditor); 696 setTabOrder(m_pScaleFactorEditor, m_pComboGraphicsControllerType); 687 697 688 698 /* Remote Display tab-order: */ … … 764 774 m_pScaleFactorEditor->setEnabled(isMachineInValidMode()); 765 775 m_pLabelVideoOptions->setEnabled(isMachineOffline()); 776 #ifdef VBOX_WITH_CRHGSMI 766 777 m_pCheckbox3D->setEnabled(isMachineOffline()); 778 #else 779 m_pCheckbox3D->hide(); 780 #endif 767 781 #ifdef VBOX_WITH_VIDEOHWACCEL 768 782 m_pCheckbox2DVideo->setEnabled(isMachineOffline() && VBox2DHelpers::isAcceleration2DVideoAvailable()); 769 #else /* !VBOX_WITH_VIDEOHWACCEL */783 #else 770 784 m_pCheckbox2DVideo->hide(); 771 #endif /* !VBOX_WITH_VIDEOHWACCEL */785 #endif 772 786 m_pComboGraphicsControllerType->setEnabled(isMachineOffline()); 773 787 … … 1208 1222 connect(m_pSliderVideoScreenCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenCountSliderChange())); 1209 1223 connect(m_pEditorVideoScreenCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenCountEditorChange())); 1210 1211 connect(m_pCheckbox3D, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 1224 #ifdef VBOX_WITH_CRHGSMI 1225 connect(m_pCheckbox3D, &QCheckBox::stateChanged, 1226 this, &UIMachineSettingsDisplay::revalidate); 1227 #endif 1212 1228 #ifdef VBOX_WITH_VIDEOHWACCEL 1213 connect(m_pCheckbox2DVideo, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 1229 connect(m_pCheckbox2DVideo, &QCheckBox::stateChanged, 1230 this, &UIMachineSettingsDisplay::revalidate); 1214 1231 #endif 1215 1232 … … 1420 1437 fSuccess = m_machine.isOk(); 1421 1438 } 1439 /* Save the Graphics Controller Type: */ 1440 if (fSuccess && isMachineOffline() && newDisplayData.m_graphicsControllerType != oldDisplayData.m_graphicsControllerType) 1441 { 1442 m_machine.SetGraphicsControllerType(newDisplayData.m_graphicsControllerType); 1443 fSuccess = m_machine.isOk(); 1444 } 1445 #ifdef VBOX_WITH_CRHGSMI 1422 1446 /* Save whether 3D acceleration is enabled: */ 1423 1447 if (fSuccess && isMachineOffline() && newDisplayData.m_f3dAccelerationEnabled != oldDisplayData.m_f3dAccelerationEnabled) … … 1426 1450 fSuccess = m_machine.isOk(); 1427 1451 } 1452 #endif 1428 1453 #ifdef VBOX_WITH_VIDEOHWACCEL 1429 1454 /* Save whether 2D video acceleration is enabled: */ 1430 if (fSuccess && isMachineOffline() && newDisplayData.m_f2d AccelerationEnabled != oldDisplayData.m_f2dAccelerationEnabled)1431 { 1432 m_machine.SetAccelerate2DVideoEnabled(newDisplayData.m_f2d AccelerationEnabled);1455 if (fSuccess && isMachineOffline() && newDisplayData.m_f2dVideoAccelerationEnabled != oldDisplayData.m_f2dVideoAccelerationEnabled) 1456 { 1457 m_machine.SetAccelerate2DVideoEnabled(newDisplayData.m_f2dVideoAccelerationEnabled); 1433 1458 fSuccess = m_machine.isOk(); 1434 1459 } 1435 1460 #endif 1436 /* Save the Graphics Controller Type: */1437 if (fSuccess && isMachineOffline() && newDisplayData.m_graphicsControllerType != oldDisplayData.m_graphicsControllerType)1438 {1439 m_machine.SetGraphicsControllerType(newDisplayData.m_graphicsControllerType);1440 fSuccess = m_machine.isOk();1441 }1442 1461 1443 1462 /* Get machine ID for further activities: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r76581 r80042 172 172 /** Holds the initial VRAM value when the dialog is opened. */ 173 173 int m_iInitialVRAM; 174 #ifdef VBOX_WITH_CRHGSMI 175 /** Holds whether the guest OS supports WDDM. */ 176 bool m_fWddmModeSupported; 177 #endif 174 178 #ifdef VBOX_WITH_VIDEOHWACCEL 175 179 /** Holds whether the guest OS supports 2D Video Acceleration. */ 176 180 bool m_f2DVideoAccelerationSupported; 177 #endif178 #ifdef VBOX_WITH_CRHGSMI179 /** Holds whether the guest OS supports WDDM. */180 bool m_fWddmModeSupported;181 181 #endif 182 182
Note:
See TracChangeset
for help on using the changeset viewer.