VirtualBox

Changeset 83654 in vbox


Ignore:
Timestamp:
Apr 9, 2020 4:48:37 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Rework Chooser pane to use CCloudMachine instead of UICloudMachine; Details pane for now detached.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
10 edited

Legend:

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

    r83212 r83654  
    2828}
    2929
    30 QList<UICloudMachine> UITaskCloudAcquireInstances::result() const
     30QVector<CCloudMachine> UITaskCloudAcquireInstances::result() const
    3131{
    3232    m_mutex.lock();
    33     const QList<UICloudMachine> resultList = m_result;
     33    const QVector<CCloudMachine> resultVector = m_result;
    3434    m_mutex.unlock();
    35     return resultList;
     35    return resultVector;
    3636}
    3737
     
    4747{
    4848    m_mutex.lock();
    49     m_result = listInstances(m_comCloudClient, m_strErrorInfo);
     49    m_result = listCloudMachines(m_comCloudClient, m_strErrorInfo);
    5050    m_mutex.unlock();
    5151}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudAcquireInstances.h

    r83212 r83654  
    2626
    2727/* GUI includes: */
    28 #include "UICloudMachine.h"
    2928#include "UITask.h"
    3029
     
    3231#include "COMEnums.h"
    3332#include "CCloudClient.h"
     33#include "CCloudMachine.h"
    3434
    3535/* Forward declaratiuons: */
     
    5757
    5858    /** Returns the task result. */
    59     QList<UICloudMachine> result() const;
     59    QVector<CCloudMachine> result() const;
    6060
    6161protected:
     
    7878
    7979    /** Holds the task result. */
    80     QList<UICloudMachine>  m_result;
     80    QVector<CCloudMachine>  m_result;
    8181};
    8282
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetInstanceInfo.cpp

    r83644 r83654  
    1717
    1818/* GUI includes: */
     19#include "UICloudNetworkingStuff.h"
    1920#include "UITaskCloudGetInstanceInfo.h"
    2021
    2122
    22 UITaskCloudGetInstanceInfo::UITaskCloudGetInstanceInfo(const UICloudMachine &guiCloudMachine)
     23UITaskCloudGetInstanceInfo::UITaskCloudGetInstanceInfo(const CCloudMachine &comCloudMachine)
    2324    : UITask(Type_CloudGetInstanceState)
    24     , m_guiCloudMachine(guiCloudMachine)
     25    , m_comCloudMachine(comCloudMachine)
    2526{
    2627}
     
    3738{
    3839    m_mutex.lock();
    39     m_guiCloudMachine.refresh();
     40    refreshCloudMachineInfo(m_comCloudMachine, m_strErrorInfo);
    4041    m_mutex.unlock();
    4142}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UITaskCloudGetInstanceInfo.h

    r83644 r83654  
    2727
    2828/* GUI includes: */
    29 #include "UICloudMachine.h"
    3029#include "UITask.h"
     30
     31/* COM includes: */
     32#include "COMEnums.h"
     33#include "CCloudMachine.h"
    3134
    3235
     
    3841public:
    3942
    40     /** Constructs task taking @a guiCloudMachine as data.
    41       * @param  guiCloudMachine  Brings the cloud VM wrapper. */
    42     UITaskCloudGetInstanceInfo(const UICloudMachine &guiCloudMachine);
     43    /** Constructs task taking @a comCloudMachine as data.
     44      * @param  comCloudMachine  Brings the cloud VM wrapper. */
     45    UITaskCloudGetInstanceInfo(const CCloudMachine &comCloudMachine);
    4346
    4447    /** Returns error info. */
     
    5255private:
    5356
    54     /** Holds the mutex to access m_guiCloudMachine member. */
     57    /** Holds the mutex to access m_comCloudMachine member. */
    5558    mutable QMutex  m_mutex;
    5659
    57     /** Holds the cloud client object. */
    58     UICloudMachine  m_guiCloudMachine;
     60    /** Holds the cloud machine object. */
     61    CCloudMachine  m_comCloudMachine;
    5962
    6063    /** Holds the error info. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp

    r83290 r83654  
    4141}
    4242
    43 UIVirtualMachineItemCloud::UIVirtualMachineItemCloud(const UICloudMachine &guiCloudMachine)
     43UIVirtualMachineItemCloud::UIVirtualMachineItemCloud(const CCloudMachine &comCloudMachine)
    4444    : UIVirtualMachineItem(ItemType_CloudReal)
    45     , m_guiCloudMachine(guiCloudMachine)
     45    , m_comCloudMachine(comCloudMachine)
    4646    , m_enmFakeCloudItemState(FakeCloudItemState_NotApplicable)
    4747    , m_pTask(0)
     
    7171void UIVirtualMachineItemCloud::pauseOrResume(bool fPause, QWidget *pParent)
    7272{
    73     /* Acquire cloud client: */
    74     CCloudClient comCloudClient = m_guiCloudMachine.client();
    75 
    76     /* Now execute async method: */
     73    /* Execute async method: */
    7774    CProgress comProgress;
    7875    if (fPause)
    79         comProgress = comCloudClient.PauseInstance(m_strInstanceId);
    80     else
    81         comProgress = comCloudClient.StartInstance(m_strInstanceId);
    82     if (!comCloudClient.isOk())
    83         msgCenter().cannotAcquireCloudClientParameter(comCloudClient);
     76        comProgress = m_comCloudMachine.PowerDown();
     77    else
     78        comProgress = m_comCloudMachine.PowerUp();
     79    if (!m_comCloudMachine.isOk())
     80        msgCenter().cannotAcquireCloudMachineParameter(m_comCloudMachine);
    8481    else
    8582    {
     
    10299{
    103100    /* Determine attributes which are always available: */
    104     if (!m_guiCloudMachine.isNull())
    105     {
    106         m_strInstanceId = m_guiCloudMachine.instanceId();
    107         m_strName = m_guiCloudMachine.instanceName();
    108         m_uId = m_guiCloudMachine.id();
     101    if (!m_comCloudMachine.isNull())
     102    {
     103        m_uId = m_comCloudMachine.GetId();
     104        m_strName = m_comCloudMachine.GetName();
    109105    }
    110106
    111107    /* Now determine whether VM is accessible: */
    112     m_fAccessible = !m_guiCloudMachine.isNull()
    113                   ? m_guiCloudMachine.accessible()
    114                   : true;
    115     m_strAccessError = !m_guiCloudMachine.isNull()
    116                      ? m_guiCloudMachine.accessError()
    117                      : QString();
     108    m_fAccessible = /*!m_comCloudMachine.isNull()
     109                  ? m_comCloudMachine.accessible()
     110                  : */true;
     111    m_strAccessError = /*!m_comCloudMachine.isNull()
     112                     ? m_comCloudMachine.accessError()
     113                     : */QString();
    118114
    119115    /* Determine own VM attributes: */
    120     m_strOSTypeId = !m_guiCloudMachine.isNull()
    121                   ? m_guiCloudMachine.osType()
     116    m_strOSTypeId = !m_comCloudMachine.isNull()
     117                  ? m_comCloudMachine.GetOSTypeId()
    122118                  : "Other";
    123119
    124120    /* Determine VM states: */
    125     m_enmMachineState = !m_guiCloudMachine.isNull()
    126                       ? m_guiCloudMachine.machineState()
     121    m_enmMachineState = !m_comCloudMachine.isNull()
     122                      ? m_comCloudMachine.GetState()
    127123                      : KMachineState_PoweredOff;
    128124    m_strMachineStateName = gpConverter->toString(m_enmMachineState);
     
    283279    if (!m_pTask)
    284280    {
    285         m_pTask = new UITaskCloudGetInstanceInfo(m_guiCloudMachine);
     281        m_pTask = new UITaskCloudGetInstanceInfo(m_comCloudMachine);
    286282        connect(uiCommon().threadPoolCloud(), &UIThreadPool::sigTaskComplete,
    287283                this, &UIVirtualMachineItemCloud::sltHandleGetCloudInstanceInfoDone);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h

    r83290 r83654  
    2323
    2424/* GUI includes: */
    25 #include "UICloudMachine.h"
    2625#include "UIVirtualMachineItem.h"
     26
     27/* COM includes: */
     28#include "COMEnums.h"
     29#include "CCloudMachine.h"
    2730
    2831/* Forward declarations: */
     
    5154    /** Constructs fake cloud VM item. */
    5255    UIVirtualMachineItemCloud();
    53     /** Constructs real cloud VM item on the basis of taken @a guiCloudMachine. */
    54     UIVirtualMachineItemCloud(const UICloudMachine &guiCloudMachine);
     56    /** Constructs real cloud VM item on the basis of taken @a comCloudMachine. */
     57    UIVirtualMachineItemCloud(const CCloudMachine &comCloudMachine);
    5558    /** Destructs cloud VM item. */
    5659    virtual ~UIVirtualMachineItemCloud();
     
    5861    /** @name Arguments.
    5962      * @{ */
    60         /** Returns cached cloud VM object. */
    61         UICloudMachine machine() const { return m_guiCloudMachine; }
     63        /** Returns cached cloud machine object. */
     64        CCloudMachine machine() const { return m_comCloudMachine; }
    6265    /** @} */
    6366
     
    131134    /** @name Arguments.
    132135      * @{ */
    133         /** Holds cached cloud VM object reference. */
    134         UICloudMachine  m_guiCloudMachine;
    135     /** @} */
    136 
    137     /** @name Basic attributes.
    138       * @{ */
    139         /** Holds the cloud instance id. */
    140         QString  m_strInstanceId;
     136        /** Holds cached cloud machine object. */
     137        CCloudMachine  m_comCloudMachine;
    141138    /** @} */
    142139
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r83351 r83654  
    2929#include "UIVirtualMachineItem.h"
    3030#ifdef VBOX_GUI_WITH_CLOUD_VMS
    31 # include "UICloudMachine.h"
    3231# include "UITaskCloudAcquireInstances.h"
    3332# include "UIThreadPool.h"
     
    3938#ifdef VBOX_GUI_WITH_CLOUD_VMS
    4039# include "CCloudClient.h"
     40# include "CCloudMachine.h"
    4141# include "CCloudProfile.h"
    4242# include "CCloudProvider.h"
     
    297297    AssertReturnVoid(pFirstChildNodeMachine->cache()->itemType() == UIVirtualMachineItem::ItemType_CloudFake);
    298298
    299     /* And if we have at least one cloud instance: */
    300     const QList<UICloudMachine> instances = pAcquiringTask->result();
    301     if (!instances.isEmpty())
     299    /* And if we have at least one cloud machine: */
     300    const QVector<CCloudMachine> machines = pAcquiringTask->result();
     301    if (!machines.isEmpty())
    302302    {
    303303        /* Remove the "Empty" node: */
     
    306306        /* Add real cloud VM nodes: */
    307307        int iPosition = 0;
    308         foreach (const UICloudMachine &guiCloudMachine, instances)
     308        foreach (const CCloudMachine &comCloudMachine, machines)
    309309        {
    310310            /* Create new node: */
     
    312312                                                                   false /* favorite */,
    313313                                                                   iPosition++ /* position */,
    314                                                                    guiCloudMachine);
     314                                                                   comCloudMachine);
    315315            /* Request async node update: */
    316316            pNode->cache()->toCloud()->updateInfoAsync(false /* delayed? */);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp

    r83316 r83654  
    4141                                           bool fFavorite,
    4242                                           int iPosition,
    43                                            const UICloudMachine &guiCloudMachine)
     43                                           const CCloudMachine &comCloudMachine)
    4444    : UIChooserNode(pParent, fFavorite)
    45     , m_pCache(new UIVirtualMachineItemCloud(guiCloudMachine))
     45    , m_pCache(new UIVirtualMachineItemCloud(comCloudMachine))
    4646{
    4747    /* Add to parent: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h

    r83055 r83654  
    2626
    2727/* Forward declarations: */
    28 class UICloudMachine;
    2928class UIVirtualMachineItem;
     29class CCloudMachine;
    3030class CMachine;
    3131
     
    4949      * @param  fFavorite        Brings whether the node is favorite.
    5050      * @param  iPosition        Brings initial node position.
    51       * @param  guiCloudMachine  Brings cloud VM object. */
     51      * @param  comCloudMachine  Brings COM cloud machine object. */
    5252    UIChooserNodeMachine(UIChooserNode *pParent,
    5353                         bool fFavorite,
    5454                         int iPosition,
    55                          const UICloudMachine &guiCloudMachine);
     55                         const CCloudMachine &comCloudMachine);
    5656    /** Constructs chooser node for fake cloud VM passing @a pParent to the base-class.
    5757      * @param  fFavorite  Brings whether the node is favorite.
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp

    r83352 r83654  
    106106            {
    107107                /* Get cloud machine: */
    108                 m_cloudMachine = m_pMachineItem->toCloud()->machine();
     108//                m_cloudMachine = m_pMachineItem->toCloud()->machine();
    109109
    110110                /* Compose a list of types to build: */
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