- Timestamp:
- Nov 21, 2012 12:21:24 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 82224
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r43424 r43920 28 28 #include <QScrollBar> 29 29 #include <QWindowsStyle> 30 #include <QPointer> 30 31 31 32 /* GUI includes: */ … … 813 814 } 814 815 815 /* Create 'take new snapshot' dialog: */816 816 if (fIsValid) 817 817 { 818 /* Prepare dialog: */ 819 VBoxTakeSnapshotDlg dlg(this, mMachine); 820 dlg.mLbIcon->setPixmap(vboxGlobal().vmGuestOSTypeIcon(mMachine.GetOSTypeId())); 818 /* Create take-snapshot dialog: */ 819 QPointer<VBoxTakeSnapshotDlg> pDlg = new VBoxTakeSnapshotDlg(this, mMachine); 820 821 /* Assign corresponding icon: */ 822 pDlg->mLbIcon->setPixmap(vboxGlobal().vmGuestOSTypeIcon(mMachine.GetOSTypeId())); 821 823 822 824 /* Search for the max available snapshot index: */ … … 833 835 ++iterator; 834 836 } 835 dlg.mLeName->setText(snapShotName.arg(iMaxSnapShotIndex + 1)); 836 837 /* Show 'take new snapshot' dialog: */ 838 if (dlg.exec() == QDialog::Accepted) 837 pDlg->mLeName->setText(snapShotName.arg(iMaxSnapShotIndex + 1)); 838 839 /* Exec the dialog: */ 840 bool fDialogAccepted = pDlg->exec() == QDialog::Accepted; 841 842 /* Is the dialog still valid? */ 843 if (pDlg) 839 844 { 840 /* Take new snapshot: */ 841 CProgress progress = console.TakeSnapshot(dlg.mLeName->text().trimmed(), dlg.mTeDescription->toPlainText()); 842 if (console.isOk()) 845 /* Acquire variables: */ 846 QString strSnapshotName = pDlg->mLeName->text().trimmed(); 847 QString strSnapshotDescription = pDlg->mTeDescription->toPlainText(); 848 849 /* Destroy dialog early: */ 850 delete pDlg; 851 852 /* Was the dialog accepted? */ 853 if (fDialogAccepted) 843 854 { 844 /* Show the progress dialog: */ 845 msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_create_90px.png", 846 msgCenter().mainWindowShown(), true); 847 if (progress.GetResultCode() != 0) 855 /* Prepare the take-snapshot progress: */ 856 CProgress progress = console.TakeSnapshot(strSnapshotName, strSnapshotDescription); 857 if (console.isOk()) 848 858 { 849 msgCenter().cannotTakeSnapshot(progress); 859 /* Show the take-snapshot progress: */ 860 msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_create_90px.png", 861 msgCenter().mainWindowShown(), true); 862 if (progress.GetResultCode() != 0) 863 { 864 msgCenter().cannotTakeSnapshot(progress); 865 fIsValid = false; 866 } 867 } 868 else 869 { 870 msgCenter().cannotTakeSnapshot(console); 850 871 fIsValid = false; 851 872 } 852 873 } 853 874 else 854 {855 msgCenter().cannotTakeSnapshot(console);856 875 fIsValid = false; 857 }858 876 } 859 877 else
Note:
See TracChangeset
for help on using the changeset viewer.