VirtualBox

Changeset 91368 in vbox


Ignore:
Timestamp:
Sep 24, 2021 4:31:13 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147042
Message:

FE/Qt: bugref:9996: Full refactoring for Export Appliance wizard; Moving it to UINativeWizard[Page] API.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r91363 r91368  
    911911    /* Use the "safe way" to open stack of Mac OS X Sheets: */
    912912    QWidget *pWizardParent = windowManager().realParentWindow(this);
    913     UISafePointerWizard pWizard = new UIWizardExportApp(pWizardParent, names,
    914                                                         pAction &&
    915                                                         pAction == actionPool()->action(UIActionIndexMN_M_Machine_S_ExportToOCI));
     913    UINativeWizardPointer pWizard = new UIWizardExportApp(pWizardParent,
     914                                                          names,
     915                                                          pAction &&
     916                                                          pAction == actionPool()->action(UIActionIndexMN_M_Machine_S_ExportToOCI));
    916917    windowManager().registerNewParent(pWizard, pWizardParent);
    917     pWizard->prepare();
    918918    pWizard->exec();
    919919    delete pWizard;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r91285 r91368  
    1717
    1818/* Qt includes: */
    19 #include <QAbstractButton>
    2019#include <QFileInfo>
     20#include <QPushButton>
    2121#include <QVariant>
    2222
     
    3535/* COM includes: */
    3636#include "CAppliance.h"
    37 
    38 /* COM includes: */
    3937#include "CVFSExplorer.h"
    4038
    4139
    4240UIWizardExportApp::UIWizardExportApp(QWidget *pParent,
    43                                      const QStringList &selectedVMNames /* = QStringList() */,
     41                                     const QStringList &predefinedMachineNames /* = QStringList() */,
    4442                                     bool fFastTraverToExportOCI /* = false */)
    45     : UIWizard(pParent, WizardType_ExportAppliance)
    46     , m_selectedVMNames(selectedVMNames)
     43    : UINativeWizard(pParent, WizardType_ExportAppliance, WizardMode_Auto,
     44                     fFastTraverToExportOCI ? "cloud-export-oci" : "ovf")
     45    , m_predefinedMachineNames(predefinedMachineNames)
    4746    , m_fFastTraverToExportOCI(fFastTraverToExportOCI)
     47    , m_fFormatCloudOne(false)
    4848{
    4949#ifndef VBOX_WS_MAC
    5050    /* Assign watermark: */
    51     assignWatermark(":/wizard_ovf_export.png");
     51    setPixmapName(":/wizard_ovf_export.png");
    5252#else
    5353    /* Assign background image: */
    54     assignBackground(":/wizard_ovf_export_bg.png");
     54    setPixmapName(":/wizard_ovf_export_bg.png");
    5555#endif
    5656}
    5757
     58QStringList UIWizardExportApp::machineNames() const
     59{
     60    return m_machineNames;
     61}
     62
     63void UIWizardExportApp::setMachineNames(const QStringList &names)
     64{
     65    m_machineNames = names;
     66}
     67
     68QList<QUuid> UIWizardExportApp::machineIDs() const
     69{
     70    return m_machineIDs;
     71}
     72
     73void UIWizardExportApp::setMachineIDs(const QList<QUuid> &ids)
     74{
     75    m_machineIDs = ids;
     76}
     77
     78QString UIWizardExportApp::format() const
     79{
     80    return m_strFormat;
     81}
     82
     83void UIWizardExportApp::setFormat(const QString &strFormat)
     84{
     85    m_strFormat = strFormat;
     86}
     87
     88bool UIWizardExportApp::isFormatCloudOne() const
     89{
     90    return m_fFormatCloudOne;
     91}
     92
     93void UIWizardExportApp::setFormatCloudOne(bool fCloudOne)
     94{
     95    m_fFormatCloudOne = fCloudOne;
     96}
     97
     98QString UIWizardExportApp::path() const
     99{
     100    return m_strPath;
     101}
     102
     103void UIWizardExportApp::setPath(const QString &strPath)
     104{
     105    m_strPath = strPath;
     106}
     107
     108MACAddressExportPolicy UIWizardExportApp::macAddressExportPolicy() const
     109{
     110    return m_enmMACAddressExportPolicy;
     111}
     112
     113void UIWizardExportApp::setMACAddressExportPolicy(MACAddressExportPolicy enmPolicy)
     114{
     115    m_enmMACAddressExportPolicy = enmPolicy;
     116}
     117
     118bool UIWizardExportApp::isManifestSelected() const
     119{
     120    return m_fManifestSelected;
     121}
     122
     123void UIWizardExportApp::setManifestSelected(bool fSelected)
     124{
     125    m_fManifestSelected = fSelected;
     126}
     127
     128bool UIWizardExportApp::isIncludeISOsSelected() const
     129{
     130    return m_fIncludeISOsSelected;
     131}
     132
     133void UIWizardExportApp::setIncludeISOsSelected(bool fSelected)
     134{
     135    m_fIncludeISOsSelected = fSelected;
     136}
     137
     138CAppliance UIWizardExportApp::localAppliance()
     139{
     140    return m_comLocalAppliance;
     141}
     142
     143void UIWizardExportApp::setLocalAppliance(const CAppliance &comAppliance)
     144{
     145    m_comLocalAppliance = comAppliance;
     146}
     147
     148QString UIWizardExportApp::profileName() const
     149{
     150    return m_strProfileName;
     151}
     152
     153void UIWizardExportApp::setProfileName(const QString &strName)
     154{
     155    m_strProfileName = strName;
     156}
     157
     158CAppliance UIWizardExportApp::cloudAppliance()
     159{
     160    return m_comCloudAppliance;
     161}
     162
     163void UIWizardExportApp::setCloudAppliance(const CAppliance &comAppliance)
     164{
     165    m_comCloudAppliance = comAppliance;
     166}
     167
     168CCloudClient UIWizardExportApp::cloudClient()
     169{
     170    return m_comCloudClient;
     171}
     172
     173void UIWizardExportApp::setCloudClient(const CCloudClient &comClient)
     174{
     175    m_comCloudClient = comClient;
     176}
     177
     178CVirtualSystemDescription UIWizardExportApp::vsd()
     179{
     180    return m_comVsd;
     181}
     182
     183void UIWizardExportApp::setVsd(const CVirtualSystemDescription &comDescription)
     184{
     185    m_comVsd = comDescription;
     186}
     187
     188CVirtualSystemDescriptionForm UIWizardExportApp::vsdExportForm()
     189{
     190    return m_comVsdExportForm;
     191}
     192
     193void UIWizardExportApp::setVsdExportForm(const CVirtualSystemDescriptionForm &comForm)
     194{
     195    m_comVsdExportForm = comForm;
     196}
     197
     198CloudExportMode UIWizardExportApp::cloudExportMode() const
     199{
     200    return m_enmCloudExportMode;
     201}
     202
     203void UIWizardExportApp::setCloudExportMode(const CloudExportMode &enmMode)
     204{
     205    m_enmCloudExportMode = enmMode;
     206}
     207
     208void UIWizardExportApp::goForward()
     209{
     210    wizardButton(WizardButtonType_Next)->click();
     211}
     212
    58213QString UIWizardExportApp::uri(bool fWithFile) const
    59214{
    60215    /* For Cloud formats: */
    61     if (field("isFormatCloudOne").toBool())
    62         return QString("%1://").arg(field("providerShortName").toString());
     216    if (isFormatCloudOne())
     217        return QString("%1://").arg(format());
    63218    else
    64219    {
    65220        /* Prepare storage path: */
    66         QString strPath = field("path").toString();
     221        QString strPath = path();
    67222        /* Append file name if requested: */
    68223        if (!fWithFile)
     
    80235{
    81236    /* Check whether there was cloud target selected: */
    82     const bool fIsFormatCloudOne = field("isFormatCloudOne").toBool();
    83     if (fIsFormatCloudOne)
     237    if (isFormatCloudOne())
    84238    {
    85239        /* Get appliance: */
    86         CAppliance comAppliance = field("cloudAppliance").value<CAppliance>();
     240        CAppliance comAppliance = cloudAppliance();
    87241        AssertReturn(comAppliance.isNotNull(), false);
    88242
     
    93247    {
    94248        /* Get appliance: */
    95         CAppliance comAppliance = field("localAppliance").value<CAppliance>();
     249        CAppliance comAppliance = localAppliance();
    96250        AssertReturn(comAppliance.isNotNull(), false);
    97251
     
    101255
    102256        /* Compose a list of all required files: */
    103         QFileInfo fi(field("path").toString());
     257        QFileInfo fi(path());
    104258        QVector<QString> files;
    105259
     
    111265        {
    112266            /* Add manifest file if requested: */
    113             if (field("manifestSelected").toBool())
     267            if (isManifestSelected())
    114268                files << fi.baseName() + ".mf";
    115269
     
    174328}
    175329
    176 void UIWizardExportApp::sltCurrentIdChanged(int iId)
    177 {
    178     /* Call to base-class: */
    179     UIWizard::sltCurrentIdChanged(iId);
    180 
    181     /* Enable 2nd button (Reset to Defaults) for 3rd and Expert pages only! */
    182     setOption(QWizard::HaveCustomButton2,    (mode() == WizardMode_Basic && iId == Page3)
    183                                           || (mode() == WizardMode_Expert && iId == PageExpert));
    184 }
    185 
    186 void UIWizardExportApp::retranslateUi()
    187 {
    188     /* Call to base-class: */
    189     UIWizard::retranslateUi();
    190 
    191     /* Translate wizard: */
    192     setWindowTitle(tr("Export Virtual Appliance"));
    193     setButtonText(QWizard::CustomButton2, tr("Restore Defaults"));
    194     setButtonText(QWizard::FinishButton, tr("Export"));
    195 }
    196 
    197 void UIWizardExportApp::prepare()
     330void UIWizardExportApp::populatePages()
    198331{
    199332    /* Create corresponding pages: */
     
    202335        case WizardMode_Basic:
    203336        {
    204             setPage(Page1, new UIWizardExportAppPageBasic1(m_selectedVMNames));
    205             setPage(Page2, new UIWizardExportAppPageBasic2(m_fFastTraverToExportOCI));
    206             setPage(Page3, new UIWizardExportAppPageBasic3);
     337            addPage(new UIWizardExportAppPageBasic1(m_predefinedMachineNames, m_fFastTraverToExportOCI));
     338            addPage(new UIWizardExportAppPageBasic2(m_fFastTraverToExportOCI));
     339            addPage(new UIWizardExportAppPageBasic3);
    207340            break;
    208341        }
    209342        case WizardMode_Expert:
    210343        {
    211             setPage(PageExpert, new UIWizardExportAppPageExpert(m_selectedVMNames, m_fFastTraverToExportOCI));
     344            addPage(new UIWizardExportAppPageExpert(m_predefinedMachineNames, m_fFastTraverToExportOCI));
    212345            break;
    213346        }
     
    218351        }
    219352    }
    220 
    221     if (!m_fFastTraverToExportOCI)
    222         enableHelpButton("ovf");
    223     else
    224         enableHelpButton("cloud-export-oci");
    225 
     353}
     354
     355void UIWizardExportApp::retranslateUi()
     356{
    226357    /* Call to base-class: */
    227     UIWizard::prepare();
    228 
    229     /* Now, when we are ready, we can
    230      * fast traver to page 2 if requested: */
    231     if (   mode() == WizardMode_Basic
    232         && m_fFastTraverToExportOCI)
    233         button(QWizard::NextButton)->click();
     358    UINativeWizard::retranslateUi();
     359
     360    /* Translate wizard: */
     361    setWindowTitle(tr("Export Virtual Appliance"));
     362    /// @todo implement this?
     363    //setButtonText(QWizard::FinishButton, tr("Export"));
    234364}
    235365
     
    290420        /* Prepare export options: */
    291421        QVector<KExportOptions> options;
    292         switch (field("macAddressExportPolicy").value<MACAddressExportPolicy>())
     422        switch (macAddressExportPolicy())
    293423        {
    294424            case MACAddressExportPolicy_StripAllNonNATMACs: options.append(KExportOptions_StripAllNonNATMACs); break;
     
    296426            default: break;
    297427        }
    298         if (field("manifestSelected").toBool())
     428        if (isManifestSelected())
    299429            options.append(KExportOptions_CreateManifest);
    300         if (field("includeISOsSelected").toBool())
     430        if (isIncludeISOsSelected())
    301431            options.append(KExportOptions_ExportDVDImages);
    302432
    303433        /* Is this VM being exported to cloud? */
    304         if (field("isFormatCloudOne").toBool())
     434        if (isFormatCloudOne())
    305435        {
    306436            /* We can have wizard and it's result
     
    308438            int iWizardResult = -1;
    309439
    310             switch (field("cloudExportMode").value<CloudExportMode>())
     440            switch (cloudExportMode())
    311441            {
    312442                case CloudExportMode_AskThenExport:
    313443                {
    314444                    /* Get the required parameters to init short wizard mode: */
    315                     CCloudClient comClient = field("client").value<CCloudClient>();
    316                     CVirtualSystemDescription comDescription = field("vsd").value<CVirtualSystemDescription>();
     445                    CCloudClient comClient = cloudClient();
     446                    CVirtualSystemDescription comDescription = vsd();
    317447                    /* Create and run wizard as modal dialog, but prevent final step: */
    318                     pNewCloudVMWizard = new UIWizardNewCloudVM(this, QString() /** @todo pass proper full group name! */, comClient, comDescription, mode());
     448                    QWidget *pWizardParent = windowManager().realParentWindow(this);
     449                    const QString strGroupName = QString("/%1/%2").arg(format(), profileName());
     450                    pNewCloudVMWizard = new UIWizardNewCloudVM(pWizardParent, strGroupName, comClient, comDescription, mode());
     451                    windowManager().registerNewParent(pNewCloudVMWizard, pWizardParent);
    319452                    pNewCloudVMWizard->setFinalStepPrevented(true);
    320453                    iWizardResult = pNewCloudVMWizard->exec();
     
    331464
    332465            /* Prepare Export VM progress: */
    333             CProgress comProgress = comAppliance.Write(field("format").toString(), options, uri());
     466            CProgress comProgress = comAppliance.Write(format(), options, uri());
    334467            if (!comAppliance.isOk())
    335468            {
     
    353486            iWizardResult = -1;
    354487
    355             switch (field("cloudExportMode").value<CloudExportMode>())
     488            switch (cloudExportMode())
    356489            {
    357490                case CloudExportMode_AskThenExport:
     
    368501                {
    369502                    /* Get the required parameters to init short wizard mode: */
    370                     CCloudClient comClient = field("client").value<CCloudClient>();
    371                     CVirtualSystemDescription comDescription = field("vsd").value<CVirtualSystemDescription>();
     503                    CCloudClient comClient = cloudClient();
     504                    CVirtualSystemDescription comDescription = vsd();
    372505                    /* Create and run short wizard mode as modal dialog: */
    373506                    QWidget *pWizardParent = windowManager().realParentWindow(this);
    374                     pNewCloudVMWizard = new UIWizardNewCloudVM(pWizardParent, QString() /** @todo pass proper full group name! */, comClient, comDescription, mode());
     507                    const QString strGroupName = QString("/%1/%2").arg(format(), profileName());
     508                    pNewCloudVMWizard = new UIWizardNewCloudVM(pWizardParent, strGroupName, comClient, comDescription, mode());
    375509                    windowManager().registerNewParent(pNewCloudVMWizard, pWizardParent);
    376510                    iWizardResult = pNewCloudVMWizard->exec();
     
    391525            /* Export appliance: */
    392526            UINotificationProgressApplianceExport *pNotification = new UINotificationProgressApplianceExport(comAppliance,
    393                                                                                                              field("format").toString(),
     527                                                                                                             format(),
    394528                                                                                                             options,
    395529                                                                                                             uri());
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.h

    r91285 r91368  
    2323
    2424/* GUI includes: */
    25 #include "UIWizard.h"
    26 
    27 /* Forward declarations: */
    28 class CAppliance;
     25#include "UINativeWizard.h"
     26
     27/* COM includes: */
     28#include "COMEnums.h"
     29#include "CAppliance.h"
     30#include "CCloudClient.h"
     31#include "CVirtualSystemDescription.h"
     32#include "CVirtualSystemDescriptionForm.h"
     33
     34/** MAC address export policies. */
     35enum MACAddressExportPolicy
     36{
     37    MACAddressExportPolicy_KeepAllMACs,
     38    MACAddressExportPolicy_StripAllNonNATMACs,
     39    MACAddressExportPolicy_StripAllMACs,
     40    MACAddressExportPolicy_MAX
     41};
     42Q_DECLARE_METATYPE(MACAddressExportPolicy);
     43
     44/** Cloud export option modes. */
     45enum CloudExportMode
     46{
     47    CloudExportMode_Invalid,
     48    CloudExportMode_AskThenExport,
     49    CloudExportMode_ExportThenAsk,
     50    CloudExportMode_DoNotAsk
     51};
     52Q_DECLARE_METATYPE(CloudExportMode);
    2953
    3054/** Export Appliance wizard. */
    31 class UIWizardExportApp : public UIWizard
     55class UIWizardExportApp : public UINativeWizard
    3256{
    3357    Q_OBJECT;
     
    3559public:
    3660
    37     /** Basic page IDs. */
    38     enum
    39     {
    40         Page1,
    41         Page2,
    42         Page3
    43     };
    44 
    45     /** Expert page IDs. */
    46     enum
    47     {
    48         PageExpert
    49     };
    50 
    51     /** Constructs export appliance wizard passing @a pParent to the base-class.
    52       * @param  selectedVMNames  Brings the names of VMs to be exported. */
     61    /** Constructs Export Appliance wizard passing @a pParent to the base-class.
     62      * @param  predefinedMachineNames  Brings the predefined list of machine names.
     63      * @param  fFastTraverToExportOCI  Brings whether wizard should start with OCI target. */
    5364    UIWizardExportApp(QWidget *pParent,
    54                       const QStringList &selectedVMNames = QStringList(),
     65                      const QStringList &predefinedMachineNames = QStringList(),
    5566                      bool fFastTraverToExportOCI = false);
    5667
    57     /** Composes universal resource identifier.
    58       * @param  fWithFile  Brings whether uri should include file name as well. */
    59     QString uri(bool fWithFile = true) const;
    60 
    61     /** Exports Appliance. */
    62     bool exportAppliance();
    63 
    64 protected slots:
    65 
    66     /** Handles page change to @a iId. */
    67     virtual void sltCurrentIdChanged(int iId) /* override final */;
     68    /** @name Common fields.
     69      * @{ */
     70        /** Returns a list of machine names. */
     71        QStringList machineNames() const;
     72        /** Defines a list of machine @a names. */
     73        void setMachineNames(const QStringList &names);
     74        /** Returns a list of machine IDs. */
     75        QList<QUuid> machineIDs() const;
     76        /** Defines a list of machine @a ids. */
     77        void setMachineIDs(const QList<QUuid> &ids);
     78
     79        /** Returns format. */
     80        QString format() const;
     81        /** Defines @a strFormat. */
     82        void setFormat(const QString &strFormat);
     83
     84        /** Returns whether format is cloud one. */
     85        bool isFormatCloudOne() const;
     86        /** Defines whether format is @a fCloudOne. */
     87        void setFormatCloudOne(bool fCloudOne);
     88    /** @} */
     89
     90    /** @name Local export fields.
     91      * @{ */
     92        /** Returns path. */
     93        QString path() const;
     94        /** Defines @a strPath. */
     95        void setPath(const QString &strPath);
     96
     97        /** Returns MAC address export policy. */
     98        MACAddressExportPolicy macAddressExportPolicy() const;
     99        /** Defines MAC address export @a enmPolicy. */
     100        void setMACAddressExportPolicy(MACAddressExportPolicy enmPolicy);
     101
     102        /** Returns whether manifest is selected. */
     103        bool isManifestSelected() const;
     104        /** Defines whether manifest is @a fSelected. */
     105        void setManifestSelected(bool fSelected);
     106
     107        /** Returns whether include ISOs is selected. */
     108        bool isIncludeISOsSelected() const;
     109        /** Defines whether include ISOs is @a fSelected. */
     110        void setIncludeISOsSelected(bool fSelected);
     111
     112        /** Returns local appliance object. */
     113        CAppliance localAppliance();
     114        /** Defines local @a comAppliance object. */
     115        void setLocalAppliance(const CAppliance &comAppliance);
     116    /** @} */
     117
     118    /** @name Cloud export fields.
     119      * @{ */
     120        /** Returns profile name. */
     121        QString profileName() const;
     122        /** Defines profile @a strName. */
     123        void setProfileName(const QString &strName);
     124
     125        /** Returns cloud appliance object. */
     126        CAppliance cloudAppliance();
     127        /** Defines cloud @a comAppliance object. */
     128        void setCloudAppliance(const CAppliance &comAppliance);
     129
     130        /** Returns cloud client object. */
     131        CCloudClient cloudClient();
     132        /** Defines cloud @a comClient object. */
     133        void setCloudClient(const CCloudClient &comClient);
     134
     135        /** Returns virtual system description object. */
     136        CVirtualSystemDescription vsd();
     137        /** Defines virtual system @a comDescription object. */
     138        void setVsd(const CVirtualSystemDescription &comDescription);
     139
     140        /** Returns virtual system description export form object. */
     141        CVirtualSystemDescriptionForm vsdExportForm();
     142        /** Defines virtual system description export @a comForm object. */
     143        void setVsdExportForm(const CVirtualSystemDescriptionForm &comForm);
     144
     145        /** Returns cloud export mode. */
     146        CloudExportMode cloudExportMode() const;
     147        /** Defines cloud export @a enmMode. */
     148        void setCloudExportMode(const CloudExportMode &enmMode);
     149    /** @} */
     150
     151    /** @name Auxiliary stuff.
     152      * @{ */
     153        /** Goes forward. Required for fast travel to next page. */
     154        void goForward();
     155
     156        /** Composes universal resource identifier.
     157          * @param  fWithFile  Brings whether uri should include file name as well. */
     158        QString uri(bool fWithFile = true) const;
     159
     160        /** Exports Appliance. */
     161        bool exportAppliance();
     162    /** @} */
    68163
    69164protected:
    70165
    71     /** Handles translation event. */
    72     virtual void retranslateUi() /* override final */;
    73 
    74     /** Prepares all. */
    75     virtual void prepare() /* override final */;
     166    /** @name Virtual stuff.
     167      * @{ */
     168        /** Populates pages. */
     169        virtual void populatePages() /* override final */;
     170
     171        /** Handles translation event. */
     172        virtual void retranslateUi() /* override final */;
     173    /** @} */
    76174
    77175private:
    78176
    79     /** Exports VMs enumerated in @a comAppliance. */
    80     bool exportVMs(CAppliance &comAppliance);
    81 
    82     /** Holds the names of VMs to be exported. */
    83     QStringList  m_selectedVMNames;
    84     /** Holds whether we should fast travel to page 2. */
    85     bool         m_fFastTraverToExportOCI;
     177    /** @name Auxiliary stuff.
     178      * @{ */
     179        /** Exports VMs enumerated in @a comAppliance. */
     180        bool exportVMs(CAppliance &comAppliance);
     181    /** @} */
     182
     183    /** @name Arguments.
     184      * @{ */
     185        /** Holds the predefined list of machine names. */
     186        QStringList  m_predefinedMachineNames;
     187        /** Holds whether we should fast travel to page 2. */
     188        bool         m_fFastTraverToExportOCI;
     189    /** @} */
     190
     191    /** @name Common fields.
     192      * @{ */
     193        /** Holds the list of machine names. */
     194        QStringList   m_machineNames;
     195        /** Holds the list of machine IDs. */
     196        QList<QUuid>  m_machineIDs;
     197
     198        /** Holds the format. */
     199        QString  m_strFormat;
     200        /** Holds whether format is cloud one. */
     201        bool     m_fFormatCloudOne;
     202    /** @} */
     203
     204    /** @name Local export fields.
     205      * @{ */
     206        /** Holds the path. */
     207        QString                 m_strPath;
     208        /** Holds the MAC address export policy. */
     209        MACAddressExportPolicy  m_enmMACAddressExportPolicy;
     210        /** Holds whether manifest is selected. */
     211        bool                    m_fManifestSelected;
     212        /** Holds whether ISOs are included. */
     213        bool                    m_fIncludeISOsSelected;
     214        /** Holds local appliance object. */
     215        CAppliance              m_comLocalAppliance;
     216    /** @} */
     217
     218    /** @name Cloud export fields.
     219      * @{ */
     220        /** Holds profile name. */
     221        QString                        m_strProfileName;
     222        /** Holds cloud appliance object. */
     223        CAppliance                     m_comCloudAppliance;
     224        /** Returns cloud client object. */
     225        CCloudClient                   m_comCloudClient;
     226        /** Returns virtual system description object. */
     227        CVirtualSystemDescription      m_comVsd;
     228        /** Returns virtual system description export form object. */
     229        CVirtualSystemDescriptionForm  m_comVsdExportForm;
     230        /** Returns cloud export mode. */
     231        CloudExportMode                m_enmCloudExportMode;
     232    /** @} */
    86233};
    87234
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp

    r91363 r91368  
    2121
    2222/* GUI includes: */
    23 #include "QILabelSeparator.h"
    2423#include "QIRichTextLabel.h"
    2524#include "UICommon.h"
     
    3231#include "CMachine.h"
    3332
     33/* Namespaces: */
     34using namespace UIWizardExportAppPage1;
     35
    3436
    3537/** QListWidgetItem subclass for Export Appliance wizard VM list. */
     
    4143      * @param  strUuid       Brings the machine ID.
    4244      * @param  fInSaveState  Brings whether machine is in Saved state. */
    43     UIVMListWidgetItem(QPixmap &pixIcon, QString &strText, QUuid aUuid, bool fInSaveState, QListWidget *pParent)
     45    UIVMListWidgetItem(QPixmap &pixIcon, QString &strText, QUuid uUuid, bool fInSaveState, QListWidget *pParent)
    4446        : QListWidgetItem(pixIcon, strText, pParent)
    45         , m_uUuid(aUuid)
     47        , m_uUuid(uUuid)
    4648        , m_fInSaveState(fInSaveState)
    4749    {}
     
    6163
    6264    /** Holds the machine ID. */
    63     QUuid    m_uUuid;
     65    QUuid  m_uUuid;
    6466    /** Holds whether machine is in Saved state. */
    65     bool     m_fInSaveState;
     67    bool   m_fInSaveState;
    6668};
    6769
     
    7173*********************************************************************************************************************************/
    7274
    73 UIWizardExportAppPage1::UIWizardExportAppPage1()
    74 {
    75 }
    76 
    77 void UIWizardExportAppPage1::populateVMSelectorItems(const QStringList &selectedVMNames)
     75void UIWizardExportAppPage1::populateVMItems(QListWidget *pVMSelector, const QStringList &selectedVMNames)
    7876{
    7977    /* Add all VM items into VM selector: */
    80     foreach (const CMachine &machine, uiCommon().virtualBox().GetMachines())
     78    foreach (const CMachine &comMachine, uiCommon().virtualBox().GetMachines())
    8179    {
    8280        QPixmap pixIcon;
     
    8583        bool fInSaveState = false;
    8684        bool fEnabled = false;
    87         const QStyle *pStyle = QApplication::style();
    88         const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
    89         if (machine.GetAccessible())
    90         {
    91             pixIcon = generalIconPool().userMachinePixmapDefault(machine);
     85        const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
     86        if (comMachine.GetAccessible())
     87        {
     88            pixIcon = generalIconPool().userMachinePixmapDefault(comMachine);
    9289            if (pixIcon.isNull())
    93                 pixIcon = generalIconPool().guestOSTypePixmapDefault(machine.GetOSTypeId());
    94             strName = machine.GetName();
    95             uUuid = machine.GetId();
    96             fEnabled = machine.GetSessionState() == KSessionState_Unlocked;
    97             fInSaveState = machine.GetState() == KMachineState_Saved || machine.GetState() == KMachineState_AbortedSaved;
     90                pixIcon = generalIconPool().guestOSTypePixmapDefault(comMachine.GetOSTypeId());
     91            strName = comMachine.GetName();
     92            uUuid = comMachine.GetId();
     93            fEnabled = comMachine.GetSessionState() == KSessionState_Unlocked;
     94            fInSaveState = comMachine.GetState() == KMachineState_Saved || comMachine.GetState() == KMachineState_AbortedSaved;
    9895        }
    9996        else
    10097        {
    101             QString settingsFile = machine.GetSettingsFilePath();
    102             QFileInfo fi(settingsFile);
     98            QFileInfo fi(comMachine.GetSettingsFilePath());
    10399            strName = UICommon::hasAllowedExtension(fi.completeSuffix(), VBoxFileExts) ? fi.completeBaseName() : fi.fileName();
    104100            pixIcon = QPixmap(":/os_other.png").scaled(iIconMetric, iIconMetric, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    105101        }
    106         QListWidgetItem *pItem = new UIVMListWidgetItem(pixIcon, strName, uUuid, fInSaveState, m_pVMSelector);
     102        QListWidgetItem *pItem = new UIVMListWidgetItem(pixIcon, strName, uUuid, fInSaveState, pVMSelector);
    107103        if (!fEnabled)
    108104            pItem->setFlags(Qt::ItemFlags());
    109         m_pVMSelector->addItem(pItem);
    110     }
    111     m_pVMSelector->sortItems();
     105        pVMSelector->addItem(pItem);
     106    }
     107    pVMSelector->sortItems();
    112108
    113109    /* Choose initially selected items (if passed): */
    114     for (int i = 0; i < selectedVMNames.size(); ++i)
    115     {
    116         QList<QListWidgetItem*> list = m_pVMSelector->findItems(selectedVMNames[i], Qt::MatchExactly);
     110    foreach (const QString &strSelectedVMName, selectedVMNames)
     111    {
     112        const QList<QListWidgetItem*> list = pVMSelector->findItems(strSelectedVMName, Qt::MatchExactly);
    117113        if (list.size() > 0)
    118114        {
    119             if (m_pVMSelector->selectedItems().isEmpty())
    120                 m_pVMSelector->setCurrentItem(list.first());
     115            if (pVMSelector->selectedItems().isEmpty())
     116                pVMSelector->setCurrentItem(list.first());
    121117            else
    122118                list.first()->setSelected(true);
     
    125121}
    126122
    127 QStringList UIWizardExportAppPage1::machineNames() const
     123void UIWizardExportAppPage1::refreshSavedMachines(QStringList &savedMachines, QListWidget *pVMSelector)
     124{
     125    savedMachines.clear();
     126    foreach (QListWidgetItem *pItem, pVMSelector->selectedItems())
     127        if (static_cast<UIVMListWidgetItem*>(pItem)->isInSaveState())
     128            savedMachines << pItem->text();
     129}
     130
     131QStringList UIWizardExportAppPage1::machineNames(QListWidget *pVMSelector)
    128132{
    129133    /* Prepare list: */
    130     QStringList machineNames;
     134    QStringList names;
    131135    /* Iterate over all the selected items: */
    132     foreach (QListWidgetItem *pItem, m_pVMSelector->selectedItems())
    133         machineNames << pItem->text();
     136    foreach (QListWidgetItem *pItem, pVMSelector->selectedItems())
     137        names << pItem->text();
    134138    /* Return result list: */
    135     return machineNames;
    136 }
    137 
    138 QList<QUuid> UIWizardExportAppPage1::machineIDs() const
     139    return names;
     140}
     141
     142QList<QUuid> UIWizardExportAppPage1::machineIDs(QListWidget *pVMSelector)
    139143{
    140144    /* Prepare list: */
    141     QList<QUuid> machineIDs;
     145    QList<QUuid> ids;
    142146    /* Iterate over all the selected items: */
    143     foreach (QListWidgetItem *pItem, m_pVMSelector->selectedItems())
    144         machineIDs.append(static_cast<UIVMListWidgetItem*>(pItem)->uuid());
     147    foreach (QListWidgetItem *pItem, pVMSelector->selectedItems())
     148        ids.append(static_cast<UIVMListWidgetItem*>(pItem)->uuid());
    145149    /* Return result list: */
    146     return machineIDs;
     150    return ids;
    147151}
    148152
     
    152156*********************************************************************************************************************************/
    153157
    154 UIWizardExportAppPageBasic1::UIWizardExportAppPageBasic1(const QStringList &selectedVMNames)
    155 {
    156     /* Create main layout: */
    157     QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    158     if (pMainLayout)
    159     {
    160         /* Create label: */
    161         m_pLabel = new QIRichTextLabel;
    162         if (m_pLabel)
    163         {
    164             /* Add into layout: */
    165             pMainLayout->addWidget(m_pLabel);
    166         }
    167 
    168         /* Create VM selector: */
    169         m_pVMSelector = new QListWidget;
     158UIWizardExportAppPageBasic1::UIWizardExportAppPageBasic1(const QStringList &selectedVMNames, bool fFastTravelToNextPage)
     159    : m_selectedVMNames(selectedVMNames)
     160    , m_fFastTravelToNextPage(fFastTravelToNextPage)
     161    , m_pLabelMain(0)
     162    , m_pVMSelector(0)
     163{
     164    /* Prepare main layout: */
     165    QVBoxLayout *pLayoutMain = new QVBoxLayout(this);
     166    if (pLayoutMain)
     167    {
     168        /* Prepare main label: */
     169        m_pLabelMain = new QIRichTextLabel(this);
     170        if (m_pLabelMain)
     171            pLayoutMain->addWidget(m_pLabelMain);
     172
     173        /* Prepare VM selector: */
     174        m_pVMSelector = new QListWidget(this);
    170175        if (m_pVMSelector)
    171176        {
    172177            m_pVMSelector->setAlternatingRowColors(true);
    173178            m_pVMSelector->setSelectionMode(QAbstractItemView::ExtendedSelection);
    174 
    175             /* Add into layout: */
    176             pMainLayout->addWidget(m_pVMSelector);
    177         }
    178     }
    179 
    180     /* Populate VM selector items: */
    181     populateVMSelectorItems(selectedVMNames);
     179            pLayoutMain->addWidget(m_pVMSelector);
     180        }
     181    }
    182182
    183183    /* Setup connections: */
    184     connect(m_pVMSelector, &QListWidget::itemSelectionChanged, this, &UIWizardExportAppPageBasic1::completeChanged);
    185 
    186     /* Register fields: */
    187     registerField("machineNames", this, "machineNames");
    188     registerField("machineIDs", this, "machineIDs");
     184    connect(m_pVMSelector, &QListWidget::itemSelectionChanged,
     185            this, &UIWizardExportAppPageBasic1::sltHandleVMItemSelectionChanged);
     186}
     187
     188UIWizardExportApp *UIWizardExportAppPageBasic1::wizard() const
     189{
     190    return qobject_cast<UIWizardExportApp*>(UINativeWizardPage::wizard());
    189191}
    190192
     
    195197
    196198    /* Translate widgets: */
    197     m_pLabel->setText(UIWizardExportApp::tr("<p>Please select the virtual machines that should be added to the appliance. "
    198                                             "You can select more than one. Please note that these machines have to be "
    199                                             "turned off before they can be exported.</p>"));
     199    m_pLabelMain->setText(UIWizardExportApp::tr("<p>Please select the virtual machines that should be added to the appliance. "
     200                                                "You can select more than one. Please note that these machines have to be "
     201                                                "turned off before they can be exported.</p>"));
    200202}
    201203
    202204void UIWizardExportAppPageBasic1::initializePage()
    203205{
     206    /* Populate VM items: */
     207    populateVMItems(m_pVMSelector, m_selectedVMNames);
    204208    /* Translate page: */
    205209    retranslateUi();
     210
     211    /* Now, when we are ready, we can
     212     * fast traver to page 2 if requested: */
     213    if (m_fFastTravelToNextPage)
     214        wizard()->goForward();
    206215}
    207216
    208217bool UIWizardExportAppPageBasic1::isComplete() const
    209 {
    210     /* There should be at least one VM selected: */
    211     return m_pVMSelector->selectedItems().size() > 0;
    212 }
    213 
    214 bool UIWizardExportAppPageBasic1::validatePage()
    215218{
    216219    /* Initial result: */
    217220    bool fResult = true;
    218221
     222    /* There should be at least one VM selected: */
     223    fResult = wizard()->machineNames().size() > 0;
     224
     225    /* Return result: */
     226    return fResult;
     227}
     228
     229bool UIWizardExportAppPageBasic1::validatePage()
     230{
     231    /* Initial result: */
     232    bool fResult = true;
     233
    219234    /* Ask user about machines which are in Saved state currently: */
    220235    QStringList savedMachines;
    221     QList<QListWidgetItem*> items = m_pVMSelector->selectedItems();
    222     for (int i=0; i < items.size(); ++i)
    223     {
    224         if (static_cast<UIVMListWidgetItem*>(items.at(i))->isInSaveState())
    225             savedMachines << items.at(i)->text();
    226     }
     236    refreshSavedMachines(savedMachines, m_pVMSelector);
    227237    if (!savedMachines.isEmpty())
    228238        fResult = msgCenter().confirmExportMachinesInSaveState(savedMachines, this);
     
    231241    return fResult;
    232242}
     243
     244void UIWizardExportAppPageBasic1::sltHandleVMItemSelectionChanged()
     245{
     246    updateMachines();
     247    emit completeChanged();
     248}
     249
     250void UIWizardExportAppPageBasic1::updateMachines()
     251{
     252    /* Update wizard fields: */
     253    wizard()->setMachineNames(machineNames(m_pVMSelector));
     254    wizard()->setMachineIDs(machineIDs(m_pVMSelector));
     255}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.h

    r82968 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626
    2727/* GUI includes: */
    28 #include "UIWizardPage.h"
     28#include "UINativeWizardPage.h"
    2929
    3030/* Forward declarations: */
    3131class QListWidget;
    3232class QIRichTextLabel;
     33class UIWizardExportApp;
    3334
     35/** Namespace for 1st basic page of the Export Appliance wizard. */
     36namespace UIWizardExportAppPage1
     37{
     38    /** Populates @a pVMSelector with items on the basis of passed @a selectedVMNames. */
     39    void populateVMItems(QListWidget *pVMSelector, const QStringList &selectedVMNames);
    3440
    35 /** UIWizardPageBase extension for 1st page of the Export Appliance wizard. */
    36 class UIWizardExportAppPage1 : public UIWizardPageBase
    37 {
    38 protected:
     41    /** Refresh a list of saved machines selected in @a pVMSelector. */
     42    void refreshSavedMachines(QStringList &savedMachines, QListWidget *pVMSelector);
    3943
    40     /** Constructs 1st page base. */
    41     UIWizardExportAppPage1();
     44    /** Returns a list of machine names selected in @a pVMSelector. */
     45    QStringList machineNames(QListWidget *pVMSelector);
     46    /** Returns a list of machine IDs selected in @a pVMSelector. */
     47    QList<QUuid> machineIDs(QListWidget *pVMSelector);
     48}
    4249
    43     /** Populates VM selector items on the basis of passed @a selectedVMNames. */
    44     void populateVMSelectorItems(const QStringList &selectedVMNames);
    45 
    46     /** Returns a list of selected machine names. */
    47     QStringList machineNames() const;
    48     /** Returns a list of selected machine IDs. */
    49     QList<QUuid> machineIDs() const;
    50 
    51     /** Holds the VM selector instance. */
    52     QListWidget *m_pVMSelector;
    53 };
    54 
    55 
    56 /** UIWizardPage extension for 1st page of the Export Appliance wizard, extends UIWizardExportAppPage1 as well. */
    57 class UIWizardExportAppPageBasic1 : public UIWizardPage, public UIWizardExportAppPage1
     50/** UINativeWizardPage extension for 1st basic page of the Export Appliance wizard,
     51  * based on UIWizardAddCloudVMPage1 namespace functions. */
     52class UIWizardExportAppPageBasic1 : public UINativeWizardPage
    5853{
    5954    Q_OBJECT;
    60     Q_PROPERTY(QStringList machineNames READ machineNames);
    61     Q_PROPERTY(QList<QUuid> machineIDs READ machineIDs);
    6255
    6356public:
    6457
    6558    /** Constructs 1st basic page.
    66       * @param  selectedVMNames  Brings the list of selected VM names. */
    67     UIWizardExportAppPageBasic1(const QStringList &selectedVMNames);
     59      * @param  selectedVMNames        Brings the list of selected VM names.
     60      * @param  fFastTravelToNextPage  Brings whether we should fast-travel to next page. */
     61    UIWizardExportAppPageBasic1(const QStringList &selectedVMNames, bool fFastTravelToNextPage);
    6862
    69 private:
     63protected:
     64
     65    /** Returns wizard this page belongs to. */
     66    UIWizardExportApp *wizard() const;
    7067
    7168    /** Handles translation event. */
     
    8178    virtual bool validatePage() /* override */;
    8279
     80private slots:
     81
     82    /** Handles VM item selection change. */
     83    void sltHandleVMItemSelectionChanged();
     84
    8385private:
    8486
    85     /** Holds the label instance. */
    86     QIRichTextLabel *m_pLabel;
     87    /** Updates machines. */
     88    void updateMachines();
     89
     90    /** Holds the list of selected VM names. */
     91    const QStringList  m_selectedVMNames;
     92    /** Holds whether we should fast travel to next page. */
     93    bool               m_fFastTravelToNextPage;
     94
     95    /** Holds the main label instance. */
     96    QIRichTextLabel *m_pLabelMain;
     97    /** Holds the VM selector instance. */
     98    QListWidget     *m_pVMSelector;
    8799};
    88100
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r91262 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1717
    1818/* Qt includes: */
     19#include <QButtonGroup>
    1920#include <QCheckBox>
    20 #include <QComboBox>
    2121#include <QDir>
    2222#include <QGridLayout>
    23 #include <QHeaderView>
    2423#include <QLabel>
    2524#include <QRadioButton>
    2625#include <QStackedWidget>
    27 #include <QTableWidget>
    2826#include <QVBoxLayout>
    2927
    3028/* GUI includes: */
     29#include "QIComboBox.h"
    3130#include "QIRichTextLabel.h"
    3231#include "QIToolButton.h"
    3332#include "UICloudNetworkingStuff.h"
    3433#include "UICommon.h"
    35 #include "UIConverter.h"
    3634#include "UIEmptyFilePathSelector.h"
    3735#include "UIIconPool.h"
     
    4644#include "CSystemProperties.h"
    4745
     46/* Namespaces: */
     47using namespace UIWizardExportAppPage2;
     48
    4849
    4950/*********************************************************************************************************************************
     
    5152*********************************************************************************************************************************/
    5253
    53 UIWizardExportAppPage2::UIWizardExportAppPage2(bool fExportToOCIByDefault)
     54void UIWizardExportAppPage2::populateFormats(QIComboBox *pCombo, bool fExportToOCIByDefault)
     55{
     56    /* Sanity check: */
     57    AssertPtrReturnVoid(pCombo);
     58    /* We need top-level parent as well: */
     59    QWidget *pParent = pCombo->window();
     60    AssertPtrReturnVoid(pParent);
     61
     62    /* Remember current item data to be able to restore it: */
     63    QString strOldData;
     64    if (pCombo->currentIndex() != -1)
     65        strOldData = pCombo->currentData(FormatData_ShortName).toString();
     66    else
     67    {
     68        /* Otherwise "OCI" or "ovf-1.0" should be the default one: */
     69        if (fExportToOCIByDefault)
     70            strOldData = "OCI";
     71        else
     72            strOldData = "ovf-1.0";
     73    }
     74
     75    /* Block signals while updating: */
     76    pCombo->blockSignals(true);
     77
     78    /* Clear combo initially: */
     79    pCombo->clear();
     80
     81    /* Compose hardcoded format list: */
     82    QStringList formats;
     83    formats << "ovf-0.9";
     84    formats << "ovf-1.0";
     85    formats << "ovf-2.0";
     86    /* Add that list to combo: */
     87    foreach (const QString &strShortName, formats)
     88    {
     89        /* Compose empty item, fill it's data: */
     90        pCombo->addItem(QString());
     91        pCombo->setItemData(pCombo->count() - 1, strShortName, FormatData_ShortName);
     92    }
     93
     94    /* Iterate through existing providers: */
     95    foreach (const CCloudProvider &comProvider, listCloudProviders(pParent))
     96    {
     97        /* Skip if we have nothing to populate (file missing?): */
     98        if (comProvider.isNull())
     99            continue;
     100        /* Acquire provider name: */
     101        QString strProviderName;
     102        if (!cloudProviderName(comProvider, strProviderName, pParent))
     103            continue;
     104        /* Acquire provider short name: */
     105        QString strProviderShortName;
     106        if (!cloudProviderShortName(comProvider, strProviderShortName, pParent))
     107            continue;
     108
     109        /* Compose empty item, fill it's data: */
     110        pCombo->addItem(QString());
     111        pCombo->setItemData(pCombo->count() - 1, strProviderName,      FormatData_Name);
     112        pCombo->setItemData(pCombo->count() - 1, strProviderShortName, FormatData_ShortName);
     113        pCombo->setItemData(pCombo->count() - 1, true,                 FormatData_IsItCloudFormat);
     114    }
     115
     116    /* Set previous/default item if possible: */
     117    int iNewIndex = -1;
     118    if (   iNewIndex == -1
     119        && !strOldData.isNull())
     120        iNewIndex = pCombo->findData(strOldData, FormatData_ShortName);
     121    if (   iNewIndex == -1
     122        && pCombo->count() > 0)
     123        iNewIndex = 0;
     124    if (iNewIndex != -1)
     125        pCombo->setCurrentIndex(iNewIndex);
     126
     127    /* Unblock signals after update: */
     128    pCombo->blockSignals(false);
     129}
     130
     131void UIWizardExportAppPage2::populateMACAddressPolicies(QIComboBox *pCombo)
     132{
     133    /* Sanity check: */
     134    AssertPtrReturnVoid(pCombo);
     135    /* We need top-level parent as well: */
     136    QWidget *pParent = pCombo->window();
     137    AssertPtrReturnVoid(pParent);
     138
     139    /* Map known export options to known MAC address export policies: */
     140    QMap<KExportOptions, MACAddressExportPolicy> knownOptions;
     141    knownOptions[KExportOptions_StripAllMACs] = MACAddressExportPolicy_StripAllMACs;
     142    knownOptions[KExportOptions_StripAllNonNATMACs] = MACAddressExportPolicy_StripAllNonNATMACs;
     143    /* Load currently supported export options: */
     144    const QVector<KExportOptions> supportedOptions =
     145        uiCommon().virtualBox().GetSystemProperties().GetSupportedExportOptions();
     146    /* Check which of supported options/policies are known: */
     147    QList<MACAddressExportPolicy> supportedPolicies;
     148    foreach (const KExportOptions &enmOption, supportedOptions)
     149        if (knownOptions.contains(enmOption))
     150            supportedPolicies << knownOptions.value(enmOption);
     151
     152    /* Remember current item data to be able to restore it: */
     153    MACAddressExportPolicy enmOldData = MACAddressExportPolicy_MAX;
     154    if (pCombo->currentIndex() != -1)
     155        enmOldData = pCombo->currentData().value<MACAddressExportPolicy>();
     156    else
     157    {
     158        if (supportedPolicies.contains(MACAddressExportPolicy_StripAllNonNATMACs))
     159            enmOldData = MACAddressExportPolicy_StripAllNonNATMACs;
     160        else
     161            enmOldData = MACAddressExportPolicy_KeepAllMACs;
     162    }
     163
     164    /* Block signals while updating: */
     165    pCombo->blockSignals(true);
     166
     167    /* Clear combo initially: */
     168    pCombo->clear();
     169
     170    /* Add supported policies first: */
     171    foreach (const MACAddressExportPolicy &enmPolicy, supportedPolicies)
     172        pCombo->addItem(QString(), QVariant::fromValue(enmPolicy));
     173
     174    /* Add hardcoded policy finally: */
     175    pCombo->addItem(QString(), QVariant::fromValue(MACAddressExportPolicy_KeepAllMACs));
     176
     177    /* Set previous/default item if possible: */
     178    int iNewIndex = -1;
     179    if (   iNewIndex == -1
     180        && enmOldData != MACAddressExportPolicy_MAX)
     181        iNewIndex = pCombo->findData(QVariant::fromValue(enmOldData));
     182    if (   iNewIndex == -1
     183        && pCombo->count() > 0)
     184        iNewIndex = 0;
     185    if (iNewIndex != -1)
     186        pCombo->setCurrentIndex(iNewIndex);
     187
     188    /* Unblock signals after update: */
     189    pCombo->blockSignals(false);
     190}
     191
     192QString UIWizardExportAppPage2::format(QIComboBox *pCombo)
     193{
     194    return pCombo->currentData(FormatData_ShortName).toString();
     195}
     196
     197bool UIWizardExportAppPage2::isFormatCloudOne(QIComboBox *pCombo, int iIndex /* = -1 */)
     198{
     199    /* Sanity check: */
     200    AssertPtrReturn(pCombo, false);
     201
     202    /* Handle special case, -1 means "current one": */
     203    if (iIndex == -1)
     204        iIndex = pCombo->currentIndex();
     205
     206    /* Give the actual result: */
     207    return pCombo->itemData(iIndex, FormatData_IsItCloudFormat).toBool();
     208}
     209
     210void UIWizardExportAppPage2::refreshStackedWidget(QStackedWidget *pStackedWidget, bool fIsFormatCloudOne)
     211{
     212    /* Update stack appearance according to chosen format: */
     213    pStackedWidget->setCurrentIndex((int)fIsFormatCloudOne);
     214}
     215
     216void UIWizardExportAppPage2::refreshFileSelectorName(QString &strFileSelectorName,
     217                                                     const QStringList &machineNames,
     218                                                     const QString &strDefaultApplianceName,
     219                                                     bool fIsFormatCloudOne)
     220{
     221    /* If format is cloud one: */
     222    if (fIsFormatCloudOne)
     223    {
     224        /* We use no name: */
     225        strFileSelectorName.clear();
     226    }
     227    /* If format is local one: */
     228    else
     229    {
     230        /* If it's one VM only, we use the VM name as file-name: */
     231        if (machineNames.size() == 1)
     232            strFileSelectorName = machineNames.first();
     233        /* Otherwise => we use the default file-name: */
     234        else
     235            strFileSelectorName = strDefaultApplianceName;
     236    }
     237}
     238
     239void UIWizardExportAppPage2::refreshFileSelectorExtension(QString &strFileSelectorExt,
     240                                                          UIEmptyFilePathSelector *pFileSelector,
     241                                                          bool fIsFormatCloudOne)
     242{
     243    /* If format is cloud one: */
     244    if (fIsFormatCloudOne)
     245    {
     246        /* We use no extension: */
     247        strFileSelectorExt.clear();
     248
     249        /* Update file chooser accordingly: */
     250        pFileSelector->setFileFilters(QString());
     251    }
     252    /* If format is local one: */
     253    else
     254    {
     255        /* We use the default (.ova) extension: */
     256        strFileSelectorExt = ".ova";
     257
     258        /* Update file chooser accordingly: */
     259        pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" +
     260                                      UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf"));
     261    }
     262}
     263
     264void UIWizardExportAppPage2::refreshFileSelectorPath(UIEmptyFilePathSelector *pFileSelector,
     265                                                     const QString &strFileSelectorName,
     266                                                     const QString &strFileSelectorExt,
     267                                                     bool fIsFormatCloudOne)
     268{
     269    /* If format is cloud one: */
     270    if (fIsFormatCloudOne)
     271    {
     272        /* Clear file selector path: */
     273        pFileSelector->setPath(QString());
     274    }
     275    /* If format is local one: */
     276    else
     277    {
     278        /* Compose file selector path: */
     279        const QString strPath = QDir::toNativeSeparators(QString("%1/%2")
     280                                                         .arg(uiCommon().documentsPath())
     281                                                         .arg(strFileSelectorName + strFileSelectorExt));
     282        pFileSelector->setPath(strPath);
     283    }
     284}
     285
     286void UIWizardExportAppPage2::refreshManifestCheckBoxAccess(QCheckBox *pCheckBox,
     287                                                           bool fIsFormatCloudOne)
     288{
     289    /* If format is cloud one: */
     290    if (fIsFormatCloudOne)
     291    {
     292        /* Disable manifest check-box: */
     293        pCheckBox->setChecked(false);
     294        pCheckBox->setEnabled(false);
     295    }
     296    /* If format is local one: */
     297    else
     298    {
     299        /* Enable and select manifest check-box: */
     300        pCheckBox->setChecked(true);
     301        pCheckBox->setEnabled(true);
     302    }
     303}
     304
     305void UIWizardExportAppPage2::refreshIncludeISOsCheckBoxAccess(QCheckBox *pCheckBox,
     306                                                              bool fIsFormatCloudOne)
     307{
     308    /* If format is cloud one: */
     309    if (fIsFormatCloudOne)
     310    {
     311        /* Disable include ISO check-box: */
     312        pCheckBox->setChecked(false);
     313        pCheckBox->setEnabled(false);
     314    }
     315    /* If format is local one: */
     316    else
     317    {
     318        /* Enable include ISO check-box: */
     319        pCheckBox->setEnabled(true);
     320    }
     321}
     322
     323void UIWizardExportAppPage2::refreshProfileCombo(QIComboBox *pCombo,
     324                                                 const QString &strFormat,
     325                                                 bool fIsFormatCloudOne)
     326{
     327    /* Sanity check: */
     328    AssertPtrReturnVoid(pCombo);
     329
     330    /* If format is cloud one: */
     331    if (fIsFormatCloudOne)
     332    {
     333        /* We need top-level parent as well: */
     334        QWidget *pParent = pCombo->window();
     335        AssertPtrReturnVoid(pParent);
     336        /* Acquire provider: */
     337        CCloudProvider comProvider = cloudProviderByShortName(strFormat, pParent);
     338        AssertReturnVoid(comProvider.isNotNull());
     339
     340        /* Remember current item data to be able to restore it: */
     341        QString strOldData;
     342        if (pCombo->currentIndex() != -1)
     343            strOldData = pCombo->currentData(ProfileData_Name).toString();
     344
     345        /* Block signals while updating: */
     346        pCombo->blockSignals(true);
     347
     348        /* Clear combo initially: */
     349        pCombo->clear();
     350
     351        /* Iterate through existing profile names: */
     352        foreach (const CCloudProfile &comProfile, listCloudProfiles(comProvider, pParent))
     353        {
     354            /* Skip if we have nothing to populate (wtf happened?): */
     355            if (comProfile.isNull())
     356                continue;
     357            /* Acquire profile name: */
     358            QString strProfileName;
     359            if (!cloudProfileName(comProfile, strProfileName, pParent))
     360                continue;
     361
     362            /* Compose item, fill it's data: */
     363            pCombo->addItem(strProfileName);
     364            pCombo->setItemData(pCombo->count() - 1, strProfileName, ProfileData_Name);
     365        }
     366
     367        /* Set previous/default item if possible: */
     368        int iNewIndex = -1;
     369        if (   iNewIndex == -1
     370            && !strOldData.isNull())
     371            iNewIndex = pCombo->findData(strOldData, ProfileData_Name);
     372        if (   iNewIndex == -1
     373            && pCombo->count() > 0)
     374            iNewIndex = 0;
     375        if (iNewIndex != -1)
     376            pCombo->setCurrentIndex(iNewIndex);
     377
     378        /* Unblock signals after update: */
     379        pCombo->blockSignals(false);
     380    }
     381    /* If format is local one: */
     382    else
     383    {
     384        /* Block signals while updating: */
     385        pCombo->blockSignals(true);
     386
     387        /* Clear combo initially: */
     388        pCombo->clear();
     389
     390        /* Unblock signals after update: */
     391        pCombo->blockSignals(false);
     392    }
     393}
     394
     395void UIWizardExportAppPage2::refreshCloudProfile(CCloudProfile &comCloudProfile,
     396                                                 const QString &strShortProviderName,
     397                                                 const QString &strProfileName,
     398                                                 bool fIsFormatCloudOne)
     399{
     400    /* If format is cloud one: */
     401    if (fIsFormatCloudOne)
     402        comCloudProfile = cloudProfileByName(strShortProviderName, strProfileName);
     403    /* If format is local one: */
     404    else
     405        comCloudProfile = CCloudProfile();
     406}
     407
     408void UIWizardExportAppPage2::refreshCloudExportMode(const QMap<CloudExportMode, QAbstractButton*> &radios,
     409                                                    bool fIsFormatCloudOne)
     410{
     411    /* If format is cloud one: */
     412    if (fIsFormatCloudOne)
     413    {
     414        /* Check if something already chosen: */
     415        bool fSomethingChosen = false;
     416        foreach (QAbstractButton *pButton, radios.values())
     417            if (pButton->isChecked())
     418                fSomethingChosen = true;
     419        /* Choose default cloud export option: */
     420        if (!fSomethingChosen)
     421            radios.value(CloudExportMode_ExportThenAsk)->setChecked(true);
     422    }
     423    /* If format is local one: */
     424    else
     425    {
     426        /* Make sure nothing chosen: */
     427        foreach (QAbstractButton *pButton, radios.values())
     428            pButton->setChecked(false);
     429    }
     430}
     431
     432void UIWizardExportAppPage2::refreshCloudStuff(CAppliance &comCloudAppliance,
     433                                               CCloudClient &comCloudClient,
     434                                               CVirtualSystemDescription &comCloudVsd,
     435                                               CVirtualSystemDescriptionForm &comCloudVsdExportForm,
     436                                               const CCloudProfile &comCloudProfile,
     437                                               const QList<QUuid> &machineIDs,
     438                                               const QString &strUri,
     439                                               const CloudExportMode enmCloudExportMode)
     440{
     441    /* Clear stuff: */
     442    comCloudAppliance = CAppliance();
     443    comCloudClient = CCloudClient();
     444    comCloudVsd = CVirtualSystemDescription();
     445    comCloudVsdExportForm = CVirtualSystemDescriptionForm();
     446
     447    /* Sanity check: */
     448    if (comCloudProfile.isNull())
     449        return;
     450    if (machineIDs.isEmpty())
     451        return;
     452
     453    /* Perform cloud export procedure for first uuid only: */
     454    const QUuid uMachineId = machineIDs.first();
     455
     456    /* Get the machine with the uMachineId: */
     457    CVirtualBox comVBox = uiCommon().virtualBox();
     458    CMachine comMachine = comVBox.FindMachine(uMachineId.toString());
     459    if (!comVBox.isOk())
     460    {
     461        msgCenter().cannotFindMachineById(comVBox, uMachineId);
     462        return;
     463    }
     464
     465    /* Create appliance: */
     466    CAppliance comAppliance = comVBox.CreateAppliance();
     467    if (!comVBox.isOk())
     468    {
     469        msgCenter().cannotCreateAppliance(comVBox);
     470        return;
     471    }
     472
     473    /* Remember appliance: */
     474    comCloudAppliance = comAppliance;
     475
     476    /* Add the export virtual system description to our appliance object: */
     477    CVirtualSystemDescription comVsd = comMachine.ExportTo(comCloudAppliance, strUri);
     478    if (!comMachine.isOk())
     479    {
     480        msgCenter().cannotExportAppliance(comMachine, comCloudAppliance.GetPath());
     481        return;
     482    }
     483
     484    /* Remember description: */
     485    comCloudVsd = comVsd;
     486
     487    /* Add Launch Instance flag to virtual system description: */
     488    switch (enmCloudExportMode)
     489    {
     490        case CloudExportMode_AskThenExport:
     491        case CloudExportMode_ExportThenAsk:
     492            comCloudVsd.AddDescription(KVirtualSystemDescriptionType_CloudLaunchInstance, "true", QString());
     493            break;
     494        default:
     495            comCloudVsd.AddDescription(KVirtualSystemDescriptionType_CloudLaunchInstance, "false", QString());
     496            break;
     497    }
     498    if (!comCloudVsd.isOk())
     499    {
     500        msgCenter().cannotAddVirtualSystemDescriptionValue(comCloudVsd);
     501        return;
     502    }
     503
     504    /* Create Cloud Client: */
     505    CCloudClient comClient = cloudClient(comCloudProfile);
     506    if (comClient.isNull())
     507        return;
     508
     509    /* Remember client: */
     510    comCloudClient = comClient;
     511
     512    /* Read Cloud Client Export description form: */
     513    CVirtualSystemDescriptionForm comVsdExportForm;
     514    bool fResult = exportDescriptionForm(comCloudClient, comCloudVsd, comVsdExportForm);
     515    if (!fResult)
     516        return;
     517
     518    /* Remember export description form: */
     519    comCloudVsdExportForm = comVsdExportForm;
     520}
     521
     522QString UIWizardExportAppPage2::profileName(QIComboBox *pCombo)
     523{
     524    return pCombo->currentData(ProfileData_Name).toString();
     525}
     526
     527void UIWizardExportAppPage2::updateFormatComboToolTip(QIComboBox *pCombo)
     528{
     529    AssertPtrReturnVoid(pCombo);
     530    QString strCurrentToolTip;
     531    if (pCombo->count() != 0)
     532    {
     533        strCurrentToolTip = pCombo->currentData(Qt::ToolTipRole).toString();
     534        AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!"));
     535    }
     536    pCombo->setToolTip(strCurrentToolTip);
     537}
     538
     539void UIWizardExportAppPage2::updateMACAddressExportPolicyComboToolTip(QIComboBox *pCombo)
     540{
     541    AssertPtrReturnVoid(pCombo);
     542    QString strCurrentToolTip;
     543    if (pCombo->count() != 0)
     544    {
     545        strCurrentToolTip = pCombo->currentData(Qt::ToolTipRole).toString();
     546        AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!"));
     547    }
     548    pCombo->setToolTip(strCurrentToolTip);
     549}
     550
     551
     552/*********************************************************************************************************************************
     553*   Class UIWizardExportAppPageBasic2 implementation.                                                                            *
     554*********************************************************************************************************************************/
     555
     556UIWizardExportAppPageBasic2::UIWizardExportAppPageBasic2(bool fExportToOCIByDefault)
    54557    : m_fExportToOCIByDefault(fExportToOCIByDefault)
     558    , m_pLabelFormat(0)
     559    , m_pLabelSettings(0)
    55560    , m_pFormatLayout(0)
    56     , m_pSettingsLayout1(0)
    57     , m_pSettingsLayout2(0)
    58561    , m_pFormatComboBoxLabel(0)
    59562    , m_pFormatComboBox(0)
    60563    , m_pSettingsWidget(0)
     564    , m_pSettingsLayout1(0)
    61565    , m_pFileSelectorLabel(0)
    62566    , m_pFileSelector(0)
     
    66570    , m_pManifestCheckbox(0)
    67571    , m_pIncludeISOsCheckbox(0)
     572    , m_pSettingsLayout2(0)
    68573    , m_pProfileLabel(0)
    69574    , m_pProfileComboBox(0)
    70575    , m_pProfileToolButton(0)
    71     , m_pMachineLabel(0)
    72     , m_pRadioDoNotAsk(0)
    73     , m_pRadioAskThenExport(0)
    74     , m_pRadioExportThenAsk(0)
    75 {
    76 }
    77 
    78 void UIWizardExportAppPage2::populateFormats()
    79 {
    80     AssertReturnVoid(m_pFormatComboBox->count() == 0);
    81 
    82     /* Compose hardcoded format list: */
    83     QStringList formats;
    84     formats << "ovf-0.9";
    85     formats << "ovf-1.0";
    86     formats << "ovf-2.0";
    87     /* Add that list to combo: */
    88     foreach (const QString &strShortName, formats)
    89     {
    90         /* Compose empty item, fill it's data: */
    91         m_pFormatComboBox->addItem(QString());
    92         m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, strShortName, FormatData_ShortName);
    93     }
    94 
    95     /* Initialize Cloud Provider Manager: */
    96     bool fOCIPresent = false;
    97     m_comCloudProviderManager = cloudProviderManager(wizardImp());
    98     if (m_comCloudProviderManager.isNotNull())
    99     {
    100         /* Iterate through existing providers: */
    101         foreach (const CCloudProvider &comProvider, listCloudProviders(wizardImp()))
    102         {
    103             /* Skip if we have nothing to populate (file missing?): */
    104             if (comProvider.isNull())
    105                 continue;
    106 
    107             /* Compose empty item, fill it's data: */
    108             m_pFormatComboBox->addItem(QString());
    109             m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, comProvider.GetId(),        FormatData_ID);
    110             m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, comProvider.GetName(),      FormatData_Name);
    111             m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, comProvider.GetShortName(), FormatData_ShortName);
    112             m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, true,                       FormatData_IsItCloudFormat);
    113             if (m_pFormatComboBox->itemData(m_pFormatComboBox->count() - 1, FormatData_ShortName).toString() == "OCI")
    114                 fOCIPresent = true;
    115         }
    116     }
    117 
    118     /* Set default: */
    119     if (m_fExportToOCIByDefault && fOCIPresent)
    120         setFormat("OCI");
    121     else
    122         setFormat("ovf-1.0");
    123 }
    124 
    125 void UIWizardExportAppPage2::populateMACAddressPolicies()
    126 {
    127     AssertReturnVoid(m_pMACComboBox->count() == 0);
    128 
    129     /* Map known export options to known MAC address export policies: */
    130     QMap<KExportOptions, MACAddressExportPolicy> knownOptions;
    131     knownOptions[KExportOptions_StripAllMACs] = MACAddressExportPolicy_StripAllMACs;
    132     knownOptions[KExportOptions_StripAllNonNATMACs] = MACAddressExportPolicy_StripAllNonNATMACs;
    133 
    134     /* Load currently supported export options: */
    135     CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();
    136     const QVector<KExportOptions> supportedOptions = comProperties.GetSupportedExportOptions();
    137 
    138     /* Check which of supported options/policies are known: */
    139     QList<MACAddressExportPolicy> supportedPolicies;
    140     foreach (const KExportOptions &enmOption, supportedOptions)
    141         if (knownOptions.contains(enmOption))
    142             supportedPolicies << knownOptions.value(enmOption);
    143 
    144     /* Add supported policies first: */
    145     foreach (const MACAddressExportPolicy &enmPolicy, supportedPolicies)
    146         m_pMACComboBox->addItem(QString(), QVariant::fromValue(enmPolicy));
    147 
    148     /* Add hardcoded policy finally: */
    149     m_pMACComboBox->addItem(QString(), QVariant::fromValue(MACAddressExportPolicy_KeepAllMACs));
    150 
    151     /* Set default: */
    152     if (supportedPolicies.contains(MACAddressExportPolicy_StripAllNonNATMACs))
    153         setMACAddressExportPolicy(MACAddressExportPolicy_StripAllNonNATMACs);
    154     else
    155         setMACAddressExportPolicy(MACAddressExportPolicy_KeepAllMACs);
    156 }
    157 
    158 void UIWizardExportAppPage2::populateProfiles()
    159 {
    160     /* Block signals while updating: */
    161     m_pProfileComboBox->blockSignals(true);
    162 
    163     /* Remember current item data to be able to restore it: */
    164     QString strOldData;
    165     if (m_pProfileComboBox->currentIndex() != -1)
    166         strOldData = m_pProfileComboBox->itemData(m_pProfileComboBox->currentIndex(), ProfileData_Name).toString();
    167 
    168     /* Clear combo initially: */
    169     m_pProfileComboBox->clear();
    170     /* Clear Cloud Provider: */
    171     m_comCloudProvider = CCloudProvider();
    172 
    173     /* If provider chosen: */
    174     if (!providerId().isNull())
    175     {
    176         /* (Re)initialize Cloud Provider: */
    177         m_comCloudProvider = cloudProviderById(providerId(), wizardImp());
    178         if (m_comCloudProvider.isNotNull())
    179         {
    180             /* Iterate through existing profile names: */
    181             foreach (const CCloudProfile &comProfile, listCloudProfiles(m_comCloudProvider, wizardImp()))
    182             {
    183                 /* Acquire profile name: */
    184                 QString strProfileName;
    185                 if (cloudProfileName(comProfile, strProfileName, wizardImp()))
    186                 {
    187                     /* Compose item, fill it's data: */
    188                     m_pProfileComboBox->addItem(strProfileName);
    189                     m_pProfileComboBox->setItemData(m_pProfileComboBox->count() - 1, strProfileName, ProfileData_Name);
    190                 }
    191             }
    192         }
    193 
    194         /* Set previous/default item if possible: */
    195         int iNewIndex = -1;
    196         if (   iNewIndex == -1
    197             && !strOldData.isNull())
    198             iNewIndex = m_pProfileComboBox->findData(strOldData, ProfileData_Name);
    199         if (   iNewIndex == -1
    200             && m_pProfileComboBox->count() > 0)
    201             iNewIndex = 0;
    202         if (iNewIndex != -1)
    203             m_pProfileComboBox->setCurrentIndex(iNewIndex);
    204     }
    205 
    206     /* Unblock signals after update: */
    207     m_pProfileComboBox->blockSignals(false);
    208 }
    209 
    210 void UIWizardExportAppPage2::populateProfile()
    211 {
    212     /* Clear Cloud Profile: */
    213     m_comCloudProfile = CCloudProfile();
    214 
    215     /* If both provider and profile chosen: */
    216     if (!providerShortName().isNull() && !profileName().isNull())
    217     {
    218         /* Acquire Cloud Profile: */
    219         m_comCloudProfile = cloudProfileByName(providerShortName(), profileName(), wizardImp());
    220     }
    221 }
    222 
    223 void UIWizardExportAppPage2::populateFormProperties()
    224 {
    225     /* Clear appliance: */
    226     m_comAppliance = CAppliance();
    227     /* Clear cloud client: */
    228     m_comClient = CCloudClient();
    229     /* Clear description: */
    230     m_comVSD = CVirtualSystemDescription();
    231     /* Clear description form: */
    232     m_comVSDExportForm = CVirtualSystemDescriptionForm();
    233 
    234     /* If profile chosen: */
    235     if (m_comCloudProfile.isNotNull())
    236     {
    237         /* Main API request sequence, can be interrupted after any step: */
    238         do
    239         {
    240             /* Perform cloud export procedure for first uuid only: */
    241             const QList<QUuid> uuids = fieldImp("machineIDs").value<QList<QUuid> >();
    242             AssertReturnVoid(!uuids.isEmpty());
    243             const QUuid uMachineId = uuids.first();
    244 
    245             /* Get the machine with the uMachineId: */
    246             CVirtualBox comVBox = uiCommon().virtualBox();
    247             CMachine comMachine = comVBox.FindMachine(uMachineId.toString());
    248             if (!comVBox.isOk())
    249             {
    250                 msgCenter().cannotFindMachineById(comVBox, uMachineId);
    251                 break;
    252             }
    253 
    254             /* Create appliance: */
    255             CAppliance comAppliance = comVBox.CreateAppliance();
    256             if (!comVBox.isOk())
    257             {
    258                 msgCenter().cannotCreateAppliance(comVBox);
    259                 break;
    260             }
    261 
    262             /* Remember appliance: */
    263             m_comAppliance = comAppliance;
    264 
    265             /* Add the export virtual system description to our appliance object: */
    266             CVirtualSystemDescription comVSD = comMachine.ExportTo(m_comAppliance, qobject_cast<UIWizardExportApp*>(wizardImp())->uri());
    267             if (!comMachine.isOk())
    268             {
    269                 msgCenter().cannotExportAppliance(comMachine, m_comAppliance.GetPath(), thisImp());
    270                 break;
    271             }
    272 
    273             /* Remember description: */
    274             m_comVSD = comVSD;
    275 
    276             /* Add Launch Instance flag to virtual system description: */
    277             switch (cloudExportMode())
    278             {
    279                 case CloudExportMode_AskThenExport:
    280                 case CloudExportMode_ExportThenAsk:
    281                     m_comVSD.AddDescription(KVirtualSystemDescriptionType_CloudLaunchInstance, "true", QString());
    282                     break;
    283                 default:
    284                     m_comVSD.AddDescription(KVirtualSystemDescriptionType_CloudLaunchInstance, "false", QString());
    285                     break;
    286             }
    287             if (!m_comVSD.isOk())
    288             {
    289                 msgCenter().cannotAddVirtualSystemDescriptionValue(m_comVSD);
    290                 break;
    291             }
    292 
    293             /* Create Cloud Client: */
    294             CCloudClient comClient = cloudClient(m_comCloudProfile);
    295             if (comClient.isNull())
    296                 break;
    297 
    298             /* Remember client: */
    299             m_comClient = comClient;
    300 
    301             /* Read Cloud Client Export description form: */
    302             CVirtualSystemDescriptionForm comExportForm;
    303             bool fResult = exportDescriptionForm(m_comClient, m_comVSD, comExportForm, wizardImp());
    304             if (!fResult)
    305                 break;
    306 
    307             /* Remember description form: */
    308             m_comVSDExportForm = comExportForm;
    309         }
    310         while (0);
    311     }
    312 }
    313 
    314 void UIWizardExportAppPage2::updatePageAppearance()
    315 {
    316     /* Update page appearance according to chosen format: */
    317     m_pSettingsWidget->setCurrentIndex((int)isFormatCloudOne());
    318 }
    319 
    320 void UIWizardExportAppPage2::refreshFileSelectorName()
    321 {
    322     /* If it's one VM only, we use the VM name as file-name: */
    323     if (fieldImp("machineNames").toStringList().size() == 1)
    324         m_strFileSelectorName = fieldImp("machineNames").toStringList()[0];
    325     /* Otherwise => we use the default file-name: */
    326     else
    327         m_strFileSelectorName = m_strDefaultApplianceName;
    328 
    329     /* Cascade update for file selector path: */
    330     refreshFileSelectorPath();
    331 }
    332 
    333 void UIWizardExportAppPage2::refreshFileSelectorExtension()
    334 {
    335     /* Save old extension to compare afterwards: */
    336     const QString strOldExtension = m_strFileSelectorExt;
    337 
    338     /* If format is cloud one: */
    339     if (isFormatCloudOne())
    340     {
    341         /* We use no extension: */
    342         m_strFileSelectorExt.clear();
    343 
    344         /* Update file chooser accordingly: */
    345         m_pFileSelector->setFileFilters(QString());
    346     }
    347     /* Otherwise: */
    348     else
    349     {
    350         /* We use the default (.ova) extension: */
    351         m_strFileSelectorExt = ".ova";
    352 
    353         /* Update file chooser accordingly: */
    354         m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" +
    355                                         UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf"));
    356     }
    357 
    358     /* Cascade update for file selector path if necessary: */
    359     if (m_strFileSelectorExt != strOldExtension)
    360         refreshFileSelectorPath();
    361 }
    362 
    363 void UIWizardExportAppPage2::refreshFileSelectorPath()
    364 {
    365     /* If format is cloud one: */
    366     if (isFormatCloudOne())
    367     {
    368         /* Clear file selector path: */
    369         m_pFileSelector->setPath(QString());
    370     }
    371     else
    372     {
    373         /* Compose file selector path: */
    374         const QString strPath = QDir::toNativeSeparators(QString("%1/%2")
    375                                                          .arg(uiCommon().documentsPath())
    376                                                          .arg(m_strFileSelectorName + m_strFileSelectorExt));
    377         m_pFileSelector->setPath(strPath);
    378     }
    379 }
    380 
    381 void UIWizardExportAppPage2::refreshManifestCheckBoxAccess()
    382 {
    383     /* If format is cloud one: */
    384     if (isFormatCloudOne())
    385     {
    386         /* Disable manifest check-box: */
    387         m_pManifestCheckbox->setChecked(false);
    388         m_pManifestCheckbox->setEnabled(false);
    389     }
    390     /* Otherwise: */
    391     else
    392     {
    393         /* Enable manifest check-box: */
    394         m_pManifestCheckbox->setChecked(true);
    395         m_pManifestCheckbox->setEnabled(true);
    396     }
    397 }
    398 
    399 void UIWizardExportAppPage2::refreshIncludeISOsCheckBoxAccess()
    400 {
    401     /* If format is cloud one: */
    402     if (isFormatCloudOne())
    403     {
    404         /* Disable include ISO check-box: */
    405         m_pIncludeISOsCheckbox->setChecked(false);
    406         m_pIncludeISOsCheckbox->setEnabled(false);
    407     }
    408     /* Otherwise: */
    409     else
    410     {
    411         /* Enable include ISO check-box: */
    412         m_pIncludeISOsCheckbox->setEnabled(true);
    413     }
    414 }
    415 
    416 void UIWizardExportAppPage2::updateFormatComboToolTip()
    417 {
    418     const int iCurrentIndex = m_pFormatComboBox->currentIndex();
    419     const QString strCurrentToolTip = m_pFormatComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString();
    420     AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!"));
    421     m_pFormatComboBox->setToolTip(strCurrentToolTip);
    422 }
    423 
    424 void UIWizardExportAppPage2::updateMACAddressExportPolicyComboToolTip()
    425 {
    426     const QString strCurrentToolTip = m_pMACComboBox->currentData(Qt::ToolTipRole).toString();
    427     AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!"));
    428     m_pMACComboBox->setToolTip(strCurrentToolTip);
    429 }
    430 
    431 void UIWizardExportAppPage2::setFormat(const QString &strFormat)
    432 {
    433     const int iIndex = m_pFormatComboBox->findData(strFormat, FormatData_ShortName);
    434     AssertMsg(iIndex != -1, ("Data not found!"));
    435     m_pFormatComboBox->setCurrentIndex(iIndex);
    436 }
    437 
    438 QString UIWizardExportAppPage2::format() const
    439 {
    440     const int iIndex = m_pFormatComboBox->currentIndex();
    441     return m_pFormatComboBox->itemData(iIndex, FormatData_ShortName).toString();
    442 }
    443 
    444 bool UIWizardExportAppPage2::isFormatCloudOne(int iIndex /* = -1 */) const
    445 {
    446     if (iIndex == -1)
    447         iIndex = m_pFormatComboBox->currentIndex();
    448     return m_pFormatComboBox->itemData(iIndex, FormatData_IsItCloudFormat).toBool();
    449 }
    450 
    451 void UIWizardExportAppPage2::setPath(const QString &strPath)
    452 {
    453     m_pFileSelector->setPath(strPath);
    454 }
    455 
    456 QString UIWizardExportAppPage2::path() const
    457 {
    458     return m_pFileSelector->path();
    459 }
    460 
    461 void UIWizardExportAppPage2::setMACAddressExportPolicy(MACAddressExportPolicy enmMACAddressExportPolicy)
    462 {
    463     const int iIndex = m_pMACComboBox->findData(enmMACAddressExportPolicy);
    464     AssertMsg(iIndex != -1, ("Data not found!"));
    465     m_pMACComboBox->setCurrentIndex(iIndex);
    466 }
    467 
    468 MACAddressExportPolicy UIWizardExportAppPage2::macAddressExportPolicy() const
    469 {
    470     return m_pMACComboBox->currentData().value<MACAddressExportPolicy>();
    471 }
    472 
    473 void UIWizardExportAppPage2::setManifestSelected(bool fChecked)
    474 {
    475     m_pManifestCheckbox->setChecked(fChecked);
    476 }
    477 
    478 bool UIWizardExportAppPage2::isManifestSelected() const
    479 {
    480     return m_pManifestCheckbox->isChecked();
    481 }
    482 
    483 void UIWizardExportAppPage2::setIncludeISOsSelected(bool fChecked)
    484 {
    485     m_pIncludeISOsCheckbox->setChecked(fChecked);
    486 }
    487 
    488 bool UIWizardExportAppPage2::isIncludeISOsSelected() const
    489 {
    490     return m_pIncludeISOsCheckbox->isChecked();
    491 }
    492 
    493 void UIWizardExportAppPage2::setProviderById(const QUuid &uId)
    494 {
    495     const int iIndex = m_pFormatComboBox->findData(uId, FormatData_ID);
    496     AssertMsg(iIndex != -1, ("Data not found!"));
    497     m_pFormatComboBox->setCurrentIndex(iIndex);
    498 }
    499 
    500 QUuid UIWizardExportAppPage2::providerId() const
    501 {
    502     const int iIndex = m_pFormatComboBox->currentIndex();
    503     return m_pFormatComboBox->itemData(iIndex, FormatData_ID).toUuid();
    504 }
    505 
    506 QString UIWizardExportAppPage2::providerShortName() const
    507 {
    508     const int iIndex = m_pFormatComboBox->currentIndex();
    509     return m_pFormatComboBox->itemData(iIndex, FormatData_ShortName).toString();
    510 }
    511 
    512 QString UIWizardExportAppPage2::profileName() const
    513 {
    514     const int iIndex = m_pProfileComboBox->currentIndex();
    515     return m_pProfileComboBox->itemData(iIndex, ProfileData_Name).toString();
    516 }
    517 
    518 CAppliance UIWizardExportAppPage2::cloudAppliance() const
    519 {
    520     return m_comAppliance;
    521 }
    522 
    523 CCloudClient UIWizardExportAppPage2::client() const
    524 {
    525     return m_comClient;
    526 }
    527 
    528 CVirtualSystemDescription UIWizardExportAppPage2::vsd() const
    529 {
    530     return m_comVSD;
    531 }
    532 
    533 CVirtualSystemDescriptionForm UIWizardExportAppPage2::vsdExportForm() const
    534 {
    535     return m_comVSDExportForm;
    536 }
    537 
    538 CloudExportMode UIWizardExportAppPage2::cloudExportMode() const
    539 {
    540     if (m_pRadioAskThenExport->isChecked())
    541         return CloudExportMode_AskThenExport;
    542     else if (m_pRadioExportThenAsk->isChecked())
    543         return CloudExportMode_ExportThenAsk;
    544     return CloudExportMode_DoNotAsk;
    545 }
    546 
    547 
    548 /*********************************************************************************************************************************
    549 *   Class UIWizardExportAppPageBasic2 implementation.                                                                            *
    550 *********************************************************************************************************************************/
    551 
    552 UIWizardExportAppPageBasic2::UIWizardExportAppPageBasic2(bool fExportToOCIByDefault)
    553     : UIWizardExportAppPage2(fExportToOCIByDefault)
    554     , m_pLabelFormat(0)
    555     , m_pLabelSettings(0)
     576    , m_pExportModeLabel(0)
     577    , m_pExportModeButtonGroup(0)
    556578{
    557579    /* Create main layout: */
     
    560582    {
    561583        /* Create format label: */
    562         m_pLabelFormat = new QIRichTextLabel;
     584        m_pLabelFormat = new QIRichTextLabel(this);
    563585        if (m_pLabelFormat)
    564         {
    565             /* Add into layout: */
    566586            pMainLayout->addWidget(m_pLabelFormat);
    567         }
    568587
    569588        /* Create format layout: */
     
    581600            m_pFormatLayout->setColumnStretch(1, 1);
    582601
    583             /* Create format combo-box: */
    584             m_pFormatComboBox = new QComboBox;
    585             if (m_pFormatComboBox)
    586             {
    587                 /* Add into layout: */
    588                 m_pFormatLayout->addWidget(m_pFormatComboBox, 0, 1);
    589             }
    590602            /* Create format combo-box label: */
    591             m_pFormatComboBoxLabel = new QLabel;
     603            m_pFormatComboBoxLabel = new QLabel(this);
    592604            if (m_pFormatComboBoxLabel)
    593605            {
    594606                m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
     607                m_pFormatLayout->addWidget(m_pFormatComboBoxLabel, 0, 0);
     608            }
     609            /* Create format combo-box: */
     610            m_pFormatComboBox = new QIComboBox(this);
     611            if (m_pFormatComboBox)
     612            {
    595613                m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox);
    596 
    597                 /* Add into layout: */
    598                 m_pFormatLayout->addWidget(m_pFormatComboBoxLabel, 0, 0);
     614                m_pFormatLayout->addWidget(m_pFormatComboBox, 0, 1);
    599615            }
    600616
     
    604620
    605621        /* Create settings label: */
    606         m_pLabelSettings = new QIRichTextLabel;
     622        m_pLabelSettings = new QIRichTextLabel(this);
    607623        if (m_pLabelSettings)
    608         {
    609             /* Add into layout: */
    610624            pMainLayout->addWidget(m_pLabelSettings);
    611         }
    612625
    613626        /* Create settings layout: */
    614         m_pSettingsWidget = new QStackedWidget;
     627        m_pSettingsWidget = new QStackedWidget(this);
    615628        if (m_pSettingsWidget)
    616629        {
    617630            /* Create settings pane 1: */
    618             QWidget *pSettingsPane1 = new QWidget;
     631            QWidget *pSettingsPane1 = new QWidget(m_pSettingsWidget);
    619632            if (pSettingsPane1)
    620633            {
     
    634647
    635648                    /* Create file selector: */
    636                     m_pFileSelector = new UIEmptyFilePathSelector;
     649                    m_pFileSelector = new UIEmptyFilePathSelector(pSettingsPane1);
    637650                    if (m_pFileSelector)
    638651                    {
     
    641654                        m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition);
    642655                        m_pFileSelector->setDefaultSaveExt("ova");
    643 
    644                         /* Add into layout: */
    645656                        m_pSettingsLayout1->addWidget(m_pFileSelector, 0, 1, 1, 2);
    646657                    }
    647658                    /* Create file selector label: */
    648                     m_pFileSelectorLabel = new QLabel;
     659                    m_pFileSelectorLabel = new QLabel(pSettingsPane1);
    649660                    if (m_pFileSelectorLabel)
    650661                    {
    651662                        m_pFileSelectorLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    652663                        m_pFileSelectorLabel->setBuddy(m_pFileSelector);
    653 
    654                         /* Add into layout: */
    655664                        m_pSettingsLayout1->addWidget(m_pFileSelectorLabel, 0, 0);
    656665                    }
    657666
    658667                    /* Create MAC policy combo-box: */
    659                     m_pMACComboBox = new QComboBox;
     668                    m_pMACComboBox = new QIComboBox(pSettingsPane1);
    660669                    if (m_pMACComboBox)
    661                     {
    662                         /* Add into layout: */
    663670                        m_pSettingsLayout1->addWidget(m_pMACComboBox, 1, 1, 1, 2);
    664                     }
    665671                    /* Create format combo-box label: */
    666                     m_pMACComboBoxLabel = new QLabel;
     672                    m_pMACComboBoxLabel = new QLabel(pSettingsPane1);
    667673                    if (m_pMACComboBoxLabel)
    668674                    {
    669675                        m_pMACComboBoxLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    670676                        m_pMACComboBoxLabel->setBuddy(m_pMACComboBox);
    671 
    672                         /* Add into layout: */
    673677                        m_pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 1, 0);
    674678                    }
    675679
    676680                    /* Create advanced label: */
    677                     m_pAdditionalLabel = new QLabel;
     681                    m_pAdditionalLabel = new QLabel(pSettingsPane1);
    678682                    if (m_pAdditionalLabel)
    679683                    {
    680684                        m_pAdditionalLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    681 
    682                         /* Add into layout: */
    683685                        m_pSettingsLayout1->addWidget(m_pAdditionalLabel, 2, 0);
    684686                    }
    685687                    /* Create manifest check-box: */
    686                     m_pManifestCheckbox = new QCheckBox;
     688                    m_pManifestCheckbox = new QCheckBox(pSettingsPane1);
    687689                    if (m_pManifestCheckbox)
    688                     {
    689                         /* Add into layout: */
    690690                        m_pSettingsLayout1->addWidget(m_pManifestCheckbox, 2, 1);
    691                     }
    692691                    /* Create include ISOs check-box: */
    693                     m_pIncludeISOsCheckbox = new QCheckBox;
     692                    m_pIncludeISOsCheckbox = new QCheckBox(pSettingsPane1);
    694693                    if (m_pIncludeISOsCheckbox)
    695                     {
    696                         /* Add into layout: */
    697694                        m_pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 3, 1);
    698                     }
    699695
    700696                    /* Create placeholder: */
    701                     QWidget *pPlaceholder = new QWidget;
     697                    QWidget *pPlaceholder = new QWidget(pSettingsPane1);
    702698                    if (pPlaceholder)
    703                     {
    704                         /* Add into layout: */
    705699                        m_pSettingsLayout1->addWidget(pPlaceholder, 4, 0, 1, 3);
    706                     }
    707700                }
    708701
     
    712705
    713706            /* Create settings pane 2: */
    714             QWidget *pSettingsPane2 = new QWidget;
     707            QWidget *pSettingsPane2 = new QWidget(m_pSettingsWidget);
    715708            if (pSettingsPane2)
    716709            {
     
    732725
    733726                    /* Create profile label: */
    734                     m_pProfileLabel = new QLabel;
     727                    m_pProfileLabel = new QLabel(pSettingsPane2);
    735728                    if (m_pProfileLabel)
    736729                    {
    737730                        m_pProfileLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    738 
    739                         /* Add into layout: */
    740731                        m_pSettingsLayout2->addWidget(m_pProfileLabel, 0, 0);
    741732                    }
     
    748739
    749740                        /* Create profile combo-box: */
    750                         m_pProfileComboBox = new QComboBox;
     741                        m_pProfileComboBox = new QIComboBox(pSettingsPane2);
    751742                        if (m_pProfileComboBox)
    752743                        {
    753744                            m_pProfileLabel->setBuddy(m_pProfileComboBox);
    754 
    755                             /* Add into layout: */
    756745                            pSubLayout->addWidget(m_pProfileComboBox);
    757746                        }
    758747                        /* Create profile tool-button: */
    759                         m_pProfileToolButton = new QIToolButton;
     748                        m_pProfileToolButton = new QIToolButton(pSettingsPane2);
    760749                        if (m_pProfileToolButton)
    761750                        {
    762751                            m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    763752                                                                              ":/cloud_profile_manager_disabled_16px.png"));
    764 
    765                             /* Add into layout: */
    766753                            pSubLayout->addWidget(m_pProfileToolButton);
    767754                        }
     
    772759
    773760                    /* Create profile label: */
    774                     m_pMachineLabel = new QLabel;
    775                     if (m_pMachineLabel)
     761                    m_pExportModeLabel = new QLabel(pSettingsPane2);
     762                    if (m_pExportModeLabel)
    776763                    {
    777                         m_pMachineLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    778 
    779                         /* Add into layout: */
    780                         m_pSettingsLayout2->addWidget(m_pMachineLabel, 1, 0);
     764                        m_pExportModeLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
     765                        m_pSettingsLayout2->addWidget(m_pExportModeLabel, 1, 0);
    781766                    }
    782                     /* Create Do Not Ask button: */
    783                     m_pRadioDoNotAsk = new QRadioButton;
    784                     if (m_pRadioDoNotAsk)
     767
     768                    /* Create button-group: */
     769                    m_pExportModeButtonGroup = new QButtonGroup(pSettingsPane2);
     770                    if (m_pExportModeButtonGroup)
    785771                    {
    786                         /* Add into layout: */
    787                         m_pSettingsLayout2->addWidget(m_pRadioDoNotAsk, 1, 1);
    788                     }
    789                     /* Create Ask Then Export button: */
    790                     m_pRadioAskThenExport = new QRadioButton;
    791                     if (m_pRadioAskThenExport)
    792                     {
    793                         /* Add into layout: */
    794                         m_pSettingsLayout2->addWidget(m_pRadioAskThenExport, 2, 1);
    795                     }
    796                     /* Create Export Then Ask button: */
    797                     m_pRadioExportThenAsk = new QRadioButton;
    798                     if (m_pRadioExportThenAsk)
    799                     {
    800                         /* Add into layout: */
    801                         m_pSettingsLayout2->addWidget(m_pRadioExportThenAsk, 3, 1);
     772                        /* Create Do Not Ask button: */
     773                        m_exportModeButtons[CloudExportMode_DoNotAsk] = new QRadioButton(pSettingsPane2);
     774                        if (m_exportModeButtons.value(CloudExportMode_DoNotAsk))
     775                        {
     776                            m_pExportModeButtonGroup->addButton(m_exportModeButtons.value(CloudExportMode_DoNotAsk));
     777                            m_pSettingsLayout2->addWidget(m_exportModeButtons.value(CloudExportMode_DoNotAsk), 1, 1);
     778                        }
     779                        /* Create Ask Then Export button: */
     780                        m_exportModeButtons[CloudExportMode_AskThenExport] = new QRadioButton(pSettingsPane2);
     781                        if (m_exportModeButtons.value(CloudExportMode_AskThenExport))
     782                        {
     783                            m_pExportModeButtonGroup->addButton(m_exportModeButtons.value(CloudExportMode_AskThenExport));
     784                            m_pSettingsLayout2->addWidget(m_exportModeButtons.value(CloudExportMode_AskThenExport), 2, 1);
     785                        }
     786                        /* Create Export Then Ask button: */
     787                        m_exportModeButtons[CloudExportMode_ExportThenAsk] = new QRadioButton(pSettingsPane2);
     788                        if (m_exportModeButtons.value(CloudExportMode_ExportThenAsk))
     789                        {
     790                            m_pExportModeButtonGroup->addButton(m_exportModeButtons.value(CloudExportMode_ExportThenAsk));
     791                            m_pSettingsLayout2->addWidget(m_exportModeButtons.value(CloudExportMode_ExportThenAsk), 3, 1);
     792                        }
    802793                    }
    803794                }
     
    811802        }
    812803    }
    813 
    814     /* Populate formats: */
    815     populateFormats();
    816     /* Populate MAC address policies: */
    817     populateMACAddressPolicies();
    818     /* Populate profiles: */
    819     populateProfiles();
    820     /* Populate profile: */
    821     populateProfile();
    822804
    823805    /* Setup connections: */
     
    828810    connect(m_pFileSelector, &UIEmptyFilePathSelector::pathChanged,
    829811            this, &UIWizardExportAppPageBasic2::sltHandleFileSelectorChange);
    830     connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     812    connect(m_pFormatComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    831813            this, &UIWizardExportAppPageBasic2::sltHandleFormatComboChange);
    832     connect(m_pMACComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     814    connect(m_pMACComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    833815            this, &UIWizardExportAppPageBasic2::sltHandleMACAddressExportPolicyComboChange);
    834     connect(m_pProfileComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     816    connect(m_pManifestCheckbox, &QCheckBox::stateChanged,
     817            this, &UIWizardExportAppPageBasic2::sltHandleManifestCheckBoxChange);
     818    connect(m_pIncludeISOsCheckbox, &QCheckBox::stateChanged,
     819            this, &UIWizardExportAppPageBasic2::sltHandleIncludeISOsCheckBoxChange);
     820    connect(m_pProfileComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    835821            this, &UIWizardExportAppPageBasic2::sltHandleProfileComboChange);
     822    connect(m_pExportModeButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled),
     823            this, &UIWizardExportAppPageBasic2::sltHandleRadioButtonToggled);
    836824    connect(m_pProfileToolButton, &QIToolButton::clicked,
    837825            this, &UIWizardExportAppPageBasic2::sltHandleProfileButtonClick);
    838 
    839     /* Register fields: */
    840     registerField("format", this, "format");
    841     registerField("isFormatCloudOne", this, "isFormatCloudOne");
    842     registerField("path", this, "path");
    843     registerField("macAddressExportPolicy", this, "macAddressExportPolicy");
    844     registerField("manifestSelected", this, "manifestSelected");
    845     registerField("includeISOsSelected", this, "includeISOsSelected");
    846     registerField("providerShortName", this, "providerShortName");
    847     registerField("cloudAppliance", this, "cloudAppliance");
    848     registerField("client", this, "client");
    849     registerField("vsd", this, "vsd");
    850     registerField("vsdExportForm", this, "vsdExportForm");
    851     registerField("cloudExportMode", this, "cloudExportMode");
     826}
     827
     828UIWizardExportApp *UIWizardExportAppPageBasic2::wizard() const
     829{
     830    return qobject_cast<UIWizardExportApp*>(UINativeWizardPage::wizard());
    852831}
    853832
     
    859838    /* Translate objects: */
    860839    m_strDefaultApplianceName = UIWizardExportApp::tr("Appliance");
     840    refreshFileSelectorName(m_strFileSelectorName, wizard()->machineNames(), m_strDefaultApplianceName, wizard()->isFormatCloudOne());
     841    refreshFileSelectorPath(m_pFileSelector, m_strFileSelectorName, m_strFileSelectorExt, wizard()->isFormatCloudOne());
    861842
    862843    /* Translate format label: */
     
    869850                               "<p>The <b>Oracle Cloud Infrastructure</b> format supports exporting to remote cloud servers only. "
    870851                               "Main virtual disk of each selected machine will be uploaded to remote server.</p>"));
     852
     853    /* Translate settings label: */
     854    if (wizard()->isFormatCloudOne())
     855        m_pLabelSettings->setText(UIWizardExportApp::
     856                                  tr("<p>Please choose one of cloud service profiles you have registered to export virtual "
     857                                     "machines to. It will be used to establish network connection required to upload your "
     858                                     "virtual machine files to a remote cloud facility.</p>"));
     859    else
     860        m_pLabelSettings->setText(UIWizardExportApp::
     861                                  tr("<p>Please choose a filename to export the virtual appliance to. Besides that you can "
     862                                     "specify a certain amount of options which affects the size and content of resulting "
     863                                     "archive.</p>"));
    871864
    872865    /* Translate file selector: */
     
    887880     * We are enumerating starting from 0 for simplicity: */
    888881    for (int i = 0; i < m_pFormatComboBox->count(); ++i)
    889         if (isFormatCloudOne(i))
     882        if (isFormatCloudOne(m_pFormatComboBox, i))
    890883        {
    891884            m_pFormatComboBox->setItemText(i, m_pFormatComboBox->itemData(i, FormatData_Name).toString());
     
    903896            {
    904897                m_pMACComboBox->setItemText(i, UIWizardExportApp::tr("Include all network adapter MAC addresses"));
    905                 m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include all network adapter MAC addresses in exported appliance archive."), Qt::ToolTipRole);
     898                m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include all network adapter MAC addresses in exported "
     899                                                                     "appliance archive."), Qt::ToolTipRole);
    906900                break;
    907901            }
     
    909903            {
    910904                m_pMACComboBox->setItemText(i, UIWizardExportApp::tr("Include only NAT network adapter MAC addresses"));
    911                 m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include only NAT network adapter MAC addresses in exported appliance archive."), Qt::ToolTipRole);
     905                m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include only NAT network adapter MAC addresses in exported "
     906                                                                     "appliance archive."), Qt::ToolTipRole);
    912907                break;
    913908            }
     
    915910            {
    916911                m_pMACComboBox->setItemText(i, UIWizardExportApp::tr("Strip all network adapter MAC addresses"));
    917                 m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Strip all network adapter MAC addresses from exported appliance archive."), Qt::ToolTipRole);
     912                m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Strip all network adapter MAC addresses from exported "
     913                                                                     "appliance archive."), Qt::ToolTipRole);
    918914                break;
    919915            }
     
    927923    m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import."));
    928924    m_pManifestCheckbox->setText(UIWizardExportApp::tr("&Write Manifest file"));
    929     m_pIncludeISOsCheckbox->setToolTip(UIWizardExportApp::tr("Include ISO image files in exported VM archive."));
     925    m_pIncludeISOsCheckbox->setToolTip(UIWizardExportApp::tr("Include ISO image files into exported VM archive."));
    930926    m_pIncludeISOsCheckbox->setText(UIWizardExportApp::tr("&Include ISO image files"));
    931927
     
    935931
    936932    /* Translate option label: */
    937     m_pMachineLabel->setText(UIWizardExportApp::tr("Machine Creation:"));
    938     m_pRadioDoNotAsk->setText(UIWizardExportApp::tr("Do not ask me about it, leave custom &image for future usage"));
    939     m_pRadioAskThenExport->setText(UIWizardExportApp::tr("Ask me about it &before exporting disk as custom image"));
    940     m_pRadioExportThenAsk->setText(UIWizardExportApp::tr("Ask me about it &after exporting disk as custom image"));
     933    m_pExportModeLabel->setText(UIWizardExportApp::tr("Machine Creation:"));
     934    m_exportModeButtons.value(CloudExportMode_DoNotAsk)->setText(UIWizardExportApp::tr("Do not ask me about it, leave custom &image for future usage"));
     935    m_exportModeButtons.value(CloudExportMode_AskThenExport)->setText(UIWizardExportApp::tr("Ask me about it &before exporting disk as custom image"));
     936    m_exportModeButtons.value(CloudExportMode_ExportThenAsk)->setText(UIWizardExportApp::tr("Ask me about it &after exporting disk as custom image"));
    941937
    942938    /* Adjust label widths: */
     
    947943    labels << m_pAdditionalLabel;
    948944    labels << m_pProfileLabel;
    949     labels << m_pMachineLabel;
     945    labels << m_pExportModeLabel;
    950946    int iMaxWidth = 0;
    951947    foreach (QWidget *pLabel, labels)
     
    955951    m_pSettingsLayout2->setColumnMinimumWidth(0, iMaxWidth);
    956952
    957     /* Refresh file selector name: */
    958     refreshFileSelectorName();
    959 
    960     /* Update page appearance: */
    961     updatePageAppearance();
    962 
    963953    /* Update tool-tips: */
    964     updateFormatComboToolTip();
    965     updateMACAddressExportPolicyComboToolTip();
     954    updateFormatComboToolTip(m_pFormatComboBox);
     955    updateMACAddressExportPolicyComboToolTip(m_pMACComboBox);
    966956}
    967957
    968958void UIWizardExportAppPageBasic2::initializePage()
    969959{
     960    /* Populate formats: */
     961    populateFormats(m_pFormatComboBox, m_fExportToOCIByDefault);
     962    /* Populate MAC address policies: */
     963    populateMACAddressPolicies(m_pMACComboBox);
    970964    /* Translate page: */
    971965    retranslateUi();
    972966
    973     /* Refresh file selector name: */
    974     // refreshFileSelectorName(); already called from retranslateUi();
    975     /* Refresh file selector extension: */
    976     refreshFileSelectorExtension();
    977     /* Refresh manifest check-box access: */
    978     refreshManifestCheckBoxAccess();
    979     /* Refresh include ISOs check-box access: */
    980     refreshIncludeISOsCheckBoxAccess();
    981 
    982     /* Choose default cloud export option: */
    983     m_pRadioExportThenAsk->setChecked(true);
     967    /* Choose initially focused widget: */
     968    if (wizard()->isFormatCloudOne())
     969        m_pProfileComboBox->setFocus();
     970    else
     971        m_pFileSelector->setFocus();
     972
     973    /* Fetch it, asynchronously: */
     974    QMetaObject::invokeMethod(this, "sltHandleFormatComboChange", Qt::QueuedConnection);
    984975}
    985976
     
    990981
    991982    /* Check whether there was cloud target selected: */
    992     if (isFormatCloudOne())
     983    if (wizard()->isFormatCloudOne())
    993984        fResult = m_comCloudProfile.isNotNull();
    994985    else
    995         fResult = UICommon::hasAllowedExtension(path().toLower(), OVFFileExts);
     986        fResult = UICommon::hasAllowedExtension(wizard()->path().toLower(), OVFFileExts);
    996987
    997988    /* Return result: */
     
    1005996
    1006997    /* Check whether there was cloud target selected: */
    1007     if (isFormatCloudOne())
    1008     {
    1009         /* Create appliance and populate form properties: */
    1010         populateFormProperties();
    1011         /* Which are required to continue to the next page: */
    1012         fResult =    field("cloudAppliance").value<CAppliance>().isNotNull()
    1013                   && field("client").value<CCloudClient>().isNotNull()
    1014                   && field("vsd").value<CVirtualSystemDescription>().isNotNull()
    1015                   && field("vsdExportForm").value<CVirtualSystemDescriptionForm>().isNotNull();
     998    if (wizard()->isFormatCloudOne())
     999    {
     1000        /* Update cloud stuff: */
     1001        updateCloudStuff();
     1002        /* Which is required to continue to the next page: */
     1003        fResult =    wizard()->cloudAppliance().isNotNull()
     1004                  && wizard()->cloudClient().isNotNull()
     1005                  && wizard()->vsd().isNotNull()
     1006                  && wizard()->vsdExportForm().isNotNull();
    10161007    }
    10171008
     
    10201011}
    10211012
    1022 void UIWizardExportAppPageBasic2::updatePageAppearance()
    1023 {
    1024     /* Call to base-class: */
    1025     UIWizardExportAppPage2::updatePageAppearance();
    1026 
    1027     /* Update page appearance according to chosen storage-type: */
    1028     if (isFormatCloudOne())
    1029     {
    1030         m_pLabelSettings->setText(UIWizardExportApp::
    1031                                   tr("<p>Please choose one of cloud service profiles you have registered to export virtual "
    1032                                      "machines to. It will be used to establish network connection required to upload your "
    1033                                      "virtual machine files to a remote cloud facility.</p>"));
    1034         m_pProfileComboBox->setFocus();
    1035     }
    1036     else
    1037     {
    1038         m_pLabelSettings->setText(UIWizardExportApp::
    1039                                   tr("<p>Please choose a filename to export the virtual appliance to. Besides that you can "
    1040                                      "specify a certain amount of options which affects the size and content of resulting "
    1041                                      "archive.</p>"));
    1042         m_pFileSelector->setFocus();
    1043     }
    1044 }
    1045 
    10461013void UIWizardExportAppPageBasic2::sltHandleFormatComboChange()
    10471014{
    1048     /* Update tool-tip: */
    1049     updateFormatComboToolTip();
    1050 
    1051     /* Refresh required settings: */
    1052     updatePageAppearance();
    1053     refreshFileSelectorExtension();
    1054     refreshManifestCheckBoxAccess();
    1055     refreshIncludeISOsCheckBoxAccess();
    1056     populateProfiles();
    1057     populateProfile();
     1015    updateFormat();
    10581016    emit completeChanged();
    10591017}
     
    10611019void UIWizardExportAppPageBasic2::sltHandleFileSelectorChange()
    10621020{
    1063     /* Remember changed name, except empty one: */
    1064     if (!m_pFileSelector->path().isEmpty())
    1065         m_strFileSelectorName = QFileInfo(m_pFileSelector->path()).completeBaseName();
    1066 
    1067     /* Refresh required settings: */
     1021    /* Skip empty paths: */
     1022    if (m_pFileSelector->path().isEmpty())
     1023        return;
     1024
     1025    m_strFileSelectorName = QFileInfo(m_pFileSelector->path()).completeBaseName();
     1026    wizard()->setPath(m_pFileSelector->path());
    10681027    emit completeChanged();
    10691028}
     
    10711030void UIWizardExportAppPageBasic2::sltHandleMACAddressExportPolicyComboChange()
    10721031{
    1073     /* Update tool-tip: */
    1074     updateMACAddressExportPolicyComboToolTip();
     1032    updateMACAddressExportPolicyComboToolTip(m_pMACComboBox);
     1033    wizard()->setMACAddressExportPolicy(m_pMACComboBox->currentData().value<MACAddressExportPolicy>());
     1034    emit completeChanged();
     1035}
     1036
     1037void UIWizardExportAppPageBasic2::sltHandleManifestCheckBoxChange()
     1038{
     1039    wizard()->setManifestSelected(m_pManifestCheckbox->isChecked());
     1040    emit completeChanged();
     1041}
     1042
     1043void UIWizardExportAppPageBasic2::sltHandleIncludeISOsCheckBoxChange()
     1044{
     1045    wizard()->setIncludeISOsSelected(m_pIncludeISOsCheckbox->isChecked());
     1046    emit completeChanged();
    10751047}
    10761048
    10771049void UIWizardExportAppPageBasic2::sltHandleProfileComboChange()
    10781050{
    1079     /* Refresh required settings: */
    1080     populateProfile();
     1051    updateProfile();
     1052    emit completeChanged();
     1053}
     1054
     1055void UIWizardExportAppPageBasic2::sltHandleRadioButtonToggled(QAbstractButton *pButton, bool fToggled)
     1056{
     1057    /* Handle checked buttons only: */
     1058    if (!fToggled)
     1059        return;
     1060
     1061    /* Update cloud export mode field value: */
     1062    wizard()->setCloudExportMode(m_exportModeButtons.key(pButton));
     1063    emit completeChanged();
    10811064}
    10821065
     
    10871070        gpManager->openCloudProfileManager();
    10881071}
     1072
     1073void UIWizardExportAppPageBasic2::updateFormat()
     1074{
     1075    /* Update combo tool-tip: */
     1076    updateFormatComboToolTip(m_pFormatComboBox);
     1077
     1078    /* Update wizard fields: */
     1079    wizard()->setFormat(format(m_pFormatComboBox));
     1080    wizard()->setFormatCloudOne(isFormatCloudOne(m_pFormatComboBox));
     1081
     1082    /* Refresh settings widget state: */
     1083    refreshStackedWidget(m_pSettingsWidget, wizard()->isFormatCloudOne());
     1084
     1085    /* Update export settings: */
     1086    refreshFileSelectorExtension(m_strFileSelectorExt, m_pFileSelector, wizard()->isFormatCloudOne());
     1087    refreshFileSelectorPath(m_pFileSelector, m_strFileSelectorName, m_strFileSelectorExt, wizard()->isFormatCloudOne());
     1088    refreshManifestCheckBoxAccess(m_pManifestCheckbox, wizard()->isFormatCloudOne());
     1089    refreshIncludeISOsCheckBoxAccess(m_pIncludeISOsCheckbox, wizard()->isFormatCloudOne());
     1090    refreshProfileCombo(m_pProfileComboBox, wizard()->format(), wizard()->isFormatCloudOne());
     1091    refreshCloudExportMode(m_exportModeButtons, wizard()->isFormatCloudOne());
     1092
     1093    /* Update profile: */
     1094    updateProfile();
     1095}
     1096
     1097void UIWizardExportAppPageBasic2::updateProfile()
     1098{
     1099    /* Update wizard fields: */
     1100    wizard()->setProfileName(profileName(m_pProfileComboBox));
     1101
     1102    /* Update export settings: */
     1103    refreshCloudProfile(m_comCloudProfile,
     1104                        wizard()->format(),
     1105                        wizard()->profileName(),
     1106                        wizard()->isFormatCloudOne());
     1107}
     1108
     1109void UIWizardExportAppPageBasic2::updateCloudStuff()
     1110{
     1111    /* Create appliance, client, VSD and VSD export form: */
     1112    CAppliance comAppliance;
     1113    CCloudClient comClient;
     1114    CVirtualSystemDescription comDescription;
     1115    CVirtualSystemDescriptionForm comForm;
     1116    refreshCloudStuff(comAppliance,
     1117                      comClient,
     1118                      comDescription,
     1119                      comForm,
     1120                      m_comCloudProfile,
     1121                      wizard()->machineIDs(),
     1122                      wizard()->uri(),
     1123                      wizard()->cloudExportMode());
     1124    wizard()->setCloudAppliance(comAppliance);
     1125    wizard()->setCloudClient(comClient);
     1126    wizard()->setVsd(comDescription);
     1127    wizard()->setVsdExportForm(comForm);
     1128}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h

    r91261 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2222#endif
    2323
    24 /* Qt includes: */
    25 #include <QVariant>
    26 
    2724/* GUI includes: */
    28 #include "UIApplianceEditorWidget.h"
    29 #include "UIWizardPage.h"
     25#include "UINativeWizardPage.h"
     26#include "UIWizardExportApp.h"
    3027
    3128/* COM includes: */
     
    3431#include "CCloudClient.h"
    3532#include "CCloudProfile.h"
    36 #include "CCloudProvider.h"
    37 #include "CCloudProviderManager.h"
    3833#include "CVirtualSystemDescription.h"
    3934#include "CVirtualSystemDescriptionForm.h"
    4035
    4136/* Forward declarations: */
     37class QAbstractButton;
     38class QButtonGroup;
    4239class QCheckBox;
    43 class QComboBox;
    4440class QGridLayout;
    4541class QLabel;
    46 class QLineEdit;
    47 class QRadioButton;
    4842class QStackedWidget;
    49 class QTableWidget;
     43class QIComboBox;
    5044class QIRichTextLabel;
    5145class QIToolButton;
    5246class UIEmptyFilePathSelector;
    5347
    54 
    55 /** MAC address export policies. */
    56 enum MACAddressExportPolicy
    57 {
    58     MACAddressExportPolicy_KeepAllMACs,
    59     MACAddressExportPolicy_StripAllNonNATMACs,
    60     MACAddressExportPolicy_StripAllMACs,
    61     MACAddressExportPolicy_MAX
    62 };
    63 Q_DECLARE_METATYPE(MACAddressExportPolicy);
    64 
    6548/** Format combo data fields. */
    6649enum
    6750{
    68     FormatData_ID              = Qt::UserRole + 1,
    69     FormatData_Name            = Qt::UserRole + 2,
    70     FormatData_ShortName       = Qt::UserRole + 3,
    71     FormatData_IsItCloudFormat = Qt::UserRole + 4
     51    FormatData_Name            = Qt::UserRole + 1,
     52    FormatData_ShortName       = Qt::UserRole + 2,
     53    FormatData_IsItCloudFormat = Qt::UserRole + 3
    7254};
    7355
     
    7860};
    7961
    80 /** Cloud export option modes. */
    81 enum CloudExportMode
    82 {
    83     CloudExportMode_Invalid,
    84     CloudExportMode_AskThenExport,
    85     CloudExportMode_ExportThenAsk,
    86     CloudExportMode_DoNotAsk
    87 };
    88 Q_DECLARE_METATYPE(CloudExportMode);
    89 
    90 
    91 /** UIWizardPageBase extension for 2nd page of the Export Appliance wizard. */
    92 class UIWizardExportAppPage2 : public UIWizardPageBase
    93 {
     62/** Namespace for 2nd basic page of the Export Appliance wizard. */
     63namespace UIWizardExportAppPage2
     64{
     65    /** Populates formats. */
     66    void populateFormats(QIComboBox *pCombo, bool fExportToOCIByDefault);
     67    /** Populates MAC address policies. */
     68    void populateMACAddressPolicies(QIComboBox *pCombo);
     69
     70    /** Returns current format of @a pCombo specified. */
     71    QString format(QIComboBox *pCombo);
     72    /** Returns whether format under certain @a iIndex is cloud one. */
     73    bool isFormatCloudOne(QIComboBox *pCombo, int iIndex = -1);
     74
     75    /** Refresh stacked widget. */
     76    void refreshStackedWidget(QStackedWidget *pStackedWidget,
     77                              bool fIsFormatCloudOne);
     78
     79    /** Refresh file selector name. */
     80    void refreshFileSelectorName(QString &strFileSelectorName,
     81                                 const QStringList &machineNames,
     82                                 const QString &strDefaultApplianceName,
     83                                 bool fIsFormatCloudOne);
     84    /** Refresh file selector extension. */
     85    void refreshFileSelectorExtension(QString &strFileSelectorExt,
     86                                      UIEmptyFilePathSelector *pFileSelector,
     87                                      bool fIsFormatCloudOne);
     88    /** Refresh file selector path. */
     89    void refreshFileSelectorPath(UIEmptyFilePathSelector *pFileSelector,
     90                                 const QString &strFileSelectorName,
     91                                 const QString &strFileSelectorExt,
     92                                 bool fIsFormatCloudOne);
     93    /** Refresh Manifest check-box access. */
     94    void refreshManifestCheckBoxAccess(QCheckBox *pCheckBox,
     95                                       bool fIsFormatCloudOne);
     96    /** Refresh Include ISOs check-box access. */
     97    void refreshIncludeISOsCheckBoxAccess(QCheckBox *pCheckBox,
     98                                          bool fIsFormatCloudOne);
     99
     100    /** Refresh profile combo. */
     101    void refreshProfileCombo(QIComboBox *pCombo,
     102                             const QString &strFormat,
     103                             bool fIsFormatCloudOne);
     104    /** Refresh cloud profile. */
     105    void refreshCloudProfile(CCloudProfile &comCloudProfile,
     106                             const QString &strShortProviderName,
     107                             const QString &strProfileName,
     108                             bool fIsFormatCloudOne);
     109    /** Refresh cloud export mode. */
     110    void refreshCloudExportMode(const QMap<CloudExportMode, QAbstractButton*> &radios,
     111                                bool fIsFormatCloudOne);
     112    /** Refresh cloud stuff. */
     113    void refreshCloudStuff(CAppliance &comCloudAppliance,
     114                           CCloudClient &comCloudClient,
     115                           CVirtualSystemDescription &comCloudVsd,
     116                           CVirtualSystemDescriptionForm &comCloudVsdExportForm,
     117                           const CCloudProfile &comCloudProfile,
     118                           const QList<QUuid> &machineIDs,
     119                           const QString &strUri,
     120                           const CloudExportMode enmCloudExportMode);
     121
     122    /** Returns current profile name of @a pCombo specified. */
     123    QString profileName(QIComboBox *pCombo);
     124    /** Returns current cloud export mode chosen in @a radioButtons specified. */
     125    CloudExportMode cloudExportMode(const QMap<CloudExportMode, QAbstractButton*> &radioButtons);
     126
     127    /** Updates format combo tool-tips. */
     128    void updateFormatComboToolTip(QIComboBox *pCombo);
     129    /** Updates MAC address export policy combo tool-tips. */
     130    void updateMACAddressExportPolicyComboToolTip(QIComboBox *pCombo);
     131}
     132
     133/** UINativeWizardPage extension for 2nd basic page of the Export Appliance wizard,
     134  * based on UIWizardAddCloudVMPage2 namespace functions. */
     135class UIWizardExportAppPageBasic2 : public UINativeWizardPage
     136{
     137    Q_OBJECT;
     138
     139public:
     140
     141    /** Constructs 2nd basic page. */
     142    UIWizardExportAppPageBasic2(bool fExportToOCIByDefault);
     143
    94144protected:
    95145
    96     /** Constructs 2nd page base. */
    97     UIWizardExportAppPage2(bool fExportToOCIByDefault);
    98 
    99     /** Populates formats. */
    100     void populateFormats();
    101     /** Populates MAC address policies. */
    102     void populateMACAddressPolicies();
    103     /** Populates profiles. */
    104     void populateProfiles();
    105     /** Populates profile. */
    106     void populateProfile();
    107     /** Populates form properties. */
    108     void populateFormProperties();
    109 
    110     /** Updates page appearance. */
    111     virtual void updatePageAppearance();
    112 
    113     /** Refresh file selector name. */
    114     void refreshFileSelectorName();
    115     /** Refresh file selector extension. */
    116     void refreshFileSelectorExtension();
    117     /** Refresh file selector path. */
    118     void refreshFileSelectorPath();
    119     /** Refresh Manifest check-box access. */
    120     void refreshManifestCheckBoxAccess();
    121     /** Refresh Include ISOs check-box access. */
    122     void refreshIncludeISOsCheckBoxAccess();
    123 
    124     /** Updates format combo tool-tips. */
    125     void updateFormatComboToolTip();
    126     /** Updates MAC address export policy combo tool-tips. */
    127     void updateMACAddressExportPolicyComboToolTip();
    128 
    129     /** Defines @a strFormat. */
    130     void setFormat(const QString &strFormat);
    131     /** Returns format. */
    132     QString format() const;
    133     /** Returns whether format under certain @a iIndex is cloud one. */
    134     bool isFormatCloudOne(int iIndex = -1) const;
    135 
    136     /** Defines @a strPath. */
    137     void setPath(const QString &strPath);
    138     /** Returns path. */
    139     QString path() const;
    140 
    141     /** Defines @a enmMACAddressExportPolicy. */
    142     void setMACAddressExportPolicy(MACAddressExportPolicy enmMACAddressExportPolicy);
    143     /** Returns MAC address export policy. */
    144     MACAddressExportPolicy macAddressExportPolicy() const;
    145 
    146     /** Defines whether manifest @a fSelected. */
    147     void setManifestSelected(bool fChecked);
    148     /** Returns whether manifest selected. */
    149     bool isManifestSelected() const;
    150 
    151     /** Defines whether include ISOs @a fSelected. */
    152     void setIncludeISOsSelected(bool fChecked);
    153     /** Returns whether include ISOs selected. */
    154     bool isIncludeISOsSelected() const;
    155 
    156     /** Defines provider by @a uId. */
    157     void setProviderById(const QUuid &uId);
    158     /** Returns provider ID. */
    159     QUuid providerId() const;
    160     /** Returns provider short name. */
    161     QString providerShortName() const;
    162     /** Returns profile name. */
    163     QString profileName() const;
    164     /** Returns Cloud Appliance object. */
    165     CAppliance cloudAppliance() const;
    166     /** Returns Cloud Client object. */
    167     CCloudClient client() const;
    168     /** Returns Virtual System Description object. */
    169     CVirtualSystemDescription vsd() const;
    170     /** Returns Virtual System Description Export Form object. */
    171     CVirtualSystemDescriptionForm vsdExportForm() const;
    172     /** Returns cloud export mode. */
    173     CloudExportMode cloudExportMode() const;
     146    /** Returns wizard this page belongs to. */
     147    UIWizardExportApp *wizard() const;
     148
     149    /** Handles translation event. */
     150    virtual void retranslateUi() /* override */;
     151
     152    /** Performs page initialization. */
     153    virtual void initializePage() /* override */;
     154
     155    /** Returns whether page is complete. */
     156    virtual bool isComplete() const /* override */;
     157
     158    /** Performs page validation. */
     159    virtual bool validatePage() /* override */;
     160
     161private slots:
     162
     163    /** Handles change in format combo-box. */
     164    void sltHandleFormatComboChange();
     165
     166    /** Handles change in file-name selector. */
     167    void sltHandleFileSelectorChange();
     168
     169    /** Handles change in MAC address export policy combo-box. */
     170    void sltHandleMACAddressExportPolicyComboChange();
     171
     172    /** Handles change in manifest check-box. */
     173    void sltHandleManifestCheckBoxChange();
     174
     175    /** Handles change in include ISOs check-box. */
     176    void sltHandleIncludeISOsCheckBoxChange();
     177
     178    /** Handles change in profile combo-box. */
     179    void sltHandleProfileComboChange();
     180
     181    /** Handles cloud export radio-button clicked. */
     182    void sltHandleRadioButtonToggled(QAbstractButton *pButton, bool fToggled);
     183
     184    /** Handles profile tool-button click. */
     185    void sltHandleProfileButtonClick();
     186
     187private:
     188
     189    /** Updates format. */
     190    void updateFormat();
     191    /** Updates profile. */
     192    void updateProfile();
     193    /** Updates cloud stuff. */
     194    void updateCloudStuff();
    174195
    175196    /** Holds whether default format should be Export to OCI. */
    176197    bool  m_fExportToOCIByDefault;
    177198
    178     /** Holds the Cloud Provider Manager reference. */
    179     CCloudProviderManager          m_comCloudProviderManager;
    180     /** Holds the Cloud Provider object reference. */
    181     CCloudProvider                 m_comCloudProvider;
    182     /** Holds the Cloud Profile object reference. */
    183     CCloudProfile                  m_comCloudProfile;
    184     /** Holds the Appliance object reference. */
    185     CAppliance                     m_comAppliance;
    186     /** Holds the Cloud Client object reference. */
    187     CCloudClient                   m_comClient;
    188     /** Holds the Virtual System Description object reference. */
    189     CVirtualSystemDescription      m_comVSD;
    190     /** Holds the Virtual System Description Export Form object reference. */
    191     CVirtualSystemDescriptionForm  m_comVSDExportForm;
    192 
    193199    /** Holds the default appliance name. */
    194200    QString  m_strDefaultApplianceName;
    195 
    196201    /** Holds the file selector name. */
    197202    QString  m_strFileSelectorName;
     
    199204    QString  m_strFileSelectorExt;
    200205
     206    /** Holds the Cloud Profile object instance. */
     207    CCloudProfile  m_comCloudProfile;
     208
     209
     210    /** Holds the format label instance. */
     211    QIRichTextLabel *m_pLabelFormat;
     212    /** Holds the settings label instance. */
     213    QIRichTextLabel *m_pLabelSettings;
     214
    201215    /** Holds the format layout. */
    202216    QGridLayout *m_pFormatLayout;
    203     /** Holds the settings layout 1. */
    204     QGridLayout *m_pSettingsLayout1;
    205     /** Holds the settings layout 2. */
    206     QGridLayout *m_pSettingsLayout2;
    207 
    208217    /** Holds the format combo-box label instance. */
    209     QLabel    *m_pFormatComboBoxLabel;
     218    QLabel      *m_pFormatComboBoxLabel;
    210219    /** Holds the format combo-box instance. */
    211     QComboBox *m_pFormatComboBox;
     220    QIComboBox *m_pFormatComboBox;
    212221
    213222    /** Holds the settings widget instance. */
    214223    QStackedWidget *m_pSettingsWidget;
    215224
     225    /** Holds the settings layout 1. */
     226    QGridLayout             *m_pSettingsLayout1;
    216227    /** Holds the file selector label instance. */
    217228    QLabel                  *m_pFileSelectorLabel;
    218229    /** Holds the file selector instance. */
    219230    UIEmptyFilePathSelector *m_pFileSelector;
    220 
    221231    /** Holds the MAC address policy combo-box label instance. */
    222     QLabel    *m_pMACComboBoxLabel;
     232    QLabel                  *m_pMACComboBoxLabel;
    223233    /** Holds the MAC address policy check-box instance. */
    224     QComboBox *m_pMACComboBox;
    225 
     234    QIComboBox              *m_pMACComboBox;
    226235    /** Holds the additional label instance. */
    227     QLabel    *m_pAdditionalLabel;
     236    QLabel                  *m_pAdditionalLabel;
    228237    /** Holds the manifest check-box instance. */
    229     QCheckBox *m_pManifestCheckbox;
     238    QCheckBox               *m_pManifestCheckbox;
    230239    /** Holds the include ISOs check-box instance. */
    231     QCheckBox *m_pIncludeISOsCheckbox;
    232 
     240    QCheckBox               *m_pIncludeISOsCheckbox;
     241
     242    /** Holds the settings layout 2. */
     243    QGridLayout   *m_pSettingsLayout2;
    233244    /** Holds the profile label instance. */
    234     QLabel       *m_pProfileLabel;
     245    QLabel        *m_pProfileLabel;
    235246    /** Holds the profile combo-box instance. */
    236     QComboBox    *m_pProfileComboBox;
     247    QIComboBox    *m_pProfileComboBox;
    237248    /** Holds the profile management tool-button instance. */
    238     QIToolButton *m_pProfileToolButton;
    239 
    240     /** Holds the machine label instance. */
    241     QLabel       *m_pMachineLabel;
    242     /** Holds the don't ask radio button instance. */
    243     QRadioButton *m_pRadioDoNotAsk;
    244     /** Holds the ask then export radio button instance. */
    245     QRadioButton *m_pRadioAskThenExport;
    246     /** Holds the export then ask radio button instance. */
    247     QRadioButton *m_pRadioExportThenAsk;
     249    QIToolButton  *m_pProfileToolButton;
     250
     251    /** Holds the export mode label instance. */
     252    QLabel                                  *m_pExportModeLabel;
     253    /** Holds the export mode button group instance. */
     254    QButtonGroup                            *m_pExportModeButtonGroup;
     255    /** Holds the map of export mode button instances. */
     256    QMap<CloudExportMode, QAbstractButton*>  m_exportModeButtons;
    248257};
    249258
    250 
    251 /** UIWizardPage extension for 2nd page of the Export Appliance wizard, extends UIWizardExportAppPage2 as well. */
    252 class UIWizardExportAppPageBasic2 : public UIWizardPage, public UIWizardExportAppPage2
    253 {
    254     Q_OBJECT;
    255     Q_PROPERTY(QString format READ format WRITE setFormat);
    256     Q_PROPERTY(bool isFormatCloudOne READ isFormatCloudOne);
    257     Q_PROPERTY(QString path READ path WRITE setPath);
    258     Q_PROPERTY(MACAddressExportPolicy macAddressExportPolicy READ macAddressExportPolicy WRITE setMACAddressExportPolicy);
    259     Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected);
    260     Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected);
    261     Q_PROPERTY(QString providerShortName READ providerShortName);
    262     Q_PROPERTY(CAppliance cloudAppliance READ cloudAppliance);
    263     Q_PROPERTY(CCloudClient client READ client);
    264     Q_PROPERTY(CVirtualSystemDescription vsd READ vsd);
    265     Q_PROPERTY(CVirtualSystemDescriptionForm vsdExportForm READ vsdExportForm);
    266     Q_PROPERTY(CloudExportMode cloudExportMode READ cloudExportMode);
    267 
    268 public:
    269 
    270     /** Constructs 2nd basic page. */
    271     UIWizardExportAppPageBasic2(bool fExportToOCIByDefault);
    272 
    273 protected:
    274 
    275     /** Allows access wizard from base part. */
    276     UIWizard *wizardImp() const { return UIWizardPage::wizard(); }
    277     /** Allows access page from base part. */
    278     UIWizardPage* thisImp() { return this; }
    279     /** Allows access wizard-field from base part. */
    280     QVariant fieldImp(const QString &strFieldName) const { return UIWizardPage::field(strFieldName); }
    281 
    282     /** Handles translation event. */
    283     virtual void retranslateUi() /* override */;
    284 
    285     /** Performs page initialization. */
    286     virtual void initializePage() /* override */;
    287 
    288     /** Returns whether page is complete. */
    289     virtual bool isComplete() const /* override */;
    290 
    291     /** Performs page validation. */
    292     virtual bool validatePage() /* override */;
    293 
    294     /** Updates page appearance. */
    295     virtual void updatePageAppearance() /* override */;
    296 
    297 private slots:
    298 
    299     /** Handles change in format combo-box. */
    300     void sltHandleFormatComboChange();
    301 
    302     /** Handles change in file-name selector. */
    303     void sltHandleFileSelectorChange();
    304 
    305     /** Handles change in MAC address export policy combo-box. */
    306     void sltHandleMACAddressExportPolicyComboChange();
    307 
    308     /** Handles change in profile combo-box. */
    309     void sltHandleProfileComboChange();
    310 
    311     /** Handles profile tool-button click. */
    312     void sltHandleProfileButtonClick();
    313 
    314 private:
    315 
    316     /** Holds the format label instance. */
    317     QIRichTextLabel *m_pLabelFormat;
    318 
    319     /** Holds the settings label instance. */
    320     QIRichTextLabel *m_pLabelSettings;
    321 };
    322 
    323259#endif /* !FEQT_INCLUDED_SRC_wizards_exportappliance_UIWizardExportAppPageBasic2_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r91262 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2525#include "UIApplianceExportEditorWidget.h"
    2626#include "UICommon.h"
     27#include "UIFormEditorWidget.h"
    2728#include "UIMessageCenter.h"
    2829#include "UIWizardExportApp.h"
     
    3334#include "CVirtualSystemDescriptionForm.h"
    3435
     36/* Namespaces: */
     37using namespace UIWizardExportAppPage3;
     38
    3539
    3640/*********************************************************************************************************************************
     
    3842*********************************************************************************************************************************/
    3943
    40 UIWizardExportAppPage3::UIWizardExportAppPage3()
    41     : m_pSettingsCntLayout(0)
    42     , m_pApplianceWidget(0)
    43 {
    44 }
    45 
    46 void UIWizardExportAppPage3::updatePageAppearance()
    47 {
    48     /* Check whether there was cloud target selected: */
    49     const bool fIsFormatCloudOne = fieldImp("isFormatCloudOne").toBool();
    50     /* Update page appearance according to chosen source: */
    51     m_pSettingsCntLayout->setCurrentIndex((int)fIsFormatCloudOne);
    52 }
    53 
    54 void UIWizardExportAppPage3::refreshApplianceSettingsWidget()
    55 {
     44void UIWizardExportAppPage3::refreshStackedLayout(QStackedLayout *pStackedLayout,
     45                                                  bool fIsFormatCloudOne)
     46{
     47    /* Update stack appearance according to chosen format: */
     48    pStackedLayout->setCurrentIndex((int)fIsFormatCloudOne);
     49}
     50
     51void UIWizardExportAppPage3::refreshApplianceSettingsWidget(UIApplianceExportEditorWidget *pApplianceWidget,
     52                                                            const QList<QUuid> &machineIDs,
     53                                                            const QString &strUri,
     54                                                            bool fIsFormatCloudOne)
     55{
     56    /* Nothing for cloud case? */
     57    if (fIsFormatCloudOne)
     58        return;
     59
    5660    /* Acquire appliance: */
    57     CAppliance *pAppliance = m_pApplianceWidget->init();
     61    CAppliance *pAppliance = pApplianceWidget->init();
    5862    if (pAppliance->isOk())
    5963    {
    6064        /* Iterate over all the selected machine uuids: */
    61         const QList<QUuid> uuids = fieldImp("machineIDs").value<QList<QUuid> >();
    62         foreach (const QUuid &uMachineId, uuids)
     65        foreach (const QUuid &uMachineId, machineIDs)
    6366        {
    6467            /* Get the machine with the uMachineId: */
     
    6871            {
    6972                /* Add the export description to our appliance object: */
    70                 CVirtualSystemDescription comVsd = comMachine.ExportTo(*pAppliance, qobject_cast<UIWizardExportApp*>(wizardImp())->uri());
     73                CVirtualSystemDescription comVsd = comMachine.ExportTo(*pAppliance, strUri);
    7174                if (comMachine.isOk() && comVsd.isNotNull())
    7275                {
     
    8083                }
    8184                else
    82                     return msgCenter().cannotExportAppliance(comMachine, pAppliance->GetPath(), thisImp());
     85                    return msgCenter().cannotExportAppliance(comMachine, pAppliance->GetPath());
    8386            }
    8487            else
     
    8689        }
    8790        /* Make sure the settings widget get the new descriptions: */
    88         m_pApplianceWidget->populate();
    89     }
    90 }
    91 
    92 void UIWizardExportAppPage3::refreshFormPropertiesTable()
    93 {
    94     /* Acquire VSD form: */
    95     CVirtualSystemDescriptionForm comForm = fieldImp("vsdExportForm").value<CVirtualSystemDescriptionForm>();
     91        pApplianceWidget->populate();
     92    }
     93}
     94
     95void UIWizardExportAppPage3::refreshFormPropertiesTable(UIFormEditorWidget *pFormEditor,
     96                                                        const CVirtualSystemDescriptionForm &comVsdExportForm,
     97                                                        bool fIsFormatCloudOne)
     98{
     99    /* Nothing for local case? */
     100    if (!fIsFormatCloudOne)
     101        return;
     102
    96103    /* Make sure the properties table get the new description form: */
    97     if (comForm.isNotNull())
    98         m_pFormEditor->setVirtualSystemDescriptionForm(comForm);
    99 }
    100 
    101 CAppliance UIWizardExportAppPage3::localAppliance() const
    102 {
    103     CAppliance *pAppliance = m_pApplianceWidget->appliance();
    104     return pAppliance ? *pAppliance : CAppliance();
     104    if (comVsdExportForm.isNotNull())
     105        pFormEditor->setVirtualSystemDescriptionForm(comVsdExportForm);
    105106}
    106107
     
    117118    {
    118119        /* Create label: */
    119         m_pLabel = new QIRichTextLabel;
     120        m_pLabel = new QIRichTextLabel(this);
    120121        if (m_pLabel)
    121         {
    122             /* Add into layout: */
    123122            pMainLayout->addWidget(m_pLabel);
    124         }
    125123
    126124        /* Create settings container layout: */
    127         m_pSettingsCntLayout = new QStackedLayout;
    128         if (m_pSettingsCntLayout)
     125        m_pSettingsLayout = new QStackedLayout(this);
     126        if (m_pSettingsLayout)
    129127        {
    130128            /* Create appliance widget container: */
     
    139137
    140138                    /* Create appliance widget: */
    141                     m_pApplianceWidget = new UIApplianceExportEditorWidget;
     139                    m_pApplianceWidget = new UIApplianceExportEditorWidget(pApplianceWidgetCnt);
    142140                    if (m_pApplianceWidget)
    143141                    {
    144142                        m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    145 
    146                         /* Add into layout: */
    147143                        pApplianceWidgetLayout->addWidget(m_pApplianceWidget);
    148144                    }
     
    150146
    151147                /* Add into layout: */
    152                 m_pSettingsCntLayout->addWidget(pApplianceWidgetCnt);
     148                m_pSettingsLayout->addWidget(pApplianceWidgetCnt);
    153149            }
    154150
     
    166162                    m_pFormEditor = new UIFormEditorWidget(pFormEditorCnt);
    167163                    if (m_pFormEditor)
    168                     {
    169                         /* Add into layout: */
    170164                        pFormEditorLayout->addWidget(m_pFormEditor);
    171                     }
    172165                }
    173166
    174167                /* Add into layout: */
    175                 m_pSettingsCntLayout->addWidget(pFormEditorCnt);
     168                m_pSettingsLayout->addWidget(pFormEditorCnt);
    176169            }
    177170
    178171            /* Add into layout: */
    179             pMainLayout->addLayout(m_pSettingsCntLayout);
     172            pMainLayout->addLayout(m_pSettingsLayout);
    180173        }
    181174    }
    182 
    183     /* Register fields: */
    184     registerField("localAppliance", this, "localAppliance");
     175}
     176
     177UIWizardExportApp *UIWizardExportAppPageBasic3::wizard() const
     178{
     179    return qobject_cast<UIWizardExportApp*>(UINativeWizardPage::wizard());
    185180}
    186181
     
    190185    setTitle(UIWizardExportApp::tr("Virtual system settings"));
    191186
    192     /* Update page appearance: */
    193     updatePageAppearance();
     187    /* Translate label: */
     188    if (wizard()->isFormatCloudOne())
     189        m_pLabel->setText(UIWizardExportApp::tr("This is the descriptive information which will be used to determine settings "
     190                                                "for a cloud storage your VM being exported to.  You can change it by double "
     191                                                "clicking on individual lines."));
     192    else
     193        m_pLabel->setText(UIWizardExportApp::tr("This is the descriptive information which will be added to the virtual "
     194                                                "appliance.  You can change it by double clicking on individual lines."));
    194195}
    195196
     
    199200    retranslateUi();
    200201
    201     /* Check whether there was cloud target selected: */
    202     const bool fIsFormatCloudOne = field("isFormatCloudOne").toBool();
    203     if (fIsFormatCloudOne)
    204         refreshFormPropertiesTable();
     202    /* Refresh settings layout state: */
     203    refreshStackedLayout(m_pSettingsLayout, wizard()->isFormatCloudOne());
     204    /* Refresh corresponding widgets: */
     205    refreshApplianceSettingsWidget(m_pApplianceWidget, wizard()->machineIDs(), wizard()->uri(), wizard()->isFormatCloudOne());
     206    refreshFormPropertiesTable(m_pFormEditor, wizard()->vsdExportForm(), wizard()->isFormatCloudOne());
     207
     208    /* Choose initially focused widget: */
     209    if (wizard()->isFormatCloudOne())
     210        m_pFormEditor->setFocus();
    205211    else
    206         refreshApplianceSettingsWidget();
    207 
    208     /* Listen for custom button clicks: */
    209     connect(wizard(), &UIWizard::customButtonClicked,
    210             this, &UIWizardExportAppPageBasic3::sltHandleCustomButtonClicked,
    211             Qt::UniqueConnection);
    212 }
    213 
    214 void UIWizardExportAppPageBasic3::cleanupPage()
    215 {
    216     /* Call to base-class: */
    217     UIWizardPage::cleanupPage();
    218 
    219     /* Stop listen for custom button clicks: */
    220     disconnect(wizard(), &UIWizard::customButtonClicked,
    221                this, &UIWizardExportAppPageBasic3::sltHandleCustomButtonClicked);
     212        m_pApplianceWidget->setFocus();
    222213}
    223214
     
    227218    bool fResult = true;
    228219
    229     /* Lock finish button: */
    230     startProcessing();
    231 
    232220    /* Check whether there was cloud target selected: */
    233     const bool fIsFormatCloudOne = fieldImp("isFormatCloudOne").toBool();
    234     if (fIsFormatCloudOne)
     221    if (wizard()->isFormatCloudOne())
    235222    {
    236223        /* Make sure table has own data committed: */
     
    238225
    239226        /* Check whether we have proper VSD form: */
    240         CVirtualSystemDescriptionForm comForm = fieldImp("vsdExportForm").value<CVirtualSystemDescriptionForm>();
     227        CVirtualSystemDescriptionForm comForm = wizard()->vsdExportForm();
    241228        fResult = comForm.isNotNull();
    242229        Assert(fResult);
     
    256243        /* Prepare export: */
    257244        m_pApplianceWidget->prepareExport();
     245        wizard()->setLocalAppliance(*m_pApplianceWidget->appliance());
    258246    }
    259247
    260248    /* Try to export appliance: */
    261249    if (fResult)
    262         fResult = qobject_cast<UIWizardExportApp*>(wizard())->exportAppliance();
    263 
    264     /* Unlock finish button: */
    265     endProcessing();
     250        fResult = wizard()->exportAppliance();
    266251
    267252    /* Return result: */
    268253    return fResult;
    269254}
    270 
    271 void UIWizardExportAppPageBasic3::updatePageAppearance()
    272 {
    273     /* Call to base-class: */
    274     UIWizardExportAppPage3::updatePageAppearance();
    275 
    276     /* Check whether there was cloud target selected: */
    277     const bool fIsFormatCloudOne = field("isFormatCloudOne").toBool();
    278     if (fIsFormatCloudOne)
    279     {
    280         m_pLabel->setText(UIWizardExportApp::tr("This is the descriptive information which will be used to determine settings "
    281                                                 "for a cloud storage your VM being exported to.  You can change it by double "
    282                                                 "clicking on individual lines."));
    283         m_pFormEditor->setFocus();
    284     }
    285     else
    286     {
    287         m_pLabel->setText(UIWizardExportApp::tr("This is the descriptive information which will be added to the virtual "
    288                                                 "appliance.  You can change it by double clicking on individual lines."));
    289         m_pApplianceWidget->setFocus();
    290     }
    291 }
    292 
    293 void UIWizardExportAppPageBasic3::sltHandleCustomButtonClicked(int iId)
    294 {
    295     /* Handle 2nd button: */
    296     if (iId == QWizard::CustomButton2)
    297     {
    298         /* Reset widget to default: */
    299         m_pApplianceWidget->restoreDefaults();
    300     }
    301 }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r91262 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424/* Qt includes: */
    2525#include <QList>
    26 #include <QVariant>
    2726
    2827/* GUI includes: */
    29 #include "UIExtraDataDefs.h"
    30 #include "UIFormEditorWidget.h"
    31 #include "UIWizardPage.h"
     28#include "UINativeWizardPage.h"
    3229
    3330/* COM includes: */
     31#include "COMEnums.h"
    3432#include "CAppliance.h"
    3533
     
    3836class QIRichTextLabel;
    3937class UIApplianceExportEditorWidget;
     38class UIFormEditorWidget;
    4039class UIWizardExportApp;
    4140
    42 
    43 /** UIWizardPageBase extension for 3rd page of the Export Appliance wizard. */
    44 class UIWizardExportAppPage3 : public UIWizardPageBase
     41/** Namespace for 3rd basic page of the Export Appliance wizard. */
     42namespace UIWizardExportAppPage3
    4543{
    46 protected:
    47 
    48     /** Constructs 3rd page base. */
    49     UIWizardExportAppPage3();
    50 
    51     /** Updates page appearance. */
    52     virtual void updatePageAppearance();
     44    /** Refresh stacked layout. */
     45    void refreshStackedLayout(QStackedLayout *pStackedLayout,
     46                              bool fIsFormatCloudOne);
    5347
    5448    /** Refreshes appliance settings widget. */
    55     void refreshApplianceSettingsWidget();
     49    void refreshApplianceSettingsWidget(UIApplianceExportEditorWidget *pApplianceWidget,
     50                                        const QList<QUuid> &machineIDs,
     51                                        const QString &strUri,
     52                                        bool fIsFormatCloudOne);
    5653    /** Refreshes form properties table. */
    57     void refreshFormPropertiesTable();
     54    void refreshFormPropertiesTable(UIFormEditorWidget *pFormEditor,
     55                                    const CVirtualSystemDescriptionForm &comVsdExportForm,
     56                                    bool fIsFormatCloudOne);
     57}
    5858
    59     /** Returns Local Appliance object. */
    60     CAppliance localAppliance() const;
    61 
    62     /** Holds the settings container layout instance. */
    63     QStackedLayout *m_pSettingsCntLayout;
    64 
    65     /** Holds the appliance widget reference. */
    66     UIApplianceExportEditorWidget *m_pApplianceWidget;
    67     /** Holds the Form Editor widget instance. */
    68     UIFormEditorWidgetPointer      m_pFormEditor;
    69 };
    70 
    71 
    72 /** UIWizardPage extension for 3rd page of the Export Appliance wizard, extends UIWizardExportAppPage3 as well. */
    73 class UIWizardExportAppPageBasic3 : public UIWizardPage, public UIWizardExportAppPage3
     59/** UINativeWizardPage extension for 3rd basic page of the Export Appliance wizard,
     60  * based on UIWizardAddCloudVMPage3 namespace functions. */
     61class UIWizardExportAppPageBasic3 : public UINativeWizardPage
    7462{
    7563    Q_OBJECT;
    76     Q_PROPERTY(CAppliance localAppliance READ localAppliance);
    7764
    7865public:
     
    8370protected:
    8471
    85     /** Allows access wizard from base part. */
    86     UIWizard *wizardImp() const { return UIWizardPage::wizard(); }
    87     /** Allows access page from base part. */
    88     UIWizardPage* thisImp() { return this; }
    89     /** Allows access wizard-field from base part. */
    90     QVariant fieldImp(const QString &strFieldName) const { return UIWizardPage::field(strFieldName); }
     72    /** Returns wizard this page belongs to. */
     73    UIWizardExportApp *wizard() const;
    9174
    9275    /** Handles translation event. */
     
    9578    /** Performs page initialization. */
    9679    virtual void initializePage() /* override */;
    97     /** Performs page cleanup. */
    98     virtual void cleanupPage() /* override */;
    9980
    10081    /** Performs page validation. */
    10182    virtual bool validatePage() /* override */;
    102 
    103     /** Updates page appearance. */
    104     virtual void updatePageAppearance() /* override */;
    105 
    106 private slots:
    107 
    108     /** Handles custom button clicked.
    109       * @param  iId  Brings clicked button id. */
    110     void sltHandleCustomButtonClicked(int iId);
    11183
    11284private:
     
    11486    /** Holds the label instance. */
    11587    QIRichTextLabel *m_pLabel;
     88
     89    /** Holds the settings container layout instance. */
     90    QStackedLayout *m_pSettingsLayout;
     91
     92    /** Holds the appliance widget reference. */
     93    UIApplianceExportEditorWidget *m_pApplianceWidget;
     94    /** Holds the Form Editor widget instance. */
     95    UIFormEditorWidget            *m_pFormEditor;
    11696};
    11797
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r91262 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1717
    1818/* Qt includes: */
     19#include <QButtonGroup>
    1920#include <QCheckBox>
    2021#include <QGridLayout>
     
    3132
    3233/* GUI includes: */
     34#include "QIComboBox.h"
    3335#include "QIToolButton.h"
    3436#include "UICommon.h"
     
    3638#include "UIConverter.h"
    3739#include "UIEmptyFilePathSelector.h"
     40#include "UIFormEditorWidget.h"
    3841#include "UIIconPool.h"
    3942#include "UIMessageCenter.h"
     
    4144#include "UIVirtualBoxManager.h"
    4245#include "UIWizardExportApp.h"
     46#include "UIWizardExportAppPageBasic1.h"
     47#include "UIWizardExportAppPageBasic2.h"
     48#include "UIWizardExportAppPageBasic3.h"
    4349#include "UIWizardExportAppPageExpert.h"
     50
     51/* Namespaces: */
     52using namespace UIWizardExportAppPage1;
     53using namespace UIWizardExportAppPage2;
     54using namespace UIWizardExportAppPage3;
    4455
    4556
     
    4960
    5061UIWizardExportAppPageExpert::UIWizardExportAppPageExpert(const QStringList &selectedVMNames, bool fExportToOCIByDefault)
    51     : UIWizardExportAppPage2(fExportToOCIByDefault)
    52     , m_fPolished(false)
     62    : m_selectedVMNames(selectedVMNames)
     63    , m_fExportToOCIByDefault(fExportToOCIByDefault)
    5364    , m_pSelectorCnt(0)
     65    , m_pVMSelector(0)
    5466    , m_pApplianceCnt(0)
     67    , m_pSettingsLayout(0)
     68    , m_pApplianceWidget(0)
     69    , m_pFormEditor(0)
    5570    , m_pSettingsCnt(0)
     71    , m_pFormatLayout(0)
     72    , m_pFormatComboBoxLabel(0)
     73    , m_pFormatComboBox(0)
     74    , m_pSettingsWidget(0)
     75    , m_pSettingsLayout1(0)
     76    , m_pFileSelectorLabel(0)
     77    , m_pFileSelector(0)
     78    , m_pMACComboBoxLabel(0)
     79    , m_pMACComboBox(0)
     80    , m_pAdditionalLabel(0)
     81    , m_pManifestCheckbox(0)
     82    , m_pIncludeISOsCheckbox(0)
     83    , m_pSettingsLayout2(0)
     84    , m_pProfileLabel(0)
     85    , m_pProfileComboBox(0)
     86    , m_pProfileToolButton(0)
     87    , m_pExportModeLabel(0)
     88    , m_pExportModeButtonGroup(0)
    5689{
    5790    /* Create widgets: */
     
    6295
    6396        /* Create VM selector container: */
    64         m_pSelectorCnt = new QGroupBox;
     97        m_pSelectorCnt = new QGroupBox(this);
    6598        if (m_pSelectorCnt)
    6699        {
     
    70103            {
    71104                /* Create VM selector: */
    72                 m_pVMSelector = new QListWidget;
     105                m_pVMSelector = new QListWidget(m_pSelectorCnt);
    73106                if (m_pVMSelector)
    74107                {
    75108                    m_pVMSelector->setAlternatingRowColors(true);
    76109                    m_pVMSelector->setSelectionMode(QAbstractItemView::ExtendedSelection);
    77 
    78                     /* Add into layout: */
    79110                    pSelectorCntLayout->addWidget(m_pVMSelector);
    80111                }
     
    86117
    87118        /* Create appliance widget container: */
    88         m_pApplianceCnt = new QGroupBox;
     119        m_pApplianceCnt = new QGroupBox(this);
    89120        if (m_pApplianceCnt)
    90121        {
     
    94125            {
    95126                /* Create settings container layout: */
    96                 m_pSettingsCntLayout = new QStackedLayout;
    97                 if (m_pSettingsCntLayout)
     127                m_pSettingsLayout = new QStackedLayout;
     128                if (m_pSettingsLayout)
    98129                {
    99130                    /* Create appliance widget container: */
     
    108139
    109140                            /* Create appliance widget: */
    110                             m_pApplianceWidget = new UIApplianceExportEditorWidget;
     141                            m_pApplianceWidget = new UIApplianceExportEditorWidget(pApplianceWidgetCnt);
    111142                            if (m_pApplianceWidget)
    112143                            {
    113144                                m_pApplianceWidget->setMinimumHeight(250);
    114145                                m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    115 
    116                                 /* Add into layout: */
    117146                                pApplianceWidgetLayout->addWidget(m_pApplianceWidget);
    118147                            }
     
    120149
    121150                        /* Add into layout: */
    122                         m_pSettingsCntLayout->addWidget(pApplianceWidgetCnt);
     151                        m_pSettingsLayout->addWidget(pApplianceWidgetCnt);
    123152                    }
    124153
     
    136165                            m_pFormEditor = new UIFormEditorWidget(pFormEditorCnt);
    137166                            if (m_pFormEditor)
    138                             {
    139                                 /* Add into layout: */
    140167                                pFormEditorLayout->addWidget(m_pFormEditor);
    141                             }
    142168                        }
    143169
    144170                        /* Add into layout: */
    145                         m_pSettingsCntLayout->addWidget(pFormEditorCnt);
     171                        m_pSettingsLayout->addWidget(pFormEditorCnt);
    146172                    }
    147173
    148174                    /* Add into layout: */
    149                     pApplianceCntLayout->addLayout(m_pSettingsCntLayout);
     175                    pApplianceCntLayout->addLayout(m_pSettingsLayout);
    150176                }
    151177            }
     
    156182
    157183        /* Create settings widget container: */
    158         m_pSettingsCnt = new QGroupBox;
     184        m_pSettingsCnt = new QGroupBox(this);
    159185        if (m_pSettingsCnt)
    160186        {
     
    179205
    180206                    /* Create format combo-box: */
    181                     m_pFormatComboBox = new QComboBox;
     207                    m_pFormatComboBox = new QIComboBox(m_pSettingsCnt);
    182208                    if (m_pFormatComboBox)
    183                     {
    184                         /* Add into layout: */
    185209                        m_pFormatLayout->addWidget(m_pFormatComboBox, 0, 1);
    186                     }
    187210                    /* Create format combo-box label: */
    188                     m_pFormatComboBoxLabel = new QLabel;
     211                    m_pFormatComboBoxLabel = new QLabel(m_pSettingsCnt);
    189212                    if (m_pFormatComboBoxLabel)
    190213                    {
    191214                        m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    192215                        m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox);
    193 
    194                         /* Add into layout: */
    195216                        m_pFormatLayout->addWidget(m_pFormatComboBoxLabel, 0, 0);
    196217                    }
     
    205226                {
    206227                    /* Create settings pane 1: */
    207                     QWidget *pSettingsPane1 = new QWidget;
     228                    QWidget *pSettingsPane1 = new QWidget(m_pSettingsWidget);
    208229                    if (pSettingsPane1)
    209230                    {
     
    243264
    244265                            /* Create MAC policy combo-box: */
    245                             m_pMACComboBox = new QComboBox;
     266                            m_pMACComboBox = new QIComboBox;
    246267                            if (m_pMACComboBox)
    247268                            {
     
    298319
    299320                    /* Create settings pane 2: */
    300                     QWidget *pSettingsPane2 = new QWidget;
     321                    QWidget *pSettingsPane2 = new QWidget(m_pSettingsWidget);
    301322                    if (pSettingsPane2)
    302323                    {
     
    313334
    314335                            /* Create profile label: */
    315                             m_pProfileLabel = new QLabel;
     336                            m_pProfileLabel = new QLabel(pSettingsPane2);
    316337                            if (m_pProfileLabel)
    317338                            {
    318339                                m_pProfileLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
    319 
    320                                 /* Add into layout: */
    321340                                m_pSettingsLayout2->addWidget(m_pProfileLabel, 0, 0);
    322341                            }
     
    329348
    330349                                /* Create profile combo-box: */
    331                                 m_pProfileComboBox = new QComboBox;
     350                                m_pProfileComboBox = new QIComboBox(pSettingsPane2);
    332351                                if (m_pProfileComboBox)
    333352                                {
    334353                                    m_pProfileLabel->setBuddy(m_pProfileComboBox);
    335 
    336                                     /* Add into layout: */
    337354                                    pSubLayout->addWidget(m_pProfileComboBox);
    338355                                }
    339356                                /* Create profile tool-button: */
    340                                 m_pProfileToolButton = new QIToolButton;
     357                                m_pProfileToolButton = new QIToolButton(pSettingsPane2);
    341358                                if (m_pProfileToolButton)
    342359                                {
    343360                                    m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    344361                                                                                      ":/cloud_profile_manager_disabled_16px.png"));
    345 
    346                                     /* Add into layout: */
    347362                                    pSubLayout->addWidget(m_pProfileToolButton);
    348363                                }
     
    353368
    354369                            /* Create profile label: */
    355                             m_pMachineLabel = new QLabel;
    356                             if (m_pMachineLabel)
    357                             {
    358                                 m_pMachineLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
    359 
    360                                 /* Add into layout: */
    361                                 m_pSettingsLayout2->addWidget(m_pMachineLabel, 1, 0);
    362                             }
    363                             /* Create Do Not Ask button: */
    364                             m_pRadioDoNotAsk = new QRadioButton;
    365                             if (m_pRadioDoNotAsk)
    366                             {
    367                                 /* Add into layout: */
    368                                 m_pSettingsLayout2->addWidget(m_pRadioDoNotAsk, 1, 1);
    369                             }
    370                             /* Create Ask Then Export button: */
    371                             m_pRadioAskThenExport = new QRadioButton;
    372                             if (m_pRadioAskThenExport)
    373                             {
    374                                 /* Add into layout: */
    375                                 m_pSettingsLayout2->addWidget(m_pRadioAskThenExport, 2, 1);
    376                             }
    377                             /* Create Export Then Ask button: */
    378                             m_pRadioExportThenAsk = new QRadioButton;
    379                             if (m_pRadioExportThenAsk)
    380                             {
    381                                 /* Add into layout: */
    382                                 m_pSettingsLayout2->addWidget(m_pRadioExportThenAsk, 3, 1);
     370                            m_pExportModeLabel = new QLabel(pSettingsPane2);
     371                            if (m_pExportModeLabel)
     372                            {
     373                                m_pExportModeLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
     374                                m_pSettingsLayout2->addWidget(m_pExportModeLabel, 1, 0);
     375                            }
     376
     377                            /* Create button-group: */
     378                            m_pExportModeButtonGroup = new QButtonGroup(pSettingsPane2);
     379                            if (m_pExportModeButtonGroup)
     380                            {
     381                                /* Create Do Not Ask button: */
     382                                m_exportModeButtons[CloudExportMode_DoNotAsk] = new QRadioButton(pSettingsPane2);
     383                                if (m_exportModeButtons.value(CloudExportMode_DoNotAsk))
     384                                {
     385                                    m_pExportModeButtonGroup->addButton(m_exportModeButtons.value(CloudExportMode_DoNotAsk));
     386                                    m_pSettingsLayout2->addWidget(m_exportModeButtons.value(CloudExportMode_DoNotAsk), 1, 1);
     387                                }
     388                                /* Create Ask Then Export button: */
     389                                m_exportModeButtons[CloudExportMode_AskThenExport] = new QRadioButton(pSettingsPane2);
     390                                if (m_exportModeButtons.value(CloudExportMode_AskThenExport))
     391                                {
     392                                    m_pExportModeButtonGroup->addButton(m_exportModeButtons.value(CloudExportMode_AskThenExport));
     393                                    m_pSettingsLayout2->addWidget(m_exportModeButtons.value(CloudExportMode_AskThenExport), 2, 1);
     394                                }
     395                                /* Create Export Then Ask button: */
     396                                m_exportModeButtons[CloudExportMode_ExportThenAsk] = new QRadioButton(pSettingsPane2);
     397                                if (m_exportModeButtons.value(CloudExportMode_ExportThenAsk))
     398                                {
     399                                    m_pExportModeButtonGroup->addButton(m_exportModeButtons.value(CloudExportMode_ExportThenAsk));
     400                                    m_pSettingsLayout2->addWidget(m_exportModeButtons.value(CloudExportMode_ExportThenAsk), 3, 1);
     401                                }
    383402                            }
    384403                        }
     
    397416        }
    398417    }
    399 
    400     /* Populate VM selector items: */
    401     populateVMSelectorItems(selectedVMNames);
    402     /* Populate formats: */
    403     populateFormats();
    404     /* Populate MAC address policies: */
    405     populateMACAddressPolicies();
    406418
    407419    /* Setup connections: */
     
    410422    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileChanged,
    411423            this, &UIWizardExportAppPageExpert::sltHandleFormatComboChange);
    412     connect(m_pVMSelector, &QListWidget::itemSelectionChanged,      this, &UIWizardExportAppPageExpert::sltVMSelectionChangeHandler);
     424    connect(m_pVMSelector, &QListWidget::itemSelectionChanged,
     425            this, &UIWizardExportAppPageExpert::sltHandleVMItemSelectionChanged);
    413426    connect(m_pFileSelector, &UIEmptyFilePathSelector::pathChanged,
    414427            this, &UIWizardExportAppPageExpert::sltHandleFileSelectorChange);
    415     connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     428    connect(m_pFormatComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    416429            this, &UIWizardExportAppPageExpert::sltHandleFormatComboChange);
    417     connect(m_pMACComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     430    connect(m_pMACComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    418431            this, &UIWizardExportAppPageExpert::sltHandleMACAddressExportPolicyComboChange);
    419     connect(m_pProfileComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     432    connect(m_pManifestCheckbox, &QCheckBox::stateChanged,
     433            this, &UIWizardExportAppPageExpert::sltHandleManifestCheckBoxChange);
     434    connect(m_pIncludeISOsCheckbox, &QCheckBox::stateChanged,
     435            this, &UIWizardExportAppPageExpert::sltHandleIncludeISOsCheckBoxChange);
     436    connect(m_pProfileComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    420437            this, &UIWizardExportAppPageExpert::sltHandleProfileComboChange);
     438    connect(m_pExportModeButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled),
     439            this, &UIWizardExportAppPageExpert::sltHandleRadioButtonToggled);
    421440    connect(m_pProfileToolButton, &QIToolButton::clicked,
    422441            this, &UIWizardExportAppPageExpert::sltHandleProfileButtonClick);
    423 
    424     /* Register fields: */
    425     registerField("machineNames", this, "machineNames");
    426     registerField("machineIDs", this, "machineIDs");
    427     registerField("format", this, "format");
    428     registerField("isFormatCloudOne", this, "isFormatCloudOne");
    429     registerField("path", this, "path");
    430     registerField("macAddressExportPolicy", this, "macAddressExportPolicy");
    431     registerField("manifestSelected", this, "manifestSelected");
    432     registerField("includeISOsSelected", this, "includeISOsSelected");
    433     registerField("providerShortName", this, "providerShortName");
    434     registerField("cloudAppliance", this, "cloudAppliance");
    435     registerField("client", this, "client");
    436     registerField("vsd", this, "vsd");
    437     registerField("vsdExportForm", this, "vsdExportForm");
    438     registerField("cloudExportMode", this, "cloudExportMode");
    439     registerField("localAppliance", this, "localAppliance");
     442}
     443
     444UIWizardExportApp *UIWizardExportAppPageExpert::wizard() const
     445{
     446    return qobject_cast<UIWizardExportApp*>(UINativeWizardPage::wizard());
    440447}
    441448
     
    444451    /* Translate objects: */
    445452    m_strDefaultApplianceName = UIWizardExportApp::tr("Appliance");
     453    refreshFileSelectorName(m_strFileSelectorName, wizard()->machineNames(), m_strDefaultApplianceName, wizard()->isFormatCloudOne());
     454    refreshFileSelectorPath(m_pFileSelector, m_strFileSelectorName, m_strFileSelectorExt, wizard()->isFormatCloudOne());
    446455
    447456    /* Translate group-boxes: */
     
    467476     * We are enumerating starting from 0 for simplicity: */
    468477    for (int i = 0; i < m_pFormatComboBox->count(); ++i)
    469         if (isFormatCloudOne(i))
     478        if (isFormatCloudOne(m_pFormatComboBox, i))
    470479        {
    471480            m_pFormatComboBox->setItemText(i, m_pFormatComboBox->itemData(i, FormatData_Name).toString());
     
    483492            {
    484493                m_pMACComboBox->setItemText(i, UIWizardExportApp::tr("Include all network adapter MAC addresses"));
    485                 m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include all network adapter MAC addresses in exported appliance archive."), Qt::ToolTipRole);
     494                m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include all network adapter MAC addresses in exported "
     495                                                                     "appliance archive."), Qt::ToolTipRole);
    486496                break;
    487497            }
     
    489499            {
    490500                m_pMACComboBox->setItemText(i, UIWizardExportApp::tr("Include only NAT network adapter MAC addresses"));
    491                 m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include only NAT network adapter MAC addresses in exported appliance archive."), Qt::ToolTipRole);
     501                m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Include only NAT network adapter MAC addresses in exported "
     502                                                                     "appliance archive."), Qt::ToolTipRole);
    492503                break;
    493504            }
     
    495506            {
    496507                m_pMACComboBox->setItemText(i, UIWizardExportApp::tr("Strip all network adapter MAC addresses"));
    497                 m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Strip all network adapter MAC addresses from exported appliance archive."), Qt::ToolTipRole);
     508                m_pMACComboBox->setItemData(i, UIWizardExportApp::tr("Strip all network adapter MAC addresses from exported "
     509                                                                     "appliance archive."), Qt::ToolTipRole);
    498510                break;
    499511            }
     
    505517    /* Translate addtional stuff: */
    506518    m_pAdditionalLabel->setText(UIWizardExportApp::tr("Additionally:"));
    507     m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Creates a manifest file for automatic data integrity checks on import."));
     519    m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import."));
    508520    m_pManifestCheckbox->setText(UIWizardExportApp::tr("&Write Manifest file"));
    509     m_pIncludeISOsCheckbox->setToolTip(UIWizardExportApp::tr("Includes ISO image files into exported VM archive."));
     521    m_pIncludeISOsCheckbox->setToolTip(UIWizardExportApp::tr("Include ISO image files into exported VM archive."));
    510522    m_pIncludeISOsCheckbox->setText(UIWizardExportApp::tr("&Include ISO image files"));
    511523
    512524    /* Translate profile stuff: */
    513525    m_pProfileLabel->setText(UIWizardExportApp::tr("&Profile:"));
    514     m_pProfileToolButton->setToolTip(UIWizardExportApp::tr("Opens Cloud Profile Manager..."));
     526    m_pProfileToolButton->setToolTip(UIWizardExportApp::tr("Open Cloud Profile Manager..."));
    515527
    516528    /* Translate option label: */
    517     m_pMachineLabel->setText(UIWizardExportApp::tr("Machine Creation:"));
    518     m_pRadioDoNotAsk->setText(UIWizardExportApp::tr("Do not ask me about it, leave custom &image for future usage"));
    519     m_pRadioAskThenExport->setText(UIWizardExportApp::tr("Ask me about it &before exporting disk as custom image"));
    520     m_pRadioExportThenAsk->setText(UIWizardExportApp::tr("Ask me about it &after exporting disk as custom image"));
     529    m_pExportModeLabel->setText(UIWizardExportApp::tr("Machine Creation:"));
     530    m_exportModeButtons.value(CloudExportMode_DoNotAsk)->setText(UIWizardExportApp::tr("Do not ask me about it, leave custom &image for future usage"));
     531    m_exportModeButtons.value(CloudExportMode_AskThenExport)->setText(UIWizardExportApp::tr("Ask me about it &before exporting disk as custom image"));
     532    m_exportModeButtons.value(CloudExportMode_ExportThenAsk)->setText(UIWizardExportApp::tr("Ask me about it &after exporting disk as custom image"));
    521533
    522534    /* Adjust label widths: */
     
    527539    labels << m_pAdditionalLabel;
    528540    labels << m_pProfileLabel;
    529     labels << m_pMachineLabel;
     541    labels << m_pExportModeLabel;
    530542    int iMaxWidth = 0;
    531543    foreach (QWidget *pLabel, labels)
     
    535547    m_pSettingsLayout2->setColumnMinimumWidth(0, iMaxWidth);
    536548
    537     /* Refresh file selector name: */
    538     refreshFileSelectorName();
    539 
    540549    /* Update tool-tips: */
    541     updateFormatComboToolTip();
    542     updateMACAddressExportPolicyComboToolTip();
     550    updateFormatComboToolTip(m_pFormatComboBox);
     551    updateMACAddressExportPolicyComboToolTip(m_pMACComboBox);
    543552}
    544553
    545554void UIWizardExportAppPageExpert::initializePage()
    546555{
    547     /* If wasn't polished yet: */
    548     if (!m_fPolished)
    549     {
    550         QMetaObject::invokeMethod(this, "sltHandleFormatComboChange", Qt::QueuedConnection);
    551         m_fPolished = true;
    552     }
    553 
     556    /* Populate VM items: */
     557    populateVMItems(m_pVMSelector, m_selectedVMNames);
     558    /* Populate formats: */
     559    populateFormats(m_pFormatComboBox, m_fExportToOCIByDefault);
     560    /* Populate MAC address policies: */
     561    populateMACAddressPolicies(m_pMACComboBox);
    554562    /* Translate page: */
    555563    retranslateUi();
    556564
    557     /* Choose default cloud export option: */
    558     m_pRadioExportThenAsk->setChecked(true);
    559 
    560     /* Listen for custom button clicks: */
    561     connect(wizard(), &UIWizard::customButtonClicked,
    562             this, &UIWizardExportAppPageExpert::sltHandleCustomButtonClicked,
    563             Qt::UniqueConnection);
    564 }
    565 
    566 void UIWizardExportAppPageExpert::cleanupPage()
    567 {
    568     /* Do not pass call to base-class, we don't want field values to be reseted. */
    569 
    570     /* Stop listen for custom button clicks: */
    571     disconnect(wizard(), &UIWizard::customButtonClicked,
    572                this, &UIWizardExportAppPageExpert::sltHandleCustomButtonClicked);
     565    /* Fetch it, asynchronously: */
     566    QMetaObject::invokeMethod(this, "sltHandleFormatComboChange", Qt::QueuedConnection);
    573567}
    574568
    575569bool UIWizardExportAppPageExpert::isComplete() const
    576570{
     571    /* Initial result: */
    577572    bool fResult = true;
    578573
    579574    /* There should be at least one vm selected: */
    580575    if (fResult)
    581         fResult = (m_pVMSelector->selectedItems().size() > 0);
     576        fResult = wizard()->machineNames().size() > 0;
    582577
    583578    /* Check appliance settings: */
    584579    if (fResult)
    585580    {
    586         const bool fOVF =    field("format").toString() == "ovf-0.9"
    587                           || field("format").toString() == "ovf-1.0"
    588                           || field("format").toString() == "ovf-2.0";
    589         const bool fCSP =    field("isFormatCloudOne").toBool();
     581        const bool fOVF =    wizard()->format() == "ovf-0.9"
     582                          || wizard()->format() == "ovf-1.0"
     583                          || wizard()->format() == "ovf-2.0";
     584        const bool fCSP =    wizard()->isFormatCloudOne();
    590585
    591586        fResult =    (   fOVF
    592                       && UICommon::hasAllowedExtension(path().toLower(), OVFFileExts))
     587                      && UICommon::hasAllowedExtension(wizard()->path().toLower(), OVFFileExts))
    593588                  || (   fCSP
    594                       && field("cloudAppliance").value<CAppliance>().isNotNull()
    595                       && field("client").value<CCloudClient>().isNotNull()
    596                       && field("vsd").value<CVirtualSystemDescription>().isNotNull()
    597                       && field("vsdExportForm").value<CVirtualSystemDescriptionForm>().isNotNull());
     589                      && wizard()->cloudAppliance().isNotNull()
     590                      && wizard()->cloudClient().isNotNull()
     591                      && wizard()->vsd().isNotNull()
     592                      && wizard()->vsdExportForm().isNotNull());
    598593    }
    599594
     595    /* Return result: */
    600596    return fResult;
    601597}
     
    606602    bool fResult = true;
    607603
    608     /* Lock finish button: */
    609     startProcessing();
    610 
    611604    /* Check whether there was cloud target selected: */
    612     const bool fIsFormatCloudOne = fieldImp("isFormatCloudOne").toBool();
    613     if (fIsFormatCloudOne)
     605    if (wizard()->isFormatCloudOne())
    614606    {
    615607        /* Make sure table has own data committed: */
     
    617609
    618610        /* Check whether we have proper VSD form: */
    619         CVirtualSystemDescriptionForm comForm = fieldImp("vsdExportForm").value<CVirtualSystemDescriptionForm>();
     611        CVirtualSystemDescriptionForm comForm = wizard()->vsdExportForm();
    620612        fResult = comForm.isNotNull();
    621613        Assert(fResult);
     
    633625    else
    634626    {
     627        /* Ask user about machines which are in Saved state currently: */
     628        QStringList savedMachines;
     629        refreshSavedMachines(savedMachines, m_pVMSelector);
     630        if (!savedMachines.isEmpty())
     631            fResult = msgCenter().confirmExportMachinesInSaveState(savedMachines, this);
     632
    635633        /* Prepare export: */
    636         m_pApplianceWidget->prepareExport();
     634        if (fResult)
     635        {
     636            m_pApplianceWidget->prepareExport();
     637            wizard()->setLocalAppliance(*m_pApplianceWidget->appliance());
     638        }
    637639    }
    638640
    639641    /* Try to export appliance: */
    640642    if (fResult)
    641         fResult = qobject_cast<UIWizardExportApp*>(wizard())->exportAppliance();
    642 
    643     /* Unlock finish button: */
    644     endProcessing();
     643        fResult = wizard()->exportAppliance();
    645644
    646645    /* Return result: */
     
    648647}
    649648
    650 void UIWizardExportAppPageExpert::sltVMSelectionChangeHandler()
    651 {
    652     /* Refresh required settings: */
    653     refreshFileSelectorName();
    654     populateFormProperties();
    655 
    656     /* Check whether there was cloud target selected: */
    657     const bool fIsFormatCloudOne = field("isFormatCloudOne").toBool();
    658     if (fIsFormatCloudOne)
    659         refreshFormPropertiesTable();
    660     else
    661         refreshApplianceSettingsWidget();
    662 
    663     /* Broadcast complete-change: */
     649void UIWizardExportAppPageExpert::sltHandleVMItemSelectionChanged()
     650{
     651    updateMachines();
    664652    emit completeChanged();
    665653}
     
    667655void UIWizardExportAppPageExpert::sltHandleFormatComboChange()
    668656{
    669     /* Update tool-tip: */
    670     updateFormatComboToolTip();
    671 
    672     /* Refresh required settings: */
    673     UIWizardExportAppPage2::updatePageAppearance();
    674     UIWizardExportAppPage3::updatePageAppearance();
    675     refreshFileSelectorExtension();
    676     refreshManifestCheckBoxAccess();
    677     refreshIncludeISOsCheckBoxAccess();
    678     populateProfiles();
    679     populateProfile();
    680     populateFormProperties();
    681 
    682     /* Check whether there was cloud target selected: */
    683     const bool fIsFormatCloudOne = field("isFormatCloudOne").toBool();
    684     if (fIsFormatCloudOne)
    685         refreshFormPropertiesTable();
    686     else
    687         refreshApplianceSettingsWidget();
    688 
    689     /* Broadcast complete-change: */
     657    updateFormat();
    690658    emit completeChanged();
    691659}
     
    693661void UIWizardExportAppPageExpert::sltHandleFileSelectorChange()
    694662{
    695     /* Remember changed name, except empty one: */
    696     if (!m_pFileSelector->path().isEmpty())
    697         m_strFileSelectorName = QFileInfo(m_pFileSelector->path()).completeBaseName();
    698 
    699     /* Broadcast complete-change: */
     663    /* Skip empty paths: */
     664    if (m_pFileSelector->path().isEmpty())
     665        return;
     666
     667    m_strFileSelectorName = QFileInfo(m_pFileSelector->path()).completeBaseName();
     668    wizard()->setPath(m_pFileSelector->path());
    700669    emit completeChanged();
    701670}
     
    703672void UIWizardExportAppPageExpert::sltHandleMACAddressExportPolicyComboChange()
    704673{
    705     /* Update tool-tip: */
    706     updateMACAddressExportPolicyComboToolTip();
    707 }
    708 
    709 void UIWizardExportAppPageExpert::sltHandleCustomButtonClicked(int iId)
    710 {
    711     /* Handle 2nd button: */
    712     if (iId == QWizard::CustomButton2)
    713     {
    714         /* Reset widget to default: */
    715         m_pApplianceWidget->restoreDefaults();
    716     }
     674    updateMACAddressExportPolicyComboToolTip(m_pMACComboBox);
     675    wizard()->setMACAddressExportPolicy(m_pMACComboBox->currentData().value<MACAddressExportPolicy>());
     676    emit completeChanged();
     677}
     678
     679void UIWizardExportAppPageExpert::sltHandleManifestCheckBoxChange()
     680{
     681    wizard()->setManifestSelected(m_pManifestCheckbox->isChecked());
     682    emit completeChanged();
     683}
     684
     685void UIWizardExportAppPageExpert::sltHandleIncludeISOsCheckBoxChange()
     686{
     687    wizard()->setIncludeISOsSelected(m_pIncludeISOsCheckbox->isChecked());
     688    emit completeChanged();
    717689}
    718690
    719691void UIWizardExportAppPageExpert::sltHandleProfileComboChange()
    720692{
    721     /* Refresh required settings: */
    722     populateProfile();
    723     populateFormProperties();
    724 
    725     /* Check whether there was cloud target selected: */
    726     const bool fIsFormatCloudOne = field("isFormatCloudOne").toBool();
    727     if (fIsFormatCloudOne)
    728         refreshFormPropertiesTable();
    729     else
    730         refreshApplianceSettingsWidget();
    731 
    732     /* Broadcast complete-change: */
     693    updateProfile();
     694    emit completeChanged();
     695}
     696
     697void UIWizardExportAppPageExpert::sltHandleRadioButtonToggled(QAbstractButton *pButton, bool fToggled)
     698{
     699    /* Handle checked buttons only: */
     700    if (!fToggled)
     701        return;
     702
     703    /* Update cloud export mode field value: */
     704    wizard()->setCloudExportMode(m_exportModeButtons.key(pButton));
    733705    emit completeChanged();
    734706}
     
    740712        gpManager->openCloudProfileManager();
    741713}
     714
     715void UIWizardExportAppPageExpert::updateMachines()
     716{
     717    /* Update wizard fields: */
     718    wizard()->setMachineNames(machineNames(m_pVMSelector));
     719    wizard()->setMachineIDs(machineIDs(m_pVMSelector));
     720
     721    /* Refresh required settings: */
     722    refreshFileSelectorName(m_strFileSelectorName, wizard()->machineNames(), m_strDefaultApplianceName, wizard()->isFormatCloudOne());
     723    refreshFileSelectorPath(m_pFileSelector, m_strFileSelectorName, m_strFileSelectorExt, wizard()->isFormatCloudOne());
     724
     725    /* Update cloud stuff: */
     726    updateCloudStuff();
     727}
     728
     729void UIWizardExportAppPageExpert::updateFormat()
     730{
     731    /* Update combo tool-tip: */
     732    updateFormatComboToolTip(m_pFormatComboBox);
     733
     734    /* Update wizard fields: */
     735    wizard()->setFormat(format(m_pFormatComboBox));
     736    wizard()->setFormatCloudOne(isFormatCloudOne(m_pFormatComboBox));
     737
     738    /* Refresh settings widget state: */
     739    refreshStackedWidget(m_pSettingsWidget, wizard()->isFormatCloudOne());
     740    refreshStackedLayout(m_pSettingsLayout, wizard()->isFormatCloudOne());
     741
     742    /* Update export settings: */
     743    refreshFileSelectorExtension(m_strFileSelectorExt, m_pFileSelector, wizard()->isFormatCloudOne());
     744    refreshFileSelectorPath(m_pFileSelector, m_strFileSelectorName, m_strFileSelectorExt, wizard()->isFormatCloudOne());
     745    refreshManifestCheckBoxAccess(m_pManifestCheckbox, wizard()->isFormatCloudOne());
     746    refreshIncludeISOsCheckBoxAccess(m_pIncludeISOsCheckbox, wizard()->isFormatCloudOne());
     747    refreshProfileCombo(m_pProfileComboBox, wizard()->format(), wizard()->isFormatCloudOne());
     748    refreshCloudExportMode(m_exportModeButtons, wizard()->isFormatCloudOne());
     749
     750    /* Update profile: */
     751    updateProfile();
     752}
     753
     754void UIWizardExportAppPageExpert::updateProfile()
     755{
     756    /* Update wizard fields: */
     757    wizard()->setProfileName(profileName(m_pProfileComboBox));
     758
     759    /* Update export settings: */
     760    refreshCloudProfile(m_comCloudProfile,
     761                        wizard()->format(),
     762                        wizard()->profileName(),
     763                        wizard()->isFormatCloudOne());
     764
     765    /* Update cloud stuff: */
     766    updateCloudStuff();
     767}
     768
     769void UIWizardExportAppPageExpert::updateCloudStuff()
     770{
     771    /* Create appliance, client, VSD and VSD export form: */
     772    CAppliance comAppliance;
     773    CCloudClient comClient;
     774    CVirtualSystemDescription comDescription;
     775    CVirtualSystemDescriptionForm comForm;
     776    refreshCloudStuff(comAppliance,
     777                      comClient,
     778                      comDescription,
     779                      comForm,
     780                      m_comCloudProfile,
     781                      wizard()->machineIDs(),
     782                      wizard()->uri(),
     783                      wizard()->cloudExportMode());
     784    wizard()->setCloudAppliance(comAppliance);
     785    wizard()->setCloudClient(comClient);
     786    wizard()->setVsd(comDescription);
     787    wizard()->setVsdExportForm(comForm);
     788
     789    /* Refresh corresponding widgets: */
     790    refreshApplianceSettingsWidget(m_pApplianceWidget, wizard()->machineIDs(), wizard()->uri(), wizard()->isFormatCloudOne());
     791    refreshFormPropertiesTable(m_pFormEditor, wizard()->vsdExportForm(), wizard()->isFormatCloudOne());
     792}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r91262 r91368  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323
    2424/* GUI includes: */
    25 #include "UIWizardExportAppPageBasic1.h"
    26 #include "UIWizardExportAppPageBasic2.h"
    27 #include "UIWizardExportAppPageBasic3.h"
     25#include "UINativeWizardPage.h"
     26#include "UIWizardExportApp.h"
     27
     28/* COM includes: */
     29#include "COMEnums.h"
     30#include "CAppliance.h"
     31#include "CCloudClient.h"
     32#include "CCloudProfile.h"
     33#include "CVirtualSystemDescription.h"
     34#include "CVirtualSystemDescriptionForm.h"
    2835
    2936/* Forward declarations: */
     37class QAbstractButton;
     38class QButtonGroup;
     39class QCheckBox;
     40class QGridLayout;
    3041class QGroupBox;
     42class QLabel;
     43class QListWidget;
     44class QStackedLayout;
     45class QStackedWidget;
     46class QIComboBox;
     47class QIToolButton;
     48class UIApplianceExportEditorWidget;
     49class UIEmptyFilePathSelector;
     50class UIFormEditorWidget;
     51class UIWizardExportApp;
    3152
    3253/** UIWizardPage extension for UIWizardExportAppPage1, UIWizardExportAppPage2 and UIWizardExportAppPage3. */
    33 class UIWizardExportAppPageExpert : public UIWizardPage,
    34                                     public UIWizardExportAppPage1,
    35                                     public UIWizardExportAppPage2,
    36                                     public UIWizardExportAppPage3
     54class UIWizardExportAppPageExpert : public UINativeWizardPage
    3755{
    3856    Q_OBJECT;
    39     Q_PROPERTY(QStringList machineNames READ machineNames);
    40     Q_PROPERTY(QList<QUuid> machineIDs READ machineIDs);
    41     Q_PROPERTY(QString format READ format WRITE setFormat);
    42     Q_PROPERTY(bool isFormatCloudOne READ isFormatCloudOne);
    43     Q_PROPERTY(QString path READ path WRITE setPath);
    44     Q_PROPERTY(MACAddressExportPolicy macAddressExportPolicy READ macAddressExportPolicy WRITE setMACAddressExportPolicy);
    45     Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected);
    46     Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected);
    47     Q_PROPERTY(QString providerShortName READ providerShortName);
    48     Q_PROPERTY(CAppliance cloudAppliance READ cloudAppliance);
    49     Q_PROPERTY(CCloudClient client READ client);
    50     Q_PROPERTY(CVirtualSystemDescription vsd READ vsd);
    51     Q_PROPERTY(CVirtualSystemDescriptionForm vsdExportForm READ vsdExportForm);
    52     Q_PROPERTY(CloudExportMode cloudExportMode READ cloudExportMode);
    53     Q_PROPERTY(CAppliance localAppliance READ localAppliance);
    5457
    5558public:
     
    6164protected:
    6265
    63     /** Allows access wizard from base part. */
    64     UIWizard *wizardImp() const { return UIWizardPage::wizard(); }
    65     /** Allows access page from base part. */
    66     UIWizardPage* thisImp() { return this; }
    67     /** Allows access wizard-field from base part. */
    68     QVariant fieldImp(const QString &strFieldName) const { return UIWizardPage::field(strFieldName); }
     66    /** Returns wizard this page belongs to. */
     67    UIWizardExportApp *wizard() const;
    6968
    7069    /** Handles translation event. */
     
    7372    /** Performs page initialization. */
    7473    virtual void initializePage() /* override */;
    75     /** Performs page uninitialization. */
    76     virtual void cleanupPage() /* override */;
    7774
    7875    /** Returns whether page is complete. */
     
    8582
    8683    /** Handles VM selector index change. */
    87     void sltVMSelectionChangeHandler();
     84    void sltHandleVMItemSelectionChanged();
    8885
    8986    /** Handles format combo change. */
     
    9693    void sltHandleMACAddressExportPolicyComboChange();
    9794
    98     /** Handles custom button clicked.
    99       * @param  iId  Brings clicked button id. */
    100     void sltHandleCustomButtonClicked(int iId);
     95    /** Handles change in manifest check-box. */
     96    void sltHandleManifestCheckBoxChange();
     97
     98    /** Handles change in include ISOs check-box. */
     99    void sltHandleIncludeISOsCheckBoxChange();
    101100
    102101    /** Handles change in profile combo-box. */
    103102    void sltHandleProfileComboChange();
    104103
     104    /** Handles cloud export radio-button clicked. */
     105    void sltHandleRadioButtonToggled(QAbstractButton *pButton, bool fToggled);
     106
    105107    /** Handles profile tool-button click. */
    106108    void sltHandleProfileButtonClick();
     
    108110private:
    109111
    110     /** Holds whether starting page was polished. */
    111     bool  m_fPolished;
     112    /** Updates machines. */
     113    void updateMachines();
     114    /** Updates format. */
     115    void updateFormat();
     116    /** Updates profile. */
     117    void updateProfile();
     118    /** Updates cloud stuff. */
     119    void updateCloudStuff();
     120
     121    /** Holds the list of selected VM names. */
     122    const QStringList  m_selectedVMNames;
     123    /** Holds whether default format should be Export to OCI. */
     124    bool               m_fExportToOCIByDefault;
     125
     126    /** Holds the default appliance name. */
     127    QString  m_strDefaultApplianceName;
     128    /** Holds the file selector name. */
     129    QString  m_strFileSelectorName;
     130    /** Holds the file selector ext. */
     131    QString  m_strFileSelectorExt;
     132
     133    /** Holds the Cloud Profile object reference. */
     134    CCloudProfile  m_comCloudProfile;
     135
    112136
    113137    /** Holds the VM selector container instance. */
    114     QGroupBox *m_pSelectorCnt;
     138    QGroupBox   *m_pSelectorCnt;
     139
     140    /** Holds the VM selector instance. */
     141    QListWidget *m_pVMSelector;
     142
     143
    115144    /** Holds the appliance widget container reference. */
    116     QGroupBox *m_pApplianceCnt;
     145    QGroupBox   *m_pApplianceCnt;
     146
     147    /** Holds the settings container layout instance. */
     148    QStackedLayout *m_pSettingsLayout;
     149
     150    /** Holds the appliance widget reference. */
     151    UIApplianceExportEditorWidget *m_pApplianceWidget;
     152    /** Holds the Form Editor widget instance. */
     153    UIFormEditorWidget            *m_pFormEditor;
     154
     155
    117156    /** Holds the settings widget container reference. */
    118157    QGroupBox *m_pSettingsCnt;
     158
     159    /** Holds the format layout. */
     160    QGridLayout *m_pFormatLayout;
     161    /** Holds the format combo-box label instance. */
     162    QLabel      *m_pFormatComboBoxLabel;
     163    /** Holds the format combo-box instance. */
     164    QIComboBox  *m_pFormatComboBox;
     165
     166    /** Holds the settings widget instance. */
     167    QStackedWidget *m_pSettingsWidget;
     168
     169    /** Holds the settings layout 1. */
     170    QGridLayout             *m_pSettingsLayout1;
     171    /** Holds the file selector label instance. */
     172    QLabel                  *m_pFileSelectorLabel;
     173    /** Holds the file selector instance. */
     174    UIEmptyFilePathSelector *m_pFileSelector;
     175    /** Holds the MAC address policy combo-box label instance. */
     176    QLabel                  *m_pMACComboBoxLabel;
     177    /** Holds the MAC address policy check-box instance. */
     178    QIComboBox              *m_pMACComboBox;
     179    /** Holds the additional label instance. */
     180    QLabel                  *m_pAdditionalLabel;
     181    /** Holds the manifest check-box instance. */
     182    QCheckBox               *m_pManifestCheckbox;
     183    /** Holds the include ISOs check-box instance. */
     184    QCheckBox               *m_pIncludeISOsCheckbox;
     185
     186    /** Holds the settings layout 2. */
     187    QGridLayout   *m_pSettingsLayout2;
     188    /** Holds the profile label instance. */
     189    QLabel        *m_pProfileLabel;
     190    /** Holds the profile combo-box instance. */
     191    QIComboBox    *m_pProfileComboBox;
     192    /** Holds the profile management tool-button instance. */
     193    QIToolButton  *m_pProfileToolButton;
     194
     195    /** Holds the export mode label instance. */
     196    QLabel                                  *m_pExportModeLabel;
     197    /** Holds the export mode button group instance. */
     198    QButtonGroup                            *m_pExportModeButtonGroup;
     199    /** Holds the map of export mode button instances. */
     200    QMap<CloudExportMode, QAbstractButton*>  m_exportModeButtons;
    119201};
    120202
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette