VirtualBox

Changeset 77356 in vbox for trunk/src


Ignore:
Timestamp:
Feb 19, 2019 10:33:05 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9340. Updating recently used medium lists, and media folder lists.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r77345 r77356  
    25492549    CVirtualBox comVBox = virtualBox();
    25502550
    2551     updateRecentlyUsedMediumListAndFolder(enmMediumType, strMediumLocation);
    2552 
    25532551    /* Open corresponding medium: */
    25542552    CMedium comMedium = comVBox.OpenMedium(strMediumLocation, mediumTypeToGlobal(enmMediumType), KAccessMode_ReadWrite, false);
     
    26372635    /* If dialog has some result: */
    26382636    if (!files.empty() && !files[0].isEmpty())
    2639         return openMedium(enmMediumType, files[0], pParent);
    2640 
     2637    {
     2638        QUuid uMediumId = openMedium(enmMediumType, files[0], pParent);
     2639        updateRecentlyUsedMediumListAndFolder(enmMediumType, medium(uMediumId).location());
     2640        return uMediumId;
     2641    }
    26412642    return QUuid();
    26422643}
     
    26942695            break;
    26952696    }
     2697    if (!uMediumId.isNull())
     2698        updateRecentlyUsedMediumListAndFolder(enmMediumType, medium(uMediumId).location());
    26962699
    26972700    return uMediumId;
     
    28292832            returnCode = UIMediumSelector::ReturnCode_Rejected;
    28302833        else
     2834        {
    28312835            outUuid = selectedMediumIds[0];
     2836            updateRecentlyUsedMediumListAndFolder(enmMediumType, medium(outUuid).location());
     2837        }
    28322838    }
    28332839    delete pSelector;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.cpp

    r77344 r77356  
    217217    /* Notify VBoxGlobal about the new medium: */
    218218    vboxGlobal().createMedium(UIMedium(newMedium, UIMediumDeviceType_Floppy, KMediumState_Created));
    219     /* Update the recently used media list: */
    220     vboxGlobal().updateRecentlyUsedMediumListAndFolder(UIMediumDeviceType_Floppy, strMediumLocation);
    221219
    222220    /* After a successful creation and initilization of the floppy disk we call base class accept
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r77291 r77356  
    443443    repopulateTreeWidget();
    444444    selectMedium(uMediumID);
    445 
    446445}
    447446
     
    450449    QUuid uMediumId = vboxGlobal().openMediumCreatorDialog(this, m_enmMediumType, m_strMachineFolder,
    451450                                                           m_strMachineName, m_strMachineGuestOSTypeId);
    452     if (!uMediumId.isNull())
    453     {
    454         /* Update the tree widget making sure we show the new item: */
    455         repopulateTreeWidget();
    456         /* Select the new item: */
    457         selectMedium(uMediumId);
    458         /* Update the search: */
    459         m_pSearchWidget->search(m_pTreeWidget);
    460     }
     451    if (uMediumId.isNull())
     452        return;
     453    /* Update the tree widget making sure we show the new item: */
     454    repopulateTreeWidget();
     455    /* Select the new item: */
     456    selectMedium(uMediumId);
     457    /* Update the search: */
     458    m_pSearchWidget->search(m_pTreeWidget);
    461459}
    462460
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