VirtualBox

Changeset 93540 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 2, 2022 7:21:28 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt, Main/Unattended. bugref:9515, bugref:9781. Adding necessary member variables to new vm wizard for detected image names and indices.

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

Legend:

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

    r93409 r93540  
    832832}
    833833
     834void UIWizardNewVM::setDetectedImageNamesAndIndices(const QVector<QString> &names, const QVector<ULONG> &ids)
     835{
     836    AssertMsg(names.size() == ids.size(),
     837              ("Sizes of the arrays for names and indices of the detected images should be equal."));
     838    m_detectedImageNames = names;
     839    m_detectedImageIndices = ids;
     840}
     841
     842const QVector<QString> &UIWizardNewVM::detectedImageNames() const
     843{
     844    return m_detectedImageNames;
     845}
     846
     847const QVector<ULONG> &UIWizardNewVM::detectedImageIndices() const
     848{
     849    return m_detectedImageIndices;
     850}
     851
    834852QVector<KMediumVariant> UIWizardNewVM::mediumVariants() const
    835853{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r93409 r93540  
    171171        void setEmptyDiskRecommended(bool fEmptyDiskRecommended);
    172172
     173        void setDetectedImageNamesAndIndices(const QVector<QString> &names, const QVector<ULONG> &ids);
     174        const QVector<QString> &detectedImageNames() const;
     175        const QVector<ULONG> &detectedImageIndices() const;
     176
    173177        QVector<KMediumVariant> mediumVariants() const;
    174178    /** @} */
     
    224228       /** Type Id od the OS detected from the ISO file by IUnattended. */
    225229       QString m_strDetectedOSTypeId;
     230       /* Name and index lists of the images detected from an ISO. Currently only for Windows ISOs. */
     231       QVector<QString> m_detectedImageNames;
     232       QVector<ULONG> m_detectedImageIndices;
    226233
    227234       /** Holds the VM OS family ID. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r93456 r93540  
    148148    AssertReturnVoid(pWizard);
    149149
    150     UIWizardNewVMNameOSTypeCommon::detectOSType(strISOPath, pWizard);
    151 
     150    UIWizardNewVMNameOSTypeCommon::detectOSAndImagesFromISO(strISOPath, pWizard);
    152151
    153152    if (UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId()))
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp

    r93456 r93540  
    311311}
    312312
    313 void UIWizardNewVMNameOSTypeCommon::detectOSType(const QString &strISOPath, UIWizardNewVM *pWizard)
     313void UIWizardNewVMNameOSTypeCommon::detectOSAndImagesFromISO(const QString &strISOPath, UIWizardNewVM *pWizard)
    314314{
    315315    if (!pWizard)
     
    327327    comUnatteded.DetectIsoOS();
    328328    pWizard->setDetectedOSTypeId(comUnatteded.GetDetectedOSTypeId());
     329
     330    pWizard->setDetectedImageNamesAndIndices(comUnatteded.GetDetectedImageNames(),
     331                                             comUnatteded.GetDetectedImageIndices());
    329332}
    330333
     
    479482    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(this->wizard());
    480483    AssertReturnVoid(pWizard);
    481     UIWizardNewVMNameOSTypeCommon::detectOSType(strPath, pWizard);
     484    UIWizardNewVMNameOSTypeCommon::detectOSAndImagesFromISO(strPath, pWizard);
    482485
    483486    if (UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId()))
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.h

    r93455 r93540  
    4343    bool cleanupMachineFolder(UIWizardNewVM *pWizard, bool fWizardCancel = false);
    4444    void composeMachineFilePath(UINameAndSystemEditor *pNameAndSystemEditor, UIWizardNewVM *pWizard);
    45     void detectOSType(const QString &strISOPath, UIWizardNewVM *pWizard);
     45    void detectOSAndImagesFromISO(const QString &strISOPath, UIWizardNewVM *pWizard);
    4646    /** Return false if ISO path is not empty but points to an missing or unreadable file. */
    4747    bool checkISOFile(UINameAndSystemEditor *pNameAndSystemEditor);
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