Changeset 88246 in vbox
- Timestamp:
- Mar 22, 2021 3:25:33 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143446
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r88115 r88246 133 133 * 2. or attach a new (empty) one. 134 134 * 3. and if the unattended install is not enabled 135 * 4. User did not select an ISO image file 135 136 * Usually we are assigning extra-data values through UIExtraDataManager, 136 137 * but in that special case VM was not registered yet, so UIExtraDataManager is unaware of it: */ 137 if (!isUnattendedEnabled() && 138 if (ISOFilePath().isEmpty() && 139 !isUnattendedEnabled() && 138 140 !m_virtualDisk.isNull()) 139 141 m_machine.SetExtraData(GUI_FirstRun, "yes"); … … 428 430 { 429 431 CMedium opticalDisk; 430 QString strISOFilePath = getStringFieldValue("ISOFilePath");432 QString strISOFilePath = ISOFilePath(); 431 433 if (!strISOFilePath.isEmpty() && !getBoolFieldValue("isUnattendedEnabled")) 432 434 { 433 QFileInfo isoFileInfo(strISOFilePath); 434 if (isoFileInfo.exists() && isoFileInfo.isReadable()) 435 { 436 CVirtualBox vbox = uiCommon().virtualBox(); 437 opticalDisk = 438 vbox.OpenMedium(strISOFilePath, KDeviceType_DVD, KAccessMode_ReadWrite, false); 439 if (!vbox.isOk()) 440 msgCenter().cannotOpenMedium(vbox, strISOFilePath, this); 441 } 435 CVirtualBox vbox = uiCommon().virtualBox(); 436 opticalDisk = 437 vbox.OpenMedium(strISOFilePath, KDeviceType_DVD, KAccessMode_ReadWrite, false); 438 if (!vbox.isOk()) 439 msgCenter().cannotOpenMedium(vbox, strISOFilePath, this); 442 440 } 443 441 machine.AttachDevice(comDVDController.GetName(), 1, 0, KDeviceType_DVD, opticalDisk); … … 634 632 setField("installGuestAdditions", m_unattendedInstallData.m_fInstallGuestAdditions); 635 633 setField("guestAdditionsISOPath", m_unattendedInstallData.m_strGuestAdditionsISOPath); 634 } 635 636 QString UIWizardNewVM::ISOFilePath() const 637 { 638 QString strPath = getStringFieldValue("ISOFilePath"); 639 if (strPath.isNull() || strPath.isEmpty()) 640 return QString(); 641 QFileInfo isoFileInfo(strPath); 642 if (isoFileInfo.exists() && isoFileInfo.isReadable()) 643 return strPath; 644 return QString(); 636 645 } 637 646 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r88038 r88246 130 130 QString getNextControllerName(KStorageBus type); 131 131 void setFieldsFromDefaultUnttendedInstallData(); 132 /* Returns ISO file path if a readable ISO file is selected. Returns an empty string otherwise. */ 133 QString ISOFilePath() const; 132 134 133 135 /** @name Variables
Note:
See TracChangeset
for help on using the changeset viewer.