VirtualBox

Changeset 96635 in vbox


Ignore:
Timestamp:
Sep 7, 2022 4:16:37 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9930: Always pass a list of VM items to Snapshot pane.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

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

    r96407 r96635  
    175175                    connect(m_pPaneSnapshots, &UISnapshotPane::sigCurrentItemChange,
    176176                            this, &UIToolPaneMachine::sigCurrentSnapshotItemChange);
    177                     m_pPaneSnapshots->setMachine(m_comMachine);
     177                    m_pPaneSnapshots->setMachineItems(m_items);
    178178
    179179                    /* Add into layout: */
     
    314314        m_pPaneDetails->setItems(m_items);
    315315    }
     316    /* Update snapshots pane if it is open: */
     317    if (isToolOpened(UIToolType_Snapshots))
     318    {
     319        AssertPtrReturnVoid(m_pPaneSnapshots);
     320        m_pPaneSnapshots->setMachineItems(m_items);
     321    }
    316322    /* Update logs pane if it is open: */
    317323    if (isToolOpened(UIToolType_Logs))
     
    334340}
    335341
    336 void UIToolPaneMachine::setMachine(const CMachine &comMachine)
    337 {
    338     /* Cache passed value: */
    339     m_comMachine = comMachine;
    340 
    341     /* Update snapshots pane is it is open: */
    342     if (isToolOpened(UIToolType_Snapshots))
    343     {
    344         AssertPtrReturnVoid(m_pPaneSnapshots);
    345         m_pPaneSnapshots->setMachine(m_comMachine);
    346     }
    347 }
    348 
    349342bool UIToolPaneMachine::isCurrentStateItemSelected() const
    350343{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h

    r96407 r96635  
    105105    void setItems(const QList<UIVirtualMachineItem*> &items);
    106106
    107     /** Defines the @a comMachine object. */
    108     void setMachine(const CMachine &comMachine);
    109 
    110107    /** Returns whether current-state item of Snapshot pane is selected. */
    111108    bool isCurrentStateItemSelected() const;
     
    152149    /** Holds the cache of passed items. */
    153150    QList<UIVirtualMachineItem*>  m_items;
    154     /** Holds the cache of passed machine. */
    155     CMachine                      m_comMachine;
    156151};
    157152
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r96407 r96635  
    11141114        if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    11151115            sltHandleToolsPaneIndexChange();
    1116 
    1117         /* Propagate current items to update the Details-pane: */
    1118         m_pPaneToolsMachine->setItems(currentItems());
    1119         /* Propagate current machine to update the Snapshots-pane or/and Logviewer-pane: */
    1120         if (pItem->itemType() == UIVirtualMachineItemType_Local)
    1121             m_pPaneToolsMachine->setMachine(pItem->toLocal()->machine());
    11221116    }
    11231117    else
     
    11331127                m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
    11341128        }
    1135 
    1136         /* Propagate current items to update the Details-pane (in any case): */
    1137         m_pPaneToolsMachine->setItems(currentItems());
    1138         /* Propagate current machine to update the Snapshots-pane or/and Logviewer-pane (in any case): */
    1139         m_pPaneToolsMachine->setMachine(CMachine());
    1140     }
    1141 }
     1129    }
     1130
     1131    /* Propagate current items to update the Details-pane: */
     1132    m_pPaneToolsMachine->setItems(currentItems());
     1133}
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r96407 r96635  
    5757#include "UITranslator.h"
    5858#include "UIVirtualBoxEventHandler.h"
     59#include "UIVirtualMachineItem.h"
     60#include "UIVirtualMachineItemLocal.h"
    5961#include "UIWizardCloneVM.h"
    6062
     
    500502    , m_pDetailsWidget(0)
    501503{
    502     /* Prepare: */
    503504    prepare();
    504505}
     
    506507UISnapshotPane::~UISnapshotPane()
    507508{
    508     /* Cleanup: */
    509509    cleanup();
    510510}
    511511
    512 void UISnapshotPane::setMachine(const CMachine &comMachine)
     512void UISnapshotPane::setMachineItems(const QList<UIVirtualMachineItem*> &items)
    513513{
    514514    /* Cache passed machine: */
    515     m_comMachine = comMachine;
     515    m_comMachine = items.isEmpty() ? CMachine() : items.first()->toLocal()->machine();
    516516
    517517    /* Cache machine details: */
     
    524524    else
    525525    {
    526         m_uMachineId = comMachine.GetId();
    527         m_enmSessionState = comMachine.GetSessionState();
     526        m_uMachineId = m_comMachine.GetId();
     527        m_enmSessionState = m_comMachine.GetSessionState();
    528528        m_fShapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(m_uMachineId);
    529529    }
     
    12131213    loadSettings();
    12141214
    1215 
     1215    /* Register help topic: */
    12161216    uiCommon().setHelpKeyword(this, "snapshots");
    12171217
     
    14321432{
    14331433    /* Create a child of passed item: */
    1434     UISnapshotItem *pSnapshotItem = pItem ? new UISnapshotItem(this, pItem, comSnapshot) :
    1435                                             new UISnapshotItem(this, m_pSnapshotTree, comSnapshot);
     1434    UISnapshotItem *pSnapshotItem = pItem ? new UISnapshotItem(this, pItem, comSnapshot)
     1435                                          : new UISnapshotItem(this, m_pSnapshotTree, comSnapshot);
    14361436    /* And recache it's content: */
    14371437    pSnapshotItem->recache();
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.h

    r96407 r96635  
    5151class UISnapshotItem;
    5252class UISnapshotTree;
     53class UIVirtualMachineItem;
    5354
    5455
     
    8182    virtual ~UISnapshotPane() RT_OVERRIDE;
    8283
    83     /** Defines the @a comMachine object to be parsed. */
    84     void setMachine(const CMachine &comMachine);
     84    /** Defines the machine @a items to be parsed. */
     85    void setMachineItems(const QList<UIVirtualMachineItem*> &items);
    8586
    8687    /** Returns cached snapshot-item icon depending on @a fOnline flag. */
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