VirtualBox

Ignore:
Timestamp:
Mar 10, 2019 7:21:30 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager UI: Chooser pane: Rework chooser pane to populate invisible nodes tree first of all; visible item tree is now buildable on demand and can be built for any particular node and deeper.

File:
1 edited

Legend:

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

    r77636 r77638  
    1616 */
    1717
    18 /* Qt includes */
    19 //#include <QUuid>
    20 
    2118/* GUI includes: */
    2219#include "UIChooserNodeMachine.h"
     
    2522UIChooserNodeMachine::UIChooserNodeMachine(UIChooserNode *pParent,
    2623                                           bool fFavorite,
     24                                           int  iPosition,
    2725                                           const CMachine &comMachine)
    2826    : UIChooserNode(pParent, fFavorite)
    2927    , UIVirtualMachineItem(comMachine)
    3028{
     29    if (parentNode())
     30        parentNode()->addNode(this, iPosition);
    3131    retranslateUi();
     32}
     33
     34UIChooserNodeMachine::UIChooserNodeMachine(UIChooserNode *pParent,
     35                                           UIChooserNodeMachine *pCopyFrom,
     36                                           int iPosition)
     37    : UIChooserNode(pParent, pCopyFrom->isFavorite())
     38    , UIVirtualMachineItem(pCopyFrom->machine())
     39{
     40    if (parentNode())
     41        parentNode()->addNode(this, iPosition);
     42    retranslateUi();
     43}
     44
     45UIChooserNodeMachine::~UIChooserNodeMachine()
     46{
     47    delete item();
     48    if (parentNode())
     49        parentNode()->removeNode(this);
    3250}
    3351
     
    5876}
    5977
     78bool UIChooserNodeMachine::hasNodes(UIChooserItemType enmType) const
     79{
     80    Q_UNUSED(enmType);
     81    AssertFailedReturn(false);
     82}
     83
     84QList<UIChooserNode*> UIChooserNodeMachine::nodes(UIChooserItemType enmType) const
     85{
     86    Q_UNUSED(enmType);
     87    AssertFailedReturn(QList<UIChooserNode*>());
     88}
     89
     90void UIChooserNodeMachine::addNode(UIChooserNode *pNode, int iPosition)
     91{
     92    Q_UNUSED(pNode);
     93    Q_UNUSED(iPosition);
     94    AssertFailedReturnVoid();
     95}
     96
     97void UIChooserNodeMachine::removeNode(UIChooserNode *pNode)
     98{
     99    Q_UNUSED(pNode);
     100    AssertFailedReturnVoid();
     101}
     102
     103void UIChooserNodeMachine::removeAllNodes(const QUuid &uId)
     104{
     105    /* Skip other ids: */
     106    if (id() != uId)
     107        return;
     108
     109    /* Remove this node: */
     110    delete this;
     111}
     112
     113void UIChooserNodeMachine::updateAllNodes(const QUuid &uId)
     114{
     115    /* Skip other ids: */
     116    if (id() != uId)
     117        return;
     118
     119    /* Update machine-node: */
     120    recache();
     121
     122    /* Update machine-item: */
     123    if (item())
     124        item()->updateItem();
     125}
     126
     127int UIChooserNodeMachine::positionOf(UIChooserNode *pNode)
     128{
     129    Q_UNUSED(pNode);
     130    AssertFailedReturn(0);
     131}
     132
    60133void UIChooserNodeMachine::retranslateUi()
    61134{
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