VirtualBox

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


Ignore:
Timestamp:
Apr 22, 2020 12:22:03 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Shortcut for cache item type.

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

Legend:

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

    r83921 r83923  
    520520    AssertPtrReturnVoid(pFirstChildNodeMachine);
    521521    AssertPtrReturnVoid(pFirstChildNodeMachine->cache());
    522     AssertReturnVoid(pFirstChildNodeMachine->cache()->itemType() == UIVirtualMachineItemType_CloudFake);
     522    AssertReturnVoid(pFirstChildNodeMachine->cacheType() == UIVirtualMachineItemType_CloudFake);
    523523
    524524    /* And if we have at least one cloud machine: */
     
    979979    foreach (UIChooserNode *pNode, pParentGroup->nodes(UIChooserNodeType_Machine))
    980980        if (UIChooserNodeMachine *pMachineNode = pNode->toMachineNode())
    981             if (   pMachineNode->cache()->itemType() == UIVirtualMachineItemType_Local
     981            if (   pMachineNode->cacheType() == UIVirtualMachineItemType_Local
    982982                && pMachineNode->cache()->accessible())
    983983                definitions[toOldStyleUuid(pMachineNode->cache()->id())] << pParentGroup->fullName();
     
    10081008    foreach (UIChooserNode *pNode, pParentGroup->nodes(UIChooserNodeType_Machine))
    10091009        if (UIChooserNodeMachine *pMachineNode = pNode->toMachineNode())
    1010             if (   pMachineNode->cache()->itemType() == UIVirtualMachineItemType_Local
    1011                 || pMachineNode->cache()->itemType() == UIVirtualMachineItemType_CloudReal)
     1010            if (   pMachineNode->cacheType() == UIVirtualMachineItemType_Local
     1011                || pMachineNode->cacheType() == UIVirtualMachineItemType_CloudReal)
    10121012                orders[strExtraDataKey] << QString("m=%1").arg(toOldStyleUuid(pMachineNode->cache()->id()));
    10131013}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp

    r83921 r83923  
    726726        /* For local items: */
    727727        if (   node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Local
    728             && pMachineItem->node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_Local)
     728            && pMachineItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local)
    729729        {
    730730            /* Make sure passed machine isn't immutable within own group: */
     
    751751        else
    752752        if (   node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Profile
    753             && pMachineItem->node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_CloudReal)
     753            && pMachineItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_CloudReal)
    754754        {
    755755            /* Make sure passed item is ours: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r83921 r83923  
    297297    /* And machine-item content to take into account: */
    298298    int iTopLineWidth = m_iMinimumNameWidth;
    299     if (   node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_Local
     299    if (   node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local
    300300        && !node()->toMachineNode()->cache()->toLocal()->snapshotName().isEmpty())
    301301        iTopLineWidth += (iMinorSpacing +
     
    395395
    396396        /* No drops for cloud items: */
    397         if (   node()->toMachineNode()->cache()->itemType() != UIVirtualMachineItemType_Local
    398             || pMachineItem->node()->toMachineNode()->cache()->itemType() != UIVirtualMachineItemType_Local)
     397        if (   node()->toMachineNode()->cacheType() != UIVirtualMachineItemType_Local
     398            || pMachineItem->node()->toMachineNode()->cacheType() != UIVirtualMachineItemType_Local)
    399399            return false;
    400400        /* No drops for immutable item: */
     
    721721    int iMinimumSnapshotNameWidth = 0;
    722722    /* Is there any snapshot exists? */
    723     if (   node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_Local
     723    if (   node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local
    724724        && !node()->toMachineNode()->cache()->toLocal()->snapshotName().isEmpty())
    725725    {
     
    807807{
    808808    /* Make sure this is local machine item: */
    809     if (node()->toMachineNode()->cache()->itemType() != UIVirtualMachineItemType_Local)
     809    if (node()->toMachineNode()->cacheType() != UIVirtualMachineItemType_Local)
    810810        return;
    811811
     
    11131113
    11141114            /* Paint middle element: */
    1115             if (   node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_Local
     1115            if (   node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local
    11161116                && !node()->toMachineNode()->cache()->toLocal()->snapshotName().isEmpty())
    11171117            {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r83921 r83923  
    10561056    foreach (UIChooserItemMachine *pItem, inaccessibleMachineItemList)
    10571057    {
    1058         switch (pItem->node()->toMachineNode()->cache()->itemType())
     1058        switch (pItem->node()->toMachineNode()->cacheType())
    10591059        {
    10601060            case UIVirtualMachineItemType_Local:
     
    11501150        if (fVerdict)
    11511151        {
    1152             if (pItem->node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_Local)
     1152            if (pItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_Local)
    11531153                localMachinesToUnregister.append(pItem->node()->toMachineNode()->cache()->toLocal()->machine());
    1154             else if (pItem->node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_CloudReal)
     1154            else if (pItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_CloudReal)
    11551155                cloudMachinesToUnregister.append(pItem->node()->toMachineNode()->cache()->toCloud()->machine());
    11561156        }
     
    17391739                                                     UIChooserItemSearchFlag_ExactId);
    17401740        AssertPtrReturnVoid(pItem);
    1741         AssertReturnVoid(pItem->node()->toMachineNode()->cache()->itemType() == UIVirtualMachineItemType_CloudReal);
     1741        AssertReturnVoid(pItem->node()->toMachineNode()->cacheType() == UIVirtualMachineItemType_CloudReal);
    17421742        AssertPtrReturnVoid(pItem->parentItem());
    17431743        AssertPtrReturnVoid(pItem->parentItem()->parentItem());
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp

    r83921 r83923  
    7979{
    8080    /* Prepare cache of corresponding type: */
    81     switch (pCopyFrom->cache()->itemType())
     81    switch (pCopyFrom->cacheType())
    8282    {
    8383        case UIVirtualMachineItemType_Local:
     
    234234}
    235235
     236UIVirtualMachineItem *UIChooserNodeMachine::cache() const
     237{
     238    return m_pCache;
     239}
     240
     241UIVirtualMachineItemType UIChooserNodeMachine::cacheType() const
     242{
     243    return cache() ? cache()->itemType() : UIVirtualMachineItemType_Local;
     244}
     245
    236246void UIChooserNodeMachine::retranslateUi()
    237247{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h

    r83884 r83923  
    2424/* GUI includes: */
    2525#include "UIChooserNode.h"
     26#include "UIManagerDefs.h"
    2627
    2728/* Forward declarations: */
     
    106107
    107108    /** Returns virtual machine cache instance. */
    108     UIVirtualMachineItem *cache() const { return m_pCache; }
     109    UIVirtualMachineItem *cache() const;
     110    /** Returns virtual machine cache instance. */
     111    UIVirtualMachineItemType cacheType() const;
    109112
    110113protected:
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