- Timestamp:
- Apr 3, 2013 5:18:31 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45313 r45314 742 742 } 743 743 744 void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName ) const745 { 746 message( mainWindowShown(), MessageType_Error,744 void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const 745 { 746 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 747 747 tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 748 .arg(strSnapshotName ).arg(CConsole(console).GetMachine().GetName()),748 .arg(strSnapshotName, strMachineName), 749 749 formatErrorInfo(console)); 750 750 } 751 751 752 void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName) const 753 { 754 /* Get console: */ 755 AssertWrapperOk(progress); 756 CConsole console(CProgress(progress).GetInitiator()); 757 AssertWrapperOk(console); 758 /* Show the message: */ 759 message(mainWindowShown(), MessageType_Error, 752 void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const 753 { 754 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 760 755 tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 761 .arg(strSnapshotName ).arg(console.GetMachine().GetName()),762 formatErrorInfo(progress.GetErrorInfo()));763 } 764 765 void UIMessageCenter::cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName ) const756 .arg(strSnapshotName, strMachineName), 757 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 758 } 759 760 void UIMessageCenter::cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName) const 766 761 { 767 762 message(mainWindowShown(), MessageType_Error, 768 763 tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 769 .arg(strSnapshotName) 770 .arg(CConsole(console).GetMachine().GetName()), 764 .arg(strSnapshotName, strMachineName), 771 765 formatErrorInfo(console)); 772 766 } 773 767 774 void UIMessageCenter::cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName) const 775 { 776 /* Get console: */ 777 AssertWrapperOk(progress); 778 CConsole console(CProgress(progress).GetInitiator()); 779 AssertWrapperOk(console); 780 /* Show the message: */ 768 void UIMessageCenter::cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const 769 { 781 770 message(mainWindowShown(), MessageType_Error, 782 771 tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.") 783 .arg(strSnapshotName) 784 .arg(console.GetMachine().GetName()), 785 formatErrorInfo(progress.GetErrorInfo())); 772 .arg(strSnapshotName).arg(strMachineName), 773 !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo())); 786 774 } 787 775 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r45313 r45314 236 236 bool warnAboutSnapshotRemovalFreeSpace(const QString &strSnapshotName, const QString &strTargetImageName, 237 237 const QString &strTargetImageMaxSize, const QString &strTargetFileSystemFree) const; 238 void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName ) const;239 void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName ) const;240 void cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName ) const;241 void cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName ) const;238 void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent = 0) const; 239 void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent = 0) const; 240 void cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName) const; 241 void cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const; 242 242 243 243 /* API: Settings warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r45296 r45314 391 391 { 392 392 /* Failed in progress: */ 393 msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName() );393 msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName(), machine.GetName(), machineLogic()->activeMachineWindow()); 394 394 return false; 395 395 } … … 398 398 { 399 399 /* Failed in console: */ 400 msgCenter().cannotRestoreSnapshot(console, snapshot.GetName() );400 msgCenter().cannotRestoreSnapshot(console, snapshot.GetName(), machine.GetName(), machineLogic()->activeMachineWindow()); 401 401 return false; 402 402 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r45296 r45314 608 608 { 609 609 msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_restore_90px.png", 610 610 msgCenter().mainWindowShown(), true); 611 611 if (progress.GetResultCode() != 0) 612 msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName() );612 msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName(), mMachine.GetName()); 613 613 } 614 614 else 615 msgCenter().cannotRestoreSnapshot(console, snapshot.GetName() );615 msgCenter().cannotRestoreSnapshot(console, snapshot.GetName(), mMachine.GetName()); 616 616 617 617 /* Unlock machine finally: */ … … 656 656 { 657 657 /* Show the progress dialog */ 658 msgCenter().showModalProgressDialog 659 658 msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_discard_90px.png", 659 msgCenter().mainWindowShown(), true); 660 660 661 661 if (progress.GetResultCode() != 0) 662 msgCenter().cannotRemoveSnapshot (progress, snapshot.GetName());662 msgCenter().cannotRemoveSnapshot(progress, snapshot.GetName(), mMachine.GetName()); 663 663 } 664 664 else 665 msgCenter().cannotRemoveSnapshot (console, snapshot.GetName());665 msgCenter().cannotRemoveSnapshot(console, snapshot.GetName(), mMachine.GetName()); 666 666 667 667 session.UnlockMachine();
Note:
See TracChangeset
for help on using the changeset viewer.