VirtualBox

Changeset 93456 in vbox


Ignore:
Timestamp:
Jan 27, 2022 10:06:47 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149568
Message:

FE/Qt: bugref:9371. Don't guess OS type from vm name if we have successfully detected it from the ISO.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r93455 r93456  
    8787{
    8888    AssertReturnVoid(wizardWindow<UIWizardNewVM>());
    89     if (!m_userModifiedParameters.contains("GuestOSType") && m_pNameAndSystemEditor)
     89    /* Allow type guessing from name only if an OS type from ISO could not be detected: */
     90    if (!m_userModifiedParameters.contains("GuestOSTypeFromISO") && m_pNameAndSystemEditor)
    9091    {
    9192        m_pNameAndSystemEditor->blockSignals(true);
     
    9596            /* Since the type `possibly` changed: */
    9697            setOSTypeDependedValues();
     98            m_userModifiedParameters << "GuestOSTypeFromName";
    9799        }
    98100        m_pNameAndSystemEditor->blockSignals(false);
     
    148150    UIWizardNewVMNameOSTypeCommon::detectOSType(strISOPath, pWizard);
    149151
    150     if (!m_userModifiedParameters.contains("GuestOSType"))
    151         UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId());
     152
     153    if (UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId()))
     154        m_userModifiedParameters << "GuestOSTypeFromISO";
     155    else /* Remove GuestOSTypeFromISO fromthe set if it is there: */
     156        m_userModifiedParameters.remove("GuestOSTypeFromISO");
     157
    152158    pWizard->setISOFilePath(strISOPath);
    153159
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp

    r93455 r93456  
    205205    AssertReturn(pNameAndSystemEditor, false);
    206206    if (strDetectedOSType.isEmpty())
     207    {
    207208        pNameAndSystemEditor->setType(uiCommon().vmGuestOSType("Other"));
     209        /* Return false to allow OS type guessing from name. See caller code: */
     210        return false;
     211    }
    208212    /* Append 32 as bit-count if the name has no 64 and 32 in the name since API returns a type name with no arch bit count for 32-bit OSs: */
    209213    if (!strDetectedOSType.contains("32") && !strDetectedOSType.contains("64"))
     
    390394{
    391395    AssertReturnVoid(wizardWindow<UIWizardNewVM>());
    392     if (!m_userModifiedParameters.contains("GuestOSType"))
     396    if (!m_userModifiedParameters.contains("GuestOSTypeFromISO"))
    393397    {
    394398        m_pNameAndSystemEditor->blockSignals(true);
    395399        if (UIWizardNewVMNameOSTypeCommon::guessOSTypeFromName(m_pNameAndSystemEditor, strNewName))
     400        {
    396401            wizardWindow<UIWizardNewVM>()->setGuestOSType(m_pNameAndSystemEditor->type());
     402            m_userModifiedParameters << "GuestOSTypeFromName";
     403        }
    397404        m_pNameAndSystemEditor->blockSignals(false);
    398405    }
     
    474481    UIWizardNewVMNameOSTypeCommon::detectOSType(strPath, pWizard);
    475482
    476     if (!m_userModifiedParameters.contains("GuestOSType"))
    477         UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId());
     483    if (UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId()))
     484        m_userModifiedParameters << "GuestOSTypeFromISO";
     485    else /* Remove GuestOSTypeFromISO fromthe set if it is there: */
     486        m_userModifiedParameters.remove("GuestOSTypeFromISO");
     487
    478488    pWizard->setISOFilePath(strPath);
    479489
Note: See TracChangeset for help on using the changeset viewer.

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