VirtualBox

Changeset 84046 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 28, 2020 12:57:40 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Do not store cloud VMs as last selected items, they can't be instantly restored on restart, store profile item instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r83962 r84046  
    14061406void UIChooserModel::saveLastSelectedItem()
    14071407{
     1408    /* Acquire first selected item: */
     1409    UIChooserItem *pFirstSelectedItem = firstSelectedItem();
     1410    /* If this item is of machine type: */
     1411    if (   pFirstSelectedItem
     1412        && pFirstSelectedItem->type() == UIChooserNodeType_Machine)
     1413    {
     1414        /* Cast to machine item: */
     1415        UIChooserItemMachine *pMachineItem = pFirstSelectedItem->toMachineItem();
     1416        AssertPtrReturnVoid(pMachineItem);
     1417        /* If this machine item is of cloud type: */
     1418        if (   pMachineItem->cacheType() == UIVirtualMachineItemType_CloudFake
     1419            || pMachineItem->cacheType() == UIVirtualMachineItemType_CloudReal)
     1420        {
     1421            /* Choose the parent (profile) group item as the last one selected: */
     1422            pFirstSelectedItem = pMachineItem->parentItem();
     1423        }
     1424    }
    14081425    /* Save last selected-item: */
    1409     gEDataManager->setSelectorWindowLastItemChosen(firstSelectedItem() ? firstSelectedItem()->definition() : QString());
     1426    gEDataManager->setSelectorWindowLastItemChosen(pFirstSelectedItem ? pFirstSelectedItem->definition() : QString());
    14101427}
    14111428
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