Changeset 79044 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 7, 2019 4:36:53 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r78893 r79044 590 590 tr("Encryption password for <nobr>ID = '%1'</nobr> is invalid.") 591 591 .arg(strPasswordId)); 592 } 593 594 void UIMessageCenter::cannotAcquireMachineParameter(const CMachine &comMachine, QWidget *pParent /* = 0 */) const 595 { 596 /* Show the error: */ 597 error(pParent, MessageType_Error, 598 tr("Failed to acquire machine parameter."), UIErrorString::formatErrorInfo(comMachine)); 592 599 } 593 600 … … 1490 1497 } 1491 1498 1492 void UIMessageCenter::cannotAcquireAttachment Medium(const CMediumAttachment &comAttachment, QWidget *pParent /* = 0 */) const1499 void UIMessageCenter::cannotAcquireAttachmentParameter(const CMediumAttachment &comAttachment, QWidget *pParent /* = 0 */) const 1493 1500 { 1494 1501 /* Show the error: */ 1495 1502 error(pParent, MessageType_Error, 1496 tr("Failed to acquire attachment medium."), UIErrorString::formatErrorInfo(comAttachment));1503 tr("Failed to acquire attachment parameter."), UIErrorString::formatErrorInfo(comAttachment)); 1497 1504 } 1498 1505 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r78893 r79044 263 263 void cannotSetExtraData(const CMachine &machine, const QString &strKey, const QString &strValue); 264 264 void warnAboutInvalidEncryptionPassword(const QString &strPasswordId, QWidget *pParent = 0); 265 void cannotAcquireMachineParameter(const CMachine &comMachine, QWidget *pParent = 0) const; 265 266 266 267 /* API: Selector warnings: */ … … 346 347 void cannotOpenMedium(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent = 0) const; 347 348 void cannotOpenKnownMedium(const CVirtualBox &comVBox, const QUuid &uMediumId, QWidget *pParent = 0) const; 348 void cannotAcquireAttachment Medium(const CMediumAttachment &comAttachment, QWidget *pParent = 0) const;349 void cannotAcquireAttachmentParameter(const CMediumAttachment &comAttachment, QWidget *pParent = 0) const; 349 350 void cannotAcquireMediumAttribute(const CMedium &comMedium, QWidget *pParent = 0) const; 350 351 void cannotCloseMedium(const UIMedium &medium, const COMResult &rc, QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r79043 r79044 776 776 { 777 777 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire attachment medium!\n")); 778 msgCenter().cannotAcquireAttachment Medium(comAttachment);778 msgCenter().cannotAcquireAttachmentParameter(comAttachment); 779 779 } 780 780 else … … 782 782 /* Parse medium: */ 783 783 result << parseMedium(comMedium); 784 785 // WORKAROUND: 786 // In current architecture there is no way to determine medium previously mounted 787 // to this attachment, so we will have to enumerate all other cached media which 788 // belongs to the same VM, since they may no longer belong to it. 789 790 /* Acquire parent VM: */ 791 CMachine comMachine = comAttachment.GetMachine(); 792 if (!comAttachment.isOk()) 793 { 794 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire attachment parent machine!\n")); 795 msgCenter().cannotAcquireAttachmentParameter(comAttachment); 796 } 797 else 798 { 799 /* Acquire machine ID: */ 800 const QUuid uMachineId = comMachine.GetId(); 801 if (!comMachine.isOk()) 802 { 803 LogRel2(("GUI: UIMediumEnumerator: Unable to acquire machine ID!\n")); 804 msgCenter().cannotAcquireMachineParameter(comMachine); 805 } 806 else 807 { 808 /* For each the cached UIMedium we have: */ 809 foreach (const QUuid &uMediumId, mediumIDs()) 810 { 811 const UIMedium guiMedium = medium(uMediumId); 812 if ( !guiMedium.isNull() 813 && guiMedium.machineIds().contains(uMachineId) 814 && !result.contains(uMediumId)) 815 { 816 /* Enumerate corresponding UIMedium: */ 817 LogRel2(("GUI: UIMediumEnumerator: Medium {%s} will be enumerated..\n", 818 uMediumId.toString().toUtf8().constData())); 819 createMediumEnumerationTask(guiMedium); 820 result << uMediumId; 821 } 822 } 823 } 824 } 784 825 } 785 826 }
Note:
See TracChangeset
for help on using the changeset viewer.