Changeset 84625 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 1, 2020 4:44:39 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138365
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r84610 r84625 574 574 } 575 575 576 void UIChooserAbstractModel::performSearch(const QString &strSearchTerm, int i ItemSearchFlags)576 void UIChooserAbstractModel::performSearch(const QString &strSearchTerm, int iSearchFlags) 577 577 { 578 578 /* Make sure invisible root exists: */ … … 591 591 592 592 /* Search for all the nodes matching required condition: */ 593 invisibleRoot()->searchForNodes(strSearchTerm, i ItemSearchFlags, m_searchResults);593 invisibleRoot()->searchForNodes(strSearchTerm, iSearchFlags, m_searchResults); 594 594 595 595 /* Assign/reset the disabled flag for required nodes: */ 596 596 foreach (UIChooserNode *pNode, nodes) 597 597 { 598 if (!pNode) 599 continue; 598 AssertPtrReturnVoid(pNode); 600 599 pNode->setDisabled(!m_searchResults.contains(pNode)); 601 600 } … … 610 609 AssertPtrReturn(invisibleRoot(), nodes); 611 610 612 /* Calling UIChooserNode::searchForNodes with an empty search string611 /* Calling UIChooserNode::searchForNodes with an empty search term 613 612 * returns a list all nodes (of the whole tree) of the required type: */ 614 613 invisibleRoot()->searchForNodes(QString(), UIChooserItemSearchFlag_Machine, nodes); … … 617 616 foreach (UIChooserNode *pNode, nodes) 618 617 { 619 if (!pNode) 620 continue; 618 AssertPtrReturn(pNode, nodes); 621 619 pNode->setDisabled(false); 622 620 } … … 625 623 m_searchResults.clear(); 626 624 627 /* Return 625 /* Return nodes: */ 628 626 return nodes; 629 627 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
r84592 r84625 91 91 /** @name Search stuff. 92 92 * @{ */ 93 /** Performs a search starting from the m_pInvisibleRootNode. */94 virtual void performSearch(const QString &strSearchTerm, int i ItemSearchFlags);95 /** Cleans the search result data members and disables item's visual effects.93 /** Performs a search using @a strSearchTerm and @a iSearchFlags specified. */ 94 virtual void performSearch(const QString &strSearchTerm, int iSearchFlags); 95 /** Resets the search result data members and disables item's visual effects. 96 96 * Also returns a list of all nodes which may be utilized by the calling code. */ 97 97 virtual QList<UIChooserNode*> resetSearch(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h
r84583 r84625 168 168 virtual void removeItem(UIChooserItem *pItem) = 0; 169 169 170 /** Searches for a first child item answering to specified @a strSearchTag and @a i ItemSearchFlags. */171 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int i ItemSearchFlags) = 0;170 /** Searches for a first child item answering to specified @a strSearchTag and @a iSearchFlags. */ 171 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int iSearchFlags) = 0; 172 172 173 173 /** Searches for a first machine child item. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r83924 r84625 210 210 } 211 211 212 UIChooserItem *UIChooserItemGlobal::searchForItem(const QString &, int i ItemSearchFlags)212 UIChooserItem *UIChooserItemGlobal::searchForItem(const QString &, int iSearchFlags) 213 213 { 214 214 /* Ignore if we are not searching for the global-item: */ 215 if (!(i ItemSearchFlags & UIChooserItemSearchFlag_Global))215 if (!(iSearchFlags & UIChooserItemSearchFlag_Global)) 216 216 return 0; 217 217 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.h
r83924 r84625 110 110 virtual void removeItem(UIChooserItem *pItem) /* override */; 111 111 112 /** Searches for a first child item answering to specified @a strSearchTag and @a i ItemSearchFlags. */113 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int i ItemSearchFlags) /* override */;112 /** Searches for a first child item answering to specified @a strSearchTag and @a iSearchFlags. */ 113 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int iSearchFlags) /* override */; 114 114 115 115 /** Searches for a first machine child item. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r84610 r84625 494 494 } 495 495 496 UIChooserItem* UIChooserItemGroup::searchForItem(const QString &strSearchTag, int i ItemSearchFlags)496 UIChooserItem* UIChooserItemGroup::searchForItem(const QString &strSearchTag, int iSearchFlags) 497 497 { 498 498 /* Are we searching among group-items? */ 499 if ( ( i ItemSearchFlags & UIChooserItemSearchFlag_LocalGroup499 if ( ( iSearchFlags & UIChooserItemSearchFlag_LocalGroup 500 500 && groupType() == UIChooserNodeGroupType_Local) 501 || ( i ItemSearchFlags & UIChooserItemSearchFlag_CloudProvider501 || ( iSearchFlags & UIChooserItemSearchFlag_CloudProvider 502 502 && groupType() == UIChooserNodeGroupType_Provider) 503 || ( i ItemSearchFlags & UIChooserItemSearchFlag_CloudProfile503 || ( iSearchFlags & UIChooserItemSearchFlag_CloudProfile 504 504 && groupType() == UIChooserNodeGroupType_Profile)) 505 505 { 506 506 /* Are we searching by the exact ID? */ 507 if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactId)507 if (iSearchFlags & UIChooserItemSearchFlag_ExactId) 508 508 { 509 509 /* Exact full-name matches? */ … … 512 512 } 513 513 /* Are we searching by the exact name? */ 514 else if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactName)514 else if (iSearchFlags & UIChooserItemSearchFlag_ExactName) 515 515 { 516 516 /* Exact name matches? */ … … 529 529 /* Search among all the children, but machines first: */ 530 530 foreach (UIChooserItem *pItem, items(UIChooserNodeType_Machine)) 531 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, i ItemSearchFlags))531 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iSearchFlags)) 532 532 return pFoundItem; 533 533 foreach (UIChooserItem *pItem, items(UIChooserNodeType_Global)) 534 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, i ItemSearchFlags))534 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iSearchFlags)) 535 535 return pFoundItem; 536 536 foreach (UIChooserItem *pItem, items(UIChooserNodeType_Group)) 537 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, i ItemSearchFlags))537 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iSearchFlags)) 538 538 return pFoundItem; 539 539 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r84400 r84625 160 160 virtual void removeItem(UIChooserItem *pItem) /* override */; 161 161 162 /** Searches for a first child item answering to specified @a strSearchTag and @a i ItemSearchFlags. */163 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int i ItemSearchFlags) /* override */;162 /** Searches for a first child item answering to specified @a strSearchTag and @a iSearchFlags. */ 163 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int iSearchFlags) /* override */; 164 164 165 165 /** Searches for a first machine child item. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r84610 r84625 265 265 } 266 266 267 UIChooserItem* UIChooserItemMachine::searchForItem(const QString &strSearchTag, int i ItemSearchFlags)267 UIChooserItem* UIChooserItemMachine::searchForItem(const QString &strSearchTag, int iSearchFlags) 268 268 { 269 269 /* Ignore if we are not searching for the machine-item: */ 270 if (!(i ItemSearchFlags & UIChooserItemSearchFlag_Machine))270 if (!(iSearchFlags & UIChooserItemSearchFlag_Machine)) 271 271 return 0; 272 272 273 273 /* Are we searching by the exact ID? */ 274 if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactId)274 if (iSearchFlags & UIChooserItemSearchFlag_ExactId) 275 275 { 276 276 /* Exact ID doesn't match? */ … … 279 279 } 280 280 /* Are we searching by the exact name? */ 281 else if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactName)281 else if (iSearchFlags & UIChooserItemSearchFlag_ExactName) 282 282 { 283 283 /* Exact name doesn't match? */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h
r83946 r84625 125 125 virtual void removeItem(UIChooserItem *pItem) /* override */; 126 126 127 /** Searches for a first child item answering to specified @a strSearchTag and @a i ItemSearchFlags. */128 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int i ItemSearchFlags) /* override */;127 /** Searches for a first child item answering to specified @a strSearchTag and @a iSearchFlags. */ 128 virtual UIChooserItem *searchForItem(const QString &strSearchTag, int iSearchFlags) /* override */; 129 129 130 130 /** Searches for a first machine child item. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r84624 r84625 512 512 } 513 513 514 void UIChooserModel::performSearch(const QString &strSearchTerm, int i ItemSearchFlags)514 void UIChooserModel::performSearch(const QString &strSearchTerm, int iSearchFlags) 515 515 { 516 516 /* Call to base-class: */ 517 UIChooserAbstractModel::performSearch(strSearchTerm, i ItemSearchFlags);517 UIChooserAbstractModel::performSearch(strSearchTerm, iSearchFlags); 518 518 519 519 /* Select 1st found item: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r84624 r84625 198 198 /** @name Search stuff. 199 199 * @{ */ 200 /** Performs a search starting from the m_pInvisibleRootNode. */201 virtual void performSearch(const QString &strSearchTerm, int i ItemSearchFlags) /* override */;202 /** Cleans the search result data members and disables item's visual effects.200 /** Performs a search using @a strSearchTerm and @a iSearchFlags specified. */ 201 virtual void performSearch(const QString &strSearchTerm, int iSearchFlags) /* override */; 202 /** Resets the search result data members and disables item's visual effects. 203 203 * Also returns a list of all nodes which may be utilized by the calling code. */ 204 204 virtual QList<UIChooserNode*> resetSearch() /* override */; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNode.h
r84373 r84625 119 119 UIChooserItem *item() const { return m_pItem.data(); } 120 120 121 /** Performs search wrt. @a strSearchTerm and @a i ItemSearchFlags and updates @a matchedItems. For an empty122 * @a strSearchTerm all items are added wrt. node type from @a i ItemSearchFlags. */123 virtual void searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems) = 0;121 /** Performs search wrt. @a strSearchTerm and @a iSearchFlags and updates @a matchedItems. For an empty 122 * @a strSearchTerm all items are added wrt. node type from @a iSearchFlags. */ 123 virtual void searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) = 0; 124 124 125 125 /** Performs sorting of children nodes. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGlobal.cpp
r84610 r84625 130 130 } 131 131 132 void UIChooserNodeGlobal::searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems)132 void UIChooserNodeGlobal::searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) 133 133 { 134 134 /* Ignore if we are not searching for the global-node: */ 135 if (!(i ItemSearchFlags & UIChooserItemSearchFlag_Global))135 if (!(iSearchFlags & UIChooserItemSearchFlag_Global)) 136 136 return; 137 137 … … 142 142 { 143 143 /* If exact name flag specified => check full node name: */ 144 if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactName)144 if (iSearchFlags & UIChooserItemSearchFlag_ExactName) 145 145 { 146 146 if (name() == strSearchTerm) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGlobal.h
r84610 r84625 84 84 virtual int positionOf(UIChooserNode *pNode) /* override */; 85 85 86 /** Updates the @a matchedItems wrt. @strSearchTerm and @a i ItemSearchFlags. */87 virtual void searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems) /* override */;86 /** Updates the @a matchedItems wrt. @strSearchTerm and @a iSearchFlags. */ 87 virtual void searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) /* override */; 88 88 89 89 /** Performs sorting of children nodes. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.cpp
r84611 r84625 224 224 } 225 225 226 void UIChooserNodeGroup::searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems)226 void UIChooserNodeGroup::searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) 227 227 { 228 228 /* If we are searching for the group-node: */ 229 if ( ( i ItemSearchFlags & UIChooserItemSearchFlag_LocalGroup229 if ( ( iSearchFlags & UIChooserItemSearchFlag_LocalGroup 230 230 && groupType() == UIChooserNodeGroupType_Local) 231 || ( i ItemSearchFlags & UIChooserItemSearchFlag_CloudProvider231 || ( iSearchFlags & UIChooserItemSearchFlag_CloudProvider 232 232 && groupType() == UIChooserNodeGroupType_Provider) 233 || ( i ItemSearchFlags & UIChooserItemSearchFlag_CloudProfile233 || ( iSearchFlags & UIChooserItemSearchFlag_CloudProfile 234 234 && groupType() == UIChooserNodeGroupType_Profile)) 235 235 { … … 240 240 { 241 241 /* If exact ID flag specified => check full node name: */ 242 if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactId)242 if (iSearchFlags & UIChooserItemSearchFlag_ExactId) 243 243 { 244 244 if (fullName() == strSearchTerm) … … 246 246 } 247 247 /* If exact name flag specified => check node name: */ 248 else if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactName)248 else if (iSearchFlags & UIChooserItemSearchFlag_ExactName) 249 249 { 250 250 if (name() == strSearchTerm) … … 262 262 /* Search among all the children: */ 263 263 foreach (UIChooserNode *pNode, m_nodesGroup) 264 pNode->searchForNodes(strSearchTerm, i ItemSearchFlags, matchedItems);264 pNode->searchForNodes(strSearchTerm, iSearchFlags, matchedItems); 265 265 foreach (UIChooserNode *pNode, m_nodesGlobal) 266 pNode->searchForNodes(strSearchTerm, i ItemSearchFlags, matchedItems);266 pNode->searchForNodes(strSearchTerm, iSearchFlags, matchedItems); 267 267 foreach (UIChooserNode *pNode, m_nodesMachine) 268 pNode->searchForNodes(strSearchTerm, i ItemSearchFlags, matchedItems);268 pNode->searchForNodes(strSearchTerm, iSearchFlags, matchedItems); 269 269 } 270 270 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.h
r84610 r84625 102 102 void close() { m_fOpened = false; } 103 103 104 /** Recursively searches for a children wrt. @a strSearchTerm and @a i ItemSearchFlags and updates the @a matchedItems. */105 virtual void searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems) /* override */;104 /** Recursively searches for a children wrt. @a strSearchTerm and @a iSearchFlags and updates the @a matchedItems. */ 105 virtual void searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) /* override */; 106 106 107 107 /** Performs sorting of children nodes. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r84610 r84625 195 195 } 196 196 197 void UIChooserNodeMachine::searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems)197 void UIChooserNodeMachine::searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) 198 198 { 199 199 /* Ignore if we are not searching for the machine-node: */ 200 if (!(i ItemSearchFlags & UIChooserItemSearchFlag_Machine))200 if (!(iSearchFlags & UIChooserItemSearchFlag_Machine)) 201 201 return; 202 202 … … 207 207 { 208 208 /* If exact ID flag specified => check node ID: */ 209 if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactId)209 if (iSearchFlags & UIChooserItemSearchFlag_ExactId) 210 210 { 211 211 if (id() == QUuid(strSearchTerm)) … … 213 213 } 214 214 /* If exact name flag specified => check full node name: */ 215 else if (i ItemSearchFlags & UIChooserItemSearchFlag_ExactName)215 else if (iSearchFlags & UIChooserItemSearchFlag_ExactName) 216 216 { 217 217 if (name() == strSearchTerm) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h
r84610 r84625 100 100 virtual int positionOf(UIChooserNode *pNode) /* override */; 101 101 102 /** Checks if this instance matches to search wrt. @a strSearchTerm and @a i ItemSearchFlags and updates @a matchedItems. */103 virtual void searchForNodes(const QString &strSearchTerm, int i ItemSearchFlags, QList<UIChooserNode*> &matchedItems) /* override */;102 /** Checks if this instance matches to search wrt. @a strSearchTerm and @a iSearchFlags and updates @a matchedItems. */ 103 virtual void searchForNodes(const QString &strSearchTerm, int iSearchFlags, QList<UIChooserNode*> &matchedItems) /* override */; 104 104 105 105 /** Performs sorting of children nodes. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserSearchWidget.h
r84587 r84625 41 41 signals: 42 42 43 void sigRedoSearch(const QString &strSearchTerm, int i ItemSearchFlags);43 void sigRedoSearch(const QString &strSearchTerm, int iSearchFlags); 44 44 /** Is being signalled as next/prev tool buttons are pressed. @a fIsNext is true 45 45 * for the next and false for the previous case. */
Note:
See TracChangeset
for help on using the changeset viewer.