- Timestamp:
- Oct 26, 2021 3:16:43 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r92036 r92086 980 980 981 981 /* static */ 982 void UINotificationMessage::cannotRemoveMachine(const CMachine &comMachine )982 void UINotificationMessage::cannotRemoveMachine(const CMachine &comMachine, UINotificationCenter *pParent /* = 0 */) 983 983 { 984 984 createMessage( … … 986 986 QApplication::translate("UIMessageCenter", "Failed to remove the virtual machine <b>%1</b>.") 987 987 .arg(CMachine(comMachine).GetName()) + 988 UIErrorString::formatErrorInfo(comMachine)); 988 UIErrorString::formatErrorInfo(comMachine), 989 QString(), QString(), pParent); 989 990 } 990 991 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r92036 r92086 394 394 /** Notifies about inability to remove machine. 395 395 * @param comMachine Brings machine being removed. */ 396 static void cannotRemoveMachine(const CMachine &comMachine );396 static void cannotRemoveMachine(const CMachine &comMachine, UINotificationCenter *pParent = 0); 397 397 398 398 /** Notifies about inability to find snapshot by ID. -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r92032 r92086 444 444 if (!success) 445 445 { 446 CVirtualBox vbox = uiCommon().virtualBox(); 447 /* Unregister on failure */ 448 QVector<CMedium> aMedia = m_machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 449 if (vbox.isOk()) 450 { 451 CProgress progress = m_machine.DeleteConfig(aMedia); 452 progress.WaitForCompletion(-1); /// @todo do this nicely with a progress dialog, this can delete lots of files 453 } 454 } 455 456 /* Make sure we detach CMedium wrapper from IMedium pointer to avoid deletion of IMedium as m_virtualDisk is deallocated: */ 457 /* Or in case of IMachine::DeleteConfig IMedium has been already deleted so detach in this case as well:*/ 446 /* Unregister VM on failure: */ 447 const QVector<CMedium> media = m_machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 448 if (!m_machine.isOk()) 449 UINotificationMessage::cannotRemoveMachine(m_machine, notificationCenter()); 450 else 451 { 452 UINotificationProgressMachineMediaRemove *pNotification = 453 new UINotificationProgressMachineMediaRemove(m_machine, media); 454 handleNotificationProgressNow(pNotification); 455 } 456 } 457 458 /* Make sure we detach CMedium wrapper from IMedium pointer to avoid deletion of IMedium as m_virtualDisk 459 * is deallocated. Or in case of UINotificationProgressMachineMediaRemove handling, IMedium has been 460 * already deleted so detach in this case as well. */ 458 461 if (!m_virtualDisk.isNull()) 459 462 m_virtualDisk.detach();
Note:
See TracChangeset
for help on using the changeset viewer.