VirtualBox

Changeset 43565 in vbox


Ignore:
Timestamp:
Oct 8, 2012 12:08:24 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group feature UI: Model prepare/cleanup stuff rework (part 1).

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  
    10801080
    10811081                /* Update model: */
    1082                 pModel->updateGroupTree();
     1082                pModel->cleanupGroupTree();
    10831083                pModel->updateNavigation();
    10841084                pModel->updateLayout();
     
    11331133
    11341134                /* Update model: */
    1135                 pModel->updateGroupTree();
     1135                pModel->cleanupGroupTree();
    11361136                pModel->updateNavigation();
    11371137                pModel->updateLayout();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r43543 r43565  
    527527
    528528                /* Update model: */
    529                 pModel->updateGroupTree();
     529                pModel->cleanupGroupTree();
    530530                pModel->updateNavigation();
    531531                pModel->updateLayout();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r43564 r43565  
    111111void UIGChooserModel::prepare()
    112112{
    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();
    115124}
    116125
    117126void UIGChooserModel::cleanup()
    118127{
    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();
    121140}
    122141
     
    508527}
    509528
    510 void UIGChooserModel::updateGroupTree()
    511 {
    512     updateGroupTree(mainRoot());
     529void UIGChooserModel::cleanupGroupTree()
     530{
     531    cleanupGroupTree(mainRoot());
    513532}
    514533
     
    597616        removeMachineItems(strId, mainRoot());
    598617        /* Update model: */
    599         updateGroupTree();
     618        cleanupGroupTree();
    600619        updateNavigation();
    601620        updateLayout();
     
    660679
    661680    /* Update model: */
    662     updateGroupTree();
     681    cleanupGroupTree();
    663682    updateNavigation();
    664683    updateLayout();
     
    717736    }
    718737    /* Update model: */
    719     updateGroupTree();
     738    cleanupGroupTree();
    720739    updateNavigation();
    721740    updateLayout();
     
    847866
    848867    /* And update model: */
    849     updateGroupTree();
     868    cleanupGroupTree();
    850869    updateNavigation();
    851870    updateLayout();
     
    11901209}
    11911210
    1192 void UIGChooserModel::prepareGroupTree()
    1193 {
    1194     /* Load group tree: */
    1195     loadGroupTree();
    1196 
    1197     /* Update model: */
    1198     updateNavigation();
    1199     updateLayout();
    1200 
     1211void UIGChooserModel::loadLastSelectedItem()
     1212{
    12011213    /* Load last selected item (choose first if unable to load): */
    12021214    setCurrentItem(vboxGlobal().virtualBox().GetExtraData(GUI_LastItemSelected));
     
    12051217}
    12061218
    1207 void UIGChooserModel::cleanupGroupTree()
     1219void UIGChooserModel::saveLastSelectedItem()
    12081220{
    12091221    /* Save last selected item: */
    12101222    vboxGlobal().virtualBox().SetExtraData(GUI_LastItemSelected,
    12111223                                           currentItem() ? currentItem()->definition() : QString());
    1212 
    1213     /* Currently we are not saving group descriptors
    1214      * (which reflecting group toggle-state) on-the-fly
    1215      * So, for now we are additionally save group orders
    1216      * when exiting application: */
    1217     saveGroupOrders();
    1218 
    1219     /* Make sure all saving steps complete: */
    1220     makeSureGroupDefinitionsSaveIsFinished();
    1221     makeSureGroupOrdersSaveIsFinished();
    12221224}
    12231225
     
    14301432}
    14311433
    1432 void UIGChooserModel::updateGroupTree(UIGChooserItem *pGroupItem)
     1434void UIGChooserModel::cleanupGroupTree(UIGChooserItem *pGroupItem)
    14331435{
    14341436    /* Cleanup all the group items first: */
    14351437    foreach (UIGChooserItem *pSubGroupItem, pGroupItem->items(UIGChooserItemType_Group))
    1436         updateGroupTree(pSubGroupItem);
     1438        cleanupGroupTree(pSubGroupItem);
    14371439    if (!pGroupItem->hasItems())
    14381440    {
     
    15741576
    15751577    /* And update model: */
    1576     updateGroupTree();
     1578    cleanupGroupTree();
    15771579    updateNavigation();
    15781580    updateLayout();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h

    r43564 r43565  
    138138    QString uniqueGroupName(UIGChooserItem *pRoot);
    139139    void startEditingGroupItemName();
    140     void updateGroupTree();
     140    void cleanupGroupTree();
    141141
    142142    /* API: Machine-item stuff: */
     
    222222    void prepareConnections();
    223223    void prepareReleaseLogging();
    224     void prepareGroupTree();
     224    void loadLastSelectedItem();
    225225
    226226    /* Helpers: Cleanup stuff: */
    227     void cleanupGroupTree();
     227    void saveLastSelectedItem();
    228228    void cleanupHandlers();
    229229    void cleanupContextMenu();
     
    251251    /* Helper: Group-item stuff: */
    252252    UIGChooserItem* findGroupItem(const QString &strName, UIGChooserItem *pParent);
    253     void updateGroupTree(UIGChooserItem *pGroupItem);
     253    void cleanupGroupTree(UIGChooserItem *pGroupItem);
    254254
    255255    /* Helpers: Machine-item stuff: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette