VirtualBox

Changeset 84196 in vbox


Ignore:
Timestamp:
May 8, 2020 4:02:37 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137804
Message:

OCI: switch ICloudMachine::state from MachineState (local VM state
enum) to CloudMachineState. Remove the temporary mapping in the GUI
that isolated the impact of this API change in preparation to it.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

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

    r84099 r84196  
    434434
    435435bool UICloudNetworkingStuff::cloudMachineState(const CCloudMachine &comCloudMachine,
    436                                                KMachineState &enmResult,
     436                                               KCloudMachineState &enmResult,
    437437                                               QWidget *pParent /* = 0 */)
    438438{
    439     const KMachineState enmState = comCloudMachine.GetState();
     439    const KCloudMachineState enmState = comCloudMachine.GetState();
    440440    if (!comCloudMachine.isOk())
    441441        msgCenter().cannotAcquireCloudMachineParameter(comCloudMachine, pParent);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h

    r84099 r84196  
    135135    /** Acquires @a comCloudMachine state as a @a enmResult, using @a pParent to show messages according to. */
    136136    SHARED_LIBRARY_STUFF bool cloudMachineState(const CCloudMachine &comCloudMachine,
    137                                                 KMachineState &enmResult,
     137                                                KCloudMachineState &enmResult,
    138138                                                QWidget *pParent = 0);
    139139
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp

    r84189 r84196  
    129129            /* Determine whether VM is accessible: */
    130130            m_fAccessible = m_comCloudMachine.GetAccessible();
    131             m_strAccessError = !m_fAccessible ? UIErrorString::formatErrorInfo(m_comCloudMachine.GetAccessError()) : QString();
     131            CVirtualBoxErrorInfo comInfo = m_comCloudMachine.GetAccessError();
     132            if (!m_fAccessible && comInfo.isNull())
     133                LogRel(("UIVirtualMachineItemCloud::recache: Error info is NULL for inaccessible VM.\n"));
     134            m_strAccessError = !m_fAccessible && !comInfo.isNull() ? UIErrorString::formatErrorInfo(comInfo) : QString();
    132135
    133136            /* Determine VM OS type: */
     
    135138
    136139            /* Determine VM states: */
    137             m_enmMachineState = m_fAccessible ? toCloudMachineState(m_comCloudMachine.GetState()) : KCloudMachineState_Stopped;
     140            m_enmMachineState = m_fAccessible ? m_comCloudMachine.GetState() : KCloudMachineState_Stopped;
    138141            m_strMachineStateName = gpConverter->toString(m_enmMachineState);
    139142            m_machineStateIcon = gpConverter->toIcon(m_enmMachineState);
     
    303306    emit sigStateChange();
    304307}
    305 
    306 /* static */
    307 KCloudMachineState UIVirtualMachineItemCloud::toCloudMachineState(KMachineState enmState)
    308 {
    309     switch (enmState)
    310     {
    311         case KMachineState_Starting:   return KCloudMachineState_Starting;
    312         case KMachineState_Running:    return KCloudMachineState_Running;
    313         case KMachineState_Stopping:   return KCloudMachineState_Stopping;
    314         case KMachineState_PoweredOff: return KCloudMachineState_Stopped;
    315         default:                       return KCloudMachineState_Stopped;
    316     }
    317 }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h

    r84189 r84196  
    125125private:
    126126
    127     /** Temporary! Converts state from KMachineState to KCloudMachineState. */
    128     static KCloudMachineState toCloudMachineState(KMachineState enmState);
    129 
    130127    /** @name Arguments.
    131128      * @{ */
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r84176 r84196  
    2674326743    </attribute>
    2674426744
    26745     <attribute name="state" type="MachineState" readonly="yes">
     26745    <attribute name="state" type="CloudMachineState" readonly="yes">
    2674626746      <desc>
    2674726747        Machine state.
     
    2683326833          Virtual machine must be Running, to be powered down.
    2683426834        </result>
     26835      </desc>
     26836      <param name="progress" type="IProgress" dir="return">
     26837        <desc>
     26838          Progress object to track the operation completion.
     26839        </desc>
     26840      </param>
     26841    </method>
     26842
     26843    <method name="terminate">
     26844      <desc>
     26845        Terminate cloud virtual machine.
    2683526846      </desc>
    2683626847      <param name="progress" type="IProgress" dir="return">
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