VirtualBox

Changeset 78392 in vbox for trunk/src


Ignore:
Timestamp:
May 6, 2019 2:41:45 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8400. Reattaching the medium even if medium type change fails.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp

    r78374 r78392  
    232232    /* Attempt to change medium type: */
    233233    comMedium.SetType(enmNewType);
    234 
     234    bool fSuccess = true;
    235235    /* Show error message if necessary: */
    236236    if (!comMedium.isOk() && parentTree())
    237237    {
    238238        msgCenter().cannotChangeMediumType(comMedium, enmOldType, enmNewType, treeWidget());
    239         return false;
     239        fSuccess = false;
    240240    }
    241241    /* Reattach the medium to all the vms it was previously attached: */
    242242    foreach (const AttachmentCache &attachmentCache, attachmentCacheList)
    243243        attachTo(attachmentCache);
    244     return true;
     244    return fSuccess;
    245245}
    246246
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r78386 r78392  
    273273    if (   comMedium.isOk()
    274274        && newData.m_options.m_enmMediumType != oldData.m_options.m_enmMediumType)
    275     {
    276275        pMediumItem->changeMediumType(oldData.m_options.m_enmMediumType, newData.m_options.m_enmMediumType);
    277     }
    278276
    279277    /* Try to assign new medium location: */
     
    10461044    {
    10471045        m_pDetailsWidget->setData(pMediumItem ? *pMediumItem : UIDataMedium(type));
    1048         if (pMediumItem)
     1046        if (pMediumItem && currentMediumItem())
    10491047            m_pDetailsWidget->enableDisableMediumModificationWidgets(currentMediumItem()->isMediumModifiable());
    10501048    }
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