VirtualBox

Changeset 75227 in vbox


Ignore:
Timestamp:
Nov 2, 2018 2:48:47 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9152: Export appliance wizard: Move CloudClient functionality from 3rd to 2nd page; this allows to acquire export operation parameters before going to 3rd page.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r75226 r75227  
    2626# include <QGridLayout>
    2727# include <QHeaderView>
     28# include <QJsonArray>
     29# include <QJsonDocument>
     30# include <QJsonObject>
     31# include <QJsonValue>
    2832# include <QLabel>
    2933# include <QLineEdit>
     
    4650
    4751/* COM includes: */
     52# include "CCloudClient.h"
    4853# include "CCloudProvider.h"
    4954
     
    288293}
    289294
     295void UIWizardExportAppPage2::populateCloudClientParameters()
     296{
     297    /* Forget current parameters: */
     298    m_cloudClientParameters.clear();
     299
     300    /* Return if no profile chosen: */
     301    if (m_comCloudProfile.isNull())
     302        return;
     303
     304    /* Create Cloud Client: */
     305    CCloudClient comCloudClient = m_comCloudProfile.CreateCloudClient();
     306    /* Show error message if necessary: */
     307    if (!m_comCloudProfile.isOk())
     308        msgCenter().cannotCreateCloudClient(m_comCloudProfile);
     309    else
     310    {
     311        /* Read Cloud Client parameters for Export VM operation: */
     312        const QString strJSON = comCloudClient.GetExportParameters();
     313        /* Show error message if necessary: */
     314        if (!comCloudClient.isOk())
     315            msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
     316        else
     317        {
     318            /* Create JSON document and parse it: */
     319            const QJsonDocument document = QJsonDocument::fromJson(strJSON.toUtf8());
     320            if (!document.isEmpty())
     321                m_cloudClientParameters = parseJsonDocument(document);
     322        }
     323    }
     324}
     325
     326/* static */
     327AbstractVSDParameterList UIWizardExportAppPage2::parseJsonDocument(const QJsonDocument &document)
     328{
     329    /* Prepare parameters: */
     330    AbstractVSDParameterList parameters;
     331
     332    /* Convert document to object, make sure it isn't empty: */
     333    QJsonObject documentObject = document.object();
     334    AssertMsgReturn(!documentObject.isEmpty(), ("Document object is empty!"), parameters);
     335
     336    /* Iterate through document object values: */
     337    foreach (const QString &strElementName, documentObject.keys())
     338    {
     339        //printf("Element name: \"%s\"\n", strElementName.toUtf8().constData());
     340
     341        /* Prepare parameter: */
     342        AbstractVSDParameter parameter;
     343
     344        /* Assign name: */
     345        parameter.name = strElementName;
     346
     347        /* Acquire element, make sure it's an object: */
     348        const QJsonValue element = documentObject.value(strElementName);
     349        AssertMsg(element.isObject(), ("Element '%s' has wrong structure!", strElementName.toUtf8().constData()));
     350        if (!element.isObject())
     351            continue;
     352
     353        /* Convert element to object, make sure it isn't empty: */
     354        const QJsonObject elementObject = element.toObject();
     355        AssertMsg(!elementObject.isEmpty(), ("Element '%s' object has wrong structure!", strElementName.toUtf8().constData()));
     356        if (elementObject.isEmpty())
     357            continue;
     358
     359        /* Iterate through element object values: */
     360        foreach (const QString &strFieldName, elementObject.keys())
     361        {
     362            //printf(" Field name: \"%s\"\n", strFieldName.toUtf8().constData());
     363
     364            /* Acquire field: */
     365            const QJsonValue field = elementObject.value(strFieldName);
     366
     367            /* Parse known fields: */
     368            if (strFieldName == "type")
     369                parameter.type = (KVirtualSystemDescriptionType)(int)parseJsonFieldDouble(strFieldName, field);
     370            else
     371            if (strFieldName == "bool")
     372            {
     373                AbstractVSDParameterBool get;
     374                get.value = parseJsonFieldBool(strFieldName, field);
     375                parameter.get = QVariant::fromValue(get);
     376                parameter.kind = ParameterKind_Bool;
     377            }
     378            else
     379            if (strFieldName == "min")
     380            {
     381                AbstractVSDParameterDouble get = parameter.get.value<AbstractVSDParameterDouble>();
     382                get.minimum = parseJsonFieldDouble(strFieldName, field);
     383                parameter.get = QVariant::fromValue(get);
     384                parameter.kind = ParameterKind_Double;
     385            }
     386            else
     387            if (strFieldName == "max")
     388            {
     389                AbstractVSDParameterDouble get = parameter.get.value<AbstractVSDParameterDouble>();
     390                get.maximum = parseJsonFieldDouble(strFieldName, field);
     391                parameter.get = QVariant::fromValue(get);
     392                parameter.kind = ParameterKind_Double;
     393            }
     394            else
     395            if (strFieldName == "unit")
     396            {
     397                AbstractVSDParameterDouble get = parameter.get.value<AbstractVSDParameterDouble>();
     398                get.unit = parseJsonFieldString(strFieldName, field);
     399                parameter.get = QVariant::fromValue(get);
     400                parameter.kind = ParameterKind_Double;
     401            }
     402            else
     403            if (strFieldName == "items")
     404            {
     405                AbstractVSDParameterArray get;
     406                get.values = parseJsonFieldArray(strFieldName, field);
     407                parameter.get = QVariant::fromValue(get);
     408                parameter.kind = ParameterKind_Array;
     409            }
     410        }
     411
     412        /* Append parameter: */
     413        parameters << parameter;
     414    }
     415
     416    /* Return parameters: */
     417    return parameters;
     418}
     419
     420/* static */
     421bool UIWizardExportAppPage2::parseJsonFieldBool(const QString &strFieldName, const QJsonValue &field)
     422{
     423    /* Make sure field is bool: */
     424    Q_UNUSED(strFieldName);
     425    AssertMsgReturn(field.isBool(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), false);
     426    const bool fFieldValue = field.toBool();
     427    //printf("  Field value: \"%s\"\n", fFieldValue ? "true" : "false");
     428
     429    return fFieldValue;
     430}
     431
     432/* static */
     433double UIWizardExportAppPage2::parseJsonFieldDouble(const QString &strFieldName, const QJsonValue &field)
     434{
     435    /* Make sure field is double: */
     436    Q_UNUSED(strFieldName);
     437    AssertMsgReturn(field.isDouble(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), 0);
     438    const double dFieldValue = field.toDouble();
     439    //printf("  Field value: \"%f\"\n", dFieldValue);
     440
     441    return dFieldValue;
     442}
     443
     444/* static */
     445QString UIWizardExportAppPage2::parseJsonFieldString(const QString &strFieldName, const QJsonValue &field)
     446{
     447    /* Make sure field is string: */
     448    Q_UNUSED(strFieldName);
     449    AssertMsgReturn(field.isString(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), QString());
     450    const QString strFieldValue = field.toString();
     451    //printf("  Field value: \"%s\"\n", strFieldValue.toUtf8().constData());
     452
     453    return strFieldValue;
     454}
     455
     456/* static */
     457QIStringPairList UIWizardExportAppPage2::parseJsonFieldArray(const QString &strFieldName, const QJsonValue &field)
     458{
     459    /* Make sure field is array: */
     460    Q_UNUSED(strFieldName);
     461    AssertMsgReturn(field.isArray(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), QIStringPairList());
     462    const QJsonArray fieldValueArray = field.toArray();
     463    QIStringPairList fieldValueStringPairList;
     464    /* Parse array: */
     465    for (int i = 0; i < fieldValueArray.count(); ++i)
     466    {
     467        /* Parse current array value: */
     468        const QJsonValue value = fieldValueArray[i];
     469        /* If value is of string type, we just take it: */
     470        if (value.isString())
     471            fieldValueStringPairList << qMakePair(fieldValueArray[i].toString(), QString());
     472        /* If value is of object type, we take object key/value pairs: */
     473        else if (value.isObject())
     474        {
     475            const QJsonObject valueObject = value.toObject();
     476            foreach (const QString &strKey, valueObject.keys())
     477                fieldValueStringPairList << qMakePair(strKey, valueObject.value(strKey).toString());
     478        }
     479    }
     480    //QStringList test;
     481    //foreach (const QIStringPair &pair, fieldValueStringPairList)
     482    //    if (pair.second.isNull())
     483    //        test << QString("{%1}").arg(pair.first);
     484    //    else
     485    //        test << QString("{%1 : %2}").arg(pair.first, pair.second);
     486    //printf("  Field value: \"%s\"\n", test.join(", ").toUtf8().constData());
     487
     488    return fieldValueStringPairList;
     489}
     490
    290491void UIWizardExportAppPage2::updatePageAppearance()
    291492{
     
    518719{
    519720    return m_comCloudProfile;
     721}
     722
     723AbstractVSDParameterList UIWizardExportAppPage2::cloudClientParameters() const
     724{
     725    return m_cloudClientParameters;
    520726}
    521727
     
    7961002            this, &UIWizardExportAppPageBasic2::sltHandleAccountButtonClick);
    7971003
     1004    /* Register classes: */
     1005    qRegisterMetaType<AbstractVSDParameterList>();
    7981006    /* Register fields: */
    7991007    registerField("format", this, "format");
     
    8061014    registerField("profileName", this, "profileName");
    8071015    registerField("profile", this, "profile");
     1016    registerField("cloudClientParameters", this, "cloudClientParameters");
    8081017}
    8091018
     
    9481157                          || field("format").toString() == "ovf-1.0"
    9491158                          || field("format").toString() == "ovf-2.0";
    950         const bool fCSP =    isFormatCloudOne();
     1159        const bool fCSP =    field("isFormatCloudOne").toBool();
    9511160
    9521161        const QString &strFile = field("path").toString().toLower();
     
    9591168    }
    9601169
     1170    return fResult;
     1171}
     1172
     1173bool UIWizardExportAppPageBasic2::validatePage()
     1174{
     1175    /* Initial result: */
     1176    bool fResult = true;
     1177
     1178    /* For cloud formats we need to: */
     1179    if (field("isFormatCloudOne").toBool())
     1180    {
     1181        /* Populate cloud client parameters: */
     1182        populateCloudClientParameters();
     1183        /* Which is required to continue to the next page: */
     1184        fResult = !field("cloudClientParameters").value<AbstractVSDParameterList>().isEmpty();
     1185    }
     1186
     1187    /* Return result: */
    9611188    return fResult;
    9621189}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h

    r75216 r75227  
    2323
    2424/* GUI includes: */
     25#include "UIApplianceEditorWidget.h"
    2526#include "UIWizardPage.h"
    2627
     
    8687    /** Populates account properties. */
    8788    void populateAccountProperties();
     89    /** Populates cloud client parameters. */
     90    void populateCloudClientParameters();
     91
     92    /** Parses JSON @a document. */
     93    static AbstractVSDParameterList parseJsonDocument(const QJsonDocument &document);
     94    /** Parses JSON bool @a field. */
     95    static bool parseJsonFieldBool(const QString &strFieldName, const QJsonValue &field);
     96    /** Parses JSON double @a field. */
     97    static double parseJsonFieldDouble(const QString &strFieldName, const QJsonValue &field);
     98    /** Parses JSON string @a field. */
     99    static QString parseJsonFieldString(const QString &strFieldName, const QJsonValue &field);
     100    /** Parses JSON array @a field. */
     101    static QIStringPairList parseJsonFieldArray(const QString &strFieldName, const QJsonValue &field);
    88102
    89103    /** Updates page appearance. */
     
    147161    /** Returns Cloud Profile object. */
    148162    CCloudProfile profile() const;
     163    /** Returns Cloud Client parameters. */
     164    AbstractVSDParameterList cloudClientParameters() const;
    149165
    150166    /** Holds the Cloud Provider Manager reference. */
    151     CCloudProviderManager  m_comCloudProviderManager;
     167    CCloudProviderManager     m_comCloudProviderManager;
    152168    /** Holds the Cloud Provider object reference. */
    153     CCloudProvider         m_comCloudProvider;
     169    CCloudProvider            m_comCloudProvider;
    154170    /** Holds the Cloud Profile object reference. */
    155     CCloudProfile          m_comCloudProfile;
     171    CCloudProfile             m_comCloudProfile;
     172    /** Holds the cloud client parameters. */
     173    AbstractVSDParameterList  m_cloudClientParameters;
    156174
    157175    /** Holds the default appliance name. */
     
    219237    Q_PROPERTY(QString profileName READ profileName);
    220238    Q_PROPERTY(CCloudProfile profile READ profile);
     239    Q_PROPERTY(AbstractVSDParameterList cloudClientParameters READ cloudClientParameters);
    221240
    222241public:
     
    242261    virtual bool isComplete() const /* override */;
    243262
     263    /** Performs page validation. */
     264    virtual bool validatePage() /* override */;
     265
    244266    /** Updates page appearance. */
    245267    virtual void updatePageAppearance() /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r75218 r75227  
    2121
    2222/* Qt includes: */
    23 # include <QJsonArray>
    24 # include <QJsonDocument>
    25 # include <QJsonObject>
    26 # include <QJsonValue>
    2723# include <QVBoxLayout>
    2824
     
    3733/* COM includes: */
    3834# include "CAppliance.h"
    39 # include "CCloudClient.h"
    40 # include "CCloudProfile.h"
    4135# include "CMachine.h"
    4236
     
    5044UIWizardExportAppPage3::UIWizardExportAppPage3()
    5145{
    52 }
    53 
    54 void UIWizardExportAppPage3::populateCloudClientParameters()
    55 {
    56     /* Forget current parameters: */
    57     m_listCloudClientParameters.clear();
    58 
    59     /* Make sure Cloud Profile is not null: */
    60     CCloudProfile comCloudProfile = fieldImp("profile").value<CCloudProfile>();
    61     if (comCloudProfile.isNull())
    62         return;
    63 
    64     /* Create Cloud Client: */
    65     CCloudClient comCloudClient = comCloudProfile.CreateCloudClient();
    66     /* Show error message if necessary: */
    67     if (!comCloudProfile.isOk())
    68         msgCenter().cannotCreateCloudClient(comCloudProfile);
    69     else
    70     {
    71         /* Read Cloud Client parameters for Export VM operation: */
    72         const QString strJSON = comCloudClient.GetExportParameters();
    73         /* Show error message if necessary: */
    74         if (!comCloudClient.isOk())
    75             msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
    76         else
    77         {
    78             /* Create JSON document and parse it: */
    79             const QJsonDocument document = QJsonDocument::fromJson(strJSON.toUtf8());
    80             if (!document.isEmpty())
    81                 m_listCloudClientParameters = parseJsonDocument(document);
    82         }
    83     }
    84 }
    85 
    86 /* static */
    87 AbstractVSDParameterList UIWizardExportAppPage3::parseJsonDocument(const QJsonDocument &document)
    88 {
    89     /* Prepare parameters: */
    90     AbstractVSDParameterList parameters;
    91 
    92     /* Convert document to object, make sure it isn't empty: */
    93     QJsonObject documentObject = document.object();
    94     AssertMsgReturn(!documentObject.isEmpty(), ("Document object is empty!"), parameters);
    95 
    96     /* Iterate through document object values: */
    97     foreach (const QString &strElementName, documentObject.keys())
    98     {
    99         //printf("Element name: \"%s\"\n", strElementName.toUtf8().constData());
    100 
    101         /* Prepare parameter: */
    102         AbstractVSDParameter parameter;
    103 
    104         /* Assign name: */
    105         parameter.name = strElementName;
    106 
    107         /* Acquire element, make sure it's an object: */
    108         const QJsonValue element = documentObject.value(strElementName);
    109         AssertMsg(element.isObject(), ("Element '%s' has wrong structure!", strElementName.toUtf8().constData()));
    110         if (!element.isObject())
    111             continue;
    112 
    113         /* Convert element to object, make sure it isn't empty: */
    114         const QJsonObject elementObject = element.toObject();
    115         AssertMsg(!elementObject.isEmpty(), ("Element '%s' object has wrong structure!", strElementName.toUtf8().constData()));
    116         if (elementObject.isEmpty())
    117             continue;
    118 
    119         /* Iterate through element object values: */
    120         foreach (const QString &strFieldName, elementObject.keys())
    121         {
    122             //printf(" Field name: \"%s\"\n", strFieldName.toUtf8().constData());
    123 
    124             /* Acquire field: */
    125             const QJsonValue field = elementObject.value(strFieldName);
    126 
    127             /* Parse known fields: */
    128             if (strFieldName == "type")
    129                 parameter.type = (KVirtualSystemDescriptionType)(int)parseJsonFieldDouble(strFieldName, field);
    130             else
    131             if (strFieldName == "bool")
    132             {
    133                 AbstractVSDParameterBool get;
    134                 get.value = parseJsonFieldBool(strFieldName, field);
    135                 parameter.get = QVariant::fromValue(get);
    136                 parameter.kind = ParameterKind_Bool;
    137             }
    138             else
    139             if (strFieldName == "min")
    140             {
    141                 AbstractVSDParameterDouble get = parameter.get.value<AbstractVSDParameterDouble>();
    142                 get.minimum = parseJsonFieldDouble(strFieldName, field);
    143                 parameter.get = QVariant::fromValue(get);
    144                 parameter.kind = ParameterKind_Double;
    145             }
    146             else
    147             if (strFieldName == "max")
    148             {
    149                 AbstractVSDParameterDouble get = parameter.get.value<AbstractVSDParameterDouble>();
    150                 get.maximum = parseJsonFieldDouble(strFieldName, field);
    151                 parameter.get = QVariant::fromValue(get);
    152                 parameter.kind = ParameterKind_Double;
    153             }
    154             else
    155             if (strFieldName == "unit")
    156             {
    157                 AbstractVSDParameterDouble get = parameter.get.value<AbstractVSDParameterDouble>();
    158                 get.unit = parseJsonFieldString(strFieldName, field);
    159                 parameter.get = QVariant::fromValue(get);
    160                 parameter.kind = ParameterKind_Double;
    161             }
    162             else
    163             if (strFieldName == "items")
    164             {
    165                 AbstractVSDParameterArray get;
    166                 get.values = parseJsonFieldArray(strFieldName, field);
    167                 parameter.get = QVariant::fromValue(get);
    168                 parameter.kind = ParameterKind_Array;
    169             }
    170         }
    171 
    172         /* Append parameter: */
    173         parameters << parameter;
    174     }
    175 
    176     /* Return parameters: */
    177     return parameters;
    178 }
    179 
    180 /* static */
    181 bool UIWizardExportAppPage3::parseJsonFieldBool(const QString &strFieldName, const QJsonValue &field)
    182 {
    183     /* Make sure field is bool: */
    184     Q_UNUSED(strFieldName);
    185     AssertMsgReturn(field.isBool(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), false);
    186     const bool fFieldValue = field.toBool();
    187     //printf("  Field value: \"%s\"\n", fFieldValue ? "true" : "false");
    188 
    189     return fFieldValue;
    190 }
    191 
    192 /* static */
    193 double UIWizardExportAppPage3::parseJsonFieldDouble(const QString &strFieldName, const QJsonValue &field)
    194 {
    195     /* Make sure field is double: */
    196     Q_UNUSED(strFieldName);
    197     AssertMsgReturn(field.isDouble(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), 0);
    198     const double dFieldValue = field.toDouble();
    199     //printf("  Field value: \"%f\"\n", dFieldValue);
    200 
    201     return dFieldValue;
    202 }
    203 
    204 /* static */
    205 QString UIWizardExportAppPage3::parseJsonFieldString(const QString &strFieldName, const QJsonValue &field)
    206 {
    207     /* Make sure field is string: */
    208     Q_UNUSED(strFieldName);
    209     AssertMsgReturn(field.isString(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), QString());
    210     const QString strFieldValue = field.toString();
    211     //printf("  Field value: \"%s\"\n", strFieldValue.toUtf8().constData());
    212 
    213     return strFieldValue;
    214 }
    215 
    216 /* static */
    217 QIStringPairList UIWizardExportAppPage3::parseJsonFieldArray(const QString &strFieldName, const QJsonValue &field)
    218 {
    219     /* Make sure field is array: */
    220     Q_UNUSED(strFieldName);
    221     AssertMsgReturn(field.isArray(), ("Field '%s' has wrong structure!", strFieldName.toUtf8().constData()), QIStringPairList());
    222     const QJsonArray fieldValueArray = field.toArray();
    223     QIStringPairList fieldValueStringPairList;
    224     /* Parse array: */
    225     for (int i = 0; i < fieldValueArray.count(); ++i)
    226     {
    227         /* Parse current array value: */
    228         const QJsonValue value = fieldValueArray[i];
    229         /* If value is of string type, we just take it: */
    230         if (value.isString())
    231             fieldValueStringPairList << qMakePair(fieldValueArray[i].toString(), QString());
    232         /* If value is of object type, we take object key/value pairs: */
    233         else if (value.isObject())
    234         {
    235             const QJsonObject valueObject = value.toObject();
    236             foreach (const QString &strKey, valueObject.keys())
    237                 fieldValueStringPairList << qMakePair(strKey, valueObject.value(strKey).toString());
    238         }
    239     }
    240     //QStringList test;
    241     //foreach (const QIStringPair &pair, fieldValueStringPairList)
    242     //    if (pair.second.isNull())
    243     //        test << QString("{%1}").arg(pair.first);
    244     //    else
    245     //        test << QString("{%1 : %2}").arg(pair.first, pair.second);
    246     //printf("  Field value: \"%s\"\n", test.join(", ").toUtf8().constData());
    247 
    248     return fieldValueStringPairList;
    24946}
    25047
     
    27067                    if (fieldImp("isFormatCloudOne").toBool())
    27168                    {
    272                         /* Populate Cloud Client parameters: */
    273                         populateCloudClientParameters();
     69                        /* Acquire Cloud Client parameters: */
     70                        const AbstractVSDParameterList cloudClientParameters =
     71                            fieldImp("cloudClientParameters").value<AbstractVSDParameterList>();
    27472                        /* Pass them as a list of hints to help editor with names/values: */
    275                         m_pApplianceWidget->setVsdHints(m_listCloudClientParameters);
     73                        m_pApplianceWidget->setVsdHints(cloudClientParameters);
    27674                        /* Add corresponding Cloud Client fields with default values: */
    277                         foreach (const AbstractVSDParameter &parameter, m_listCloudClientParameters)
     75                        foreach (const AbstractVSDParameter &parameter, cloudClientParameters)
    27876                        {
    27977                            QString strValue;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r75217 r75227  
    4343    UIWizardExportAppPage3();
    4444
    45     /** Populates cloud client parameters. */
    46     void populateCloudClientParameters();
    47 
    48     /** Parses JSON @a document. */
    49     static AbstractVSDParameterList parseJsonDocument(const QJsonDocument &document);
    50     /** Parses JSON bool @a field. */
    51     static bool parseJsonFieldBool(const QString &strFieldName, const QJsonValue &field);
    52     /** Parses JSON double @a field. */
    53     static double parseJsonFieldDouble(const QString &strFieldName, const QJsonValue &field);
    54     /** Parses JSON string @a field. */
    55     static QString parseJsonFieldString(const QString &strFieldName, const QJsonValue &field);
    56     /** Parses JSON array @a field. */
    57     static QIStringPairList parseJsonFieldArray(const QString &strFieldName, const QJsonValue &field);
    58 
    5945    /** Refreshes appliance settings widget. */
    6046    void refreshApplianceSettingsWidget();
     
    6248    /** Returns the appliance widget reference. */
    6349    ExportAppliancePointer applianceWidget() const { return m_pApplianceWidget; }
    64 
    65     /** Holds the cloud client parameters. */
    66     AbstractVSDParameterList  m_listCloudClientParameters;
    6750
    6851    /** Holds the appliance widget reference. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r75225 r75227  
    352352    /* Populate account properties: */
    353353    populateAccountProperties();
     354    /* Populate cloud client parameters: */
     355    populateCloudClientParameters();
    354356
    355357    /* Setup connections: */
     
    371373    qRegisterMetaType<ExportAppliancePointer>();
    372374
     375    /* Register classes: */
     376    qRegisterMetaType<AbstractVSDParameterList>();
    373377    /* Register fields: */
    374378    registerField("machineNames", this, "machineNames");
     
    383387    registerField("profileName", this, "profileName");
    384388    registerField("profile", this, "profile");
     389    registerField("cloudClientParameters", this, "cloudClientParameters");
    385390    registerField("applianceWidget", this, "applianceWidget");
    386391}
     
    532537        const QString &strFile = field("path").toString().toLower();
    533538        const QString &strAccount = field("profileName").toString();
     539        const AbstractVSDParameterList &parameters = field("cloudClientParameters").value<AbstractVSDParameterList>();
    534540
    535541        fResult =    (   fOVF
    536542                      && VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts))
    537543                  || (   fCSP
    538                       && !strAccount.isNull());
     544                      && !strAccount.isNull()
     545                      && !parameters.isEmpty());
    539546    }
    540547
     
    582589    populateAccounts();
    583590    populateAccountProperties();
     591    populateCloudClientParameters();
    584592    refreshApplianceSettingsWidget();
    585593    emit completeChanged();
     
    596604    /* Refresh required settings: */
    597605    populateAccountProperties();
     606    populateCloudClientParameters();
     607    refreshApplianceSettingsWidget();
     608    emit completeChanged();
    598609}
    599610
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r75225 r75227  
    4545    Q_PROPERTY(QString profileName READ profileName);
    4646    Q_PROPERTY(CCloudProfile profile READ profile);
     47    Q_PROPERTY(AbstractVSDParameterList cloudClientParameters READ cloudClientParameters);
    4748    Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget);
    4849
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