- Timestamp:
- May 26, 2020 3:53:40 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r84537 r84542 791 791 void UIVirtualBoxManager::sltPerformMachineMoveToNewGroup() 792 792 { 793 m_pWidget->moveMachineTo NewGroup();793 m_pWidget->moveMachineToGroup(); 794 794 } 795 795 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r84518 r84542 131 131 } 132 132 133 void UIVirtualBoxManagerWidget::moveMachineTo NewGroup()134 { 135 m_pPaneChooser->moveMachineTo NewGroup();133 void UIVirtualBoxManagerWidget::moveMachineToGroup(const QString &strName /* = QString() */) 134 { 135 m_pPaneChooser->moveMachineToGroup(strName); 136 136 } 137 137 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r84518 r84542 146 146 /** Removes machine. */ 147 147 void removeMachine(); 148 /** Moves machine to a new group. */149 void moveMachineTo NewGroup();148 /** Moves machine to a group with certain @a strName. */ 149 void moveMachineToGroup(const QString &strName = QString()); 150 150 /** Refreshes machine. */ 151 151 void refreshMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r84518 r84542 131 131 } 132 132 133 void UIChooser::moveMachineTo NewGroup()134 { 135 AssertPtrReturnVoid(model()); 136 model()->moveSelectedMachineItemsTo NewGroupItem();133 void UIChooser::moveMachineToGroup(const QString &strName) 134 { 135 AssertPtrReturnVoid(model()); 136 model()->moveSelectedMachineItemsToGroupItem(strName); 137 137 } 138 138 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r84518 r84542 140 140 /** Removes machine. */ 141 141 void removeMachine(); 142 /** Moves machine to a new group. */143 void moveMachineTo NewGroup();142 /** Moves machine to a group with certain @a strName. */ 143 void moveMachineToGroup(const QString &strName); 144 144 /** Refreshes machine. */ 145 145 void refreshMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r84518 r84542 735 735 } 736 736 737 void UIChooserModel::moveSelectedMachineItemsToNewGroupItem() 738 { 739 /* Create new group node in the current root: */ 740 UIChooserNodeGroup *pNewGroupNode = new UIChooserNodeGroup(invisibleRoot(), 741 false /* favorite */, 742 invisibleRoot()->nodes().size() /* position */, 743 uniqueGroupName(invisibleRoot()), 744 UIChooserNodeGroupType_Local, 745 true /* opened */); 746 UIChooserItemGroup *pNewGroupItem = new UIChooserItemGroup(root(), pNewGroupNode); 737 void UIChooserModel::moveSelectedMachineItemsToGroupItem(const QString &strName /* = QString() */) 738 { 739 /* Prepare target group pointers: */ 740 UIChooserNodeGroup *pTargetGroupNode = 0; 741 UIChooserItemGroup *pTargetGroupItem = 0; 742 if (strName.isNull()) 743 { 744 /* Create new group node in the current root: */ 745 pTargetGroupNode = new UIChooserNodeGroup(invisibleRoot(), 746 false /* favorite */, 747 invisibleRoot()->nodes().size() /* position */, 748 uniqueGroupName(invisibleRoot()), 749 UIChooserNodeGroupType_Local, 750 true /* opened */); 751 pTargetGroupItem = new UIChooserItemGroup(root(), pTargetGroupNode); 752 } 753 else 754 { 755 /* Search for existing group with certain name: */ 756 UIChooserItem *pTargetItem = root()->searchForItem(strName, 757 UIChooserItemSearchFlag_LocalGroup | 758 UIChooserItemSearchFlag_ExactId); 759 AssertPtrReturnVoid(pTargetItem); 760 pTargetGroupItem = pTargetItem->toGroupItem(); 761 UIChooserNode *pTargetNode = pTargetItem->node(); 762 AssertPtrReturnVoid(pTargetNode); 763 pTargetGroupNode = pTargetNode->toGroupNode(); 764 } 765 AssertPtrReturnVoid(pTargetGroupNode); 766 AssertPtrReturnVoid(pTargetGroupItem); 747 767 748 768 /* For each of currently selected-items: */ … … 762 782 busyGroupNames << pItem->name(); 763 783 /* Copy or move group-item: */ 764 UIChooserNodeGroup *pNewGroupSubNode = new UIChooserNodeGroup(p NewGroupNode,784 UIChooserNodeGroup *pNewGroupSubNode = new UIChooserNodeGroup(pTargetGroupNode, 765 785 pItem->node()->toGroupNode(), 766 p NewGroupNode->nodes().size());767 new UIChooserItemGroup(p NewGroupItem, pNewGroupSubNode);786 pTargetGroupNode->nodes().size()); 787 new UIChooserItemGroup(pTargetGroupItem, pNewGroupSubNode); 768 788 delete pItem->node(); 769 789 break; … … 777 797 busyMachineNames << pItem->name(); 778 798 /* Copy or move machine-item: */ 779 UIChooserNodeMachine *pNewMachineSubNode = new UIChooserNodeMachine(p NewGroupNode,799 UIChooserNodeMachine *pNewMachineSubNode = new UIChooserNodeMachine(pTargetGroupNode, 780 800 pItem->node()->toMachineNode(), 781 p NewGroupNode->nodes().size());782 new UIChooserItemMachine(p NewGroupItem, pNewMachineSubNode);801 pTargetGroupNode->nodes().size()); 802 new UIChooserItemMachine(pTargetGroupItem, pNewMachineSubNode); 783 803 delete pItem->node(); 784 804 break; … … 790 810 wipeOutEmptyGroups(); 791 811 updateTreeForMainRoot(); 792 setSelectedItem(p NewGroupItem);812 setSelectedItem(pTargetGroupItem); 793 813 saveGroups(); 794 814 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r84518 r84542 222 222 /** Removes selected machine items. */ 223 223 void removeSelectedMachineItems(); 224 /** Moves selected machine items to new group item. */ 225 void moveSelectedMachineItemsToNewGroupItem(); 224 /** Moves selected machine items to group item. 225 * @param strName Holds the group item name to move items to, if 226 * that name isn't specified, new top-level group 227 * item will be created. */ 228 void moveSelectedMachineItemsToGroupItem(const QString &strName); 226 229 /** Starts or shows selected items. */ 227 230 void startOrShowSelectedItems();
Note:
See TracChangeset
for help on using the changeset viewer.