VirtualBox

Changeset 83700 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 15, 2020 1:48:33 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Implementing inaccessible item support for UIVirtualMachineItemCloud.

File:
1 edited

Legend:

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

    r83656 r83700  
    2323#include "UICommon.h"
    2424#include "UIConverter.h"
     25#include "UIErrorString.h"
    2526#include "UIIconPool.h"
    2627#include "UIMessageCenter.h"
     
    3132/* COM includes: */
    3233#include "CProgress.h"
     34#include "CVirtualBoxErrorInfo.h"
    3335
    3436
     
    106108
    107109    /* Now determine whether VM is accessible: */
    108     m_fAccessible = /*!m_comCloudMachine.isNull()
    109                   ? m_comCloudMachine.accessible()
    110                   : */true;
    111     m_strAccessError = /*!m_comCloudMachine.isNull()
    112                      ? m_comCloudMachine.accessError()
    113                      : */QString();
     110    m_fAccessible = !m_comCloudMachine.isNull()
     111                  ? m_comCloudMachine.GetAccessible()
     112                  : true;
     113    m_strAccessError =    !m_comCloudMachine.isNull()
     114                       && !m_comCloudMachine.GetAccessible()
     115                       && !m_comCloudMachine.GetAccessError().isNull()
     116                     ? UIErrorString::formatErrorInfo(m_comCloudMachine.GetAccessError())
     117                     : QString();
    114118
    115119    /* Determine own VM attributes: */
    116     m_strOSTypeId = !m_comCloudMachine.isNull()
     120    m_strOSTypeId =    !m_comCloudMachine.isNull()
     121                    && m_comCloudMachine.GetAccessible()
    117122                  ? m_comCloudMachine.GetOSTypeId()
    118123                  : "Other";
    119124
    120125    /* Determine VM states: */
    121     m_enmMachineState = !m_comCloudMachine.isNull()
     126    m_enmMachineState =    !m_comCloudMachine.isNull()
     127                        && m_comCloudMachine.GetAccessible()
    122128                      ? m_comCloudMachine.GetState()
    123129                      : KMachineState_PoweredOff;
     
    155161void UIVirtualMachineItemCloud::recachePixmap()
    156162{
    157     /* If machine is accessible: */
    158     if (m_fAccessible)
    159     {
    160         /* We are using icon corresponding to cached guest OS type: */
    161         if (   itemType() == ItemType_CloudFake
    162             && fakeCloudItemState() == FakeCloudItemState_Loading)
    163             m_pixmap = uiCommon().vmGuestOSTypePixmapDefault("Cloud", &m_logicalPixmapSize);
    164         else
    165             m_pixmap = uiCommon().vmGuestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
    166     }
    167     /* Otherwise: */
    168     else
    169     {
    170         /// @todo handle inaccessible cloud VM
    171     }
     163    /* We are using icon corresponding to cached guest OS type: */
     164    if (   itemType() == ItemType_CloudFake
     165        && fakeCloudItemState() == FakeCloudItemState_Loading)
     166        m_pixmap = uiCommon().vmGuestOSTypePixmapDefault("Cloud", &m_logicalPixmapSize);
     167    else
     168        m_pixmap = uiCommon().vmGuestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
    172169}
    173170
     
    227224{
    228225    /* If machine is accessible: */
    229     if (m_fAccessible)
     226    if (accessible())
    230227    {
    231228        if (itemType() == ItemType_CloudFake)
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