Changeset 90060 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 6, 2021 12:12:10 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145555
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r90040 r90060 64 64 , m_fStartHeadless(false) 65 65 , m_fSkipUnattendedInstall(false) 66 , m_iCPUCount(1) 67 , m_iMemoryAmount(0) 68 66 69 { 67 70 #ifndef VBOX_WS_MAC … … 85 88 { 86 89 addPage(new UIWizardNewVMNameOSTypePageBasic); 87 addPage(new UIWizardNewVMUnattendedPageBasic);88 addPage(new UIWizardNewVMHardwarePageBasic);89 addPage(new UIWizardNewVMDiskPageBasic);90 // addPage(new UIWizardNewVMUnattendedPageBasic); 91 // addPage(new UIWizardNewVMHardwarePageBasic); 92 // addPage(new UIWizardNewVMDiskPageBasic); 90 93 break; 91 94 } … … 758 761 } 759 762 763 int UIWizardNewVM::CPUCount() const 764 { 765 return m_iCPUCount; 766 } 767 768 void UIWizardNewVM::setCPUCount(int iCPUCount) 769 { 770 m_iCPUCount = iCPUCount; 771 } 772 773 int UIWizardNewVM::memoryAmount() const 774 { 775 return m_iMemoryAmount; 776 } 777 778 void UIWizardNewVM::setMemoryCount(int iMemory) 779 { 780 m_iMemoryAmount = iMemory; 781 } 782 760 783 const UIUnattendedInstallData &UIWizardNewVM::unattendedInstallData() const 761 784 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r90041 r90060 29 29 #include "CMachine.h" 30 30 #include "CMedium.h" 31 32 #define parentWizardSet(functionName, value) \ 33 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); \ 34 if (pWizard) \ 35 pWizard->functionName(value); 31 36 32 37 /** Container for unattended install related data. */ … … 129 134 void setProductKey(const QString &productKey); 130 135 136 int CPUCount() const; 137 void setCPUCount(int iCPUCount); 138 139 int memoryAmount() const; 140 void setMemoryCount(int iMemory); 141 131 142 protected: 132 143 … … 195 206 QString m_strHostname; 196 207 QString m_strProductKey; 208 209 int m_iCPUCount; 210 int m_iMemoryAmount; 197 211 }; 198 212 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePageBasic.cpp
r90003 r90060 34 34 #include "CGuestOSType.h" 35 35 36 // UIWizardNewVMHardwarePage::UIWizardNewVMHardwarePage()37 // {38 // }39 40 // int UIWizardNewVMHardwarePage::baseMemory() const41 // {42 // if (!m_pBaseMemoryEditor)43 // return 0;44 // return m_pBaseMemoryEditor->value();45 // }46 47 // int UIWizardNewVMHardwarePage::VCPUCount() const48 // {49 // if (!m_pVirtualCPUEditor)50 // return 1;51 // return m_pVirtualCPUEditor->value();52 // }53 54 // bool UIWizardNewVMHardwarePage::EFIEnabled() const55 // {56 // if (!m_pEFICheckBox)57 // return false;58 // return m_pEFICheckBox->isChecked();59 // }60 61 62 36 UIWizardNewVMHardwarePageBasic::UIWizardNewVMHardwarePageBasic() 63 37 : m_pBaseMemoryEditor(0) … … 66 40 , m_pLabel(0) 67 41 { 42 m_pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 68 43 prepare(); 69 44 qRegisterMetaType<CMedium>(); … … 79 54 80 55 pMainLayout->addStretch(); 81 //createConnections();56 createConnections(); 82 57 } 83 58 84 59 void UIWizardNewVMHardwarePageBasic::createConnections() 85 60 { 61 connect(m_pBaseMemoryEditor, &UIBaseMemoryEditor::sigValueChanged, 62 this, &UIWizardNewVMHardwarePageBasic::sltMemoryAmountChanged); 63 64 86 65 } 87 66 … … 145 124 return pHardwareContainer; 146 125 } 126 127 void UIWizardNewVMHardwarePageBasic::sltMemoryAmountChanged(int iValue) 128 { 129 Q_UNUSED(iValue); 130 } 131 132 void UIWizardNewVMHardwarePageBasic::sltCPUCountChanged(int iCount) 133 { 134 Q_UNUSED(iCount); 135 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePageBasic.h
r90003 r90060 38 38 class UIBaseMemoryEditor; 39 39 class UIVirtualCPUEditor; 40 class UIWizardNewVM; 40 41 41 /** 3rd page of the New Virtual Machine wizard (base part). */ 42 // class UIWizardNewVMHardwarePage : public UIWizardPageBase 43 // { 44 45 // protected: 46 47 // /** Constructor. */ 48 // UIWizardNewVMHardwarePage(); 49 50 51 // /** @name Property getters/setters 52 // * @{ */ 42 namespace UIWizardNewVMHardwarePage 43 { 44 } 53 45 // int baseMemory() const; 54 46 // int VCPUCount() const; 55 47 // bool EFIEnabled() const; 56 // /** @} */57 58 // QWidget *createHardwareWidgets();59 // void retranslateWidgets();60 48 61 49 62 63 64 // };65 66 /** 3rd page of the New Virtual Machine wizard (basic extension). */67 50 class UIWizardNewVMHardwarePageBasic : public UINativeWizardPage 68 51 { … … 71 54 public: 72 55 73 /** Constructor. */74 56 UIWizardNewVMHardwarePageBasic(); 75 57 … … 79 61 private slots: 80 62 63 void sltMemoryAmountChanged(int iValue); 64 void sltCPUCountChanged(int iCount); 81 65 82 66 private: 83 84 67 85 68 /** Prepare stuff. */ … … 91 74 QWidget *createHardwareWidgets(); 92 75 bool isComplete() const; 76 77 UIWizardNewVM *m_pWizard; 93 78 94 79 /** @name Widgets -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.cpp
r90037 r90060 38 38 #include "CSystemProperties.h" 39 39 #include "CUnattended.h" 40 40 41 41 42 /* Defines some patterns to guess the right OS type. Should be in sync with … … 344 345 , m_pNameOSTypeLabel(0) 345 346 { 346 m_pWizard = qobject_cast<UIWizardNewVM*>(wizard());347 347 prepare(); 348 348 } … … 400 400 { 401 401 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, strNewName); 402 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, m_pWizard); 402 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard())); 403 emit completeChanged(); 403 404 } 404 405 … … 406 407 { 407 408 Q_UNUSED(strNewPath); 408 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, m_pWizard);409 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard())); 409 410 } 410 411 … … 457 458 { 458 459 /* Try to create machine folder: */ 459 return UIWizardNewVMNameOSTypePage::createMachineFolder(m_pNameAndSystemEditor, this, m_pWizard);460 return UIWizardNewVMNameOSTypePage::createMachineFolder(m_pNameAndSystemEditor, this, qobject_cast<UIWizardNewVM*>(wizard())); 460 461 } 461 462 462 463 void UIWizardNewVMNameOSTypePageBasic::sltISOPathChanged(const QString &strPath) 463 464 { 464 UIWizardNewVMNameOSTypePage::determineOSType(strPath, m_pWizard); 465 if (m_pWizard) 466 { 467 if (!m_pWizard->detectedOSTypeId().isEmpty()) 468 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, m_pWizard->detectedOSTypeId()); 469 m_pWizard->setISOFilePath(strPath); 465 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(this->wizard()); 466 UIWizardNewVMNameOSTypePage::determineOSType(strPath, pWizard); 467 if (pWizard) 468 { 469 if (!pWizard->detectedOSTypeId().isEmpty()) 470 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, pWizard->detectedOSTypeId()); 471 pWizard->setISOFilePath(strPath); 470 472 } 471 473 /* Update the global recent ISO path: */ … … 479 481 void UIWizardNewVMNameOSTypePageBasic::sltGuestOSFamilChanged(const QString &strGuestOSFamilyId) 480 482 { 481 if (m_pWizard) 482 m_pWizard->setGuestOSFamilyId(strGuestOSFamilyId); 483 parentWizardSet(setGuestOSFamilyId, strGuestOSFamilyId); 483 484 } 484 485 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.h
r90037 r90060 101 101 bool isUnattendedEnabled() const; 102 102 103 UIWizardNewVM *m_pWizard;104 105 103 /** @name Widgets 106 104 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
r90040 r90060 68 68 , m_pProductKeyLabel(0) 69 69 { 70 m_pWizard = qobject_cast<UIWizardNewVM*>(wizard());71 70 prepare(); 72 71 } … … 159 158 { 160 159 markWidgets(); 161 if (m_pWizard && m_pWizard->installGuestAdditions() && 160 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 161 if (pWizard && pWizard->installGuestAdditions() && 162 162 !UIWizardNewVMUnattendedPage::checkGAISOFile(m_pGAISOFilePathSelector)) 163 163 return false; … … 179 179 { 180 180 disableEnableGAWidgets(fEnabled); 181 if (m_pWizard) 182 m_pWizard->setInstallGuestAdditions(fEnabled); 181 parentWizardSet(setInstallGuestAdditions, fEnabled); 183 182 emit completeChanged(); 184 183 } … … 186 185 void UIWizardNewVMUnattendedPageBasic::sltGAISOPathChanged(const QString &strPath) 187 186 { 188 if (m_pWizard) 189 m_pWizard->setGuestAdditionsISOPath(strPath); 187 parentWizardSet(setGuestAdditionsISOPath, strPath); 190 188 emit completeChanged(); 191 189 } … … 193 191 void UIWizardNewVMUnattendedPageBasic::sltPasswordChanged(const QString &strPassword) 194 192 { 195 if (m_pWizard) 196 m_pWizard->setPassword(strPassword); 193 parentWizardSet(setPassword, strPassword); 197 194 emit completeChanged(); 198 195 } … … 200 197 void UIWizardNewVMUnattendedPageBasic::sltUserNameChanged(const QString &strUserName) 201 198 { 202 if (m_pWizard) 203 m_pWizard->setUserName(strUserName); 199 parentWizardSet(setUserName, strUserName); 204 200 emit completeChanged(); 205 201 } … … 207 203 bool UIWizardNewVMUnattendedPageBasic::isProductKeyWidgetEnabled() const 208 204 { 209 if (!m_pWizard || !m_pWizard->isUnattendedEnabled() || !m_pWizard->isGuestOSTypeWindows()) 205 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 206 if (!pWizard || !pWizard->isUnattendedEnabled() || !pWizard->isGuestOSTypeWindows()) 210 207 return false; 211 208 return true; … … 214 211 void UIWizardNewVMUnattendedPageBasic::sltHostnameChanged(const QString &strHostname) 215 212 { 216 if (m_pWizard) 217 m_pWizard->setHostname(strHostname); 213 parentWizardSet(setHostname, strHostname); 218 214 } 219 215 220 216 void UIWizardNewVMUnattendedPageBasic::sltProductKeyChanged(const QString &strProductKey) 221 217 { 222 if (m_pWizard) 223 m_pWizard->setProductKey(strProductKey); 218 parentWizardSet(setProductKey, strProductKey); 224 219 } 225 220 226 221 void UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged(bool fStartHeadless) 227 222 { 228 if (m_pWizard) 229 m_pWizard->setStartHeadless(fStartHeadless); 223 parentWizardSet(setStartHeadless, fStartHeadless); 230 224 } 231 225 … … 355 349 void UIWizardNewVMUnattendedPageBasic::markWidgets() const 356 350 { 357 if (m_pWizard && m_pWizard->installGuestAdditions()) 351 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 352 if (pWizard && pWizard->installGuestAdditions()) 358 353 m_pGAISOFilePathSelector->mark(!UIWizardNewVMUnattendedPage::checkGAISOFile(m_pGAISOFilePathSelector)); 359 354 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
r90040 r90060 35 35 class UIFilePathSelector; 36 36 class UIUserNamePasswordEditor; 37 class UIWizardNewVM;38 37 struct UIUnattendedInstallData; 39 38 … … 86 85 void markWidgets() const; 87 86 88 UIWizardNewVM *m_pWizard;89 90 87 /** @name Widgets 91 88 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.