VirtualBox

Ignore:
Timestamp:
Jul 2, 2021 11:34:16 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145476
Message:

FE/Qt: bugref:9996: Moving Add Cloud VM wizard to new UINativeWizard API.

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

Legend:

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

    r89985 r89999  
    10431043        UISafePointerWizardAddCloudVM pWizard = new UIWizardAddCloudVM(pWizardParent, m_pWidget->fullGroupName());
    10441044        windowManager().registerNewParent(pWizard, pWizardParent);
    1045         pWizard->prepare();
    10461045
    10471046        /* Execute wizard: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.cpp

    r86573 r89999  
    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
    2525/* COM includes: */
     26#include "CCloudMachine.h"
    2627#include "CProgress.h"
    2728
     
    3031                                       const QString &strFullGroupName /* = QString() */,
    3132                                       WizardMode enmMode /* = WizardMode_Auto */)
    32     : UIWizard(pParent, WizardType_AddCloudVM, enmMode)
     33    : UINativeWizard(pParent, WizardType_AddCloudVM, enmMode)
    3334    , m_strFullGroupName(strFullGroupName)
    3435{
    3536#ifndef VBOX_WS_MAC
    3637    /* Assign watermark: */
    37     assignWatermark(":/wizard_new_cloud_vm.png");
     38    setPixmapName(":/wizard_new_cloud_vm.png");
    3839#else
    3940    /* Assign background image: */
    40     assignBackground(":/wizard_new_cloud_vm_bg.png");
     41    setPixmapName(":/wizard_new_cloud_vm_bg.png");
    4142#endif
    42 }
    43 
    44 void UIWizardAddCloudVM::prepare()
    45 {
    46     /* Create corresponding pages: */
    47     switch (mode())
    48     {
    49         case WizardMode_Basic:
    50         {
    51             setPage(Page1, new UIWizardAddCloudVMPageBasic1);
    52             break;
    53         }
    54         case WizardMode_Expert:
    55         {
    56             setPage(PageExpert, new UIWizardAddCloudVMPageExpert);
    57             break;
    58         }
    59         default:
    60         {
    61             AssertMsgFailed(("Invalid mode: %d", mode()));
    62             break;
    63         }
    64     }
    65     /* Call to base-class: */
    66     UIWizard::prepare();
    6743}
    6844
     
    7753
    7854    /* For each cloud instance name we have: */
    79     foreach (const QString &strInstanceName, field("instanceIds").toStringList())
     55    foreach (const QString &strInstanceName, instanceIds())
    8056    {
    8157        /* Initiate cloud VM add procedure: */
     
    10985                    if (comMachine.isNotNull())
    11086                    {
    111                         uiCommon().notifyCloudMachineRegistered(field("source").toString(),
    112                                                                 field("profileName").toString(),
     87                        /* Notify GUI about VM was added: */
     88                        uiCommon().notifyCloudMachineRegistered(shortProviderName(),
     89                                                                profileName(),
    11390                                                                comMachine);
     91
     92                        /* Finally, success: */
    11493                        fResult = true;
    11594                    }
     
    123102}
    124103
     104void UIWizardAddCloudVM::populatePages()
     105{
     106    /* Create corresponding pages: */
     107    switch (mode())
     108    {
     109        case WizardMode_Basic:
     110        {
     111            addPage(new UIWizardAddCloudVMPageBasic1);
     112            break;
     113        }
     114        case WizardMode_Expert:
     115        {
     116            addPage(new UIWizardAddCloudVMPageExpert);
     117            break;
     118        }
     119        default:
     120        {
     121            AssertMsgFailed(("Invalid mode: %d", mode()));
     122            break;
     123        }
     124    }
     125}
     126
    125127void UIWizardAddCloudVM::retranslateUi()
    126128{
    127129    /* Call to base-class: */
    128     UIWizard::retranslateUi();
     130    UINativeWizard::retranslateUi();
    129131
    130132    /* Translate wizard: */
    131133    setWindowTitle(tr("Add Cloud Virtual Machine"));
    132     setButtonText(QWizard::FinishButton, tr("Add"));
     134    /// @todo implement this?
     135    //setButtonText(QWizard::FinishButton, tr("Add"));
    133136}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.h

    r86345 r89999  
    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 "UIWizard.h"
     25#include "UINativeWizard.h"
    2626
    2727/* COM includes: */
    2828#include "COMEnums.h"
    2929#include "CCloudClient.h"
    30 #include "CCloudMachine.h"
    3130
    3231/** Add Cloud VM wizard. */
    33 class UIWizardAddCloudVM : public UIWizard
     32class UIWizardAddCloudVM : public UINativeWizard
    3433{
    3534    Q_OBJECT;
    3635
    3736public:
    38 
    39     /** Basic page IDs. */
    40     enum
    41     {
    42         Page1
    43     };
    44 
    45     /** Expert page IDs. */
    46     enum
    47     {
    48         PageExpert
    49     };
    5037
    5138    /** Constructs Add Cloud VM wizard passing @a pParent & @a enmMode to the base-class.
     
    5542                       WizardMode enmMode = WizardMode_Auto);
    5643
    57     /** Prepares all. */
    58     virtual void prepare() /* override */;
    59 
    6044    /** Returns full group name. */
    6145    QString fullGroupName() const { return m_strFullGroupName; }
     46
     47    /** Defines @a strShortProviderName. */
     48    void setShortProviderName(const QString &strShortProviderName) { m_strShortProviderName = strShortProviderName; }
     49    /** Returns short provider name. */
     50    QString shortProviderName() const { return m_strShortProviderName; }
     51
     52    /** Defines @a strProfileName. */
     53    void setProfileName(const QString &strProfileName) { m_strProfileName = strProfileName; }
     54    /** Returns profile name. */
     55    QString profileName() const { return m_strProfileName; }
     56
     57    /** Defines @a instanceIds. */
     58    void setInstanceIds(const QStringList &instanceIds) { m_instanceIds = instanceIds; }
     59    /** Returns instance IDs. */
     60    QStringList instanceIds() const { return m_instanceIds; }
    6261
    6362    /** Defines Cloud @a comClient object wrapper. */
     
    7170protected:
    7271
     72    /** Populates pages. */
     73    virtual void populatePages() /* override final */;
     74
    7375    /** Handles translation event. */
    74     virtual void retranslateUi() /* override */;
     76    virtual void retranslateUi() /* override final */;
    7577
    7678private:
    7779
    7880    /** Holds the full group name (/provider/profile) to add VM to. */
    79     QString  m_strFullGroupName;
    80 
     81    QString       m_strFullGroupName;
     82    /** Holds the short provider name. */
     83    QString       m_strShortProviderName;
     84    /** Holds the profile name. */
     85    QString       m_strProfileName;
     86    /** Holds the instance ids. */
     87    QStringList   m_instanceIds;
    8188    /** Holds the Cloud Client object wrapper. */
    8289    CCloudClient  m_comClient;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.cpp

    r89998 r89999  
    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 <QGridLayout>
    1920#include <QHeaderView>
    20 #include <QGridLayout>
    2121#include <QLabel>
    2222#include <QListWidget>
    23 #include <QTableWidget>
    2423#include <QVBoxLayout>
    2524
     
    3938#include "CStringArray.h"
    4039
     40/* Namespaces: */
     41using namespace UIWizardAddCloudVMPage1;
     42
    4143
    4244/*********************************************************************************************************************************
    43 *   Class UIWizardAddCloudVMPage1 implementation.                                                                                *
     45*   Namespace UIWizardAddCloudVMPage1 implementation.                                                                            *
    4446*********************************************************************************************************************************/
    4547
    46 UIWizardAddCloudVMPage1::UIWizardAddCloudVMPage1()
    47     : m_fPolished(false)
    48     , m_pSourceLayout(0)
    49     , m_pSourceLabel(0)
    50     , m_pSourceComboBox(0)
    51     , m_pCloudContainerLayout(0)
    52     , m_pProfileLabel(0)
    53     , m_pProfileComboBox(0)
    54     , m_pProfileToolButton(0)
    55     , m_pProfileInstanceLabel(0)
    56     , m_pProfileInstanceList(0)
    57 {
    58 }
    59 
    60 void UIWizardAddCloudVMPage1::populateSources()
    61 {
    62     /* To be executed just once, so combo should be empty: */
    63     AssertReturnVoid(m_pSourceComboBox->count() == 0);
    64 
    65     /* Do we have OCI source? */
    66     bool fOCIPresent = false;
    67 
    68     /* Main API request sequence, can be interrupted after any step: */
    69     do
    70     {
    71         /* Initialize Cloud Provider Manager: */
    72         CVirtualBox comVBox = uiCommon().virtualBox();
    73         m_comCloudProviderManager = comVBox.GetCloudProviderManager();
    74         if (!comVBox.isOk())
    75         {
    76             msgCenter().cannotAcquireCloudProviderManager(comVBox);
    77             break;
    78         }
    79 
    80         /* Acquire existing providers: */
    81         const QVector<CCloudProvider> providers = m_comCloudProviderManager.GetProviders();
    82         if (!m_comCloudProviderManager.isOk())
    83         {
    84             msgCenter().cannotAcquireCloudProviderManagerParameter(m_comCloudProviderManager);
    85             break;
    86         }
    87 
    88         /* Iterate through existing providers: */
    89         foreach (const CCloudProvider &comProvider, providers)
    90         {
    91             /* Skip if we have nothing to populate (file missing?): */
    92             if (comProvider.isNull())
    93                 continue;
    94 
    95             /* Compose empty item, fill it's data: */
    96             m_pSourceComboBox->addItem(QString());
    97             m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, comProvider.GetId(),        SourceData_ID);
    98             m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, comProvider.GetName(),      SourceData_Name);
    99             m_pSourceComboBox->setItemData(m_pSourceComboBox->count() - 1, comProvider.GetShortName(), SourceData_ShortName);
    100             if (m_pSourceComboBox->itemData(m_pSourceComboBox->count() - 1, SourceData_ShortName).toString() == "OCI")
    101                 fOCIPresent = true;
    102         }
    103     }
    104     while (0);
    105 
    106     /* Set default: */
    107     if (fOCIPresent)
    108         setSource("OCI");
    109 }
    110 
    111 void UIWizardAddCloudVMPage1::populateProfiles()
    112 {
     48void UIWizardAddCloudVMPage1::populateProviders(QIComboBox *pCombo)
     49{
     50    /* Sanity check: */
     51    AssertPtrReturnVoid(pCombo);
     52    /* We need top-level parent as well: */
     53    QWidget *pParent = pCombo->window();
     54    AssertPtrReturnVoid(pParent);
     55
    11356    /* Block signals while updating: */
    114     m_pProfileComboBox->blockSignals(true);
     57    pCombo->blockSignals(true);
    11558
    11659    /* Remember current item data to be able to restore it: */
    11760    QString strOldData;
    118     if (m_pProfileComboBox->currentIndex() != -1)
    119         strOldData = m_pProfileComboBox->itemData(m_pProfileComboBox->currentIndex(), ProfileData_Name).toString();
     61    if (pCombo->currentIndex() != -1)
     62        strOldData = pCombo->itemData(pCombo->currentIndex(), ProviderData_ShortName).toString();
     63    /* Otherwise "OCI" should be the default one: */
    12064    else
     65        strOldData = "OCI";
     66
     67    /* Clear combo initially: */
     68    pCombo->clear();
     69
     70    /* Iterate through existing providers: */
     71    foreach (const CCloudProvider &comProvider, listCloudProviders(pParent))
     72    {
     73        /* Skip if we have nothing to populate (file missing?): */
     74        if (comProvider.isNull())
     75            continue;
     76        /* Acquire provider name: */
     77        QString strProviderName;
     78        if (!cloudProviderName(comProvider, strProviderName, pParent))
     79            continue;
     80        /* Acquire provider short name: */
     81        QString strProviderShortName;
     82        if (!cloudProviderShortName(comProvider, strProviderShortName, pParent))
     83            continue;
     84
     85        /* Compose empty item, fill the data: */
     86        pCombo->addItem(QString());
     87        pCombo->setItemData(pCombo->count() - 1, strProviderName,      ProviderData_Name);
     88        pCombo->setItemData(pCombo->count() - 1, strProviderShortName, ProviderData_ShortName);
     89    }
     90
     91    /* Set previous/default item if possible: */
     92    int iNewIndex = -1;
     93    if (   iNewIndex == -1
     94        && !strOldData.isNull())
     95        iNewIndex = pCombo->findData(strOldData, ProviderData_ShortName);
     96    if (   iNewIndex == -1
     97        && pCombo->count() > 0)
     98        iNewIndex = 0;
     99    if (iNewIndex != -1)
     100        pCombo->setCurrentIndex(iNewIndex);
     101
     102    /* Unblock signals after update: */
     103    pCombo->blockSignals(false);
     104}
     105
     106void UIWizardAddCloudVMPage1::populateProfiles(QIComboBox *pCombo, const CCloudProvider &comProvider)
     107{
     108    /* Sanity check: */
     109    AssertPtrReturnVoid(pCombo);
     110    AssertReturnVoid(comProvider.isNotNull());
     111    /* We need top-level parent as well: */
     112    QWidget *pParent = pCombo->window();
     113    AssertPtrReturnVoid(pParent);
     114
     115    /* Block signals while updating: */
     116    pCombo->blockSignals(true);
     117
     118    /* Remember current item data to be able to restore it: */
     119    QString strOldData;
     120    if (pCombo->currentIndex() != -1)
     121        strOldData = pCombo->itemData(pCombo->currentIndex(), ProfileData_Name).toString();
     122    else
    121123    {
    122124        /* Try to fetch "old" profile name from wizard full group name: */
    123         UIWizardAddCloudVM *pWizard = qobject_cast<UIWizardAddCloudVM*>(wizardImp());
     125        UIWizardAddCloudVM *pWizard = qobject_cast<UIWizardAddCloudVM*>(pParent);
    124126        AssertPtrReturnVoid(pWizard);
    125127        const QString strFullGroupName = pWizard->fullGroupName();
     
    130132
    131133    /* Clear combo initially: */
    132     m_pProfileComboBox->clear();
    133     /* Clear Cloud Provider: */
    134     m_comCloudProvider = CCloudProvider();
    135 
    136     /* If provider chosen: */
    137     if (!sourceId().isNull())
    138     {
    139         /* Main API request sequence, can be interrupted after any step: */
    140         do
     134    pCombo->clear();
     135
     136    /* Iterate through existing profiles: */
     137    foreach (const CCloudProfile &comProfile, listCloudProfiles(comProvider, pParent))
     138    {
     139        /* Skip if we have nothing to populate (wtf happened?): */
     140        if (comProfile.isNull())
     141            continue;
     142        /* Acquire profile name: */
     143        QString strProfileName;
     144        if (!cloudProfileName(comProfile, strProfileName, pParent))
     145            continue;
     146
     147        /* Compose item, fill the data: */
     148        pCombo->addItem(strProfileName);
     149        pCombo->setItemData(pCombo->count() - 1, strProfileName, ProfileData_Name);
     150    }
     151
     152    /* Set previous/default item if possible: */
     153    int iNewIndex = -1;
     154    if (   iNewIndex == -1
     155        && !strOldData.isNull())
     156        iNewIndex = pCombo->findData(strOldData, ProfileData_Name);
     157    if (   iNewIndex == -1
     158        && pCombo->count() > 0)
     159        iNewIndex = 0;
     160    if (iNewIndex != -1)
     161        pCombo->setCurrentIndex(iNewIndex);
     162
     163    /* Unblock signals after update: */
     164    pCombo->blockSignals(false);
     165}
     166
     167void UIWizardAddCloudVMPage1::populateProfileInstances(QListWidget *pList, const CCloudClient &comClient)
     168{
     169    /* Sanity check: */
     170    AssertPtrReturnVoid(pList);
     171    AssertReturnVoid(comClient.isNotNull());
     172    /* We need top-level parent as well: */
     173    QWidget *pParent = pList->window();
     174    AssertPtrReturnVoid(pParent);
     175
     176    /* Block signals while updating: */
     177    pList->blockSignals(true);
     178
     179    /* Clear list initially: */
     180    pList->clear();
     181
     182    /* Gather instance names and ids: */
     183    CStringArray comNames;
     184    CStringArray comIDs;
     185    if (listCloudSourceInstances(comClient, comNames, comIDs, pParent))
     186    {
     187        /* Push acquired names to list rows: */
     188        const QVector<QString> names = comNames.GetValues();
     189        const QVector<QString> ids = comIDs.GetValues();
     190        for (int i = 0; i < names.size(); ++i)
    141191        {
    142             /* (Re)initialize Cloud Provider: */
    143             m_comCloudProvider = m_comCloudProviderManager.GetProviderById(sourceId());
    144             if (!m_comCloudProviderManager.isOk())
     192            /* Create list item: */
     193            QListWidgetItem *pItem = new QListWidgetItem(names.at(i), pList);
     194            if (pItem)
    145195            {
    146                 msgCenter().cannotFindCloudProvider(m_comCloudProviderManager, sourceId());
    147                 break;
     196                pItem->setFlags(pItem->flags() & ~Qt::ItemIsEditable);
     197                pItem->setData(Qt::UserRole, ids.at(i));
    148198            }
    149 
    150             /* Acquire existing profile names: */
    151             const QVector<QString> profileNames = m_comCloudProvider.GetProfileNames();
    152             if (!m_comCloudProvider.isOk())
    153             {
    154                 msgCenter().cannotAcquireCloudProviderParameter(m_comCloudProvider);
    155                 break;
    156             }
    157 
    158             /* Iterate through existing profile names: */
    159             foreach (const QString &strProfileName, profileNames)
    160             {
    161                 /* Skip if we have nothing to show (wtf happened?): */
    162                 if (strProfileName.isEmpty())
    163                     continue;
    164 
    165                 /* Compose item, fill it's data: */
    166                 m_pProfileComboBox->addItem(strProfileName);
    167                 m_pProfileComboBox->setItemData(m_pProfileComboBox->count() - 1, strProfileName, ProfileData_Name);
    168             }
    169 
    170             /* Set previous/default item if possible: */
    171             int iNewIndex = -1;
    172             if (   iNewIndex == -1
    173                 && !strOldData.isNull())
    174                 iNewIndex = m_pProfileComboBox->findData(strOldData, ProfileData_Name);
    175             if (   iNewIndex == -1
    176                 && m_pProfileComboBox->count() > 0)
    177                 iNewIndex = 0;
    178             if (iNewIndex != -1)
    179                 m_pProfileComboBox->setCurrentIndex(iNewIndex);
    180199        }
    181         while (0);
    182     }
     200    }
     201
     202    /* Choose the 1st one by default if possible: */
     203    if (pList->count())
     204        pList->setCurrentRow(0);
    183205
    184206    /* Unblock signals after update: */
    185     m_pProfileComboBox->blockSignals(false);
    186 }
    187 
    188 void UIWizardAddCloudVMPage1::populateProfile()
    189 {
    190     /* Clear Cloud Profile: */
    191     m_comCloudProfile = CCloudProfile();
    192 
    193     /* If both provider and profile chosen: */
    194     if (m_comCloudProvider.isNotNull() && !profileName().isNull())
    195     {
    196         /* Acquire Cloud Profile: */
    197         m_comCloudProfile = m_comCloudProvider.GetProfileByName(profileName());
    198         /* Show error message if necessary: */
    199         if (!m_comCloudProvider.isOk())
    200             msgCenter().cannotFindCloudProfile(m_comCloudProvider, profileName());
    201     }
    202 }
    203 
    204 void UIWizardAddCloudVMPage1::populateProfileInstances()
    205 {
    206     /* Block signals while updating: */
    207     m_pProfileInstanceList->blockSignals(true);
    208 
    209     /* Clear list initially: */
    210     m_pProfileInstanceList->clear();
    211     /* Clear Cloud Client: */
    212     setClient(CCloudClient());
    213 
    214     /* If profile chosen: */
    215     if (m_comCloudProfile.isNotNull())
    216     {
    217         /* Main API request sequence, can be interrupted after any step: */
    218         do
    219         {
    220             /* Acquire Cloud Client: */
    221             CCloudClient comCloudClient = m_comCloudProfile.CreateCloudClient();
    222             if (!m_comCloudProfile.isOk())
    223             {
    224                 msgCenter().cannotCreateCloudClient(m_comCloudProfile);
    225                 break;
    226             }
    227 
    228             /* Remember Cloud Client: */
    229             setClient(comCloudClient);
    230 
    231             /* Gather instance names and ids: */
    232             CStringArray comNames;
    233             CStringArray comIDs;
    234             if (listCloudSourceInstances(comCloudClient, comNames, comIDs, wizardImp()))
    235             {
    236                 /* Push acquired names to list rows: */
    237                 const QVector<QString> names = comNames.GetValues();
    238                 const QVector<QString> ids = comIDs.GetValues();
    239                 for (int i = 0; i < names.size(); ++i)
    240                 {
    241                     /* Create list item: */
    242                     QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pProfileInstanceList);
    243                     if (pItem)
    244                     {
    245                         pItem->setFlags(pItem->flags() & ~Qt::ItemIsEditable);
    246                         pItem->setData(Qt::UserRole, ids.at(i));
    247                     }
    248                 }
    249             }
    250 
    251             /* Choose the 1st one by default if possible: */
    252             if (m_pProfileInstanceList->count())
    253                 m_pProfileInstanceList->setCurrentRow(0);
    254         }
    255         while (0);
    256     }
    257 
    258     /* Unblock signals after update: */
    259     m_pProfileInstanceList->blockSignals(false);
    260 }
    261 
    262 void UIWizardAddCloudVMPage1::updateSourceComboToolTip()
    263 {
    264     const int iCurrentIndex = m_pSourceComboBox->currentIndex();
     207    pList->blockSignals(false);
     208}
     209
     210void UIWizardAddCloudVMPage1::updateComboToolTip(QIComboBox *pCombo)
     211{
     212    /* Sanity check: */
     213    AssertPtrReturnVoid(pCombo);
     214
     215    const int iCurrentIndex = pCombo->currentIndex();
    265216    if (iCurrentIndex != -1)
    266217    {
    267         const QString strCurrentToolTip = m_pSourceComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString();
    268         AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!"));
    269         m_pSourceComboBox->setToolTip(strCurrentToolTip);
    270     }
    271 }
    272 
    273 void UIWizardAddCloudVMPage1::setSource(const QString &strSource)
    274 {
    275     const int iIndex = m_pSourceComboBox->findData(strSource, SourceData_ShortName);
    276     AssertMsg(iIndex != -1, ("Data not found!"));
    277     m_pSourceComboBox->setCurrentIndex(iIndex);
    278 }
    279 
    280 QString UIWizardAddCloudVMPage1::source() const
    281 {
    282     const int iIndex = m_pSourceComboBox->currentIndex();
    283     return m_pSourceComboBox->itemData(iIndex, SourceData_ShortName).toString();
    284 }
    285 
    286 QUuid UIWizardAddCloudVMPage1::sourceId() const
    287 {
    288     const int iIndex = m_pSourceComboBox->currentIndex();
    289     return m_pSourceComboBox->itemData(iIndex, SourceData_ID).toUuid();
    290 }
    291 
    292 QString UIWizardAddCloudVMPage1::profileName() const
    293 {
    294     const int iIndex = m_pProfileComboBox->currentIndex();
    295     return m_pProfileComboBox->itemData(iIndex, ProfileData_Name).toString();
    296 }
    297 
    298 QStringList UIWizardAddCloudVMPage1::instanceIds() const
     218        const QString strCurrentToolTip = pCombo->itemData(iCurrentIndex, Qt::ToolTipRole).toString();
     219        AssertMsg(!strCurrentToolTip.isEmpty(), ("Tool-tip data not found!\n"));
     220        pCombo->setToolTip(strCurrentToolTip);
     221    }
     222}
     223
     224QStringList UIWizardAddCloudVMPage1::currentListWidgetData(QListWidget *pList)
    299225{
    300226    QStringList result;
    301     foreach (QListWidgetItem *pItem, m_pProfileInstanceList->selectedItems())
     227    foreach (QListWidgetItem *pItem, pList->selectedItems())
    302228        result << pItem->data(Qt::UserRole).toString();
    303229    return result;
    304 }
    305 
    306 void UIWizardAddCloudVMPage1::setClient(const CCloudClient &comClient)
    307 {
    308     qobject_cast<UIWizardAddCloudVM*>(wizardImp())->setClient(comClient);
    309 }
    310 
    311 CCloudClient UIWizardAddCloudVMPage1::client() const
    312 {
    313     return qobject_cast<UIWizardAddCloudVM*>(wizardImp())->client();
    314230}
    315231
     
    321237UIWizardAddCloudVMPageBasic1::UIWizardAddCloudVMPageBasic1()
    322238    : m_pLabelMain(0)
     239    , m_pProviderLayout(0)
     240    , m_pProviderLabel(0)
     241    , m_pProviderComboBox(0)
    323242    , m_pLabelDescription(0)
    324 {
    325     /* Create main layout: */
    326     QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    327     if (pMainLayout)
    328     {
    329         /* Create main label: */
     243    , m_pOptionsLayout(0)
     244    , m_pProfileLabel(0)
     245    , m_pProfileComboBox(0)
     246    , m_pProfileToolButton(0)
     247    , m_pSourceInstanceLabel(0)
     248    , m_pSourceInstanceList(0)
     249{
     250    /* Prepare main layout: */
     251    QVBoxLayout *pLayoutMain = new QVBoxLayout(this);
     252    if (pLayoutMain)
     253    {
     254        /* Prepare main label: */
    330255        m_pLabelMain = new QIRichTextLabel(this);
    331256        if (m_pLabelMain)
     257            pLayoutMain->addWidget(m_pLabelMain);
     258
     259        /* Prepare provider layout: */
     260        m_pProviderLayout = new QGridLayout;
     261        if (m_pProviderLayout)
    332262        {
     263            m_pProviderLayout->setContentsMargins(0, 0, 0, 0);
     264            m_pProviderLayout->setColumnStretch(0, 0);
     265            m_pProviderLayout->setColumnStretch(1, 1);
     266
     267            /* Prepare provider label: */
     268            m_pProviderLabel = new QLabel(this);
     269            if (m_pProviderLabel)
     270                m_pProviderLayout->addWidget(m_pProviderLabel, 0, 0, Qt::AlignRight);
     271            /* Prepare provider combo-box: */
     272            m_pProviderComboBox = new QIComboBox(this);
     273            if (m_pProviderComboBox)
     274            {
     275                m_pProviderLabel->setBuddy(m_pProviderComboBox);
     276                m_pProviderLayout->addWidget(m_pProviderComboBox, 0, 1);
     277            }
     278
    333279            /* Add into layout: */
    334             pMainLayout->addWidget(m_pLabelMain);
     280            pLayoutMain->addLayout(m_pProviderLayout);
    335281        }
    336282
    337         /* Create source layout: */
    338         m_pSourceLayout = new QGridLayout;
    339         if (m_pSourceLayout)
    340         {
    341             m_pSourceLayout->setContentsMargins(0, 0, 0, 0);
    342             m_pSourceLayout->setColumnStretch(0, 0);
    343             m_pSourceLayout->setColumnStretch(1, 1);
    344 
    345             /* Create source label: */
    346             m_pSourceLabel = new QLabel(this);
    347             if (m_pSourceLabel)
    348             {
    349                 /* Add into layout: */
    350                 m_pSourceLayout->addWidget(m_pSourceLabel, 0, 0, Qt::AlignRight);
    351             }
    352             /* Create source selector: */
    353             m_pSourceComboBox = new QIComboBox(this);
    354             if (m_pSourceComboBox)
    355             {
    356                 m_pSourceLabel->setBuddy(m_pSourceComboBox);
    357 
    358                 /* Add into layout: */
    359                 m_pSourceLayout->addWidget(m_pSourceComboBox, 0, 1);
    360             }
    361 
    362             /* Add into layout: */
    363             pMainLayout->addLayout(m_pSourceLayout);
    364         }
    365 
    366         /* Create description label: */
     283        /* Prepare description label: */
    367284        m_pLabelDescription = new QIRichTextLabel(this);
    368285        if (m_pLabelDescription)
     286            pLayoutMain->addWidget(m_pLabelDescription);
     287
     288        /* Prepare options layout: */
     289        m_pOptionsLayout = new QGridLayout;
     290        if (m_pOptionsLayout)
    369291        {
    370             /* Add into layout: */
    371             pMainLayout->addWidget(m_pLabelDescription);
    372         }
    373 
    374         /* Create cloud container layout: */
    375         m_pCloudContainerLayout = new QGridLayout;
    376         if (m_pCloudContainerLayout)
    377         {
    378             m_pCloudContainerLayout->setContentsMargins(0, 0, 0, 0);
    379             m_pCloudContainerLayout->setColumnStretch(0, 0);
    380             m_pCloudContainerLayout->setColumnStretch(1, 1);
    381             m_pCloudContainerLayout->setRowStretch(1, 0);
    382             m_pCloudContainerLayout->setRowStretch(2, 1);
    383 
    384             /* Create profile label: */
     292            m_pOptionsLayout->setContentsMargins(0, 0, 0, 0);
     293            m_pOptionsLayout->setColumnStretch(0, 0);
     294            m_pOptionsLayout->setColumnStretch(1, 1);
     295            m_pOptionsLayout->setRowStretch(1, 0);
     296            m_pOptionsLayout->setRowStretch(2, 1);
     297
     298            /* Prepare profile label: */
    385299            m_pProfileLabel = new QLabel(this);
    386300            if (m_pProfileLabel)
     301                m_pOptionsLayout->addWidget(m_pProfileLabel, 0, 0, Qt::AlignRight);
     302
     303            /* Prepare profile layout: */
     304            QHBoxLayout *pProfileLayout = new QHBoxLayout;
     305            if (pProfileLayout)
    387306            {
    388                 /* Add into layout: */
    389                 m_pCloudContainerLayout->addWidget(m_pProfileLabel, 0, 0, Qt::AlignRight);
    390             }
    391             /* Create sub-layout: */
    392             QHBoxLayout *pSubLayout = new QHBoxLayout;
    393             if (pSubLayout)
    394             {
    395                 pSubLayout->setContentsMargins(0, 0, 0, 0);
    396                 pSubLayout->setSpacing(1);
    397 
    398                 /* Create profile combo-box: */
     307                pProfileLayout->setContentsMargins(0, 0, 0, 0);
     308                pProfileLayout->setSpacing(1);
     309
     310                /* Prepare profile combo-box: */
    399311                m_pProfileComboBox = new QIComboBox(this);
    400312                if (m_pProfileComboBox)
    401313                {
    402314                    m_pProfileLabel->setBuddy(m_pProfileComboBox);
    403 
    404                     /* Add into layout: */
    405                     pSubLayout->addWidget(m_pProfileComboBox);
     315                    pProfileLayout->addWidget(m_pProfileComboBox);
    406316                }
    407                 /* Create profile tool-button: */
     317
     318                /* Prepare profile tool-button: */
    408319                m_pProfileToolButton = new QIToolButton(this);
    409320                if (m_pProfileToolButton)
     
    411322                    m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    412323                                                                      ":/cloud_profile_manager_disabled_16px.png"));
    413 
    414                     /* Add into layout: */
    415                     pSubLayout->addWidget(m_pProfileToolButton);
     324                    pProfileLayout->addWidget(m_pProfileToolButton);
    416325                }
    417326
    418327                /* Add into layout: */
    419                 m_pCloudContainerLayout->addLayout(pSubLayout, 0, 1);
     328                m_pOptionsLayout->addLayout(pProfileLayout, 0, 1);
    420329            }
    421330
    422             /* Create profile instance label: */
    423             m_pProfileInstanceLabel = new QLabel(this);
    424             if (m_pProfileInstanceLabel)
     331            /* Prepare source instance label: */
     332            m_pSourceInstanceLabel = new QLabel(this);
     333            if (m_pSourceInstanceLabel)
     334                m_pOptionsLayout->addWidget(m_pSourceInstanceLabel, 1, 0, Qt::AlignRight);
     335
     336            /* Prepare source instances table: */
     337            m_pSourceInstanceList = new QListWidget(this);
     338            if (m_pSourceInstanceList)
    425339            {
    426                 /* Add into layout: */
    427                 m_pCloudContainerLayout->addWidget(m_pProfileInstanceLabel, 1, 0, Qt::AlignRight);
    428             }
    429             /* Create profile instances table: */
    430             m_pProfileInstanceList = new QListWidget(this);
    431             if (m_pProfileInstanceList)
    432             {
    433                 m_pProfileInstanceLabel->setBuddy(m_pProfileInstanceLabel);
    434                 const QFontMetrics fm(m_pProfileInstanceList->font());
     340                m_pSourceInstanceLabel->setBuddy(m_pSourceInstanceLabel);
     341                /* Make source image list fit 50 symbols
     342                 * horizontally and 8 lines vertically: */
     343                const QFontMetrics fm(m_pSourceInstanceList->font());
    435344                const int iFontWidth = fm.width('x');
    436345                const int iTotalWidth = 50 * iFontWidth;
    437346                const int iFontHeight = fm.height();
    438                 const int iTotalHeight = 4 * iFontHeight;
    439                 m_pProfileInstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
    440                 //m_pProfileInstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    441                 m_pProfileInstanceList->setAlternatingRowColors(true);
    442                 m_pProfileInstanceList->setSelectionMode(QAbstractItemView::ExtendedSelection);
     347                const int iTotalHeight = 8 * iFontHeight;
     348                m_pSourceInstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
     349                m_pSourceInstanceList->setAlternatingRowColors(true);
     350                m_pSourceInstanceList->setSelectionMode(QAbstractItemView::ExtendedSelection);
    443351
    444352                /* Add into layout: */
    445                 m_pCloudContainerLayout->addWidget(m_pProfileInstanceList, 1, 1, 2, 1);
     353                m_pOptionsLayout->addWidget(m_pSourceInstanceList, 1, 1, 2, 1);
    446354            }
    447355
    448356            /* Add into layout: */
    449             pMainLayout->addLayout(m_pCloudContainerLayout);
     357            pLayoutMain->addLayout(m_pOptionsLayout);
    450358        }
    451359    }
     
    453361    /* Setup connections: */
    454362    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileRegistered,
    455             this, &UIWizardAddCloudVMPageBasic1::sltHandleSourceChange);
     363            this, &UIWizardAddCloudVMPageBasic1::sltHandleProviderComboChange);
    456364    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileChanged,
    457             this, &UIWizardAddCloudVMPageBasic1::sltHandleSourceChange);
    458     connect(m_pSourceComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),
    459             this, &UIWizardAddCloudVMPageBasic1::sltHandleSourceChange);
     365            this, &UIWizardAddCloudVMPageBasic1::sltHandleProviderComboChange);
     366    connect(m_pProviderComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),
     367            this, &UIWizardAddCloudVMPageBasic1::sltHandleProviderComboChange);
    460368    connect(m_pProfileComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    461369            this, &UIWizardAddCloudVMPageBasic1::sltHandleProfileComboChange);
    462370    connect(m_pProfileToolButton, &QIToolButton::clicked,
    463371            this, &UIWizardAddCloudVMPageBasic1::sltHandleProfileButtonClick);
    464     connect(m_pProfileInstanceList, &QListWidget::currentRowChanged,
    465             this, &UIWizardAddCloudVMPageBasic1::completeChanged);
    466 
    467     /* Register fields: */
    468     registerField("source", this, "source");
    469     registerField("profileName", this, "profileName");
    470     registerField("instanceIds", this, "instanceIds");
     372    connect(m_pSourceInstanceList, &QListWidget::currentRowChanged,
     373            this, &UIWizardAddCloudVMPageBasic1::sltHandleSourceInstanceChange);
    471374}
    472375
     
    480383                                                 "be one of known cloud service providers below."));
    481384
    482     /* Translate source label: */
    483     m_pSourceLabel->setText(UIWizardAddCloudVM::tr("&Source:"));
     385    /* Translate provider label: */
     386    m_pProviderLabel->setText(UIWizardAddCloudVM::tr("&Source:"));
    484387    /* Translate received values of Source combo-box.
    485388     * We are enumerating starting from 0 for simplicity: */
    486     for (int i = 0; i < m_pSourceComboBox->count(); ++i)
    487     {
    488         m_pSourceComboBox->setItemText(i, m_pSourceComboBox->itemData(i, SourceData_Name).toString());
    489         m_pSourceComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole);
     389    for (int i = 0; i < m_pProviderComboBox->count(); ++i)
     390    {
     391        m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString());
     392        m_pProviderComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole);
    490393    }
    491394
     
    499402    m_pProfileLabel->setText(UIWizardAddCloudVM::tr("&Profile:"));
    500403    m_pProfileToolButton->setToolTip(UIWizardAddCloudVM::tr("Open Cloud Profile Manager..."));
    501     m_pProfileInstanceLabel->setText(UIWizardAddCloudVM::tr("&Instances:"));
     404    m_pSourceInstanceLabel->setText(UIWizardAddCloudVM::tr("&Instances:"));
    502405
    503406    /* Adjust label widths: */
    504407    QList<QWidget*> labels;
    505     labels << m_pSourceLabel;
     408    labels << m_pProviderLabel;
    506409    labels << m_pProfileLabel;
    507     labels << m_pProfileInstanceLabel;
     410    labels << m_pSourceInstanceLabel;
    508411    int iMaxWidth = 0;
    509412    foreach (QWidget *pLabel, labels)
    510413        iMaxWidth = qMax(iMaxWidth, pLabel->minimumSizeHint().width());
    511     m_pSourceLayout->setColumnMinimumWidth(0, iMaxWidth);
    512     m_pCloudContainerLayout->setColumnMinimumWidth(0, iMaxWidth);
     414    m_pProviderLayout->setColumnMinimumWidth(0, iMaxWidth);
     415    m_pOptionsLayout->setColumnMinimumWidth(0, iMaxWidth);
    513416
    514417    /* Update tool-tips: */
    515     updateSourceComboToolTip();
     418    updateComboToolTip(m_pProviderComboBox);
    516419}
    517420
    518421void UIWizardAddCloudVMPageBasic1::initializePage()
    519422{
    520     /* If wasn't polished yet: */
    521     if (!m_fPolished)
    522     {
    523         /* Populate sources: */
    524         populateSources();
    525         /* Choose one of them, asynchronously: */
    526         QMetaObject::invokeMethod(this, "sltHandleSourceChange", Qt::QueuedConnection);
    527         m_fPolished = true;
    528     }
    529 
    530     /* Translate page: */
     423    /* Populate providers: */
     424    populateProviders(m_pProviderComboBox);
     425    /* Translate providers: */
    531426    retranslateUi();
     427    /* Fetch it, asynchronously: */
     428    QMetaObject::invokeMethod(this, "sltHandleProviderComboChange", Qt::QueuedConnection);
     429    /* Make image list focused by default: */
     430    m_pSourceInstanceList->setFocus();
    532431}
    533432
     
    551450    bool fResult = true;
    552451
    553     /* Lock finish button: */
    554     startProcessing();
    555 
    556452    /* Try to add cloud VMs: */
    557453    fResult = qobject_cast<UIWizardAddCloudVM*>(wizard())->addCloudVMs();
    558454
    559     /* Unlock finish button: */
    560     endProcessing();
    561 
    562455    /* Return result: */
    563456    return fResult;
    564457}
    565458
    566 void UIWizardAddCloudVMPageBasic1::sltHandleSourceChange()
    567 {
    568     /* Update tool-tip: */
    569     updateSourceComboToolTip();
    570 
    571     /* Make instance list focused by default: */
    572     m_pProfileInstanceList->setFocus();
    573 
    574     /* Refresh required settings: */
    575     populateProfiles();
    576     populateProfile();
    577     populateProfileInstances();
     459void UIWizardAddCloudVMPageBasic1::sltHandleProviderComboChange()
     460{
     461    updateProvider();
    578462    emit completeChanged();
    579463}
     
    581465void UIWizardAddCloudVMPageBasic1::sltHandleProfileComboChange()
    582466{
    583     /* Refresh required settings: */
    584     populateProfile();
    585     populateProfileInstances();
     467    updateProfile();
    586468    emit completeChanged();
    587469}
     
    589471void UIWizardAddCloudVMPageBasic1::sltHandleProfileButtonClick()
    590472{
    591     /* Open Cloud Profile Manager: */
    592473    if (gpManager)
    593474        gpManager->openCloudProfileManager();
    594475}
     476
     477void UIWizardAddCloudVMPageBasic1::sltHandleSourceInstanceChange()
     478{
     479    updateSourceInstance();
     480    emit completeChanged();
     481}
     482
     483void UIWizardAddCloudVMPageBasic1::setShortProviderName(const QString &strShortProviderName)
     484{
     485    qobject_cast<UIWizardAddCloudVM*>(wizard())->setShortProviderName(strShortProviderName);
     486}
     487
     488QString UIWizardAddCloudVMPageBasic1::shortProviderName() const
     489{
     490    return qobject_cast<UIWizardAddCloudVM*>(wizard())->shortProviderName();
     491}
     492
     493void UIWizardAddCloudVMPageBasic1::setProfileName(const QString &strProfileName)
     494{
     495    qobject_cast<UIWizardAddCloudVM*>(wizard())->setProfileName(strProfileName);
     496}
     497
     498QString UIWizardAddCloudVMPageBasic1::profileName() const
     499{
     500    return qobject_cast<UIWizardAddCloudVM*>(wizard())->profileName();
     501}
     502
     503void UIWizardAddCloudVMPageBasic1::setClient(const CCloudClient &comClient)
     504{
     505    qobject_cast<UIWizardAddCloudVM*>(wizard())->setClient(comClient);
     506}
     507
     508CCloudClient UIWizardAddCloudVMPageBasic1::client() const
     509{
     510    return qobject_cast<UIWizardAddCloudVM*>(wizard())->client();
     511}
     512
     513void UIWizardAddCloudVMPageBasic1::setInstanceIds(const QStringList &instanceIds)
     514{
     515    qobject_cast<UIWizardAddCloudVM*>(wizard())->setInstanceIds(instanceIds);
     516}
     517
     518QStringList UIWizardAddCloudVMPageBasic1::instanceIds() const
     519{
     520    return qobject_cast<UIWizardAddCloudVM*>(wizard())->instanceIds();
     521}
     522
     523void UIWizardAddCloudVMPageBasic1::updateProvider()
     524{
     525    updateComboToolTip(m_pProviderComboBox);
     526    setShortProviderName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString());
     527    CCloudProvider comCloudProvider = cloudProviderByShortName(shortProviderName(), wizard());
     528    populateProfiles(m_pProfileComboBox, comCloudProvider);
     529    updateProfile();
     530}
     531
     532void UIWizardAddCloudVMPageBasic1::updateProfile()
     533{
     534    setProfileName(m_pProfileComboBox->currentData(ProfileData_Name).toString());
     535    setClient(cloudClientByName(shortProviderName(), profileName(), wizard()));
     536    populateProfileInstances(m_pSourceInstanceList, client());
     537    updateSourceInstance();
     538}
     539
     540void UIWizardAddCloudVMPageBasic1::updateSourceInstance()
     541{
     542    setInstanceIds(currentListWidgetData(m_pSourceInstanceList));
     543}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.h

    r86346 r89999  
    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 "UIWizardPage.h"
     25#include "UINativeWizardPage.h"
    2626
    2727/* COM includes: */
    2828#include "COMEnums.h"
    2929#include "CCloudClient.h"
    30 #include "CCloudProfile.h"
    31 #include "CCloudProvider.h"
    32 #include "CCloudProviderManager.h"
    3330
    3431/* Forward declarations: */
     
    3633class QLabel;
    3734class QListWidget;
    38 class QTableWidget;
    3935class QIComboBox;
    4036class QIRichTextLabel;
    4137class QIToolButton;
    4238
    43 /** Source combo data fields. */
     39/** Provider combo data fields. */
    4440enum
    4541{
    46     SourceData_ID        = Qt::UserRole + 1,
    47     SourceData_Name      = Qt::UserRole + 2,
    48     SourceData_ShortName = Qt::UserRole + 3
     42    ProviderData_Name      = Qt::UserRole + 1,
     43    ProviderData_ShortName = Qt::UserRole + 2
    4944};
    5045
     
    5550};
    5651
    57 /** UIWizardPageBase extension for 1st page of the Add Cloud VM wizard. */
    58 class UIWizardAddCloudVMPage1 : public UIWizardPageBase
     52/** Namespace for 1st page of the Add Cloud VM wizard. */
     53namespace UIWizardAddCloudVMPage1
    5954{
    60 protected:
     55    /** Populates @a pCombo with known providers. */
     56    void populateProviders(QIComboBox *pCombo);
     57    /** Populates @a pCombo with known profiles of @a comProvider specified. */
     58    void populateProfiles(QIComboBox *pCombo, const CCloudProvider &comProvider);
     59    /** Populates @a pList with profile instances available in @a comClient. */
     60    void populateProfileInstances(QListWidget *pList, const CCloudClient &comClient);
    6161
    62     /** Constructs 1st page base. */
    63     UIWizardAddCloudVMPage1();
     62    /** Updates @a pCombo tool-tips. */
     63    void updateComboToolTip(QIComboBox *pCombo);
    6464
    65     /** Populates sources. */
    66     void populateSources();
    67     /** Populates profiles. */
    68     void populateProfiles();
    69     /** Populates profile. */
    70     void populateProfile();
    71     /** Populates profile instances. */
    72     void populateProfileInstances();
     65    /** Returns current user data for @a pList specified. */
     66    QStringList currentListWidgetData(QListWidget *pList);
     67}
    7368
    74     /** Updates source combo tool-tips. */
    75     void updateSourceComboToolTip();
    76 
    77     /** Defines @a strSource. */
    78     void setSource(const QString &strSource);
    79     /** Returns source. */
    80     QString source() const;
    81     /** Returns source ID. */
    82     QUuid sourceId() const;
    83 
    84     /** Returns profile name. */
    85     QString profileName() const;
    86     /** Returns instance IDs. */
    87     QStringList instanceIds() const;
    88 
    89     /** Defines Cloud @a comClient object. */
    90     void setClient(const CCloudClient &comClient);
    91     /** Returns Cloud Client object. */
    92     CCloudClient client() const;
    93 
    94     /** Holds whether starting page was polished. */
    95     bool  m_fPolished;
    96 
    97     /** Holds the Cloud Provider Manager reference. */
    98     CCloudProviderManager  m_comCloudProviderManager;
    99     /** Holds the Cloud Provider object reference. */
    100     CCloudProvider         m_comCloudProvider;
    101     /** Holds the Cloud Profile object reference. */
    102     CCloudProfile          m_comCloudProfile;
    103 
    104     /** Holds the source layout instance. */
    105     QGridLayout *m_pSourceLayout;
    106     /** Holds the source type label instance. */
    107     QLabel      *m_pSourceLabel;
    108     /** Holds the source type combo-box instance. */
    109     QIComboBox  *m_pSourceComboBox;
    110 
    111     /** Holds the cloud container layout instance. */
    112     QGridLayout  *m_pCloudContainerLayout;
    113     /** Holds the profile label instance. */
    114     QLabel       *m_pProfileLabel;
    115     /** Holds the profile combo-box instance. */
    116     QIComboBox   *m_pProfileComboBox;
    117     /** Holds the profile management tool-button instance. */
    118     QIToolButton *m_pProfileToolButton;
    119     /** Holds the profile instance label instance. */
    120     QLabel       *m_pProfileInstanceLabel;
    121     /** Holds the profile instance list instance. */
    122     QListWidget  *m_pProfileInstanceList;
    123 };
    124 
    125 /** UIWizardPage extension for 1st page of the Add Cloud VM wizard, extends UIWizardAddCloudVMPage1 as well. */
    126 class UIWizardAddCloudVMPageBasic1 : public UIWizardPage, public UIWizardAddCloudVMPage1
     69/** UINativeWizardPage extension for 1st page of the Add Cloud VM wizard,
     70  * based on UIWizardAddCloudVMPage1 namespace functions. */
     71class UIWizardAddCloudVMPageBasic1 : public UINativeWizardPage
    12772{
    12873    Q_OBJECT;
    129     Q_PROPERTY(QString source READ source);
    130     Q_PROPERTY(QString profileName READ profileName);
    131     Q_PROPERTY(QStringList instanceIds READ instanceIds);
    13274
    13375public:
     
    13880protected:
    13981
    140     /** Allows access wizard from base part. */
    141     virtual UIWizard *wizardImp() const /* override */ { return UIWizardPage::wizard(); }
    142 
    14382    /** Handles translation event. */
    144     virtual void retranslateUi() /* override */;
     83    virtual void retranslateUi() /* override final */;
    14584
    14685    /** Performs page initialization. */
    147     virtual void initializePage() /* override */;
     86    virtual void initializePage() /* override final */;
    14887
    14988    /** Returns whether page is complete. */
    150     virtual bool isComplete() const /* override */;
     89    virtual bool isComplete() const /* override final */;
    15190
    15291    /** Performs page validation. */
    153     virtual bool validatePage() /* override */;
     92    virtual bool validatePage() /* override final */;
    15493
    15594private slots:
    15695
    157     /** Handles change in source combo-box. */
    158     void sltHandleSourceChange();
     96    /** Handles change in provider combo-box. */
     97    void sltHandleProviderComboChange();
    15998
    16099    /** Handles change in profile combo-box. */
    161100    void sltHandleProfileComboChange();
    162 
    163101    /** Handles profile tool-button click. */
    164102    void sltHandleProfileButtonClick();
    165103
     104    /** Handles change in instance list. */
     105    void sltHandleSourceInstanceChange();
     106
    166107private:
     108
     109    /** Defines short provider name. */
     110    void setShortProviderName(const QString &strShortProviderName);
     111    /** Returns profile name. */
     112    QString shortProviderName() const;
     113
     114    /** Defines profile name. */
     115    void setProfileName(const QString &strProfileName);
     116    /** Returns profile name. */
     117    QString profileName() const;
     118
     119    /** Defines Cloud @a comClient object. */
     120    void setClient(const CCloudClient &comClient);
     121    /** Returns Cloud Client object. */
     122    CCloudClient client() const;
     123
     124    /** Defines @a instanceIds. */
     125    void setInstanceIds(const QStringList &instanceIds);
     126    /** Returns instance IDs. */
     127    QStringList instanceIds() const;
     128
     129    /** Updates provider. */
     130    void updateProvider();
     131    /** Updates profile. */
     132    void updateProfile();
     133    /** Updates source instance. */
     134    void updateSourceInstance();
    167135
    168136    /** Holds the main label instance. */
    169137    QIRichTextLabel *m_pLabelMain;
     138
     139    /** Holds the provider layout instance. */
     140    QGridLayout *m_pProviderLayout;
     141    /** Holds the provider type label instance. */
     142    QLabel      *m_pProviderLabel;
     143    /** Holds the provider type combo-box instance. */
     144    QIComboBox  *m_pProviderComboBox;
     145
    170146    /** Holds the description label instance. */
    171147    QIRichTextLabel *m_pLabelDescription;
     148
     149    /** Holds the options layout instance. */
     150    QGridLayout  *m_pOptionsLayout;
     151    /** Holds the profile label instance. */
     152    QLabel       *m_pProfileLabel;
     153    /** Holds the profile combo-box instance. */
     154    QIComboBox   *m_pProfileComboBox;
     155    /** Holds the profile management tool-button instance. */
     156    QIToolButton *m_pProfileToolButton;
     157    /** Holds the source instance label instance. */
     158    QLabel       *m_pSourceInstanceLabel;
     159    /** Holds the source instance list instance. */
     160    QListWidget  *m_pSourceInstanceList;
    172161};
    173162
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp

    r86687 r89999  
    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#include "QIComboBox.h"
    2727#include "QIToolButton.h"
     28#include "UICloudNetworkingStuff.h"
    2829#include "UIIconPool.h"
    2930#include "UIMessageCenter.h"
     
    3334#include "UIWizardAddCloudVMPageExpert.h"
    3435
     36/* Namespaces: */
     37using namespace UIWizardAddCloudVMPage1;
     38
    3539
    3640UIWizardAddCloudVMPageExpert::UIWizardAddCloudVMPageExpert()
    37     : m_pCntSource(0)
    38 {
    39     /* Create main layout: */
    40     QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    41     if (pMainLayout)
     41    : m_pCntProvider(0)
     42    , m_pProviderLayout(0)
     43    , m_pProviderLabel(0)
     44    , m_pProviderComboBox(0)
     45    , m_pOptionsLayout(0)
     46    , m_pProfileLabel(0)
     47    , m_pProfileComboBox(0)
     48    , m_pProfileToolButton(0)
     49    , m_pSourceInstanceLabel(0)
     50    , m_pSourceInstanceList(0)
     51{
     52    /* Prepare main layout: */
     53    QHBoxLayout *pLayoutMain = new QHBoxLayout(this);
     54    if (pLayoutMain)
    4255    {
    43         /* Create source container: */
    44         m_pCntSource = new QGroupBox(this);
    45         if (m_pCntSource)
     56        /* Prepare provider container: */
     57        m_pCntProvider = new QGroupBox(this);
     58        if (m_pCntProvider)
    4659        {
    47             /* Create source layout: */
    48             m_pSourceLayout = new QGridLayout(m_pCntSource);
    49             if (m_pSourceLayout)
     60            /* Prepare provider layout: */
     61            m_pProviderLayout = new QGridLayout(m_pCntProvider);
     62            if (m_pProviderLayout)
    5063            {
    51                 /* Create source selector: */
    52                 m_pSourceComboBox = new QIComboBox(m_pCntSource);
    53                 if (m_pSourceComboBox)
     64                /* Prepare provider selector: */
     65                m_pProviderComboBox = new QIComboBox(m_pCntProvider);
     66                if (m_pProviderComboBox)
     67                    m_pProviderLayout->addWidget(m_pProviderComboBox, 0, 0);
     68
     69                /* Prepare options layout: */
     70                m_pOptionsLayout = new QGridLayout;
     71                if (m_pOptionsLayout)
    5472                {
    55                     /* Add into layout: */
    56                     m_pSourceLayout->addWidget(m_pSourceComboBox, 0, 0);
    57                 }
    58 
    59                 /* Create cloud container layout: */
    60                 m_pCloudContainerLayout = new QGridLayout;
    61                 if (m_pCloudContainerLayout)
    62                 {
    63                     m_pCloudContainerLayout->setContentsMargins(0, 0, 0, 0);
    64                     m_pCloudContainerLayout->setRowStretch(1, 1);
    65 
    66                     /* Create sub-layout: */
     73                    m_pOptionsLayout->setContentsMargins(0, 0, 0, 0);
     74                    m_pOptionsLayout->setRowStretch(1, 1);
     75
     76                    /* Prepare sub-layout: */
    6777                    QHBoxLayout *pSubLayout = new QHBoxLayout;
    6878                    if (pSubLayout)
     
    7181                        pSubLayout->setSpacing(1);
    7282
    73                         /* Create profile combo-box: */
    74                         m_pProfileComboBox = new QIComboBox(m_pCntSource);
     83                        /* Prepare profile combo-box: */
     84                        m_pProfileComboBox = new QIComboBox(m_pCntProvider);
    7585                        if (m_pProfileComboBox)
    76                         {
    77                             /* Add into layout: */
    7886                            pSubLayout->addWidget(m_pProfileComboBox);
    79                         }
    80                         /* Create profile tool-button: */
    81                         m_pProfileToolButton = new QIToolButton(m_pCntSource);
     87
     88                        /* Prepare profile tool-button: */
     89                        m_pProfileToolButton = new QIToolButton(m_pCntProvider);
    8290                        if (m_pProfileToolButton)
    8391                        {
    8492                            m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    8593                                                                              ":/cloud_profile_manager_disabled_16px.png"));
    86 
    87                             /* Add into layout: */
    8894                            pSubLayout->addWidget(m_pProfileToolButton);
    8995                        }
    9096
    9197                        /* Add into layout: */
    92                         m_pCloudContainerLayout->addLayout(pSubLayout, 0, 0);
     98                        m_pOptionsLayout->addLayout(pSubLayout, 0, 0);
    9399                    }
    94100
    95                     /* Create profile instances table: */
    96                     m_pProfileInstanceList = new QListWidget(m_pCntSource);
    97                     if (m_pProfileInstanceList)
     101                    /* Prepare source instances table: */
     102                    m_pSourceInstanceList = new QListWidget(m_pCntProvider);
     103                    if (m_pSourceInstanceList)
    98104                    {
    99                         const QFontMetrics fm(m_pProfileInstanceList->font());
     105                        /* Make source image list fit 50 symbols
     106                         * horizontally and 8 lines vertically: */
     107                        const QFontMetrics fm(m_pSourceInstanceList->font());
    100108                        const int iFontWidth = fm.width('x');
    101109                        const int iTotalWidth = 50 * iFontWidth;
    102110                        const int iFontHeight = fm.height();
    103                         const int iTotalHeight = 4 * iFontHeight;
    104                         m_pProfileInstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
    105                         //m_pProfileInstanceList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    106                         m_pProfileInstanceList->setAlternatingRowColors(true);
    107                         m_pProfileInstanceList->setSelectionMode(QAbstractItemView::ExtendedSelection);
     111                        const int iTotalHeight = 8 * iFontHeight;
     112                        m_pSourceInstanceList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
     113                        m_pSourceInstanceList->setAlternatingRowColors(true);
     114                        m_pSourceInstanceList->setSelectionMode(QAbstractItemView::ExtendedSelection);
    108115
    109116                        /* Add into layout: */
    110                         m_pCloudContainerLayout->addWidget(m_pProfileInstanceList, 1, 0);
     117                        m_pOptionsLayout->addWidget(m_pSourceInstanceList, 1, 0);
    111118                    }
    112119
    113120                    /* Add into layout: */
    114                     m_pSourceLayout->addLayout(m_pCloudContainerLayout, 1, 0);
     121                    m_pProviderLayout->addLayout(m_pOptionsLayout, 1, 0);
    115122                }
    116123            }
    117124
    118125            /* Add into layout: */
    119             pMainLayout->addWidget(m_pCntSource);
     126            pLayoutMain->addWidget(m_pCntProvider);
    120127        }
    121128    }
     
    123130    /* Setup connections: */
    124131    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileRegistered,
    125             this, &UIWizardAddCloudVMPageExpert::sltHandleSourceChange);
     132            this, &UIWizardAddCloudVMPageExpert::sltHandleProviderComboChange);
    126133    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileChanged,
    127             this, &UIWizardAddCloudVMPageExpert::sltHandleSourceChange);
    128     connect(m_pSourceComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),
    129             this, &UIWizardAddCloudVMPageExpert::sltHandleSourceChange);
     134            this, &UIWizardAddCloudVMPageExpert::sltHandleProviderComboChange);
     135    connect(m_pProviderComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),
     136            this, &UIWizardAddCloudVMPageExpert::sltHandleProviderComboChange);
    130137    connect(m_pProfileComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
    131138            this, &UIWizardAddCloudVMPageExpert::sltHandleProfileComboChange);
    132139    connect(m_pProfileToolButton, &QIToolButton::clicked,
    133140            this, &UIWizardAddCloudVMPageExpert::sltHandleProfileButtonClick);
    134     connect(m_pProfileInstanceList, &QListWidget::currentRowChanged,
     141    connect(m_pSourceInstanceList, &QListWidget::currentRowChanged,
    135142            this, &UIWizardAddCloudVMPageExpert::completeChanged);
    136 
    137     /* Register fields: */
    138     registerField("source", this, "source");
    139     registerField("profileName", this, "profileName");
    140     registerField("instanceIds", this, "instanceIds");
    141143}
    142144
     
    144146{
    145147    /* Translate source container: */
    146     m_pCntSource->setTitle(UIWizardAddCloudVM::tr("Source"));
     148    m_pCntProvider->setTitle(UIWizardAddCloudVM::tr("Source"));
    147149
    148150    /* Translate profile stuff: */
     
    151153    /* Translate received values of Source combo-box.
    152154     * We are enumerating starting from 0 for simplicity: */
    153     for (int i = 0; i < m_pSourceComboBox->count(); ++i)
     155    for (int i = 0; i < m_pProviderComboBox->count(); ++i)
    154156    {
    155         m_pSourceComboBox->setItemText(i, m_pSourceComboBox->itemData(i, SourceData_Name).toString());
    156         m_pSourceComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole);
     157        m_pProviderComboBox->setItemText(i, m_pProviderComboBox->itemData(i, ProviderData_Name).toString());
     158        m_pProviderComboBox->setItemData(i, UIWizardAddCloudVM::tr("Add VM from cloud service provider."), Qt::ToolTipRole);
    157159    }
    158160
    159161    /* Update tool-tips: */
    160     updateSourceComboToolTip();
     162    updateComboToolTip(m_pProviderComboBox);
    161163}
    162164
    163165void UIWizardAddCloudVMPageExpert::initializePage()
    164166{
    165     /* If wasn't polished yet: */
    166     if (!UIWizardAddCloudVMPage1::m_fPolished)
    167     {
    168         /* Populate sources: */
    169         populateSources();
    170         /* Choose one of them, asynchronously: */
    171         QMetaObject::invokeMethod(this, "sltHandleSourceChange", Qt::QueuedConnection);
    172         UIWizardAddCloudVMPage1::m_fPolished = true;
    173     }
    174 
    175     /* Translate page: */
     167    /* Populate providers: */
     168    populateProviders(m_pProviderComboBox);
     169    /* Translate providers: */
    176170    retranslateUi();
     171    /* Fetch it, asynchronously: */
     172    QMetaObject::invokeMethod(this, "sltHandleProviderComboChange", Qt::QueuedConnection);
     173    /* Make image list focused by default: */
     174    m_pSourceInstanceList->setFocus();
    177175}
    178176
     
    184182    /* Make sure client is not NULL and
    185183     * at least one instance is selected: */
    186     fResult =   UIWizardAddCloudVMPage1::client().isNotNull()
    187             && !UIWizardAddCloudVMPage1::instanceIds().isEmpty();
     184    fResult =    client().isNotNull()
     185              && !instanceIds().isEmpty();
    188186
    189187    /* Return result: */
     
    196194    bool fResult = true;
    197195
    198     /* Lock finish button: */
    199     startProcessing();
    200 
    201196    /* Try to add cloud VMs: */
    202197    fResult = qobject_cast<UIWizardAddCloudVM*>(wizard())->addCloudVMs();
    203198
    204     /* Unlock finish button: */
    205     endProcessing();
    206 
    207199    /* Return result: */
    208200    return fResult;
    209201}
    210202
    211 void UIWizardAddCloudVMPageExpert::sltHandleSourceChange()
    212 {
    213     /* Update tool-tip: */
    214     updateSourceComboToolTip();
    215 
    216     /* Make instance list focused by default: */
    217     m_pProfileInstanceList->setFocus();
    218 
    219     /* Refresh required settings: */
    220     populateProfiles();
    221     populateProfile();
    222     populateProfileInstances();
     203void UIWizardAddCloudVMPageExpert::sltHandleProviderComboChange()
     204{
     205    updateProvider();
    223206    emit completeChanged();
    224207}
     
    226209void UIWizardAddCloudVMPageExpert::sltHandleProfileComboChange()
    227210{
    228     /* Refresh required settings: */
    229     populateProfile();
    230     populateProfileInstances();
     211    updateProfile();
    231212    emit completeChanged();
    232213}
     
    234215void UIWizardAddCloudVMPageExpert::sltHandleProfileButtonClick()
    235216{
    236     /* Open Cloud Profile Manager: */
    237217    if (gpManager)
    238218        gpManager->openCloudProfileManager();
    239219}
     220
     221void UIWizardAddCloudVMPageExpert::sltHandleSourceInstanceChange()
     222{
     223    updateSourceInstance();
     224    emit completeChanged();
     225}
     226
     227void UIWizardAddCloudVMPageExpert::setShortProviderName(const QString &strShortProviderName)
     228{
     229    qobject_cast<UIWizardAddCloudVM*>(wizard())->setShortProviderName(strShortProviderName);
     230}
     231
     232QString UIWizardAddCloudVMPageExpert::shortProviderName() const
     233{
     234    return qobject_cast<UIWizardAddCloudVM*>(wizard())->shortProviderName();
     235}
     236
     237void UIWizardAddCloudVMPageExpert::setProfileName(const QString &strProfileName)
     238{
     239    qobject_cast<UIWizardAddCloudVM*>(wizard())->setProfileName(strProfileName);
     240}
     241
     242QString UIWizardAddCloudVMPageExpert::profileName() const
     243{
     244    return qobject_cast<UIWizardAddCloudVM*>(wizard())->profileName();
     245}
     246
     247void UIWizardAddCloudVMPageExpert::setClient(const CCloudClient &comClient)
     248{
     249    qobject_cast<UIWizardAddCloudVM*>(wizard())->setClient(comClient);
     250}
     251
     252CCloudClient UIWizardAddCloudVMPageExpert::client() const
     253{
     254    return qobject_cast<UIWizardAddCloudVM*>(wizard())->client();
     255}
     256
     257void UIWizardAddCloudVMPageExpert::setInstanceIds(const QStringList &instanceIds)
     258{
     259    qobject_cast<UIWizardAddCloudVM*>(wizard())->setInstanceIds(instanceIds);
     260}
     261
     262QStringList UIWizardAddCloudVMPageExpert::instanceIds() const
     263{
     264    return qobject_cast<UIWizardAddCloudVM*>(wizard())->instanceIds();
     265}
     266
     267void UIWizardAddCloudVMPageExpert::updateProvider()
     268{
     269    updateComboToolTip(m_pProviderComboBox);
     270    setShortProviderName(m_pProviderComboBox->currentData(ProviderData_ShortName).toString());
     271    CCloudProvider comCloudProvider = cloudProviderByShortName(shortProviderName(), wizard());
     272    populateProfiles(m_pProfileComboBox, comCloudProvider);
     273    updateProfile();
     274}
     275
     276void UIWizardAddCloudVMPageExpert::updateProfile()
     277{
     278    setProfileName(m_pProfileComboBox->currentData(ProfileData_Name).toString());
     279    setClient(cloudClientByName(shortProviderName(), profileName(), wizard()));
     280    populateProfileInstances(m_pSourceInstanceList, client());
     281    updateSourceInstance();
     282}
     283
     284void UIWizardAddCloudVMPageExpert::updateSourceInstance()
     285{
     286    setInstanceIds(currentListWidgetData(m_pSourceInstanceList));
     287}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.h

    r86346 r89999  
    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
     
    2828class QGroupBox;
    2929
    30 /** UIWizardPage extension for UIWizardAddCloudVMPage1. */
    31 class UIWizardAddCloudVMPageExpert : public UIWizardPage,
    32                                      public UIWizardAddCloudVMPage1
     30/** UINativeWizardPage extension for Expert page of the Add Cloud VM wizard,
     31  * based on UIWizardAddCloudVMPage1 namespace functions. */
     32class UIWizardAddCloudVMPageExpert : public UINativeWizardPage
    3333{
    3434    Q_OBJECT;
    35     Q_PROPERTY(QString source READ source);
    36     Q_PROPERTY(QString profileName READ profileName);
    37     Q_PROPERTY(QStringList instanceIds READ instanceIds);
    3835
    3936public:
     
    4441protected:
    4542
    46     /** Allows access wizard from base part. */
    47     virtual UIWizard *wizardImp() const /* override */ { return UIWizardPage::wizard(); }
    48 
    4943    /** Handles translation event. */
    50     virtual void retranslateUi() /* override */;
     44    virtual void retranslateUi() /* override final */;
    5145
    5246    /** Performs page initialization. */
    53     virtual void initializePage() /* override */;
     47    virtual void initializePage() /* override final */;
    5448
    5549    /** Returns whether page is complete. */
    56     virtual bool isComplete() const /* override */;
     50    virtual bool isComplete() const /* override final */;
    5751
    5852    /** Performs page validation. */
    59     virtual bool validatePage() /* override */;
     53    virtual bool validatePage() /* override final */;
    6054
    6155private slots:
    6256
    63     /** Handles change in source combo-box. */
    64     void sltHandleSourceChange();
     57    /** Handles change in provider combo-box. */
     58    void sltHandleProviderComboChange();
    6559
    6660    /** Handles change in profile combo-box. */
    6761    void sltHandleProfileComboChange();
    68 
    6962    /** Handles profile tool-button click. */
    7063    void sltHandleProfileButtonClick();
    7164
     65    /** Handles change in instance list. */
     66    void sltHandleSourceInstanceChange();
     67
    7268private:
    7369
    74     /** Holds the source container instance. */
    75     QGroupBox *m_pCntSource;
     70    /** Defines short provider name. */
     71    void setShortProviderName(const QString &strShortProviderName);
     72    /** Returns profile name. */
     73    QString shortProviderName() const;
     74
     75    /** Defines profile name. */
     76    void setProfileName(const QString &strProfileName);
     77    /** Returns profile name. */
     78    QString profileName() const;
     79
     80    /** Defines Cloud @a comClient object. */
     81    void setClient(const CCloudClient &comClient);
     82    /** Returns Cloud Client object. */
     83    CCloudClient client() const;
     84
     85    /** Defines @a instanceIds. */
     86    void setInstanceIds(const QStringList &instanceIds);
     87    /** Returns instance IDs. */
     88    QStringList instanceIds() const;
     89
     90    /** Updates provider. */
     91    void updateProvider();
     92    /** Updates profile. */
     93    void updateProfile();
     94    /** Updates source instance. */
     95    void updateSourceInstance();
     96
     97    /** Holds the provider container instance. */
     98    QGroupBox *m_pCntProvider;
     99
     100    /** Holds the provider layout instance. */
     101    QGridLayout *m_pProviderLayout;
     102    /** Holds the provider type label instance. */
     103    QLabel      *m_pProviderLabel;
     104    /** Holds the provider type combo-box instance. */
     105    QIComboBox  *m_pProviderComboBox;
     106
     107    /** Holds the options layout instance. */
     108    QGridLayout  *m_pOptionsLayout;
     109    /** Holds the profile label instance. */
     110    QLabel       *m_pProfileLabel;
     111    /** Holds the profile combo-box instance. */
     112    QIComboBox   *m_pProfileComboBox;
     113    /** Holds the profile management tool-button instance. */
     114    QIToolButton *m_pProfileToolButton;
     115    /** Holds the source instance label instance. */
     116    QLabel       *m_pSourceInstanceLabel;
     117    /** Holds the source instance list instance. */
     118    QListWidget  *m_pSourceInstanceList;
    76119};
    77120
Note: See TracChangeset for help on using the changeset viewer.

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