Changeset 88115 in vbox
- Timestamp:
- Mar 15, 2021 9:34:32 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r88019 r88115 422 422 } 423 423 424 /* Attach emptyoptical drive: */424 /* Attach optical drive: */ 425 425 KStorageBus enmDVDBus = comGuestType.GetRecommendedDVDStorageBus(); 426 426 CStorageController comDVDController = m_machine.GetStorageControllerByInstance(enmDVDBus, 0); 427 427 if (!comDVDController.isNull()) 428 428 { 429 machine.AttachDevice(comDVDController.GetName(), 1, 0, KDeviceType_DVD, CMedium()); 429 CMedium opticalDisk; 430 QString strISOFilePath = getStringFieldValue("ISOFilePath"); 431 if (!strISOFilePath.isEmpty() && !getBoolFieldValue("isUnattendedEnabled")) 432 { 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 } 442 } 443 machine.AttachDevice(comDVDController.GetName(), 1, 0, KDeviceType_DVD, opticalDisk); 430 444 if (!machine.isOk()) 431 445 msgCenter().cannotAttachDevice(machine, UIMediumDeviceType_DVD, QString(), 432 446 StorageSlot(enmDVDBus, 1, 0), this); 433 434 447 } 435 448 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r88114 r88115 361 361 m_pSkipUnattendedCheckBox->setToolTip(UIWizardNewVM::tr("<p>When checked selected ISO file will be mounted to the CD drive " 362 362 "of the virtual machine but the unattended installation will " 363 "not start </p>"));363 "not start.</p>")); 364 364 } 365 365 } … … 378 378 const QString &strPath = m_pNameAndSystemEditor->ISOFilePath(); 379 379 if (strPath.isNull() || strPath.isEmpty()) 380 return false; 381 if (m_pSkipUnattendedCheckBox && m_pSkipUnattendedCheckBox->isChecked()) 380 382 return false; 381 383 return true; … … 422 424 } 423 425 424 void UIWizardNewVMPage1::setSkipCheckBoxEnable(bool fEnable) 425 { 426 if (m_pSkipUnattendedCheckBox) 427 m_pSkipUnattendedCheckBox->setEnabled(fEnable); 426 void UIWizardNewVMPage1::setSkipCheckBoxEnable() 427 { 428 if (!m_pSkipUnattendedCheckBox) 429 return; 430 if (m_pNameAndSystemEditor) 431 { 432 const QString &strPath = m_pNameAndSystemEditor->ISOFilePath(); 433 m_pSkipUnattendedCheckBox->setEnabled(!strPath.isNull() && !strPath.isEmpty()); 434 } 428 435 } 429 436 … … 471 478 registerField("ISOFilePath", this, "ISOFilePath"); 472 479 registerField("isUnattendedEnabled", this, "isUnattendedEnabled"); 473 registerField("skipUnattendedInstall", this, "skipUnattendedInstall");480 //registerField("skipUnattendedInstall", this, "skipUnattendedInstall"); 474 481 registerField("detectedOSTypeId", this, "detectedOSTypeId"); 475 482 } … … 542 549 if (m_pNameAndSystemEditor) 543 550 m_pNameAndSystemEditor->setFocus(); 544 setSkipCheckBoxEnable( isUnattendedEnabled());551 setSkipCheckBoxEnable(); 545 552 } 546 553 … … 567 574 if (fileInfo.exists() && fileInfo.isReadable()) 568 575 uiCommon().updateRecentlyUsedMediumListAndFolder(UIMediumDeviceType_DVD, strPath); 569 setSkipCheckBoxEnable( isUnattendedEnabled());576 setSkipCheckBoxEnable(); 570 577 emit completeChanged(); 571 578 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r88114 r88115 86 86 /** Return false if ISO path is not empty but points to an missing or unreadable file. */ 87 87 bool checkISOFile() const; 88 void setSkipCheckBoxEnable( bool fEnable);88 void setSkipCheckBoxEnable(); 89 89 /** @name Widgets 90 90 * @{ */ … … 126 126 Q_PROPERTY(QString ISOFilePath READ ISOFilePath); 127 127 Q_PROPERTY(bool isUnattendedEnabled READ isUnattendedEnabled); 128 Q_PROPERTY(bool skipUnattendedInstall READ skipUnattendedInstall);128 //Q_PROPERTY(bool skipUnattendedInstall READ skipUnattendedInstall); 129 129 Q_PROPERTY(QString detectedOSTypeId READ detectedOSTypeId); 130 130 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r88110 r88115 83 83 registerField("ISOFilePath", this, "ISOFilePath"); 84 84 registerField("isUnattendedEnabled", this, "isUnattendedEnabled"); 85 registerField("skipUnattendedInstall", this, "skipUnattendedInstall");85 //registerField("skipUnattendedInstall", this, "skipUnattendedInstall"); 86 86 registerField("startHeadless", this, "startHeadless"); 87 87 registerField("detectedOSTypeId", this, "detectedOSTypeId"); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r88110 r88115 55 55 Q_PROPERTY(QString ISOFilePath READ ISOFilePath); 56 56 Q_PROPERTY(bool isUnattendedEnabled READ isUnattendedEnabled); 57 Q_PROPERTY(bool skipUnattendedInstall READ skipUnattendedInstall);57 //Q_PROPERTY(bool skipUnattendedInstall READ skipUnattendedInstall); 58 58 Q_PROPERTY(bool startHeadless READ startHeadless); 59 59 Q_PROPERTY(QString detectedOSTypeId READ detectedOSTypeId);
Note:
See TracChangeset
for help on using the changeset viewer.