Changeset 43565 in vbox
- Timestamp:
- Oct 8, 2012 12:08:24 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43551 r43565 1080 1080 1081 1081 /* Update model: */ 1082 pModel-> updateGroupTree();1082 pModel->cleanupGroupTree(); 1083 1083 pModel->updateNavigation(); 1084 1084 pModel->updateLayout(); … … 1133 1133 1134 1134 /* Update model: */ 1135 pModel-> updateGroupTree();1135 pModel->cleanupGroupTree(); 1136 1136 pModel->updateNavigation(); 1137 1137 pModel->updateLayout(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r43543 r43565 527 527 528 528 /* Update model: */ 529 pModel-> updateGroupTree();529 pModel->cleanupGroupTree(); 530 530 pModel->updateNavigation(); 531 531 pModel->updateLayout(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
r43564 r43565 111 111 void UIGChooserModel::prepare() 112 112 { 113 /* Prepare group-tree: */ 114 prepareGroupTree(); 113 /* Load group tree: */ 114 loadGroupTree(); 115 116 /* Update navigation: */ 117 updateNavigation(); 118 119 /* Update layout: */ 120 updateLayout(); 121 122 /* Load last selected item: */ 123 loadLastSelectedItem(); 115 124 } 116 125 117 126 void UIGChooserModel::cleanup() 118 127 { 119 /* Cleanup group-tree: */ 120 cleanupGroupTree(); 128 /* Save last selected item: */ 129 saveLastSelectedItem(); 130 131 /* Currently we are not saving group descriptors 132 * (which reflecting group toggle-state) on-the-fly 133 * So, for now we are additionally save group orders 134 * when exiting application: */ 135 saveGroupOrders(); 136 137 /* Make sure all saving steps complete: */ 138 makeSureGroupDefinitionsSaveIsFinished(); 139 makeSureGroupOrdersSaveIsFinished(); 121 140 } 122 141 … … 508 527 } 509 528 510 void UIGChooserModel:: updateGroupTree()511 { 512 updateGroupTree(mainRoot());529 void UIGChooserModel::cleanupGroupTree() 530 { 531 cleanupGroupTree(mainRoot()); 513 532 } 514 533 … … 597 616 removeMachineItems(strId, mainRoot()); 598 617 /* Update model: */ 599 updateGroupTree();618 cleanupGroupTree(); 600 619 updateNavigation(); 601 620 updateLayout(); … … 660 679 661 680 /* Update model: */ 662 updateGroupTree();681 cleanupGroupTree(); 663 682 updateNavigation(); 664 683 updateLayout(); … … 717 736 } 718 737 /* Update model: */ 719 updateGroupTree();738 cleanupGroupTree(); 720 739 updateNavigation(); 721 740 updateLayout(); … … 847 866 848 867 /* And update model: */ 849 updateGroupTree();868 cleanupGroupTree(); 850 869 updateNavigation(); 851 870 updateLayout(); … … 1190 1209 } 1191 1210 1192 void UIGChooserModel::prepareGroupTree() 1193 { 1194 /* Load group tree: */ 1195 loadGroupTree(); 1196 1197 /* Update model: */ 1198 updateNavigation(); 1199 updateLayout(); 1200 1211 void UIGChooserModel::loadLastSelectedItem() 1212 { 1201 1213 /* Load last selected item (choose first if unable to load): */ 1202 1214 setCurrentItem(vboxGlobal().virtualBox().GetExtraData(GUI_LastItemSelected)); … … 1205 1217 } 1206 1218 1207 void UIGChooserModel:: cleanupGroupTree()1219 void UIGChooserModel::saveLastSelectedItem() 1208 1220 { 1209 1221 /* Save last selected item: */ 1210 1222 vboxGlobal().virtualBox().SetExtraData(GUI_LastItemSelected, 1211 1223 currentItem() ? currentItem()->definition() : QString()); 1212 1213 /* Currently we are not saving group descriptors1214 * (which reflecting group toggle-state) on-the-fly1215 * So, for now we are additionally save group orders1216 * when exiting application: */1217 saveGroupOrders();1218 1219 /* Make sure all saving steps complete: */1220 makeSureGroupDefinitionsSaveIsFinished();1221 makeSureGroupOrdersSaveIsFinished();1222 1224 } 1223 1225 … … 1430 1432 } 1431 1433 1432 void UIGChooserModel:: updateGroupTree(UIGChooserItem *pGroupItem)1434 void UIGChooserModel::cleanupGroupTree(UIGChooserItem *pGroupItem) 1433 1435 { 1434 1436 /* Cleanup all the group items first: */ 1435 1437 foreach (UIGChooserItem *pSubGroupItem, pGroupItem->items(UIGChooserItemType_Group)) 1436 updateGroupTree(pSubGroupItem);1438 cleanupGroupTree(pSubGroupItem); 1437 1439 if (!pGroupItem->hasItems()) 1438 1440 { … … 1574 1576 1575 1577 /* And update model: */ 1576 updateGroupTree();1578 cleanupGroupTree(); 1577 1579 updateNavigation(); 1578 1580 updateLayout(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
r43564 r43565 138 138 QString uniqueGroupName(UIGChooserItem *pRoot); 139 139 void startEditingGroupItemName(); 140 void updateGroupTree();140 void cleanupGroupTree(); 141 141 142 142 /* API: Machine-item stuff: */ … … 222 222 void prepareConnections(); 223 223 void prepareReleaseLogging(); 224 void prepareGroupTree();224 void loadLastSelectedItem(); 225 225 226 226 /* Helpers: Cleanup stuff: */ 227 void cleanupGroupTree();227 void saveLastSelectedItem(); 228 228 void cleanupHandlers(); 229 229 void cleanupContextMenu(); … … 251 251 /* Helper: Group-item stuff: */ 252 252 UIGChooserItem* findGroupItem(const QString &strName, UIGChooserItem *pParent); 253 void updateGroupTree(UIGChooserItem *pGroupItem);253 void cleanupGroupTree(UIGChooserItem *pGroupItem); 254 254 255 255 /* Helpers: Machine-item stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.