VirtualBox

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


Ignore:
Timestamp:
Jul 7, 2021 1:10:38 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145572
Message:

FE/Qt: bugref:9996: Adding some parameters for disk attachment.

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

Legend:

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

    r90073 r90075  
    807807}
    808808
     809
     810KMediumVariant UIWizardNewVM::mediumVariant() const
     811{
     812    return m_enmMediumVariant;
     813}
     814
     815void UIWizardNewVM::setMediumVariant(KMediumVariant enmMediumVariant)
     816{
     817    m_enmMediumVariant = enmMediumVariant;
     818}
     819
     820const CMediumFormat &UIWizardNewVM::mediumFormat()
     821{
     822    return m_comMediumFormat;
     823}
     824
     825void UIWizardNewVM::setMediumFormat(const CMediumFormat &mediumFormat)
     826{
     827    m_comMediumFormat = mediumFormat;
     828}
     829
     830const QString &UIWizardNewVM::mediumPath() const
     831{
     832    return m_strMediumPath;
     833}
     834
     835void UIWizardNewVM::setMediumPath(const QString &strMediumPath)
     836{
     837    m_strMediumPath = strMediumPath;
     838}
     839
     840qulonglong UIWizardNewVM::mediumSize() const
     841{
     842    return m_uMediumSize;
     843}
     844
     845void UIWizardNewVM::setMediumSize(qulonglong uMediumSize)
     846{
     847    m_uMediumSize = uMediumSize;
     848}
     849
    809850const UIUnattendedInstallData &UIWizardNewVM::unattendedInstallData() const
    810851{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r90074 r90075  
    2929#include "CMachine.h"
    3030#include "CMedium.h"
     31#include "CMediumFormat.h"
    3132#include "CGuestOSType.h"
    3233
     
    140141    void setMemorySize(int iMemory);
    141142
     143    KMediumVariant mediumVariant() const;
     144    void setMediumVariant(KMediumVariant enmMediumVariant);
     145
     146    const CMediumFormat &mediumFormat();
     147    void setMediumFormat(const CMediumFormat &mediumFormat);
     148
     149    const QString &mediumPath() const;
     150    void setMediumPath(const QString &strMediumPath);
     151
     152    qulonglong mediumSize() const;
     153    void setMediumSize(qulonglong mediumSize);
     154
    142155protected:
    143156
     
    214227    int m_iMemorySize;
    215228    int m_iUnattendedInstallPageIndex;
     229
     230    KMediumVariant m_enmMediumVariant;
     231    CMediumFormat m_comMediumFormat;
     232    QString m_strMediumPath;
     233    qulonglong m_uMediumSize;
    216234};
    217235
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.cpp

    r90074 r90075  
    235235void UIWizardNewVMDiskPageBasic::createConnections()
    236236{
    237     // if (m_pDiskSourceButtonGroup)
    238     //     connect(m_pDiskSourceButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked),
    239     //             this, &UIWizardNewVMDiskPageBasic::sltSelectedDiskSourceChanged);
    240     // if (m_pDiskSelector)
    241     //     connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
    242     //             this, &UIWizardNewVMDiskPageBasic::sltMediaComboBoxIndexChanged);
    243     // if (m_pDiskSelectionButton)
    244     //     connect(m_pDiskSelectionButton, &QIToolButton::clicked,
    245     //             this, &UIWizardNewVMDiskPageBasic::sltGetWithFileOpenDialog);
    246     // if (m_pMediumSizeEditor)
    247     // {
    248     //     connect(m_pMediumSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
    249     //             this, &UIWizardNewVMDiskPageBasic::completeChanged);
    250     //     connect(m_pMediumSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
    251     //             this, &UIWizardNewVMDiskPageBasic::sltHandleSizeEditorChange);
    252     // }
     237    if (m_pDiskSourceButtonGroup)
     238        connect(m_pDiskSourceButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked),
     239                this, &UIWizardNewVMDiskPageBasic::sltSelectedDiskSourceChanged);
     240    if (m_pDiskSelector)
     241        connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
     242                this, &UIWizardNewVMDiskPageBasic::sltMediaComboBoxIndexChanged);
     243    if (m_pDiskSelectionButton)
     244        connect(m_pDiskSelectionButton, &QIToolButton::clicked,
     245                this, &UIWizardNewVMDiskPageBasic::sltGetWithFileOpenDialog);
     246    if (m_pMediumSizeEditor)
     247    {
     248        connect(m_pMediumSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
     249                this, &UIWizardNewVMDiskPageBasic::completeChanged);
     250        connect(m_pMediumSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
     251                this, &UIWizardNewVMDiskPageBasic::sltHandleSizeEditorChange);
     252    }
    253253}
    254254
     
    428428{
    429429    bool fResult = true;
    430 
    431     // /* Make sure user really intents to creae a vm with no hard drive: */
    432     // if (selectedDiskSource() == SelectedDiskSource_Empty)
    433     // {
    434     //     /* Ask user about disk-less machine unless that's the recommendation: */
    435     //     if (!m_fRecommendedNoDisk)
    436     //     {
    437     //         if (!msgCenter().confirmHardDisklessMachine(thisImp()))
    438     //             return false;
    439     //     }
    440     // }
    441     // else if (selectedDiskSource() == SelectedDiskSource_New)
    442     // {
    443     //     /* Check if the path we will be using for hard drive creation exists: */
    444     //     const QString strMediumPath(fieldImp("mediumPath").toString());
    445     //     fResult = !QFileInfo(strMediumPath).exists();
    446     //     if (!fResult)
    447     //     {
    448     //         msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
    449     //         return fResult;
    450     //     }
    451     //     /* Check FAT size limitation of the host hard drive: */
    452     //     fResult = UIWizardNewVDPageBaseSizeLocation::checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(),
    453     //                                                          fieldImp("mediumPath").toString(),
    454     //                                                          fieldImp("mediumSize").toULongLong());
    455     //     if (!fResult)
    456     //     {
    457     //         msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this);
    458     //         return fResult;
    459     //     }
    460     // }
     430    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
     431    AssertReturn(pWizard, false);
     432
     433    /* Make sure user really intents to creae a vm with no hard drive: */
     434    if (m_enmSelectedDiskSource == SelectedDiskSource_Empty)
     435    {
     436        /* Ask user about disk-less machine unless that's the recommendation: */
     437        if (!m_fRecommendedNoDisk)
     438        {
     439            if (!msgCenter().confirmHardDisklessMachine(this))
     440                return false;
     441        }
     442    }
     443    else if (m_enmSelectedDiskSource == SelectedDiskSource_New)
     444    {
     445        /* Check if the path we will be using for hard drive creation exists: */
     446        const QString strMediumPath(mediumPath());
     447        fResult = !QFileInfo(strMediumPath).exists();
     448        if (!fResult)
     449        {
     450            msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
     451            return fResult;
     452        }
     453        /* Check FAT size limitation of the host hard drive: */
     454        fResult = UIWizardNewVDPageBaseSizeLocation::checkFATSizeLimitation(pWizard->mediumVariant(),
     455                                                                            pWizard->mediumPath(),
     456                                                                            pWizard->mediumSize());
     457        if (!fResult)
     458        {
     459            msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this);
     460            return fResult;
     461        }
     462    }
    461463
    462464    // startProcessing();
    463     // UIWizardNewVM *pWizard = wizardImp();
    464     // if (pWizard)
    465     // {
     465    if (pWizard)
     466    {
    466467    //     if (selectedDiskSource() == SelectedDiskSource_New)
    467468    //     {
     
    477478    //     if (!fResult)
    478479    //         pWizard->deleteVirtualDisk();
    479     // }
     480    }
    480481    // endProcessing();
    481482
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