VirtualBox

Changeset 42850 in vbox for trunk/src


Ignore:
Timestamp:
Aug 16, 2012 4:36:21 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6234: Support for VM groups: Rework "Group" action logic to move grouped items into the new group instead of just copying them.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r42849 r42850  
    377377    void retranslateUi()
    378378    {
    379         setText(QApplication::translate("UIActionPool", "&Add Group..."));
     379        setText(QApplication::translate("UIActionPool", "Gro&up"));
    380380        setStatusTip(QApplication::translate("UIActionPool", "Add a new group based on the items selected"));
    381381    }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r42849 r42850  
    776776    QStringList busyGroupNames;
    777777    QStringList busyMachineNames;
    778     foreach (UIGChooserItem *pItem, selectionList())
     778    QList<UIGChooserItem*> selectedItems = selectionList();
     779    foreach (UIGChooserItem *pItem, selectedItems)
    779780    {
    780781        /* For each of known types: */
     
    786787                if (busyGroupNames.contains(pItem->name()))
    787788                    break;
    788                 /* Copy group item: */
     789                /* Add name to busy: */
     790                busyGroupNames << pItem->name();
     791                /* Copy or move group item: */
    789792                new UIGChooserItemGroup(pNewGroupItem, pItem->toGroupItem());
    790                 busyGroupNames << pItem->name();
     793                delete pItem;
    791794                break;
    792795            }
     
    796799                if (busyMachineNames.contains(pItem->name()))
    797800                    break;
    798                 /* Copy machine item: */
     801                /* Add name to busy: */
     802                busyMachineNames << pItem->name();
     803                /* Copy or move machine item: */
    799804                new UIGChooserItemMachine(pNewGroupItem, pItem->toMachineItem());
    800                 busyMachineNames << pItem->name();
     805                delete pItem;
    801806                break;
    802807            }
     
    804809    }
    805810    /* Update model: */
     811    updateGroupTree();
    806812    updateNavigation();
    807813    updateLayout();
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