VirtualBox

Ignore:
Timestamp:
Sep 30, 2020 12:37:06 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140634
Message:

FE/Qt: bugref:9653: Wizards stuff: Pass full group name to add/create cloud VM wizards as a hint to determine profile (and provider in future).

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

Legend:

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

    r86344 r86345  
    808808        /* Use the "safe way" to open stack of Mac OS X Sheets: */
    809809        QWidget *pWizardParent = windowManager().realParentWindow(this);
    810         UISafePointerWizardNewCloudVM pWizard = new UIWizardNewCloudVM(pWizardParent);
     810        UISafePointerWizardNewCloudVM pWizard = new UIWizardNewCloudVM(pWizardParent, m_pWidget->fullGroupName());
    811811        windowManager().registerNewParent(pWizard, pWizardParent);
    812812        pWizard->prepare();
     
    844844        /* Use the "safe way" to open stack of Mac OS X Sheets: */
    845845        QWidget *pWizardParent = windowManager().realParentWindow(this);
    846         UISafePointerWizardAddCloudVM pWizard = new UIWizardAddCloudVM(pWizardParent);
     846        UISafePointerWizardAddCloudVM pWizard = new UIWizardAddCloudVM(pWizardParent, m_pWidget->fullGroupName());
    847847        windowManager().registerNewParent(pWizard, pWizardParent);
    848848        pWizard->prepare();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.cpp

    r84417 r86345  
    2828
    2929UIWizardAddCloudVM::UIWizardAddCloudVM(QWidget *pParent,
    30                                        const CCloudClient &comClient /* = CCloudClient() */,
     30                                       const QString &strFullGroupName /* = QString() */,
    3131                                       WizardMode enmMode /* = WizardMode_Auto */)
    3232    : UIWizard(pParent, WizardType_AddCloudVM, enmMode)
    33     , m_comClient(comClient)
     33    , m_strFullGroupName(strFullGroupName)
    3434{
    3535#ifndef VBOX_WS_MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.h

    r83858 r86345  
    5050
    5151    /** Constructs Add Cloud VM wizard passing @a pParent & @a enmMode to the base-class.
    52       * @param  comClient  Brings the Cloud Client object wrapper to work with. */
     52      * @param  strFullGroupName  Brings full group name (/provider/profile) to add VM to. */
    5353    UIWizardAddCloudVM(QWidget *pParent,
    54                        const CCloudClient &comClient = CCloudClient(),
     54                       const QString &strFullGroupName = QString(),
    5555                       WizardMode enmMode = WizardMode_Auto);
    5656
    5757    /** Prepares all. */
    5858    virtual void prepare() /* override */;
     59
     60    /** Returns full group name. */
     61    QString fullGroupName() const { return m_strFullGroupName; }
    5962
    6063    /** Defines Cloud @a comClient object wrapper. */
     
    7376private:
    7477
     78    /** Holds the full group name (/provider/profile) to add VM to. */
     79    QString  m_strFullGroupName;
     80
    7581    /** Holds the Cloud Client object wrapper. */
    7682    CCloudClient  m_comClient;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.cpp

    r86343 r86345  
    116116    if (m_pAccountComboBox->currentIndex() != -1)
    117117        strOldData = m_pAccountComboBox->itemData(m_pAccountComboBox->currentIndex(), AccountData_ProfileName).toString();
     118    else
     119    {
     120        /* Try to fetch "old" account name from wizard full group name: */
     121        UIWizardAddCloudVM *pWizard = qobject_cast<UIWizardAddCloudVM*>(wizardImp());
     122        AssertPtrReturnVoid(pWizard);
     123        const QString strFullGroupName = pWizard->fullGroupName();
     124        const QString strProfileName = strFullGroupName.section('/', 2, 2);
     125        if (!strProfileName.isEmpty())
     126            strOldData = strProfileName;
     127    }
    118128
    119129    /* Clear combo initially: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r82968 r86345  
    331331                    CVirtualSystemDescription comDescription = field("vsd").value<CVirtualSystemDescription>();
    332332                    /* Create and run wizard as modal dialog, but prevent final step: */
    333                     pNewCloudVMWizard = new UIWizardNewCloudVM(this, comClient, comDescription, mode());
     333                    pNewCloudVMWizard = new UIWizardNewCloudVM(this, QString() /** @todo pass proper full group name! */, comClient, comDescription, mode());
    334334                    pNewCloudVMWizard->setFinalStepPrevented(true);
    335335                    pNewCloudVMWizard->prepare();
     
    392392                    /* Create and run short wizard mode as modal dialog: */
    393393                    QWidget *pWizardParent = windowManager().realParentWindow(this);
    394                     pNewCloudVMWizard = new UIWizardNewCloudVM(pWizardParent, comClient, comDescription, mode());
     394                    pNewCloudVMWizard = new UIWizardNewCloudVM(pWizardParent, QString() /** @todo pass proper full group name! */, comClient, comDescription, mode());
    395395                    windowManager().registerNewParent(pNewCloudVMWizard, pWizardParent);
    396396                    pNewCloudVMWizard->prepare();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp

    r84288 r86345  
    3333
    3434UIWizardNewCloudVM::UIWizardNewCloudVM(QWidget *pParent,
     35                                       const QString &strFullGroupName /* = QString() */,
    3536                                       const CCloudClient &comClient /* = CCloudClient() */,
    3637                                       const CVirtualSystemDescription &comDescription /* = CVirtualSystemDescription() */,
    3738                                       WizardMode enmMode /* = WizardMode_Auto */)
    3839    : UIWizard(pParent, WizardType_NewCloudVM, enmMode)
     40    , m_strFullGroupName(strFullGroupName)
    3941    , m_comClient(comClient)
    4042    , m_comVSD(comDescription)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.h

    r82968 r86345  
    5252
    5353    /** 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. */
     54      * @param  strFullGroupName  Brings full group name (/provider/profile) to create VM in.
     55      * @param  comClient         Brings the Cloud Client object to work with.
     56      * @param  comDescription    Brings the Virtual System Description object to use. */
    5657    UIWizardNewCloudVM(QWidget *pParent,
     58                       const QString &strFullGroupName = QString(),
    5759                       const CCloudClient &comClient = CCloudClient(),
    5860                       const CVirtualSystemDescription &comDescription = CVirtualSystemDescription(),
     
    6466    /** Sets whether the final step is @a fPrevented. */
    6567    void setFinalStepPrevented(bool fPrevented) { m_fFinalStepPrevented = fPrevented; }
     68
     69    /** Returns full group name. */
     70    QString fullGroupName() const { return m_strFullGroupName; }
    6671
    6772    /** Defines Cloud @a comClient object. */
     
    102107private:
    103108
     109    /** Holds the full group name (/provider/profile) to add VM to. */
     110    QString                        m_strFullGroupName;
    104111    /** Holds the Cloud Client object reference. */
    105112    CCloudClient                   m_comClient;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp

    r86343 r86345  
    117117    if (m_pAccountComboBox->currentIndex() != -1)
    118118        strOldData = m_pAccountComboBox->itemData(m_pAccountComboBox->currentIndex(), AccountData_ProfileName).toString();
     119    else
     120    {
     121        /* Try to fetch "old" account name from wizard full group name: */
     122        UIWizardNewCloudVM *pWizard = qobject_cast<UIWizardNewCloudVM*>(wizardImp());
     123        AssertPtrReturnVoid(pWizard);
     124        const QString strFullGroupName = pWizard->fullGroupName();
     125        const QString strProfileName = strFullGroupName.section('/', 2, 2);
     126        if (!strProfileName.isEmpty())
     127            strOldData = strProfileName;
     128    }
    119129
    120130    /* Clear combo initially: */
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