VirtualBox

Changeset 83149 in vbox


Ignore:
Timestamp:
Feb 25, 2020 12:33:39 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Details pane: Make set and element items aware of chooser item type.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/details
Files:
4 edited

Legend:

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

    r82968 r83149  
    305305}
    306306
     307const UICloudMachine &UIDetailsElement::cloudMachine()
     308{
     309    return m_pSet->cloudMachine();
     310}
     311
     312bool UIDetailsElement::isLocal() const
     313{
     314    return m_pSet->isLocal();
     315}
     316
    307317void UIDetailsElement::setName(const QString &strName)
    308318{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h

    r82968 r83149  
    3434class QStateMachine;
    3535class QTextLayout;
     36class UICloudMachine;
    3637class UIDetailsSet;
    3738class UIGraphicsRotatorButton;
     
    159160        /** Returns cached machine reference. */
    160161        const CMachine &machine();
     162        /** Returns cached cloud machine reference. */
     163        const UICloudMachine &cloudMachine();
     164
     165        /** Returns whether element is of local type. */
     166        bool isLocal() const;
    161167
    162168        /** Defines element @a strName. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp

    r82968 r83149  
    2727#include "UIDetailsSet.h"
    2828#include "UIVirtualBoxEventHandler.h"
     29#include "UIVirtualMachineItemCloud.h"
    2930#include "UIVirtualMachineItemLocal.h"
    3031
     
    3839    , m_pMachineItem(0)
    3940    , m_fFullSet(true)
     41    , m_fIsLocal(true)
    4042    , m_fHasDetails(false)
    4143    , m_configurationAccessLevel(ConfigurationAccessLevel_Null)
     
    6668    /* Remember passed arguments: */
    6769    m_pMachineItem = pMachineItem;
    68     m_machine = m_pMachineItem->toLocal()->machine();
     70    m_fIsLocal = m_pMachineItem->itemType() == UIVirtualMachineItem::ItemType_Local;
    6971    m_fHasDetails = m_pMachineItem->hasDetails();
    7072    m_fFullSet = fFullSet;
     
    7274
    7375    /* Cleanup superfluous items: */
    74     if (!m_fFullSet || !m_fHasDetails)
    75     {
    76         int iFirstItem = m_fHasDetails ? DetailsElementType_Display : DetailsElementType_General;
     76    if (   !m_fHasDetails
     77        || !m_fIsLocal
     78        || !m_fFullSet)
     79    {
     80        int iFirstItem = !m_fHasDetails
     81                       ? DetailsElementType_General
     82                       : !m_fIsLocal
     83                       ? DetailsElementType_Preview
     84                       : DetailsElementType_Display;
    7785        int iLastItem = DetailsElementType_Description;
    7886        bool fCleanupPerformed = false;
     
    97105    }
    98106
    99     /* Choose last-step number: */
    100     m_iLastStepNumber = m_fFullSet ? DetailsElementType_Description : DetailsElementType_Preview;
    101 
    102     /* Fetch USB controller restrictions: */
    103     const CUSBDeviceFilters &filters = m_machine.GetUSBDeviceFilters();
    104     if (filters.isNull() || !m_machine.GetUSBProxyAvailable())
    105         m_settings.remove(DetailsElementType_USB);
     107    /* Special handling wrt item type: */
     108    switch (m_pMachineItem->itemType())
     109    {
     110        case UIVirtualMachineItem::ItemType_Local:
     111        {
     112            /* Get local machine: */
     113            m_machine = m_pMachineItem->toLocal()->machine();
     114
     115            /* Choose last-step number: */
     116            m_iLastStepNumber = m_fFullSet ? DetailsElementType_Description : DetailsElementType_Preview;
     117
     118            /* Fetch USB controller restrictions: */
     119            const CUSBDeviceFilters &filters = m_machine.GetUSBDeviceFilters();
     120            if (filters.isNull() || !m_machine.GetUSBProxyAvailable())
     121                m_settings.remove(DetailsElementType_USB);
     122
     123            break;
     124        }
     125        case UIVirtualMachineItem::ItemType_CloudReal:
     126        {
     127            /* Get cloud machine: */
     128            m_cloudMachine = m_pMachineItem->toCloud()->machine();
     129
     130            /* Choose last-step number: */
     131            m_iLastStepNumber = DetailsElementType_System;
     132
     133            break;
     134        }
     135        default:
     136            break;
     137    }
    106138
    107139    /* Start building set: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h

    r82968 r83149  
    2323
    2424/* GUI includes: */
     25#include "UICloudMachine.h"
    2526#include "UIDetailsItem.h"
    2627#include "UIExtraDataDefs.h"
     
    6162        /** Returns cached machine. */
    6263        const CMachine &machine() const { return m_machine; }
     64        /** Returns cached cloud machine. */
     65        const UICloudMachine &cloudMachine() const { return m_cloudMachine; }
     66
     67        /** Returns whether set is of local type. */
     68        bool isLocal() const { return m_fIsLocal; }
    6369        /** Returns whether set has cached details. */
    6470        bool hasDetails() const { return m_fHasDetails; }
     
    198204
    199205        /** Holds the machine reference. */
    200         CMachine                  m_machine;
     206        CMachine        m_machine;
     207        /** Holds the cloud machine reference. */
     208        UICloudMachine  m_cloudMachine;
     209
     210        /** Holds whether set is of local type. */
     211        bool                      m_fIsLocal;
    201212        /** Holds whether set has details. */
    202213        bool                      m_fHasDetails;
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