VirtualBox

Changeset 105549 in vbox


Ignore:
Timestamp:
Jul 31, 2024 9:45:06 AM (4 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10736. Adding a new ctor to the new vd wizard.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp

    r105542 r105549  
    6060    setPixmapName(":/wizard_new_harddisk_bg.png");
    6161#endif /* VBOX_WS_MAC */
     62}
     63
     64UIWizardNewVD::UIWizardNewVD(QWidget *pParent, const QUuid &uMediumId)
     65    : UINativeWizard(pParent, WizardType_CloneVD)
     66    , m_iMediumVariantPageIndex(-1)
     67    , m_enmDeviceType(KDeviceType_Null)
     68{
     69#ifndef VBOX_WS_MAC
     70    /* Assign watermark: */
     71    setPixmapName(":/wizard_new_harddisk.png");
     72#else /* VBOX_WS_MAC */
     73    /* Assign background image: */
     74    setPixmapName(":/wizard_new_harddisk_bg.png");
     75#endif /* VBOX_WS_MAC */
     76
     77    /* Init medium to be cloned: */
     78    UIMedium uiMedium = gpMediumEnumerator->medium(uMediumId);
     79    m_comSourceVirtualDisk = uiMedium.medium();
     80
     81    /* Init device type: */
     82    m_enmDeviceType = m_comSourceVirtualDisk.GetDeviceType();
    6283}
    6384
     
    262283    return m_comSourceVirtualDisk.GetLogicalSize();
    263284}
     285
     286KDeviceType UIWizardNewVD::deviceType() const
     287{
     288    return m_enmDeviceType;
     289}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h

    r105542 r105549  
    5151                  qulonglong uDefaultSize);
    5252
     53    /** Constructs wizard to clone medium referenced by @a uMediumId, passing @a pParent to the base-class. */
     54    UIWizardNewVD(QWidget *pParent, const QUuid &uMediumId);
     55
    5356    bool createVirtualDisk();
    5457
     
    8487       const QString &defaultName() const;
    8588       qulonglong defaultSize() const;
     89       KDeviceType deviceType() const;
    8690
    8791protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp

    r105543 r105549  
    158158    pWizard->setMediumFormat(comMediumFormat);
    159159
    160     QString strExtension = UIWizardDiskEditors::defaultExtension(comMediumFormat, KDeviceType_HardDisk);
     160    QString strExtension = UIWizardDiskEditors::defaultExtension(comMediumFormat, pWizard->deviceType());
    161161    QString strMediumFilePath =
    162162        UIWizardDiskEditors::constructMediumFilePath(UIWizardDiskEditors::appendExtension(pWizard->defaultName(),
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