Changeset 90040 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 5, 2021 8:05:25 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145534
- 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
r90039 r90040 62 62 , m_iUSBCount(0) 63 63 , m_fInstallGuestAdditions(false) 64 , m_fStartHeadless(false) 65 , m_fSkipUnattendedInstall(false) 64 66 { 65 67 #ifndef VBOX_WS_MAC … … 74 76 75 77 connect(this, &UIWizardNewVM::rejected, this, &UIWizardNewVM::sltHandleWizardCancel); 76 }77 78 void UIWizardNewVM::prepare()79 {80 // enableHelpButton("gui-createvm");81 // /* Create corresponding pages: */82 // switch (mode())83 // {84 // case WizardMode_Basic:85 // {86 // // setPage(Page1, new UIWizardNewVMPageNameOSType(m_strMachineGroup));87 // // setPage(Page2, new UIWizardNewVMPageUnattended);88 // // setPage(Page3, new UIWizardNewVMPageHardware);89 // // setPage(Page4, new UIWizardNewVMPageDisk);90 91 // // setStartId(Page1);92 // break;93 // }94 // case WizardMode_Expert:95 // {96 // setPage(PageExpert, new UIWizardNewVMPageExpert(m_strMachineGroup));97 // break;98 // }99 // default:100 // {101 // AssertMsgFailed(("Invalid mode: %d", mode()));102 // break;103 // }104 // }105 // /* Call to base-class: */106 // UIWizard::prepare();107 78 } 108 79 … … 525 496 } 526 497 527 // void UIWizardNewVM::sltHandleDetectedOSTypeChange()528 // {529 // // UIWizardNewVMPageNameOSType *pPage = qobject_cast<UIWizardNewVMPageNameOSType*>(page(Page1));530 // // if (!pPage)531 // // return;532 // // pPage->setTypeByISODetectedOSType(getStringFieldValue("detectedOSTypeId"));533 // }534 535 void UIWizardNewVM::sltCustomButtonClicked(int iId)536 {537 Q_UNUSED(iId);538 // UIWizard::sltCustomButtonClicked(iId);539 // setFieldsFromDefaultUnttendedInstallData();540 }541 542 498 void UIWizardNewVM::retranslateUi() 543 499 { 544 /* Call to base-class: */545 500 UINativeWizard::retranslateUi(); 546 547 501 setWindowTitle(tr("Create Virtual Machine")); 548 502 // setButtonText(QWizard::FinishButton, tr("Create")); … … 722 676 { 723 677 m_fInstallGuestAdditions = fInstallGA; 678 } 679 680 bool UIWizardNewVM::startHeadless() const 681 { 682 return m_fStartHeadless; 683 } 684 685 void UIWizardNewVM::setStartHeadless(bool fStartHeadless) 686 { 687 m_fStartHeadless = fStartHeadless; 688 } 689 690 bool UIWizardNewVM::skipUnattendedInstall() const 691 { 692 return m_fSkipUnattendedInstall; 693 } 694 695 void UIWizardNewVM::setSkipUnattendedInstall(bool fSkipUnattendedInstall) 696 { 697 m_fSkipUnattendedInstall = fSkipUnattendedInstall; 724 698 } 725 699 … … 799 773 m_unattendedInstallData.m_strGuestAdditionsISOPath = m_strGuestAdditionsISOPath; 800 774 801 // m_unattendedInstallData.m_fUnattendedEnabled = getBoolFieldValue("isUnattendedEnabled");802 // m_unattendedInstallData.m_fStartHeadless = getBoolFieldValue("startHeadless");775 m_unattendedInstallData.m_fUnattendedEnabled = isUnattendedEnabled(); 776 m_unattendedInstallData.m_fStartHeadless = m_fStartHeadless; 803 777 m_unattendedInstallData.m_fInstallGuestAdditions = m_fInstallGuestAdditions; 804 778 // m_unattendedInstallData.m_uMachineUid = createdMachineId(); … … 809 783 bool UIWizardNewVM::isUnattendedEnabled() const 810 784 { 811 // QVariant fieldValue = field("isUnattendedEnabled");812 // if (fieldValue.isNull() || !fieldValue.isValid() || !fieldValue.canConvert(QMetaType::Bool))813 // return false;814 // return fieldValue.toBool();785 if (!m_fSkipUnattendedInstall) 786 return false; 787 if (m_strISOFilePath.isEmpty() || m_strISOFilePath.isNull()) 788 return false; 815 789 return true; 816 790 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r90039 r90040 71 71 public: 72 72 73 74 /** Constructor: */75 73 UIWizardNewVM(QWidget *pParent, const QString &strMachineGroup = QString(), WizardMode enmMode = WizardMode_Auto); 76 77 /** Prepare routine. */78 void prepare();79 80 74 /** Returns the Id of newly created VM. */ 81 75 QUuid createdMachineId() const; 76 bool isUnattendedEnabled() const; 82 77 void setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData); 83 78 const UIUnattendedInstallData &unattendedInstallData() const; 84 bool isUnattendedEnabled() const;85 79 bool isGuestOSTypeWindows() const; 86 80 CMedium &virtualDisk(); … … 111 105 void setInstallGuestAdditions(bool fInstallGA); 112 106 107 bool startHeadless() const; 108 void setStartHeadless(bool fStartHeadless); 109 110 bool skipUnattendedInstall() const; 111 void setSkipUnattendedInstall(bool fSkipUnattendedInstall); 112 113 113 const QString &ISOFilePath() const; 114 114 void setISOFilePath(const QString &strISOFilePath); … … 132 132 133 133 /** Populates pages. */ 134 virtual void populatePages() /* final */;134 virtual void populatePages() /* final override */; 135 135 136 136 bool createVM(); … … 149 149 private: 150 150 151 /* Translation stuff: */152 151 void retranslateUi(); 153 154 155 /* Helping stuff: */156 152 QString getNextControllerName(KStorageBus type); 157 153 void setFieldsFromDefaultUnttendedInstallData(); … … 193 189 /** True if guest additions are to be installed during unattended install. */ 194 190 bool m_fInstallGuestAdditions; 191 bool m_fStartHeadless; 192 bool m_fSkipUnattendedInstall; 195 193 196 194 QString m_strUserName; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
r90039 r90040 40 40 #include "CUnattended.h" 41 41 42 // QString UIWizardNewVMUnattendedPage::productKey() const43 // {44 // if (!m_pProductKeyLineEdit || !m_pProductKeyLineEdit->hasAcceptableInput())45 // return QString();46 // return m_pProductKeyLineEdit->text();47 // }48 49 50 42 bool UIWizardNewVMUnattendedPage::checkGAISOFile(UIFilePathSelector *pGAISOFilePathSelector) 51 43 { … … 61 53 return true; 62 54 } 63 64 65 66 // bool UIWizardNewVMUnattendedPage::startHeadless() const67 // {68 // if (!m_pStartHeadlessCheckBox)69 // return false;70 // return m_pStartHeadlessCheckBox->isChecked();71 // }72 73 55 74 56 UIWizardNewVMUnattendedPageBasic::UIWizardNewVMUnattendedPageBasic() … … 114 96 this, &UIWizardNewVMUnattendedPageBasic::sltUserNameChanged); 115 97 } 116 117 98 if (m_pGAISOFilePathSelector) 118 99 connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged, … … 127 108 connect(m_pProductKeyLineEdit, &QLineEdit::textChanged, 128 109 this, &UIWizardNewVMUnattendedPageBasic::sltProductKeyChanged); 129 110 if (m_pStartHeadlessCheckBox) 111 connect(m_pStartHeadlessCheckBox, &QCheckBox::toggled, 112 this, &UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged); 130 113 } 131 114 … … 149 132 m_pGAInstallationISOContainer->setTitle(UIWizardNewVM::tr("Gu&est Additions")); 150 133 m_pGAInstallationISOContainer->setToolTip(UIWizardNewVM::tr("<p>When checked the guest additions will be installed " 151 "after the OS install.</p>"));134 "after the OS install.</p>")); 152 135 } 153 136 if (m_pProductKeyLabel) … … 239 222 if (m_pWizard) 240 223 m_pWizard->setProductKey(strProductKey); 224 } 225 226 void UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged(bool fStartHeadless) 227 { 228 if (m_pWizard) 229 m_pWizard->setStartHeadless(fStartHeadless); 241 230 } 242 231 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
r90039 r90040 41 41 namespace UIWizardNewVMUnattendedPage 42 42 { 43 /** Returns false if ISO path selector is non empty but has invalid file path. */ 43 44 bool checkGAISOFile(UIFilePathSelector *pGAISOFilePathSelector); 44 // UIWizardNewVMUnattendedPage();45 46 // /** @name Property getters/setters47 // * @{ */48 // QString userName() const;49 // void setUserName(const QString &strName);50 // QString password() const;51 // void setPassword(const QString &strPassword);52 // QString hostname() const;53 // void setHostname(const QString &strHostName);54 // QString guestAdditionsISOPath() const;55 // void setGuestAdditionsISOPath(const QString &strISOPath);56 // QString productKey() const;57 // /** @} */58 59 60 // /** Returns false if ISO path selector is non empty but has invalid file path. */61 // bool checkGAISOFile() const;62 63 // void retranslateWidgets();64 65 66 // bool startHeadless() const;67 68 69 45 } 70 46 … … 91 67 void sltHostnameChanged(const QString &strHostname); 92 68 void sltProductKeyChanged(const QString &strProductKey); 69 void sltStartHeadlessChanged(bool fStartHeadless); 93 70 94 71 private:
Note:
See TracChangeset
for help on using the changeset viewer.