Changeset 90073 in vbox
- Timestamp:
- Jul 7, 2021 6:38:10 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145570
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp ¶
r90072 r90073 64 64 , m_fStartHeadless(false) 65 65 , m_fSkipUnattendedInstall(false) 66 , m_fEFIEnabled(false) 66 67 , m_iCPUCount(1) 67 68 , m_iMemorySize(0) … … 672 673 } 673 674 675 const CGuestOSType &UIWizardNewVM::guestOSType() const 676 { 677 return m_comGuestOSType;; 678 } 679 680 void UIWizardNewVM::setGuestOSType(const CGuestOSType &guestOSType) 681 { 682 m_comGuestOSType= guestOSType; 683 } 684 674 685 bool UIWizardNewVM::installGuestAdditions() const 675 686 { … … 702 713 /* We hide/show unattended install page depending on the value of isUnattendedEnabled: */ 703 714 setUnattendedPageVisible(isUnattendedEnabled()); 715 } 716 717 bool UIWizardNewVM::EFIEnabled() const 718 { 719 return m_fEFIEnabled; 720 } 721 722 void UIWizardNewVM::setEFIEnabled(bool fEnabled) 723 { 724 m_fEFIEnabled = fEnabled; 704 725 } 705 726 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h ¶
r90072 r90073 29 29 #include "CMachine.h" 30 30 #include "CMedium.h" 31 #include "CGuestOSType.h" 31 32 32 33 #define newVMWizardPropertySet(functionName, value) \ … … 112 113 void setGuestOSFamilyId(const QString &strGuestOSFamilyId); 113 114 115 const CGuestOSType &guestOSType() const; 116 void setGuestOSType(const CGuestOSType &guestOSType); 117 114 118 bool installGuestAdditions() const; 115 119 void setInstallGuestAdditions(bool fInstallGA); … … 120 124 bool skipUnattendedInstall() const; 121 125 void setSkipUnattendedInstall(bool fSkipUnattendedInstall); 126 127 bool EFIEnabled() const; 128 void setEFIEnabled(bool fEnabled); 122 129 123 130 const QString &ISOFilePath() const; … … 201 208 /** Holds the VM OS family ID. */ 202 209 QString m_strGuestOSFamilyId; 210 /** Holds the VM OS type. */ 211 CGuestOSType m_comGuestOSType; 203 212 204 213 /** True if guest additions are to be installed during unattended install. */ … … 206 215 bool m_fStartHeadless; 207 216 bool m_fSkipUnattendedInstall; 217 bool m_fEFIEnabled; 208 218 209 219 QString m_strUserName; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePageBasic.cpp ¶
r90066 r90073 64 64 connect(m_pVirtualCPUEditor, &UIVirtualCPUEditor::sigValueChanged, 65 65 this, &UIWizardNewVMHardwarePageBasic::sltCPUCountChanged); 66 if (m_pEFICheckBox) 67 connect(m_pEFICheckBox, &QCheckBox::toggled, 68 this, &UIWizardNewVMHardwarePageBasic::sltEFIEnabledChanged); 66 69 67 70 } … … 88 91 retranslateUi(); 89 92 90 // if (!field("type").canConvert<CGuestOSType>()) 91 // return; 92 93 // CGuestOSType type = field("type").value<CGuestOSType>(); 94 // ULONG recommendedRam = type.GetRecommendedRAM(); 95 // if (m_pBaseMemoryEditor) 96 // m_pBaseMemoryEditor->setValue(recommendedRam); 97 98 // KFirmwareType fwType = type.GetRecommendedFirmware(); 99 // if (m_pEFICheckBox) 100 // m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS); 93 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 94 if (pWizard) 95 { 96 CGuestOSType type = pWizard->guestOSType(); 97 if (!type.isNull()) 98 { 99 if (!m_userModifiedParameters.contains("MemorySize")) 100 { 101 ULONG recommendedRam = type.GetRecommendedRAM(); 102 if (m_pBaseMemoryEditor) 103 m_pBaseMemoryEditor->setValue(recommendedRam); 104 } 105 if (!m_userModifiedParameters.contains("EFIEnabled")) 106 { 107 KFirmwareType fwType = type.GetRecommendedFirmware(); 108 if (m_pEFICheckBox) 109 m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS); 110 } 111 } 112 } 101 113 } 102 114 … … 130 142 { 131 143 newVMWizardPropertySet(MemorySize, iValue); 144 m_userModifiedParameters << "MemorySize"; 132 145 } 133 146 … … 136 149 newVMWizardPropertySet(CPUCount, iCount); 137 150 } 151 152 void UIWizardNewVMHardwarePageBasic::sltEFIEnabledChanged(bool fEnabled) 153 { 154 newVMWizardPropertySet(EFIEnabled, fEnabled); 155 m_userModifiedParameters << "EFIEnabled"; 156 } -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePageBasic.h ¶
r90066 r90073 23 23 24 24 /* Qt includes: */ 25 #include <QSet> 25 26 #include <QVariant> 26 27 … … 63 64 void sltMemorySizeChanged(int iValue); 64 65 void sltCPUCountChanged(int iCount); 66 void sltEFIEnabledChanged(bool fEnabled); 65 67 66 68 private: … … 82 84 QIRichTextLabel *m_pLabel; 83 85 /** @} */ 86 /** This set is used to decide if we have to set wizard's parameters 87 * some default values or not. When user modifies a value through a widget we 88 * no longer touch user set value during page initilization. see initializePage. */ 89 QSet<QString> m_userModifiedParameters; 84 90 }; 85 91 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.cpp ¶
r90072 r90073 412 412 * So simply disconnect the text-edit signal. */ 413 413 if (m_pNameAndSystemEditor) 414 { 414 415 m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltNameChanged(const QString &))); 416 newVMWizardPropertySet(GuestOSType, m_pNameAndSystemEditor->type()); 417 } 415 418 } 416 419 … … 440 443 retranslateUi(); 441 444 442 /* Make sure parameters are initialized correctly: */ 443 if (m_pNameAndSystemEditor) 444 newVMWizardPropertySet(GuestOSFamilyId, m_pNameAndSystemEditor->familyId()); 445 446 if (m_pNameAndSystemEditor) 447 m_pNameAndSystemEditor->setFocus(); 448 setSkipCheckBoxEnable(); 445 /* Initialize this page's widgets etc: */ 446 { 447 if (m_pNameAndSystemEditor) 448 m_pNameAndSystemEditor->setFocus(); 449 setSkipCheckBoxEnable(); 450 } 451 452 /* Initialize some of the wizard's parameters: */ 453 { 454 if (m_pNameAndSystemEditor) 455 { 456 newVMWizardPropertySet(GuestOSFamilyId, m_pNameAndSystemEditor->familyId()); 457 newVMWizardPropertySet(GuestOSType, m_pNameAndSystemEditor->type()); 458 /* Vm name, folder, file path etc. will be initilized by composeMachineFilePath: */ 459 } 460 } 449 461 } 450 462
Note:
See TracChangeset
for help on using the changeset viewer.