Changeset 43615 in vbox
- Timestamp:
- Oct 11, 2012 11:34:53 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
r43604 r43615 107 107 virtual UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0; 108 108 virtual UIGChooserItemMachine* firstMachineItem() = 0; 109 virtual void sortItems() = 0; 109 110 110 111 /* API: Layout stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43604 r43615 779 779 } 780 780 781 void UIGChooserItemGroup::sortItems() 782 { 783 /* Sort group-items: */ 784 QMap<QString, UIGChooserItem*> sorter; 785 foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Group)) 786 sorter.insert(pItem->name().toLower(), pItem); 787 setItems(sorter.values(), UIGChooserItemType_Group); 788 789 /* Sort machine-items: */ 790 sorter.clear(); 791 foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Machine)) 792 sorter.insert(pItem->name().toLower(), pItem); 793 setItems(sorter.values(), UIGChooserItemType_Machine); 794 795 /* Update model: */ 796 model()->updateNavigation(); 797 model()->updateLayout(); 798 } 799 781 800 void UIGChooserItemGroup::updateLayout() 782 801 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43604 r43615 150 150 UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 151 151 UIGChooserItemMachine* firstMachineItem(); 152 void sortItems(); 152 153 153 154 /* Helpers: Layout stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r43604 r43615 390 390 } 391 391 392 void UIGChooserItemMachine::sortItems() 393 { 394 AssertMsgFailed(("Machine graphics item do NOT support children!")); 395 } 396 392 397 void UIGChooserItemMachine::updateLayout() 393 398 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h
r43604 r43615 126 126 UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 127 127 UIGChooserItemMachine* firstMachineItem(); 128 void sortItems(); 128 129 129 130 /* Helpers: Layout stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r43614 r43615 728 728 729 729 /* Sorting group: */ 730 sortItems(currentItem());730 currentItem()->sortItems(); 731 731 } 732 732 … … 915 915 916 916 /* Sorting parent group: */ 917 sortItems(currentItem()->parentItem());917 currentItem()->parentItem()->sortItems(); 918 918 } 919 919 … … 1425 1425 unindentRoot(); 1426 1426 } 1427 }1428 1429 void UIGChooserModel::sortItems(UIGChooserItem *pParent)1430 {1431 /* Sort group-items: */1432 QMap<QString, UIGChooserItem*> sorter;1433 foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))1434 sorter.insert(pItem->name().toLower(), pItem);1435 pParent->setItems(sorter.values(), UIGChooserItemType_Group);1436 1437 /* Sort machine-items: */1438 sorter.clear();1439 foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))1440 sorter.insert(pItem->name().toLower(), pItem);1441 pParent->setItems(sorter.values(), UIGChooserItemType_Machine);1442 1443 /* Update model: */1444 updateNavigation();1445 updateLayout();1446 1427 } 1447 1428 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r43614 r43615 247 247 248 248 /* Helpers: Machine-item stuff: */ 249 void sortItems(UIGChooserItem *pParent);250 249 void updateMachineItems(const QString &strId, UIGChooserItem *pParent); 251 250 void removeMachineItems(const QString &strId, UIGChooserItem *pParent);
Note:
See TracChangeset
for help on using the changeset viewer.