Changeset 77638 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
- Timestamp:
- Mar 10, 2019 7:21:30 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r77636 r77638 16 16 */ 17 17 18 /* Qt includes */19 //#include <QUuid>20 21 18 /* GUI includes: */ 22 19 #include "UIChooserNodeMachine.h" … … 25 22 UIChooserNodeMachine::UIChooserNodeMachine(UIChooserNode *pParent, 26 23 bool fFavorite, 24 int iPosition, 27 25 const CMachine &comMachine) 28 26 : UIChooserNode(pParent, fFavorite) 29 27 , UIVirtualMachineItem(comMachine) 30 28 { 29 if (parentNode()) 30 parentNode()->addNode(this, iPosition); 31 31 retranslateUi(); 32 } 33 34 UIChooserNodeMachine::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 45 UIChooserNodeMachine::~UIChooserNodeMachine() 46 { 47 delete item(); 48 if (parentNode()) 49 parentNode()->removeNode(this); 32 50 } 33 51 … … 58 76 } 59 77 78 bool UIChooserNodeMachine::hasNodes(UIChooserItemType enmType) const 79 { 80 Q_UNUSED(enmType); 81 AssertFailedReturn(false); 82 } 83 84 QList<UIChooserNode*> UIChooserNodeMachine::nodes(UIChooserItemType enmType) const 85 { 86 Q_UNUSED(enmType); 87 AssertFailedReturn(QList<UIChooserNode*>()); 88 } 89 90 void UIChooserNodeMachine::addNode(UIChooserNode *pNode, int iPosition) 91 { 92 Q_UNUSED(pNode); 93 Q_UNUSED(iPosition); 94 AssertFailedReturnVoid(); 95 } 96 97 void UIChooserNodeMachine::removeNode(UIChooserNode *pNode) 98 { 99 Q_UNUSED(pNode); 100 AssertFailedReturnVoid(); 101 } 102 103 void 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 113 void 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 127 int UIChooserNodeMachine::positionOf(UIChooserNode *pNode) 128 { 129 Q_UNUSED(pNode); 130 AssertFailedReturn(0); 131 } 132 60 133 void UIChooserNodeMachine::retranslateUi() 61 134 {
Note:
See TracChangeset
for help on using the changeset viewer.