Changeset 84373 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 19, 2020 3:34:13 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r84371 r84373 941 941 foreach (UIChooserNode *pNode, pParentGroup->nodes(UIChooserNodeType_Global)) 942 942 { 943 const QString strGlobalDescriptor(pNode->isFavorite() ? "nf" : "n"); 944 orders[strExtraDataKey] << QString("%1=GLOBAL").arg(strGlobalDescriptor); 943 /* Append node definition: */ 944 AssertPtrReturnVoid(pNode); 945 orders[strExtraDataKey] << pNode->definition(true /* full */); 945 946 } 946 947 /* Iterate over all the group-nodes: */ 947 948 foreach (UIChooserNode *pNode, pParentGroup->nodes(UIChooserNodeType_Group)) 948 949 { 949 const QString strGroupDescriptor(pNode->toGroupNode()->isOpened() ? "go" : "gc"); 950 orders[strExtraDataKey] << QString("%1=%2").arg(strGroupDescriptor, pNode->name()); 950 /* Append node definition: */ 951 AssertPtrReturnVoid(pNode); 952 orders[strExtraDataKey] << pNode->definition(true /* full */); 953 /* Go recursively through children: */ 951 954 gatherGroupOrders(orders, pNode); 952 955 } … … 958 961 UIChooserNodeMachine *pMachineNode = pNode->toMachineNode(); 959 962 AssertPtrReturnVoid(pMachineNode); 960 /* Make sure it's local or real cloud machine node exactly: */963 /* Append node definition, make sure it's local or real cloud machine node only: */ 961 964 if ( pMachineNode->cacheType() == UIVirtualMachineItemType_Local 962 965 || pMachineNode->cacheType() == UIVirtualMachineItemType_CloudReal) 963 orders[strExtraDataKey] << QString("m=%1").arg(toOldStyleUuid(pMachineNode->id()));966 orders[strExtraDataKey] << pNode->definition(true /* full */); 964 967 } 965 968 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNode.h
r83884 r84373 87 87 /** Returns item description. */ 88 88 virtual QString description() const = 0; 89 /** Returns item definition. */ 90 virtual QString definition() const = 0; 89 /** Returns item definition. 90 * @param fFull Brings whether full definition is required 91 * which is used while saving group definitions, 92 * otherwise short definition will be returned, 93 * which is used while saving last chosen node. */ 94 virtual QString definition(bool fFull = false) const = 0; 91 95 92 96 /** Returns whether there are children of certain @a enmType. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGlobal.cpp
r83884 r84373 75 75 } 76 76 77 QString UIChooserNodeGlobal::definition( ) const77 QString UIChooserNodeGlobal::definition(bool fFull /* = false */) const 78 78 { 79 return QString("n=%1").arg("GLOBAL"); 79 return fFull 80 ? QString("n%1=%2").arg(isFavorite() ? "f" : "").arg("GLOBAL") 81 : QString("n=%1").arg("GLOBAL"); 80 82 } 81 83 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGlobal.h
r83884 r84373 59 59 /** Returns item description. */ 60 60 virtual QString description() const /* override */; 61 /** Returns item definition. */ 62 virtual QString definition() const /* override */; 61 /** Returns item definition. 62 * @param fFull Brings whether full definition is required 63 * which is used while saving group definitions, 64 * otherwise short definition will be returned, 65 * which is used while saving last chosen node. */ 66 virtual QString definition(bool fFull = false) const /* override */; 63 67 64 68 /** Returns whether there are children of certain @a enmType. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.cpp
r84371 r84373 105 105 } 106 106 107 QString UIChooserNodeGroup::definition() const 108 { 109 return QString("g=%1").arg(fullName()); 107 QString UIChooserNodeGroup::definition(bool fFull /* = false */) const 108 { 109 return fFull 110 ? QString("g%1=%2").arg(isOpened() ? "o" : "").arg(name()) 111 : QString("g=%1").arg(fullName()); 110 112 } 111 113 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.h
r83884 r84373 63 63 /** Returns item description. */ 64 64 virtual QString description() const /* override */; 65 /** Returns item definition. */ 66 virtual QString definition() const /* override */; 65 /** Returns item definition. 66 * @param fFull Brings whether full definition is required 67 * which is used while saving group definitions, 68 * otherwise short definition will be returned, 69 * which is used while saving last chosen node. */ 70 virtual QString definition(bool fFull = false) const /* override */; 67 71 68 72 /** Returns whether there are children of certain @a enmType. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r83946 r84373 136 136 } 137 137 138 QString UIChooserNodeMachine::definition( ) const138 QString UIChooserNodeMachine::definition(bool) const 139 139 { 140 140 return QString("m=%1").arg(UIChooserAbstractModel::toOldStyleUuid(id())); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h
r83946 r84373 79 79 /** Returns item description. */ 80 80 virtual QString description() const /* override */; 81 /** Returns item definition. */ 82 virtual QString definition() const /* override */; 81 /** Returns item definition. 82 * @param fFull Brings whether full definition is required 83 * which is used while saving group definitions, 84 * otherwise short definition will be returned, 85 * which is used while saving last chosen node. */ 86 virtual QString definition(bool fFull = false) const /* override */; 83 87 84 88 /** Returns whether there are children of certain @a enmType. */
Note:
See TracChangeset
for help on using the changeset viewer.