VirtualBox

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


Ignore:
Timestamp:
Sep 25, 2023 2:00:59 PM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10523. New vm wizard uses UIGuestOSType from no on.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.cpp

    r101226 r101253  
    169169    return m_strDescription;
    170170}
     171
     172KStorageBus UIGuestOSTypeII::getRecommendedHDStorageBus() const
     173{
     174    if (m_comGuestOSType.isOk())
     175        return m_comGuestOSType.GetRecommendedHDStorageBus();
     176    return KStorageBus_Null;
     177}
     178
     179ULONG UIGuestOSTypeII::getRecommendedRAM() const
     180{
     181    if (m_comGuestOSType.isOk())
     182        return m_comGuestOSType.GetRecommendedRAM();
     183    return 0;
     184}
     185
     186KStorageBus UIGuestOSTypeII::getRecommendedDVDStorageBus() const
     187{
     188    if (m_comGuestOSType.isOk())
     189        return m_comGuestOSType.GetRecommendedDVDStorageBus();
     190    return KStorageBus_Null;
     191}
     192
     193ULONG UIGuestOSTypeII::getRecommendedCPUCount() const
     194{
     195    if (m_comGuestOSType.isOk())
     196        return m_comGuestOSType.GetRecommendedCPUCount();
     197    return 0;
     198}
     199
     200KFirmwareType UIGuestOSTypeII::getRecommendedFirmware() const
     201{
     202    if (m_comGuestOSType.isOk())
     203        return m_comGuestOSType.GetRecommendedFirmware();
     204    return  KFirmwareType_Max;
     205}
     206
     207bool UIGuestOSTypeII::getRecommendedFloppy() const
     208{
     209    if (m_comGuestOSType.isOk())
     210        return m_comGuestOSType.GetRecommendedFloppy();
     211    return false;
     212}
     213
     214LONG64 UIGuestOSTypeII::getRecommendedHDD() const
     215{
     216    if (m_comGuestOSType.isOk())
     217        return m_comGuestOSType.GetRecommendedHDD();
     218    return 0;
     219}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.h

    r101226 r101253  
    8989    const QString &getDescription() const;
    9090
     91    /** @name Wrapper getters for CGuestOSType member.
     92      * @{ */
     93        KStorageBus getRecommendedHDStorageBus() const;
     94        ULONG getRecommendedRAM() const;
     95        KStorageBus getRecommendedDVDStorageBus() const;
     96        ULONG getRecommendedCPUCount() const;
     97        KFirmwareType getRecommendedFirmware() const;
     98        bool getRecommendedFloppy() const;
     99        LONG64 getRecommendedHDD() const;
     100    /** @} */
     101
    91102    bool isOk() const;
    92103
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp

    r101244 r101253  
    454454        {
    455455            m_pComboVariant->addItem(strVariant);
    456             if (strVariant == "Oracle Linux")
     456            if (strVariant.contains(QRegularExpression("Oracle.*Linux")))
    457457                iOracleIndex = m_pComboVariant->count() - 1;
    458458        }
     
    463463    }
    464464    m_pComboVariant->blockSignals(false);
    465     // AssertPtrReturnVoid(m_pComboFamily);
    466 
    467     // /* Lock the signals of m_pComboType to prevent it's reaction on clearing: */
    468     // m_pComboType->blockSignals(true);
    469     // m_pComboType->clear();
    470 
    471 
    472     // /* Populate combo-box with OS types related to currently selected family id: */
    473     // foreach (const UIGuestOSType &guiType, m_types.value(m_strFamilyId))
    474     // {
    475     //     const int idxItem = m_pComboType->count();
    476     //     m_pComboType->insertItem(idxItem, guiType.typeDescription);
    477     //     m_pComboType->setItemData(idxItem, guiType.typeId, TypeID);
    478     // }
    479 
    480 
    481     // /* Update all the stuff: */
    482     // sltTypeChanged(m_pComboType->currentIndex());
    483 
    484     // /* Unlock the signals of m_pComboType: */
    485     // m_pComboType->blockSignals(false);
    486465
    487466    /* Notify listeners about this change: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r101237 r101253  
    149149{
    150150    CVirtualBox vbox = uiCommon().virtualBox();
    151     QString strTypeId = m_comGuestOSType.GetId();
     151    QString strTypeId = m_guestOSType.getId();
    152152
    153153    /* Create virtual machine: */
     
    284284        if (!m_virtualDisk.isNull())
    285285        {
    286             KStorageBus enmHDDBus = m_comGuestOSType.GetRecommendedHDStorageBus();
     286            KStorageBus enmHDDBus = m_guestOSType.getRecommendedHDStorageBus();
    287287            CStorageController comHDDController = m_machine.GetStorageControllerByInstance(enmHDDBus, 0);
    288288            if (!comHDDController.isNull())
     
    296296
    297297        /* Attach optical drive: */
    298         KStorageBus enmDVDBus = m_comGuestOSType.GetRecommendedDVDStorageBus();
     298        KStorageBus enmDVDBus = m_guestOSType.getRecommendedDVDStorageBus();
    299299        CStorageController comDVDController = m_machine.GetStorageControllerByInstance(enmDVDBus, 0);
    300300        if (!comDVDController.isNull())
     
    317317
    318318        /* Attach an empty floppy drive if recommended */
    319         if (m_comGuestOSType.GetRecommendedFloppy()) {
     319        if (m_guestOSType.getRecommendedFloppy()) {
    320320            CStorageController comFloppyController = m_machine.GetStorageControllerByInstance(KStorageBus_Floppy, 0);
    321321            if (!comFloppyController.isNull())
     
    523523}
    524524
    525 const CGuestOSType &UIWizardNewVM::guestOSType() const
    526 {
    527     return m_comGuestOSType;;
    528 }
    529 
    530 void UIWizardNewVM::setGuestOSType(const CGuestOSType &guestOSType)
    531 {
    532     m_comGuestOSType= guestOSType;
     525const UIGuestOSTypeII &UIWizardNewVM::guestOSType() const
     526{
     527    return m_guestOSType;
     528}
     529
     530void UIWizardNewVM::setGuestOSType(const UIGuestOSTypeII &guestOSType)
     531{
     532    m_guestOSType = guestOSType;
    533533}
    534534
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r101237 r101253  
    3333
    3434/* GUI includes: */
     35#include "UIGuestOSTypeII.h"
    3536#include "UINativeWizard.h"
    3637
     
    4041#include "CMedium.h"
    4142#include "CMediumFormat.h"
    42 #include "CGuestOSType.h"
    4343#include "CUnattended.h"
    4444
     
    104104        void setGuestOSFamilyId(const QString &strGuestOSFamilyId);
    105105
    106         const CGuestOSType &guestOSType() const;
    107         void setGuestOSType(const CGuestOSType &guestOSType);
     106        const UIGuestOSTypeII &guestOSType() const;
     107        void setGuestOSType(const UIGuestOSTypeII &guestOSType);
    108108
    109109        bool installGuestAdditions() const;
     
    219219       QString  m_strGuestOSFamilyId;
    220220       /** Holds the VM OS type. */
    221        CGuestOSType m_comGuestOSType;
     221       UIGuestOSTypeII m_guestOSType;
    222222
    223223       /** True if guest additions are to be installed during unattended install. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp

    r98103 r101253  
    206206    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
    207207    AssertReturnVoid(pWizard);
    208     const CGuestOSType &comOSType = pWizard->guestOSType();
    209     AssertReturnVoid(!comOSType.isNull());
    210     QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(comOSType.GetId(),
     208    const UIGuestOSTypeII &OSType = pWizard->guestOSType();
     209
     210    QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(OSType.getId(),
    211211                                                                     pWizard->machineFolder(),
    212212                                                                     this, m_pActionPool);
     
    266266
    267267    LONG64 iRecommendedSize = 0;
    268     CGuestOSType type = pWizard->guestOSType();
    269     if (!type.isNull() && !m_userModifiedParameters.contains("SelectedDiskSource"))
    270     {
    271         iRecommendedSize = type.GetRecommendedHDD();
     268    const UIGuestOSTypeII &type = pWizard->guestOSType();
     269    if (!type.isOk() && !m_userModifiedParameters.contains("SelectedDiskSource"))
     270    {
     271        iRecommendedSize = type.getRecommendedHDD();
    272272        if (iRecommendedSize != 0)
    273273        {
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r98898 r101253  
    148148    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
    149149    AssertReturnVoid(pWizard);
    150     const CGuestOSType &comOSType = pWizard->guestOSType();
    151     AssertReturnVoid(!comOSType.isNull());
    152     QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(comOSType.GetId(),
     150    const UIGuestOSTypeII &OSType = pWizard->guestOSType();
     151    AssertReturnVoid(!OSType.isOk());
     152    QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(OSType.getId(),
    153153                                                                     pWizard->machineFolder(),
    154154                                                                     this, m_pActionPool);
     
    348348
    349349    /* Get recommended 'ram' field value: */
    350     const CGuestOSType &type = pWizard->guestOSType();
    351     ULONG recommendedRam = type.GetRecommendedRAM();
     350    const UIGuestOSTypeII &type = pWizard->guestOSType();
     351    ULONG recommendedRam = type.getRecommendedRAM();
    352352
    353353    if (m_pHardwareWidgetContainer)
     
    363363
    364364        /* Set Firmware Type of the widget and the wizard: */
    365         KFirmwareType fwType = type.GetRecommendedFirmware();
     365        KFirmwareType fwType = type.getRecommendedFirmware();
    366366        if (!m_userModifiedParameters.contains("EFIEnabled"))
    367367        {
     
    371371
    372372        /* Initialize CPU count:*/
    373         int iCPUCount = type.GetRecommendedCPUCount();
     373        int iCPUCount = type.getRecommendedCPUCount();
    374374        if (!m_userModifiedParameters.contains("CPUCount"))
    375375        {
     
    380380    }
    381381
    382     LONG64 iRecommendedDiskSize = type.GetRecommendedHDD();
     382    LONG64 iRecommendedDiskSize = type.getRecommendedHDD();
    383383    /* Prepare initial disk choice: */
    384384    if (!m_userModifiedParameters.contains("SelectedDiskSource"))
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePage.cpp

    r98103 r101253  
    9191    if (pWizard && m_pHardwareWidgetContainer)
    9292    {
    93         CGuestOSType type = pWizard->guestOSType();
    94         if (!type.isNull())
     93        const UIGuestOSTypeII &type = pWizard->guestOSType();
     94
     95        m_pHardwareWidgetContainer->blockSignals(true);
     96        if (!m_userModifiedParameters.contains("MemorySize"))
    9597        {
    96             m_pHardwareWidgetContainer->blockSignals(true);
    97             if (!m_userModifiedParameters.contains("MemorySize"))
    98             {
    99                 ULONG recommendedRam = type.GetRecommendedRAM();
    100                 m_pHardwareWidgetContainer->setMemorySize(recommendedRam);
    101                 pWizard->setMemorySize(recommendedRam);
    102             }
    103             if (!m_userModifiedParameters.contains("CPUCount"))
    104             {
    105                 ULONG recommendedCPUs = type.GetRecommendedCPUCount();
    106                 m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs);
    107                 pWizard->setCPUCount(recommendedCPUs);
    108             }
    109             if (!m_userModifiedParameters.contains("EFIEnabled"))
    110             {
    111                 KFirmwareType fwType = type.GetRecommendedFirmware();
    112                 m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS);
    113                 pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS);
    114             }
    115             m_pHardwareWidgetContainer->blockSignals(false);
     98            ULONG recommendedRam = type.getRecommendedRAM();
     99            m_pHardwareWidgetContainer->setMemorySize(recommendedRam);
     100            pWizard->setMemorySize(recommendedRam);
    116101        }
     102        if (!m_userModifiedParameters.contains("CPUCount"))
     103        {
     104            ULONG recommendedCPUs = type.getRecommendedCPUCount();
     105            m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs);
     106            pWizard->setCPUCount(recommendedCPUs);
     107        }
     108        if (!m_userModifiedParameters.contains("EFIEnabled"))
     109        {
     110            KFirmwareType fwType = type.getRecommendedFirmware();
     111            m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS);
     112            pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS);
     113        }
     114        m_pHardwareWidgetContainer->blockSignals(false);
    117115    }
    118116}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMSummaryPage.cpp

    r98103 r101253  
    354354    pNameRoot->addChild(UIWizardNewVM::tr("Machine Folder"), pWizard->machineFolder());
    355355    pNameRoot->addChild(UIWizardNewVM::tr("ISO Image"), pWizard->ISOFilePath());
    356     pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), pWizard->guestOSType().GetDescription());
     356    pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), pWizard->guestOSType().getDescription());
    357357
    358358    const QString &ISOPath = pWizard->ISOFilePath();
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