Changeset 101265 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 26, 2023 11:41:17 AM (16 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r101210 r101265 2567 2567 } 2568 2568 2569 KGraphicsControllerType UICommon::getRecommendedGraphicsController(const QString &strGuestOSTypeId) const 2570 { 2571 if (!m_pGuestOSTypeManager) 2572 return KGraphicsControllerType_Null; 2573 return m_pGuestOSTypeManager->getRecommendedGraphicsController(strGuestOSTypeId); 2574 } 2575 2569 2576 /* static */ 2570 2577 void UICommon::setHelpKeyword(QObject *pObject, const QString &strHelpKeyword) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r101209 r101265 502 502 * resolution at maximum possible screen depth in bpp. */ 503 503 static quint64 requiredVideoMemory(const QString &strGuestOSTypeId, int cMonitors = 1); 504 KGraphicsControllerType getRecommendedGraphicsController(const QString &strGuestOSTypeId) const; 504 505 /** @} */ 505 506 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.cpp
r101263 r101265 121 121 } 122 122 123 KGraphicsControllerType UIGuestOSTypeManager::getRecommendedGraphicsController(const QString &strTypeId) const 124 { 125 if (strTypeId.isEmpty()) 126 return KGraphicsControllerType_Null; 127 foreach (const UIGuestOSTypeII &type, m_guestOSTypes) 128 { 129 if (type.getId() == strTypeId) 130 return type.getRecommendedGraphicsController(); 131 } 132 return KGraphicsControllerType_Null; 133 } 134 123 135 UIGuestOSTypeII::UIGuestOSTypeII() 124 136 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.h
r101263 r101265 63 63 UIGuestOSTypeII findGuestTypeById(const QString &strTypeId) const; 64 64 65 KGraphicsControllerType getRecommendedGraphicsController(const QString &strTypeId) const; 66 65 67 private: 66 68 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.cpp
r100989 r101265 514 514 UIMachineSettingsDisplay *pDisplayPage = qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(MachineSettingsPageType_Display)); 515 515 if (pGeneralPage && pDisplayPage) 516 pDisplayPage->setGuestOSType (pGeneralPage->guestOSType());516 pDisplayPage->setGuestOSTypeId(pGeneralPage->guestOSTypeId()); 517 517 break; 518 518 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r100902 r101265 518 518 UIMachineSettingsDisplay *pDisplayPage = qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(MachineSettingsPageType_Display)); 519 519 if (pGeneralPage && pDisplayPage) 520 pDisplayPage->setGuestOSType (pGeneralPage->guestOSType());520 pDisplayPage->setGuestOSTypeId(pGeneralPage->guestOSTypeId()); 521 521 break; 522 522 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r101264 r101265 294 294 295 295 UIMachineSettingsDisplay::UIMachineSettingsDisplay() 296 : m_ guestOSType(CGuestOSType())296 : m_strGuestOSTypeId(QString()) 297 297 #ifdef VBOX_WITH_3D_ACCELERATION 298 298 , m_fWddmModeSupported(false) … … 322 322 } 323 323 324 void UIMachineSettingsDisplay::setGuestOSType (UIGuestOSTypeII guestOSType)324 void UIMachineSettingsDisplay::setGuestOSTypeId(const QString &strGuestOSTypeId) 325 325 { 326 326 /* Check if guest OS type changed: */ 327 if (m_ guestOSType == guestOSType)327 if (m_strGuestOSTypeId == strGuestOSTypeId) 328 328 return; 329 329 330 330 /* Remember new guest OS type: */ 331 m_ guestOSType = guestOSType;332 m_pEditorVideoMemorySize->setGuestOSTypeId(m_ guestOSType.getId());331 m_strGuestOSTypeId = strGuestOSTypeId; 332 m_pEditorVideoMemorySize->setGuestOSTypeId(m_strGuestOSTypeId); 333 333 334 334 #ifdef VBOX_WITH_3D_ACCELERATION 335 335 /* Check if WDDM mode supported by the guest OS type: */ 336 const QString strGuestOSTypeId = m_guestOSType.isOk() ? m_guestOSType.getId() : QString(); 337 m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(strGuestOSTypeId); 336 m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(m_strGuestOSTypeId); 338 337 m_pEditorVideoMemorySize->set3DAccelerationSupported(m_fWddmModeSupported); 339 338 #endif /* VBOX_WITH_3D_ACCELERATION */ 340 339 /* Acquire recommended graphics controller type: */ 341 m_enmGraphicsControllerTypeRecommended = m_guestOSType.getRecommendedGraphicsController(); 342 340 m_enmGraphicsControllerTypeRecommended = uiCommon().getRecommendedGraphicsController(m_strGuestOSTypeId); 343 341 /* Revalidate: */ 344 342 revalidate(); … … 636 634 637 635 /* Video RAM amount test: */ 638 if (shouldWeWarnAboutLowVRAM() && m_guestOSType.isOk())639 { 640 quint64 uNeedBytes = UICommon::requiredVideoMemory(m_ guestOSType.getId(), m_pEditorMonitorCount->value());636 if (shouldWeWarnAboutLowVRAM() && !m_strGuestOSTypeId.isEmpty()) 637 { 638 quint64 uNeedBytes = UICommon::requiredVideoMemory(m_strGuestOSTypeId, m_pEditorMonitorCount->value()); 641 639 642 640 /* Basic video RAM amount test: */ … … 664 662 665 663 /* Graphics controller type test: */ 666 if ( m_guestOSType.isOk())664 if (!m_strGuestOSTypeId.isEmpty()) 667 665 { 668 666 if (graphicsControllerTypeCurrent() != graphicsControllerTypeRecommended()) … … 1023 1021 bool UIMachineSettingsDisplay::shouldWeWarnAboutLowVRAM() 1024 1022 { 1025 bool fResult = true;1026 1027 1023 QStringList excludingOSList = QStringList() 1028 1024 << "Other" << "DOS" << "Netware" << "L4" << "QNX" << "JRockitVE"; 1029 if (!m_guestOSType.isOk() || excludingOSList.contains(m_guestOSType.getId())) 1030 fResult = false; 1031 1032 return fResult; 1025 return !excludingOSList.contains(m_strGuestOSTypeId); 1033 1026 } 1034 1027 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r101263 r101265 33 33 34 34 /* GUI includes: */ 35 #include "UIGuestOSTypeII.h"36 35 #include "UISettingsPage.h" 37 36 … … 63 62 64 63 /** Defines @a comGuestOSType. */ 65 void setGuestOSType (UIGuestOSTypeII comGuestOSType);64 void setGuestOSTypeId(const QString &strGuestOSTypeId); 66 65 67 66 #ifdef VBOX_WITH_3D_ACCELERATION … … 149 148 150 149 /** Holds the guest OS type. */ 151 UIGuestOSTypeII m_guestOSType;150 QString m_strGuestOSTypeId; 152 151 #ifdef VBOX_WITH_3D_ACCELERATION 153 152 /** Holds whether the guest OS supports WDDM. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r101263 r101265 158 158 } 159 159 160 UIGuestOSTypeII UIMachineSettingsGeneral::guestOSType() const161 { 162 AssertPtrReturn(m_pEditorNameAndSystem, UIGuestOSTypeII());163 return m_pEditorNameAndSystem->type ();160 QString UIMachineSettingsGeneral::guestOSTypeId() const 161 { 162 AssertPtrReturn(m_pEditorNameAndSystem, QString()); 163 return m_pEditorNameAndSystem->typeId(); 164 164 } 165 165 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
r101263 r101265 33 33 34 34 /* GUI includes: */ 35 #include "UIGuestOSTypeII.h"36 35 #include "UISettingsPage.h" 37 36 … … 59 58 virtual ~UIMachineSettingsGeneral() RT_OVERRIDE; 60 59 61 /** Returns the VM OS type . */62 UIGuestOSTypeII guestOSType() const;60 /** Returns the VM OS type Id. */ 61 QString guestOSTypeId() const; 63 62 64 63 protected:
Note:
See TracChangeset
for help on using the changeset viewer.