VirtualBox

Ignore:
Timestamp:
Jul 21, 2021 11:29:35 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996. More fixes related to medium path updates. take 2

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp

    r90272 r90273  
    382382    if (!m_pLocationEditor)
    383383        return;
    384     m_pLocationEditor->blockSignals(true);
    385384    m_pLocationEditor->setText(strMediumPath);
    386     m_pLocationEditor->blockSignals(false);
    387385}
    388386
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r90262 r90273  
    812812{
    813813    m_strMediumPath = strMediumPath;
     814    printf("%s\n", qPrintable(m_strMediumPath));
    814815}
    815816
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r90272 r90273  
    9191    /* Register classes: */
    9292    qRegisterMetaType<CMedium>();
    93     //qRegisterMetaType<SelectedDiskSource>();
    94 
    95     /* Register fields: */
    96 //     registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
    97 //     registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));
    98 //     registerField("machineFilePath", this, "machineFilePath");
    99 //     registerField("machineFolder", this, "machineFolder");
    100 //     registerField("machineBaseName", this, "machineBaseName");
    101 //     registerField("baseMemory", this, "baseMemory");
    102 //     registerField("guestOSFamiyId", this, "guestOSFamiyId");
    103 //     registerField("ISOFilePath", this, "ISOFilePath");
    104 //     registerField("isUnattendedEnabled", this, "isUnattendedEnabled");
    105 //     registerField("startHeadless", this, "startHeadless");
    106 //     registerField("detectedOSTypeId", this, "detectedOSTypeId");
    107 //     registerField("userName", this, "userName");
    108 //     registerField("password", this, "password");
    109 //     registerField("hostname", this, "hostname");
    110 //     registerField("installGuestAdditions", this, "installGuestAdditions");
    111 //     registerField("guestAdditionsISOPath", this, "guestAdditionsISOPath");
    112 //     registerField("productKey", this, "productKey");
    113 //     registerField("VCPUCount", this, "VCPUCount");
    114 //     registerField("EFIEnabled", this, "EFIEnabled");
    115 //     registerField("mediumPath", this, "mediumPath");
    116 //     registerField("mediumFormat", this, "mediumFormat");
    117 //     registerField("mediumSize", this, "mediumSize");
    118 //     registerField("selectedDiskSource", this, "selectedDiskSource");
    119 //     registerField("mediumVariant", this, "mediumVariant");
    120 
    12193}
    12294
     
    12698        UIWizardNewVMNameOSTypePage::guessOSTypeFromName(m_pNameAndSystemEditor, strNewName);
    12799    UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard()));
    128     if (!m_userModifiedParameters.contains("MediumPath") && m_pSizeAndLocationGroup)
    129     {
     100    if (!m_userModifiedParameters.contains("MediumPath"))
    130101        updateVirtualMediumPathFromMachinePathName();
    131         newVMWizardPropertySet(MediumPath, m_pSizeAndLocationGroup->mediumPath());
    132     }
    133102    if (!m_userModifiedParameters.contains("HostnameDomainName"))
    134103        updateHostnameDomainNameFromMachineName();
     
    140109    Q_UNUSED(strNewPath);
    141110    UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard()));
    142     if (!m_userModifiedParameters.contains("MediumPath") && m_pSizeAndLocationGroup)
    143     {
     111    if (!m_userModifiedParameters.contains("MediumPath"))
    144112        updateVirtualMediumPathFromMachinePathName();
    145         newVMWizardPropertySet(MediumPath, m_pSizeAndLocationGroup->mediumPath());
    146     }
    147113}
    148114
     
    398364        if (m_pFormatButtonGroup)
    399365            newVMWizardPropertySet(MediumFormat, m_pFormatButtonGroup->mediumFormat());
    400         /* First set value for medium path in widget the wizard: */
    401366        updateVirtualMediumPathFromMachinePathName();
    402         newVMWizardPropertySet(MediumPath, m_pSizeAndLocationGroup->mediumPath());
    403367    }
    404368
     
    422386    setOSTypeDependedValues();
    423387    disableEnableUnattendedRelatedWidgets(isUnattendedEnabled());
    424     updateWidgetAfterMediumFormatChange();
     388    updateDiskWidgetsAfterMediumFormatChange();
    425389    // setSkipCheckBoxEnable();
    426390    retranslateUi();
     
    693657    m_userModifiedParameters << "MediumFormat";
    694658    newVMWizardPropertySet(MediumFormat, m_pFormatButtonGroup->mediumFormat());
    695 
    696     updateWidgetAfterMediumFormatChange();
     659    updateDiskWidgetsAfterMediumFormatChange();
    697660    emit completeChanged();
    698661}
     
    815778            UIWizardNewVMDiskPage::absoluteFilePath(UIWizardNewVMDiskPage::toFileName(strDiskFileName,
    816779                                                                                      strExtension), strMediumPath);
     780        m_pSizeAndLocationGroup->blockSignals(true);
    817781        m_pSizeAndLocationGroup->setMediumPath(strMediumFilePath);
    818     }
    819 }
    820 
    821 void UIWizardNewVMPageExpert::updateWidgetAfterMediumFormatChange()
     782        m_pSizeAndLocationGroup->blockSignals(false);
     783        newVMWizardPropertySet(MediumPath, m_pSizeAndLocationGroup->mediumPath());
     784    }
     785}
     786
     787void UIWizardNewVMPageExpert::updateDiskWidgetsAfterMediumFormatChange()
    822788{
    823789    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
     
    825791    const CMediumFormat &comMediumFormat = pWizard->mediumFormat();
    826792    AssertReturnVoid(!comMediumFormat.isNull());
     793
     794    /* Block signals of the updated widgets to avoid calling corresponding slots since they add the parameters to m_userModifiedParameters: */
     795    m_pDiskVariantGroupBox->blockSignals(true);
    827796    m_pDiskVariantGroupBox->updateMediumVariantWidgetsAfterFormatChange(comMediumFormat);
     797    m_pDiskVariantGroupBox->blockSignals(false);
     798
     799    m_pSizeAndLocationGroup->blockSignals(true);
    828800    m_pSizeAndLocationGroup->updateMediumPath(comMediumFormat, m_pFormatButtonGroup->formatExtensions());
     801    m_pSizeAndLocationGroup->blockSignals(true);
     802    /* Update the wizard parameters explicitly since we blocked th signals: */
     803    newVMWizardPropertySet(MediumPath, m_pSizeAndLocationGroup->mediumPath());
     804    newVMWizardPropertySet(MediumVariant, m_pDiskVariantGroupBox->mediumVariant());
    829805}
    830806
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r90263 r90273  
    135135
    136136    void updateVirtualMediumPathFromMachinePathName();
    137     void updateWidgetAfterMediumFormatChange();
     137    void updateDiskWidgetsAfterMediumFormatChange();
    138138    void updateHostnameDomainNameFromMachineName();
    139139    void setEnableNewDiskWidgets(bool fEnable);
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