VirtualBox

Changeset 78127 in vbox for trunk


Ignore:
Timestamp:
Apr 15, 2019 5:24:30 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9434: Import Appliance wizard: 1st basic page: Rework r129980 to pass VSD form (instead of cloud client) through as wizard field to be used on 2nd basic page.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance
Files:
2 edited

Legend:

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

    r78113 r78127  
    386386}
    387387
    388 CCloudClient UIWizardImportAppPage1::client() const
    389 {
    390     return m_comCloudClient;
     388CVirtualSystemDescriptionForm UIWizardImportAppPage1::vsdForm() const
     389{
     390    return m_comVSDForm;
    391391}
    392392
     
    619619    registerField("isSourceCloudOne", this, "isSourceCloudOne");
    620620    registerField("profile", this, "profile");
    621     registerField("client", this, "client");
     621    registerField("vsdForm", this, "vsdForm");
    622622}
    623623
     
    723723bool UIWizardImportAppPageBasic1::validatePage()
    724724{
    725     /* Get import appliance widget: */
    726     ImportAppliancePointer pImportApplianceWidget = field("applianceWidget").value<ImportAppliancePointer>();
    727     AssertMsg(!pImportApplianceWidget.isNull(), ("Appliance Widget is not set!\n"));
    728 
    729     /* If file name was changed: */
    730     if (m_pFileSelector->isModified())
    731     {
    732         /* Check if set file contains valid appliance: */
    733         if (!pImportApplianceWidget->setFile(m_pFileSelector->path()))
     725    if (isSourceCloudOne())
     726    {
     727        CVirtualSystemDescriptionForm comForm;
     728        CProgress comProgress = m_comCloudClient.GetExportLaunchDescriptionForm(comForm);
     729        /* Show error message if necessary: */
     730        if (!m_comCloudClient.isOk())
     731        {
     732            /// @todo add real error message
     733            //msgCenter().cannotAcquireExportLaunchDescriptionForm(comCloudClient, this);
    734734            return false;
    735         /* Reset the modified bit afterwards: */
    736         m_pFileSelector->resetModified();
    737     }
    738 
    739     /* If we have a valid ovf proceed to the appliance settings page: */
    740     return pImportApplianceWidget->isValid();
     735        }
     736        else
     737        {
     738            /* Show "Acquire export form" progress: */
     739            msgCenter().showModalProgressDialog(comProgress, UIWizardImportApp::tr("Acquire export form..."),
     740                                                ":/progress_media_move_90px.png", this);
     741
     742            /* Show error message if necessary: */
     743            if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     744            {
     745                /// @todo add real error message
     746                //msgCenter().cannotAcquireExportLaunchDescriptionForm(comProgress, this);
     747                return false;
     748            }
     749            else
     750                m_comVSDForm = comForm;
     751        }
     752        return true;
     753    }
     754    else
     755    {
     756        /* Get import appliance widget: */
     757        ImportAppliancePointer pImportApplianceWidget = field("applianceWidget").value<ImportAppliancePointer>();
     758        AssertMsg(!pImportApplianceWidget.isNull(), ("Appliance Widget is not set!\n"));
     759
     760        /* If file name was changed: */
     761        if (m_pFileSelector->isModified())
     762        {
     763            /* Check if set file contains valid appliance: */
     764            if (!pImportApplianceWidget->setFile(m_pFileSelector->path()))
     765                return false;
     766            /* Reset the modified bit afterwards: */
     767            m_pFileSelector->resetModified();
     768        }
     769
     770        /* If we have a valid ovf proceed to the appliance settings page: */
     771        return pImportApplianceWidget->isValid();
     772    }
    741773}
    742774
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h

    r78113 r78127  
    3232#include "CCloudProvider.h"
    3333#include "CCloudProviderManager.h"
     34#include "CVirtualSystemDescriptionForm.h"
    3435
    3536/* Forward declarations: */
     
    9899    /** Returns Cloud Profile object. */
    99100    CCloudProfile profile() const;
    100     /** Returns Cloud Client object. */
    101     CCloudClient client() const;
     101    /** Returns Virtual System Description Form object. */
     102    CVirtualSystemDescriptionForm vsdForm() const;
    102103
    103104    /** Holds whether default source should be Import from OCI. */
     
    105106
    106107    /** Holds the Cloud Provider Manager reference. */
    107     CCloudProviderManager  m_comCloudProviderManager;
     108    CCloudProviderManager          m_comCloudProviderManager;
    108109    /** Holds the Cloud Provider object reference. */
    109     CCloudProvider         m_comCloudProvider;
     110    CCloudProvider                 m_comCloudProvider;
    110111    /** Holds the Cloud Profile object reference. */
    111     CCloudProfile          m_comCloudProfile;
     112    CCloudProfile                  m_comCloudProfile;
    112113    /** Holds the Cloud Client object reference. */
    113     CCloudClient           m_comCloudClient;
     114    CCloudClient                   m_comCloudClient;
     115    /** Holds the Virtual System Description Form object reference. */
     116    CVirtualSystemDescriptionForm  m_comVSDForm;
    114117
    115118    /** Holds the source layout instance. */
     
    149152    Q_PROPERTY(bool isSourceCloudOne READ isSourceCloudOne);
    150153    Q_PROPERTY(CCloudProfile profile READ profile);
    151     Q_PROPERTY(CCloudClient client READ client);
     154    Q_PROPERTY(CVirtualSystemDescriptionForm vsdForm READ vsdForm);
    152155
    153156public:
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