VirtualBox

Changeset 83858 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 20, 2020 2:13:40 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137387
Message:

FE/Qt: bugref:9653: Rework Add Cloud VM wizard the way it notifies about registered cloud VM via temporary UICommon API; This is to be replaced by corresponding Main API event later.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r83760 r83858  
    25702570}
    25712571
     2572void UICommon::notifyCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
     2573                                            const QUuid &uId, const bool fRegistered)
     2574{
     2575    emit sigCloudMachineRegistered(strProviderShortName, strProfileName, uId, fRegistered);
     2576}
     2577
    25722578void UICommon::enumerateMedia(const CMediumVector &comMedia /* = CMediumVector() */)
    25732579{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r83760 r83858  
    8484        /** Notifies listeners about the VBoxSVC availability change. */
    8585        void sigVBoxSVCAvailabilityChange();
     86    /** @} */
     87
     88    /** @name Temporary: Cloud Virtual Machine stuff.
     89     * @{ */
     90        /** Notifies listeners about cloud VM was (un)registered.
     91          * @note   This is to be replaced by corresponding Main API event later.
     92          * @param  strProviderShortName  Brings provider short name.
     93          * @param  strProfileName        Brings profile name.
     94          * @param  uId                   Brings cloud VM id.
     95          * @param  fRegistered           True is machine was registered, false otherwise. */
     96        void sigCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
     97                                       const QUuid &uId, const bool fRegistered);
    8698    /** @} */
    8799
     
    483495    /** @} */
    484496
     497    /** @name Temporary: Cloud Virtual Machine stuff.
     498     * @{ */
     499        /** Notifies listeners about cloud VM was (un)registered.
     500          * @note   This is to be replaced by corresponding Main API event later.
     501          * @param  strProviderShortName  Brings provider short name.
     502          * @param  strProfileName        Brings profile name.
     503          * @param  uId                   Brings cloud VM id.
     504          * @param  fRegistered           True is machine was registered, false otherwise. */
     505        void notifyCloudMachineRegistered(const QString &strProviderShortName, const QString &strProfileName,
     506                                          const QUuid &uId, const bool fRegistered);
     507    /** @} */
     508
    485509    /** @name COM: Virtual Media stuff.
    486510     * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r83706 r83858  
    539539    connect(this, &UIChooserAbstractModel::sigGroupSavingStateChanged,
    540540            m_pParent, &UIChooser::sigGroupSavingStateChanged);
     541
     542    /* Setup temporary connections,
     543     * this is to be replaced by corresponding Main API event later. */
     544    connect(&uiCommon(), &UICommon::sigCloudMachineRegistered,
     545            this, &UIChooserAbstractModel::sltCloudMachineRegistered);
    541546
    542547    /* Setup global connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r83857 r83858  
    978978        /* Execute wizard: */
    979979        pWizard->exec();
    980 
    981         // WORKAROUND:
    982         // Hehey! Now we have to inject created VM nodes and then rebuild tree for the main root node
    983         // ourselves cause there is no corresponding event yet. So we are calling actual handler to do that.
    984         foreach (const CCloudMachine &comMachine, pWizard->machines())
    985             sltCloudMachineRegistered(pWizard->source() /* provider name */,
    986                                       pWizard->profileName() /* profile name */,
    987                                       comMachine.GetId() /* machine ID */,
    988                                       true /* registered? */);
    989 
    990980        delete pWizard;
    991981    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.cpp

    r83857 r83858  
    1717
    1818/* GUI includes: */
     19#include "UICommon.h"
    1920#include "UIMessageCenter.h"
    2021#include "UIWizardAddCloudVM.h"
     
    6667}
    6768
    68 QString UIWizardAddCloudVM::source() const
    69 {
    70     return field("source").toString();
    71 }
    72 
    73 QString UIWizardAddCloudVM::profileName() const
    74 {
    75     return field("profileName").toString();
    76 }
    77 
    7869bool UIWizardAddCloudVM::addCloudVMs()
    7970{
     
    118109                    if (comMachine.isNotNull())
    119110                    {
    120                         m_machines << comMachine;
     111                        uiCommon().notifyCloudMachineRegistered(field("source").toString(),
     112                                                                field("profileName").toString(),
     113                                                                comMachine.GetId(),
     114                                                                true /* registered */);
    121115                        fResult = true;
    122116                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVM.h

    r83857 r83858  
    6363    CCloudClient client() const { return m_comClient; }
    6464
    65     /** Returns Cloud Machine object wrapper list. */
    66     QList<CCloudMachine> machines() const { return m_machines; }
    67 
    68     /** Returns source. */
    69     QString source() const;
    70     /** Returns profile name. */
    71     QString profileName() const;
    72 
    7365    /** Adds cloud VMs. */
    7466    bool addCloudVMs();
     
    8375    /** Holds the Cloud Client object wrapper. */
    8476    CCloudClient  m_comClient;
    85 
    86     /** Holds the Cloud Machine object wrapper list. */
    87     QList<CCloudMachine>  m_machines;
    8877};
    8978
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