VirtualBox

Changeset 87974 in vbox


Ignore:
Timestamp:
Mar 5, 2021 3:37:10 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9950. Handling medium size change in the expert mpde page

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

Legend:

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

    r87956 r87974  
    343343    m_strDefaultName = strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName;
    344344    m_strDefaultPath = fieldImp("machineFolder").toString();
     345    /* Set the recommended disk size if user has already not done so: */
    345346    if (m_pSizeEditor && !m_fUserSetSize)
    346347    {
     
    349350        m_pSizeEditor->blockSignals(false);
    350351    }
    351 
    352352}
    353353
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r87973 r87974  
    9797    registerField("mediumPath", this, "mediumPath");
    9898    registerField("mediumFormat", this, "mediumFormat");
     99    registerField("mediumSize", this, "mediumSize");
     100
    99101
    100102    disableEnableUnattendedRelatedWidgets(isUnattendedEnabled());
     
    121123void UIWizardNewVMPageExpert::sltOsTypeChanged()
    122124{
    123     /* Call to base-class: */
    124125    onOsTypeChanged();
    125 
    126126    setOSTypeDependedValues();
    127 
    128     /* Broadcast complete-change: */
    129127    emit completeChanged();
    130128}
     
    276274        connect(m_pFormatButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),
    277275                this, &UIWizardNewVMPageExpert::sltMediumFormatChanged);
     276    if (m_pSizeEditor)
     277        connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
     278                this, &UIWizardNewVMPageExpert::sltMediumSizeChanged);
    278279}
    279280
     
    301302        m_pEFICheckBox->blockSignals(false);
    302303    }
    303 
     304    LONG64 recommendedDiskSize = type.GetRecommendedHDD();
    304305    /* Prepare initial disk choice: */
    305306    if (!m_userSetWidgets.contains(m_pDiskNew) &&
     
    307308        !m_userSetWidgets.contains(m_pDiskExisting))
    308309    {
    309         if (type.GetRecommendedHDD() != 0)
     310        if (recommendedDiskSize != 0)
    310311        {
    311312            if (m_pDiskNew)
     
    327328        if (m_pDiskSelector)
    328329            m_pDiskSelector->setCurrentIndex(0);
     330    }
     331
     332    if (m_pSizeEditor  && !m_userSetWidgets.contains(m_pSizeEditor))
     333    {
     334        m_pSizeEditor->blockSignals(true);
     335        setMediumSize(recommendedDiskSize);
     336        m_pSizeEditor->blockSignals(false);
    329337    }
    330338
     
    494502        }
    495503    }
     504
     505     // return !mediumFormat().isNull() &&
     506     //       mediumVariant() != (qulonglong)KMediumVariant_Max &&
     507     //       !m_pLocationEditor->text().trimmed().isEmpty() &&
     508     //       mediumSize() >= m_uMediumSizeMin && mediumSize() <= m_uMediumSizeMax;
     509
    496510    return fIsComplete;
    497511}
     
    568582}
    569583
     584void UIWizardNewVMPageExpert::sltMediumSizeChanged()
     585{
     586    if (!m_pSizeEditor)
     587        return;
     588    m_userSetWidgets << m_pSizeEditor;
     589    completeChanged();
     590}
     591
    570592void UIWizardNewVMPageExpert::updateVirtualDiskPathFromMachinePathName()
    571593{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r87973 r87974  
    7373    // Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant);
    7474    Q_PROPERTY(QString mediumPath READ mediumPath);
    75     // Q_PROPERTY(qulonglong mediumSize READ mediumSize WRITE setMediumSize);
     75    Q_PROPERTY(qulonglong mediumSize READ mediumSize WRITE setMediumSize);
    7676
    7777public:
     
    102102    void sltValueModified();
    103103    void sltMediumFormatChanged();
     104    void sltMediumSizeChanged();
    104105
    105106private:
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