VirtualBox

Changeset 79580 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 7, 2019 4:12:08 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131870
Message:

FE/Qt: bugref:9495: New Cloud VM wizard: Short wizard form runnable from another wizard which can provide this one with proper client and description.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp

    r79575 r79580  
    2727
    2828
    29 UIWizardNewCloudVM::UIWizardNewCloudVM(QWidget *pParent)
     29UIWizardNewCloudVM::UIWizardNewCloudVM(QWidget *pParent,
     30                                       const CCloudClient &comClient /* = CCloudClient() */,
     31                                       const CVirtualSystemDescription &comDescription /* = CVirtualSystemDescription() */)
    3032    : UIWizard(pParent, WizardType_NewCloudVM)
     33    , m_comClient(comClient)
     34    , m_comVSD(comDescription)
     35    , m_fFullWizard(m_comClient.isNull() || m_comVSD.isNull())
    3136{
    3237#ifndef VBOX_WS_MAC
     
    4651        case WizardMode_Basic:
    4752        {
    48             setPage(Page1, new UIWizardNewCloudVMPageBasic1);
    49             setPage(Page2, new UIWizardNewCloudVMPageBasic2);
     53            if (m_fFullWizard)
     54                setPage(Page1, new UIWizardNewCloudVMPageBasic1);
     55            setPage(Page2, new UIWizardNewCloudVMPageBasic2(m_fFullWizard));
    5056            break;
    5157        }
    5258        case WizardMode_Expert:
    5359        {
    54             setPage(PageExpert, new UIWizardNewCloudVMPageExpert);
     60            setPage(PageExpert, new UIWizardNewCloudVMPageExpert(m_fFullWizard));
    5561            break;
    5662        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.h

    r79575 r79580  
    5151    };
    5252
    53     /** Constructs new cloud vm wizard passing @a pParent to the base-class. */
    54     UIWizardNewCloudVM(QWidget *pParent);
     53    /** Constructs New Cloud VM wizard passing @a pParent to the base-class.
     54      * @param  comClient       Brings the Cloud Client object to work with.
     55      * @param  comDescription  Brings the Virtual System Description object to use. */
     56    UIWizardNewCloudVM(QWidget *pParent,
     57                       const CCloudClient &comClient = CCloudClient(),
     58                       const CVirtualSystemDescription &comDescription = CVirtualSystemDescription());
    5559
    5660    /** Prepares all. */
     
    9195    /** Holds the Virtual System Description Form object reference. */
    9296    CVirtualSystemDescriptionForm  m_comVSDForm;
     97
     98    /** Holds whether we want full wizard form or short one. */
     99    bool  m_fFullWizard;
    93100};
    94101
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic2.cpp

    r79575 r79580  
    3131*********************************************************************************************************************************/
    3232
    33 UIWizardNewCloudVMPage2::UIWizardNewCloudVMPage2()
     33UIWizardNewCloudVMPage2::UIWizardNewCloudVMPage2(bool fFullWizard)
     34    : m_fFullWizard(fFullWizard)
     35    , m_fPolished(false)
    3436{
    3537}
     
    5456*********************************************************************************************************************************/
    5557
    56 UIWizardNewCloudVMPageBasic2::UIWizardNewCloudVMPageBasic2()
     58UIWizardNewCloudVMPageBasic2::UIWizardNewCloudVMPageBasic2(bool fFullWizard)
     59    : UIWizardNewCloudVMPage2(fFullWizard)
    5760{
    5861    /* Create main layout: */
     
    9295void UIWizardNewCloudVMPageBasic2::initializePage()
    9396{
     97    /* If wasn't polished yet: */
     98    if (!m_fPolished)
     99    {
     100        if (!m_fFullWizard)
     101        {
     102            /* Generate VSD form, asynchronously: */
     103            QMetaObject::invokeMethod(this, "sltInitShortWizardForm", Qt::QueuedConnection);
     104        }
     105        m_fPolished = true;
     106    }
     107
    94108    /* Refresh form properties: */
    95109    refreshFormPropertiesTable();
     
    131145    return fResult;
    132146}
     147
     148void UIWizardNewCloudVMPageBasic2::sltInitShortWizardForm()
     149{
     150    /* Create Virtual System Description Form: */
     151    qobject_cast<UIWizardNewCloudVM*>(wizardImp())->createVSDForm();
     152
     153    /* Refresh form properties table: */
     154    refreshFormPropertiesTable();
     155}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic2.h

    r79575 r79580  
    3535
    3636    /** Constructs 2nd page base. */
    37     UIWizardNewCloudVMPage2();
     37    UIWizardNewCloudVMPage2(bool fFullWizard);
    3838
    3939    /** Refreshes form properties table. */
     
    4242    /** Returns Virtual System Description Form object. */
    4343    CVirtualSystemDescriptionForm vsdForm() const;
     44
     45    /** Holds whether wizard should be in full form. */
     46    bool  m_fFullWizard;
     47    /** Holds whether starting page was polished. */
     48    bool  m_fPolished;
    4449
    4550    /** Holds the Form Editor widget instance. */
     
    5560
    5661    /** Constructs 2nd basic page. */
    57     UIWizardNewCloudVMPageBasic2();
     62    UIWizardNewCloudVMPageBasic2(bool fFullWizard);
    5863
    5964protected:
     
    7176    virtual bool validatePage() /* override */;
    7277
     78private slots:
     79
     80    /** Initializes short wizard form. */
     81    void sltInitShortWizardForm();
     82
    7383private:
    7484
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp

    r79579 r79580  
    3333
    3434
    35 UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert()
    36     : m_pCntDestination(0)
     35UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert(bool fFullWizard)
     36    : UIWizardNewCloudVMPage2(fFullWizard)
     37    , m_pCntDestination(0)
    3738    , m_pSettingsCnt(0)
    3839{
     
    4546        if (m_pCntDestination)
    4647        {
     48            /* There is no destination table in short wizard form: */
     49            if (!m_fFullWizard)
     50                m_pCntDestination->setVisible(false);
     51
    4752            /* Create destination layout: */
    4853            m_pDestinationLayout = new QGridLayout(m_pCntDestination);
     
    219224{
    220225    /* If wasn't polished yet: */
    221     if (!m_fPolished)
    222     {
    223         /* Populate destinations: */
    224         populateDestinations();
    225         /* Choose one of them, asynchronously: */
    226         QMetaObject::invokeMethod(this, "sltHandleDestinationChange", Qt::QueuedConnection);
    227         m_fPolished = true;
     226    if (!UIWizardNewCloudVMPage1::m_fPolished || !UIWizardNewCloudVMPage2::m_fPolished)
     227    {
     228        if (m_fFullWizard)
     229        {
     230            /* Populate destinations: */
     231            populateDestinations();
     232            /* Choose one of them, asynchronously: */
     233            QMetaObject::invokeMethod(this, "sltHandleDestinationChange", Qt::QueuedConnection);
     234        }
     235        else
     236        {
     237            /* Generate VSD form, asynchronously: */
     238            QMetaObject::invokeMethod(this, "sltInitShortWizardForm", Qt::QueuedConnection);
     239        }
     240        UIWizardNewCloudVMPage1::m_fPolished = true;
     241        UIWizardNewCloudVMPage2::m_fPolished = true;
    228242    }
    229243
     
    321335    emit completeChanged();
    322336}
     337
     338void UIWizardNewCloudVMPageExpert::sltInitShortWizardForm()
     339{
     340    /* Create Virtual System Description Form: */
     341    qobject_cast<UIWizardNewCloudVM*>(wizardImp())->createVSDForm();
     342
     343    /* Refresh form properties table: */
     344    refreshFormPropertiesTable();
     345}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h

    r79575 r79580  
    3939
    4040    /** Constructs expert page. */
    41     UIWizardNewCloudVMPageExpert();
     41    UIWizardNewCloudVMPageExpert(bool fFullWizard);
    4242
    4343protected:
     
    7474    void sltHandleInstanceListChange();
    7575
     76    /** Initializes short wizard form. */
     77    void sltInitShortWizardForm();
     78
    7679private:
    7780
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