VirtualBox

Changeset 101265 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 26, 2023 11:41:17 AM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10523. Addendum to r159247.

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  
    25672567}
    25682568
     2569KGraphicsControllerType UICommon::getRecommendedGraphicsController(const QString &strGuestOSTypeId) const
     2570{
     2571    if (!m_pGuestOSTypeManager)
     2572        return KGraphicsControllerType_Null;
     2573    return m_pGuestOSTypeManager->getRecommendedGraphicsController(strGuestOSTypeId);
     2574}
     2575
    25692576/* static */
    25702577void UICommon::setHelpKeyword(QObject *pObject, const QString &strHelpKeyword)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r101209 r101265  
    502502          * resolution at maximum possible screen depth in bpp. */
    503503        static quint64 requiredVideoMemory(const QString &strGuestOSTypeId, int cMonitors = 1);
     504        KGraphicsControllerType getRecommendedGraphicsController(const QString &strGuestOSTypeId) const;
    504505    /** @} */
    505506
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.cpp

    r101263 r101265  
    121121}
    122122
     123KGraphicsControllerType 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
    123135UIGuestOSTypeII::UIGuestOSTypeII()
    124136{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.h

    r101263 r101265  
    6363    UIGuestOSTypeII findGuestTypeById(const QString &strTypeId) const;
    6464
     65    KGraphicsControllerType getRecommendedGraphicsController(const QString &strTypeId) const;
     66
    6567private:
    6668
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.cpp

    r100989 r101265  
    514514            UIMachineSettingsDisplay *pDisplayPage = qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(MachineSettingsPageType_Display));
    515515            if (pGeneralPage && pDisplayPage)
    516                 pDisplayPage->setGuestOSType(pGeneralPage->guestOSType());
     516                pDisplayPage->setGuestOSTypeId(pGeneralPage->guestOSTypeId());
    517517            break;
    518518        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r100902 r101265  
    518518            UIMachineSettingsDisplay *pDisplayPage = qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(MachineSettingsPageType_Display));
    519519            if (pGeneralPage && pDisplayPage)
    520                 pDisplayPage->setGuestOSType(pGeneralPage->guestOSType());
     520                pDisplayPage->setGuestOSTypeId(pGeneralPage->guestOSTypeId());
    521521            break;
    522522        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r101264 r101265  
    294294
    295295UIMachineSettingsDisplay::UIMachineSettingsDisplay()
    296     : m_guestOSType(CGuestOSType())
     296    : m_strGuestOSTypeId(QString())
    297297#ifdef VBOX_WITH_3D_ACCELERATION
    298298    , m_fWddmModeSupported(false)
     
    322322}
    323323
    324 void UIMachineSettingsDisplay::setGuestOSType(UIGuestOSTypeII guestOSType)
     324void UIMachineSettingsDisplay::setGuestOSTypeId(const QString &strGuestOSTypeId)
    325325{
    326326    /* Check if guest OS type changed: */
    327     if (m_guestOSType == guestOSType)
     327    if (m_strGuestOSTypeId == strGuestOSTypeId)
    328328        return;
    329329
    330330    /* 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);
    333333
    334334#ifdef VBOX_WITH_3D_ACCELERATION
    335335    /* 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);
    338337    m_pEditorVideoMemorySize->set3DAccelerationSupported(m_fWddmModeSupported);
    339338#endif /* VBOX_WITH_3D_ACCELERATION */
    340339    /* Acquire recommended graphics controller type: */
    341     m_enmGraphicsControllerTypeRecommended = m_guestOSType.getRecommendedGraphicsController();
    342 
     340    m_enmGraphicsControllerTypeRecommended = uiCommon().getRecommendedGraphicsController(m_strGuestOSTypeId);
    343341    /* Revalidate: */
    344342    revalidate();
     
    636634
    637635        /* 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());
    641639
    642640            /* Basic video RAM amount test: */
     
    664662
    665663        /* Graphics controller type test: */
    666         if (m_guestOSType.isOk())
     664        if (!m_strGuestOSTypeId.isEmpty())
    667665        {
    668666            if (graphicsControllerTypeCurrent() != graphicsControllerTypeRecommended())
     
    10231021bool UIMachineSettingsDisplay::shouldWeWarnAboutLowVRAM()
    10241022{
    1025     bool fResult = true;
    1026 
    10271023    QStringList excludingOSList = QStringList()
    10281024        << "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);
    10331026}
    10341027
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h

    r101263 r101265  
    3333
    3434/* GUI includes: */
    35 #include "UIGuestOSTypeII.h"
    3635#include "UISettingsPage.h"
    3736
     
    6362
    6463    /** Defines @a comGuestOSType. */
    65     void setGuestOSType(UIGuestOSTypeII comGuestOSType);
     64    void setGuestOSTypeId(const QString &strGuestOSTypeId);
    6665
    6766#ifdef VBOX_WITH_3D_ACCELERATION
     
    149148
    150149    /** Holds the guest OS type. */
    151     UIGuestOSTypeII  m_guestOSType;
     150    QString m_strGuestOSTypeId;
    152151#ifdef VBOX_WITH_3D_ACCELERATION
    153152    /** Holds whether the guest OS supports WDDM. */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r101263 r101265  
    158158}
    159159
    160 UIGuestOSTypeII UIMachineSettingsGeneral::guestOSType() const
    161 {
    162     AssertPtrReturn(m_pEditorNameAndSystem, UIGuestOSTypeII());
    163     return m_pEditorNameAndSystem->type();
     160QString UIMachineSettingsGeneral::guestOSTypeId() const
     161{
     162    AssertPtrReturn(m_pEditorNameAndSystem, QString());
     163    return m_pEditorNameAndSystem->typeId();
    164164}
    165165
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h

    r101263 r101265  
    3333
    3434/* GUI includes: */
    35 #include "UIGuestOSTypeII.h"
    3635#include "UISettingsPage.h"
    3736
     
    5958    virtual ~UIMachineSettingsGeneral() RT_OVERRIDE;
    6059
    61     /** Returns the VM OS type. */
    62     UIGuestOSTypeII guestOSType() const;
     60    /** Returns the VM OS type Id. */
     61    QString guestOSTypeId() const;
    6362
    6463protected:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette