Changeset 77598 in vbox
- Timestamp:
- Mar 7, 2019 1:51:44 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129225
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r77596 r77598 383 383 { 384 384 pItem = navigationList().at(idxBefore); 385 if (!currentItems().contains(pItem) )385 if (!currentItems().contains(pItem) && pItem->type() == UIChooserItemType_Machine) 386 386 return pItem; 387 387 --idxBefore; … … 390 390 { 391 391 pItem = navigationList().at(idxAfter); 392 if (!currentItems().contains(pItem) )392 if (!currentItems().contains(pItem) && pItem->type() == UIChooserItemType_Machine) 393 393 return pItem; 394 394 ++idxAfter; … … 705 705 if (uId == m_uLastCreatedMachineId) 706 706 { 707 708 709 710 711 707 setCurrentItem(root()->searchForItem(comMachine.GetName(), 708 UIChooserItemSearchFlag_Machine | 709 UIChooserItemSearchFlag_ExactName)); 710 } 711 } 712 712 } 713 713 /* Existing VM unregistered? */ … … 970 970 971 971 /* And update model: */ 972 updateNavigation();973 updateLayout();974 975 /* Make sure at least one item selected after that: */976 if (!currentItem() && !navigationList().isEmpty())977 setCurrentItem(navigationList().first());972 updateNavigation(); 973 updateLayout(); 974 975 /* Make sure at least one item selected after that: */ 976 if (!currentItem() && !navigationList().isEmpty()) 977 setCurrentItem(navigationList().first()); 978 978 979 979 /* Notify listeners about selection change: */ … … 1004 1004 QList<UIChooserItemMachine*> inaccessibleMachineItemList; 1005 1005 UIChooserItemMachine::enumerateMachineItems(currentItems(), inaccessibleMachineItemList, 1006 1007 1006 UIChooserItemMachineEnumerationFlag_Unique | 1007 UIChooserItemMachineEnumerationFlag_Inaccessible); 1008 1008 1009 1009 /* For each machine-item: */ … … 1611 1611 1612 1612 /* Add all the approved machines we have into the group-tree: */ 1613 LogRelFlow(("UIChooserModel: Loading VMs...\n"));1613 LogRelFlow(("UIChooserModel: Loading VMs...\n")); 1614 1614 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1615 {1615 { 1616 1616 const QUuid uMachineID = machine.GetId(); 1617 if (!uMachineID.isNull() && gEDataManager->showMachineInSelectorChooser(uMachineID))1617 if (!uMachineID.isNull() && gEDataManager->showMachineInSelectorChooser(uMachineID)) 1618 1618 addMachineIntoTheTree(machine); 1619 }1620 LogRelFlow(("UIChooserModel: VMs loaded.\n"));1621 }1619 } 1620 LogRelFlow(("UIChooserModel: VMs loaded.\n")); 1621 } 1622 1622 1623 1623 void UIChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */) … … 1641 1641 const QString strGroups = groupList.join(", "); 1642 1642 LogRelFlow(("UIChooserModel: VM {%s} has groups: {%s}.\n", strName.toUtf8().constData(), 1643 1643 strGroups.toUtf8().constData())); 1644 1644 foreach (QString strGroup, groups) 1645 1645 { … … 1649 1649 /* Create machine-item with found group-item as parent: */ 1650 1650 LogRelFlow(("UIChooserModel: Creating item for VM {%s} in group {%s}.\n", strName.toUtf8().constData(), 1651 1651 strGroup.toUtf8().constData())); 1652 1652 createMachineItem(machine, getGroupItem(strGroup, root(), fMakeItVisible)); 1653 1653 } … … 1676 1676 if (!pParent->isRoot()) 1677 1677 delete pParent; 1678 }1679 }1678 } 1679 } 1680 1680 1681 1681 bool UIChooserModel::isGlobalItemFavorite(UIChooserItem *pParentItem) const … … 1734 1734 pFoundGroupItem->open(false); 1735 1735 return pFoundItem; 1736 1737 1738 1736 } 1737 } 1738 } 1739 1739 1740 1740 /* Found nothing? Creating: */ … … 2072 2072 foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Machine)) 2073 2073 orders[strExtraDataKey] << QString("m=%1").arg(toOldStyleUuid(pItem->toMachineItem()->id())); 2074 }2074 } 2075 2075 2076 2076 void UIChooserModel::makeSureGroupDefinitionsSaveIsFinished()
Note:
See TracChangeset
for help on using the changeset viewer.