void VBoxSnapshotsWgt::sltCloneSnapshot() { SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 : static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem()); AssertReturn (item, (void) 0); CMachine machine; CSnapshot snapshot; if (item->isCurrentStateItem()) machine = item->machine(); else { snapshot = item->snapshot(); AssertReturn(!snapshot.isNull(), (void)0); machine = snapshot.GetMachine(); } AssertReturn(!machine.isNull(), (void)0); /* Show Clone VM wizard: */ UISafePointerWizard pWizard = new UIWizardCloneVM(this, machine, snapshot); pWizard->prepare(); pWizard->exec(); if (pWizard) delete pWizard; }
void VBoxSnapshotsWgt::sltShowSnapshotDetails() { SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 : static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem()); AssertReturn (item, (void) 0); CSnapshot snap = item->snapshot(); AssertReturn (!snap.isNull(), (void) 0); CMachine snapMachine = snap.GetMachine(); VBoxSnapshotDetailsDlg dlg (this); dlg.getFromSnapshot (snap); if (dlg.exec() == QDialog::Accepted) dlg.putBackToSnapshot(); }