VirtualBox

Changeset 43551 in vbox


Ignore:
Timestamp:
Oct 5, 2012 10:38:14 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group feature UI: Group-item cleanup (part 1): Open group on dropping something into it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp

    r43540 r43551  
    165165    if (model()->focusItem() == this)
    166166    {
    167         /* Unset the focus/selection: */
    168         model()->setFocusItem(0, true);
    169     }
    170     /* If that item is NOT focused, but selected: */
    171     else if (model()->currentItems().contains(this))
     167        /* Unset the focus: */
     168        model()->setFocusItem(0);
     169    }
     170    /* If that item is selected: */
     171    if (model()->currentItems().contains(this))
    172172    {
    173173        /* Remove item from the selection list: */
     
    10691069                /* Copy passed item into this group: */
    10701070                UIGChooserItem *pNewGroupItem = new UIGChooserItemGroup(this, pItem->toGroupItem(), iPosition);
     1071                if (closed())
     1072                    open(false);
    10711073
    10721074                /* If proposed action is 'move': */
     
    10811083                pModel->updateNavigation();
    10821084                pModel->updateLayout();
    1083                 pModel->setCurrentItem(pNewGroupItem->parentItem()->toGroupItem()->opened() ?
    1084                                        pNewGroupItem : pNewGroupItem->parentItem());
     1085                pModel->setCurrentItem(pNewGroupItem);
    10851086                pModel->saveGroupSettings();
    10861087                break;
     
    11211122                /* Copy passed machine item into this group: */
    11221123                UIGChooserItem *pNewMachineItem = new UIGChooserItemMachine(this, pItem->toMachineItem(), iPosition);
     1124                if (closed())
     1125                    open(false);
    11231126
    11241127                /* If proposed action is 'move': */
     
    11331136                pModel->updateNavigation();
    11341137                pModel->updateLayout();
    1135                 pModel->setCurrentItem(pNewMachineItem->parentItem()->toGroupItem()->opened() ?
    1136                                        pNewMachineItem : pNewMachineItem->parentItem());
     1138                pModel->setCurrentItem(pNewMachineItem);
    11371139                pModel->saveGroupSettings();
    11381140                break;
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