Changeset 88000 in vbox
- Timestamp:
- Mar 8, 2021 8:29:00 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143123
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r87932 r88000 230 230 } 231 231 232 void UIWizardNewVM::deleteVirtualDisk() 233 { 234 CMedium comDisk = virtualDisk(); 235 /* Make sure virtual-disk valid: */ 236 if (comDisk.isNull()) 237 return; 238 239 /* Remember virtual-disk attributes: */ 240 QString strLocation = comDisk.GetLocation(); 241 /* Prepare delete storage progress: */ 242 CProgress progress = comDisk.DeleteStorage(); 243 if (comDisk.isOk()) 244 { 245 /* Show delete storage progress: */ 246 msgCenter().showModalProgressDialog(progress, windowTitle(), ":/progress_media_delete_90px.png", this); 247 if (!progress.isOk() || progress.GetResultCode() != 0) 248 msgCenter().cannotDeleteHardDiskStorage(progress, strLocation, this); 249 } 250 else 251 msgCenter().cannotDeleteHardDiskStorage(comDisk, strLocation, this); 252 253 /* Detach virtual-disk anyway: */ 254 comDisk.detach(); 255 } 256 232 257 void UIWizardNewVM::configureVM(const QString &strGuestTypeId, const CGuestOSType &comGuestType) 233 258 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r87916 r88000 101 101 bool createVM(); 102 102 bool createVirtualDisk(); 103 void deleteVirtualDisk(); 103 104 104 105 void configureVM(const QString &strGuestTypeId, const CGuestOSType &comGuestType); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp
r87981 r88000 419 419 return fResult; 420 420 } 421 421 422 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM(); 423 /* Try to delete the hard disk: */ 424 if (!fResult) 425 qobject_cast<UIWizardNewVM*>(wizard())->deleteVirtualDisk(); 426 422 427 endProcessing(); 423 428 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87982 r88000 38 38 #include "UIMedium.h" 39 39 #include "UIMediumSizeEditor.h" 40 #include "UIMessageCenter.h" 40 41 #include "UINameAndSystemEditor.h" 41 42 #include "UIToolBox.h" … … 528 529 bool UIWizardNewVMPageExpert::validatePage() 529 530 { 530 /* Initial result: */531 531 bool fResult = true; 532 532 533 /* Lock finish button: */ 533 if (selectedDiskSource() == SelectedDiskSource_New) 534 { 535 /* Check if the path we will be using for hard drive creation exists: */ 536 const QString strMediumPath(fieldImp("mediumPath").toString()); 537 fResult = !QFileInfo(strMediumPath).exists(); 538 if (!fResult) 539 { 540 msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); 541 return fResult; 542 } 543 /* Check FAT size limitation of the host hard drive: */ 544 fResult = UIWizardNewVDPage3::checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(), 545 fieldImp("mediumPath").toString(), 546 fieldImp("mediumSize").toULongLong()); 547 if (!fResult) 548 { 549 msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this); 550 return fResult; 551 } 552 } 553 534 554 startProcessing(); 535 536 /* Try to create machine folder: */ 537 if (fResult) 538 fResult = createMachineFolder(); 539 540 /* Try to assign boot virtual-disk: */ 541 if (fResult) 542 { 543 /* Ensure there is no virtual-disk created yet: */ 544 Assert(m_virtualDisk.isNull()); 545 if (fResult) 546 { 547 if (m_pDiskNew->isChecked()) 548 { 549 } 550 } 551 } 552 553 /* Try to create VM: */ 554 if (fResult) 555 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM(); 556 557 /* Unlock finish button: */ 555 if (selectedDiskSource() == SelectedDiskSource_New) 556 { 557 /* Try to create the hard drive:*/ 558 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVirtualDisk(); 559 /*Don't show any error message here since UIWizardNewVM::createVirtualDisk already does so: */ 560 if (!fResult) 561 return fResult; 562 } 563 564 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM(); 565 /* Try to delete the hard disk: */ 566 if (!fResult) 567 qobject_cast<UIWizardNewVM*>(wizard())->deleteVirtualDisk(); 568 558 569 endProcessing(); 559 570 560 /* Return result: */561 571 return fResult; 562 572 }
Note:
See TracChangeset
for help on using the changeset viewer.