Changeset 93642 in vbox for trunk/src/VBox
- Timestamp:
- Feb 7, 2022 2:36:58 PM (3 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
r93638 r93642 560 560 } 561 561 562 // void UIWizardNewVM::setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData)563 // {564 // m_unattendedInstallData = unattendedInstallData;565 // }566 567 562 CMedium &UIWizardNewVM::virtualDisk() 568 563 { … … 634 629 } 635 630 636 const QString &UIWizardNewVM::detectedOSTypeId() const 637 { 638 return m_strDetectedOSTypeId; 639 } 640 641 void UIWizardNewVM::setDetectedOSTypeId(const QString &strDetectedOSTypeId) 642 { 643 m_strDetectedOSTypeId = strDetectedOSTypeId; 631 QString UIWizardNewVM::detectedOSTypeId() const 632 { 633 AssertReturn(!m_comUnattended.isNull(), QString()); 634 return m_comUnattended.GetDetectedOSTypeId(); 644 635 } 645 636 … … 717 708 void UIWizardNewVM::setISOFilePath(const QString &strISOFilePath) 718 709 { 710 /* am I being a paranoid?: */ 711 QFileInfo isoFileInfo(strISOFilePath); 712 if (!isoFileInfo.exists()) 713 return; 714 719 715 AssertReturnVoid(!m_comUnattended.isNull()); 720 716 m_comUnattended.SetIsoPath(strISOFilePath); … … 722 718 setUnattendedPageVisible(isUnattendedEnabled()); 723 719 AssertReturnVoid(checkUnattendedInstallError(m_comUnattended)); 720 721 m_comUnattended.DetectIsoOS(); 722 723 const QVector<ULONG> &indices = m_comUnattended.GetDetectedImageIndices(); 724 QVector<ulong> qIndices; 725 for (int i = 0; i < indices.size(); ++i) 726 qIndices << indices[i]; 727 setDetectedWindowsImageNamesAndIndices(m_comUnattended.GetDetectedImageNames(), qIndices); 724 728 } 725 729 … … 929 933 bool UIWizardNewVM::isOSTypeDetectionOK() const 930 934 { 931 if (m_strDetectedOSTypeId.isEmpty()) 935 QString strDetectedOSTypeId = detectedOSTypeId(); 936 if (strDetectedOSTypeId.isEmpty()) 932 937 return false; 933 if ( m_strDetectedOSTypeId.contains("other", Qt::CaseInsensitive))938 if (strDetectedOSTypeId.contains("other", Qt::CaseInsensitive)) 934 939 return false; 935 940 return true; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r93638 r93642 83 83 void setCreatedMachineFolder(const QString &strCreatedMachineFolder); 84 84 85 const QString &detectedOSTypeId() const; 86 void setDetectedOSTypeId(const QString &strDetectedOSTypeId); 85 QString detectedOSTypeId() const; 87 86 88 87 const QString &guestOSFamilyId() const; … … 198 197 QString m_strMachineBaseName; 199 198 200 /** Type Id od the OS detected from the ISO file by IUnattended. */201 QString m_strDetectedOSTypeId;202 199 /* Name and index lists of the images detected from an ISO. Currently only for Windows ISOs. */ 203 200 QVector<QString> m_detectedWindowsImageNames; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
r93638 r93642 148 148 AssertReturnVoid(pWizard); 149 149 150 UIWizardNewVMNameOSTypeCommon::detectOSAndImagesFromISO(strISOPath, pWizard);150 pWizard->setISOFilePath(strISOPath); 151 151 152 152 if (UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId())) … … 154 154 else /* Remove GuestOSTypeFromISO from the set if it is there: */ 155 155 m_userModifiedParameters.remove("GuestOSTypeFromISO"); 156 157 pWizard->setISOFilePath(strISOPath);158 156 159 157 /* Update the global recent ISO path: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp
r93607 r93642 311 311 } 312 312 313 void UIWizardNewVMNameOSTypeCommon::detectOSAndImagesFromISO(const QString &strISOPath, UIWizardNewVM *pWizard)314 {315 if (!pWizard)316 return;317 318 QFileInfo isoFileInfo(strISOPath);319 if (!isoFileInfo.exists())320 {321 pWizard->setDetectedOSTypeId(QString());322 return;323 }324 325 CUnattended comUnatteded = uiCommon().virtualBox().CreateUnattendedInstaller();326 comUnatteded.SetIsoPath(strISOPath);327 comUnatteded.DetectIsoOS();328 pWizard->setDetectedOSTypeId(comUnatteded.GetDetectedOSTypeId());329 330 const QVector<ULONG> &indices = comUnatteded.GetDetectedImageIndices();331 QVector<ulong> qIndices;332 for (int i = 0; i < indices.size(); ++i)333 qIndices << indices[i];334 pWizard->setDetectedWindowsImageNamesAndIndices(comUnatteded.GetDetectedImageNames(), qIndices);335 }336 337 313 bool UIWizardNewVMNameOSTypeCommon::checkISOFile(UINameAndSystemEditor *pNameAndSystemEditor) 338 314 { … … 486 462 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(this->wizard()); 487 463 AssertReturnVoid(pWizard); 488 UIWizardNewVMNameOSTypeCommon::detectOSAndImagesFromISO(strPath, pWizard); 464 465 pWizard->setISOFilePath(strPath); 489 466 490 467 if (UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(m_pNameAndSystemEditor, pWizard->detectedOSTypeId())) … … 492 469 else /* Remove GuestOSTypeFromISO fromthe set if it is there: */ 493 470 m_userModifiedParameters.remove("GuestOSTypeFromISO"); 494 495 pWizard->setISOFilePath(strPath);496 471 497 472 /* Update the global recent ISO path: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.h
r93607 r93642 43 43 bool cleanupMachineFolder(UIWizardNewVM *pWizard, bool fWizardCancel = false); 44 44 void composeMachineFilePath(UINameAndSystemEditor *pNameAndSystemEditor, UIWizardNewVM *pWizard); 45 void detectOSAndImagesFromISO(const QString &strISOPath, UIWizardNewVM *pWizard);46 45 /** Return false if ISO path is not empty but points to an missing or unreadable file. */ 47 46 bool checkISOFile(UINameAndSystemEditor *pNameAndSystemEditor);
Note:
See TracChangeset
for help on using the changeset viewer.