VirtualBox

Ignore:
Timestamp:
Oct 5, 2021 5:24:33 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: UIWizardImportApp: Moving appliance related code from UIApplianceImportEditorWidget to UIWizardImportApp itself where it belongs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp

    r91567 r91578  
    142142
    143143UIWizardImportAppPageBasic2::UIWizardImportAppPageBasic2(const QString &strFileName)
    144     : m_enmCertText(kCertText_Uninitialized)
     144    : m_strFileName(strFileName)
     145    , m_enmCertText(kCertText_Uninitialized)
    145146{
    146147    /* Create main layout: */
     
    174175                    {
    175176                        m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    176                         m_pApplianceWidget->setFile(strFileName);
    177177                        pApplianceWidgetLayout->addWidget(m_pApplianceWidget, 0, 0, 1, 3);
    178178                    }
     
    370370    /* Update widget visibility: */
    371371    updatePageAppearance();
    372     /* Populate MAC address import combo: */
    373     populateMACAddressImportPolicies();
    374372
    375373    /* Check whether there was cloud source selected: */
    376374    const bool fIsSourceCloudOne = field("isSourceCloudOne").toBool();
    377375    if (fIsSourceCloudOne)
     376    {
     377        /* Refresh form properties table: */
    378378        refreshFormPropertiesTable();
     379    }
    379380    else
    380381    {
    381         /* Acquire appliance: */
    382         CAppliance *pAppliance = m_pApplianceWidget->appliance();
    383 
    384         /* Check if pAppliance is alive. If not just return here.
    385          * This prevents crashes when an invalid ova file is supllied: */
    386         if (!pAppliance)
     382        /* Populate MAC address import combo: */
     383        populateMACAddressImportPolicies();
     384
     385        /* If we have file name passed,
     386         * check if specified file contains valid appliance: */
     387        if (   !m_strFileName.isEmpty()
     388            && !qobject_cast<UIWizardImportApp*>(wizard())->setFile(m_strFileName))
    387389        {
    388             if (wizard())
    389                 wizard()->reject();
     390            wizard()->reject();
    390391            return;
    391392        }
    392393
    393         /* Make sure we initialize model items with correct base folder path: */
     394        /* Acquire appliance: */
     395        CAppliance comAppliance = qobject_cast<UIWizardImportApp*>(wizard())->appliance();
     396
     397        /* Initialize appliance widget: */
     398        m_pApplianceWidget->setAppliance(comAppliance);
     399        /* Make sure we initialize appliance widget model with correct base folder path: */
    394400        if (m_pEditorImportFilePath)
    395401            sltHandlePathChanged(m_pEditorImportFilePath->path());
    396402
    397403        /* Acquire certificate: */
    398         CCertificate comCertificate = pAppliance->GetCertificate();
     404        CCertificate comCertificate = comAppliance.GetCertificate();
    399405        if (comCertificate.isNull())
    400406            m_enmCertText = kCertText_Unsigned;
     
    421427
    422428                /* Instantiate the dialog: */
    423                 QPointer<UIApplianceUnverifiedCertificateViewer> pDialog = new UIApplianceUnverifiedCertificateViewer(this, comCertificate);
    424                 AssertPtrReturnVoid(pDialog.data());
     429                QPointer<UIApplianceUnverifiedCertificateViewer> pDialog =
     430                    new UIApplianceUnverifiedCertificateViewer(this, comCertificate);
    425431
    426432                /* Show viewer in modal mode: */
     
    481487        }
    482488    }
     489    else
     490    {
     491        /* Make sure widget has own data committed: */
     492        m_pApplianceWidget->prepareImport();
     493    }
    483494
    484495    /* Try to import appliance: */
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