Changeset 87612 in vbox
- Timestamp:
- Feb 4, 2021 6:55:43 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIBaseMemoryEditor.cpp
r86086 r87612 393 393 { 394 394 if (m_pSlider) 395 { 395 396 emit sigValidChanged(m_pSlider->value() < (int)m_pSlider->maxRAMAlw()); 397 emit sigValueChanged(m_pSlider->value()); 398 } 396 399 } 397 400 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIBaseMemoryEditor.h
r86089 r87612 43 43 /** Notifies listeners about value has became @a fValid. */ 44 44 void sigValidChanged(bool fValid); 45 void sigValueChanged(int iValue); 45 46 46 47 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r87610 r87612 154 154 if (iVPUCount > 1) 155 155 m_machine.GetBIOSSettings().SetIOAPICEnabled(true); 156 157 /* Set recommended firmware type: */ 158 m_machine.SetFirmwareType(getBoolFieldValue("EFIEnabled") ? KFirmwareType_EFI : KFirmwareType_BIOS); 156 159 #endif 157 160 … … 281 284 282 285 /* Set recommended firmware type: */ 283 KFirmwareType fwType = comGuestType.GetRecommendedFirmware(); 284 m_machine.SetFirmwareType(fwType); 286 m_machine.SetFirmwareType(getBoolFieldValue("EFIEnabled") ? KFirmwareType_EFI : KFirmwareType_BIOS); 285 287 286 288 /* Set recommended human interface device types: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r87575 r87612 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 19 20 #include <QGridLayout> 20 21 #include <QMetaType> 21 #include <QRadioButton>22 22 #include <QVBoxLayout> 23 23 24 24 /* GUI includes: */ 25 25 #include "QIRichTextLabel.h" 26 #include "QIToolButton.h"27 26 #include "UIBaseMemoryEditor.h" 28 #include "UIIconPool.h"29 #include "UIMediaComboBox.h"30 #include "UIMedium.h"31 #include "UIMediumSelector.h"32 #include "UIMessageCenter.h"33 27 #include "UIVirtualCPUEditor.h" 34 #include "UIWizardNewVD.h"35 28 #include "UIWizardNewVM.h" 36 29 #include "UIWizardNewVMPageBasic3.h" 30 31 /* COM includes: */ 32 #include "CGuestOSType.h" 37 33 38 34 UIWizardNewVMPage3::UIWizardNewVMPage3() 39 35 : m_pBaseMemoryEditor(0) 40 36 , m_pVirtualCPUEditor(0) 37 , m_pEFICheckBox(0) 41 38 { 42 39 } … … 56 53 } 57 54 55 bool UIWizardNewVMPage3::EFIEnabled() const 56 { 57 if (!m_pEFICheckBox) 58 return false; 59 return m_pEFICheckBox->isChecked(); 60 } 61 58 62 void UIWizardNewVMPage3::retranslateWidgets() 59 63 { 64 if (m_pEFICheckBox) 65 { 66 m_pEFICheckBox->setText(UIWizardNewVM::tr("Enable &EFI (special OSes only)")); 67 m_pEFICheckBox->setWhatsThis(UIWizardNewVM::tr("When checked, the guest will support the " 68 "Extended Firmware Interface (EFI), which is required to boot certain " 69 "guest OSes. Non-EFI aware OSes will not be able to boot if this option is activated.")); 70 } 60 71 } 61 72 … … 67 78 m_pBaseMemoryEditor = new UIBaseMemoryEditor(0, true); 68 79 m_pVirtualCPUEditor = new UIVirtualCPUEditor(0, true); 80 m_pEFICheckBox = new QCheckBox; 69 81 pHardwareLayout->addWidget(m_pBaseMemoryEditor, 0, 0, 1, 4); 70 82 pHardwareLayout->addWidget(m_pVirtualCPUEditor, 1, 0, 1, 4); 83 pHardwareLayout->addWidget(m_pEFICheckBox, 2, 0, 1, 1); 84 71 85 return pHardwareContainer; 72 86 } … … 79 93 registerField("baseMemory", this, "baseMemory"); 80 94 registerField("VCPUCount", this, "VCPUCount"); 95 registerField("EFIEnabled", this, "EFIEnabled"); 81 96 } 82 97 … … 95 110 void UIWizardNewVMPageBasic3::createConnections() 96 111 { 97 98 112 } 99 100 113 101 114 void UIWizardNewVMPageBasic3::retranslateUi() … … 122 135 m_pBaseMemoryEditor->setValue(recommendedRam); 123 136 137 KFirmwareType fwType = type.GetRecommendedFirmware(); 138 if (m_pEFICheckBox) 139 m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS); 124 140 } 125 141 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h
r87575 r87612 34 34 /* Forward declarations: */ 35 35 class QRadioButton; 36 class QCheckBox; 36 37 class QIRichTextLabel; 37 class QIToolButton;38 38 class UIBaseMemoryEditor; 39 class UIMediaComboBox;40 39 class UIVirtualCPUEditor; 41 40 … … 54 53 int baseMemory() const; 55 54 int VCPUCount() const; 55 bool EFIEnabled() const; 56 56 /** @} */ 57 57 … … 65 65 UIBaseMemoryEditor *m_pBaseMemoryEditor; 66 66 UIVirtualCPUEditor *m_pVirtualCPUEditor; 67 QCheckBox *m_pEFICheckBox; 67 68 /** @} */ 68 69 … … 75 76 Q_PROPERTY(int baseMemory READ baseMemory); 76 77 Q_PROPERTY(int VCPUCount READ VCPUCount); 78 Q_PROPERTY(bool EFIEnabled READ EFIEnabled); 77 79 78 80 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87608 r87612 89 89 registerField("productKey", this, "productKey"); 90 90 registerField("VCPUCount", this, "VCPUCount"); 91 registerField("EFIEnabled", this, "EFIEnabled"); 91 92 92 93 const QPalette pal = palette(); … … 137 138 onOsTypeChanged(); 138 139 139 /* Fetch recommended RAM value: */ 140 CGuestOSType type = m_pNameAndSystemEditor->type(); 141 m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM()); 140 setOSTypeDependedValues(); 142 141 143 142 /* Broadcast complete-change: */ … … 242 241 /* Connections for disk and hardware stuff: */ 243 242 if (m_pDiskSkip) 243 { 244 244 connect(m_pDiskSkip, &QRadioButton::toggled, 245 245 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 246 connect(m_pDiskSkip, &QRadioButton::toggled, 247 this, &UIWizardNewVMPageExpert::sltValueModified); 248 } 246 249 if (m_pDiskCreate) 250 { 247 251 connect(m_pDiskCreate, &QRadioButton::toggled, 248 252 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 253 connect(m_pDiskCreate, &QRadioButton::toggled, 254 this, &UIWizardNewVMPageExpert::sltValueModified); 255 } 249 256 if (m_pDiskPresent) 257 { 250 258 connect(m_pDiskPresent, &QRadioButton::toggled, 251 259 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 260 connect(m_pDiskPresent, &QRadioButton::toggled, 261 this, &UIWizardNewVMPageExpert::sltValueModified); 262 } 252 263 if (m_pDiskSelector) 253 264 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), … … 256 267 connect(m_pVMMButton, &QIToolButton::clicked, 257 268 this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog); 258 } 259 260 void UIWizardNewVMPageExpert::initializePage() 261 { 262 /* Translate page: */ 263 retranslateUi(); 264 269 if (m_pBaseMemoryEditor) 270 connect(m_pBaseMemoryEditor, &UIBaseMemoryEditor::sigValueChanged, 271 this, &UIWizardNewVMPageExpert::sltValueModified); 272 if (m_pEFICheckBox) 273 connect(m_pEFICheckBox, &QCheckBox::toggled, 274 this, &UIWizardNewVMPageExpert::sltValueModified); 275 } 276 277 void UIWizardNewVMPageExpert::setOSTypeDependedValues() 278 { 265 279 if (!field("type").canConvert<CGuestOSType>()) 266 280 return; … … 269 283 CGuestOSType type = field("type").value<CGuestOSType>(); 270 284 ULONG recommendedRam = type.GetRecommendedRAM(); 271 m_pBaseMemoryEditor->setValue(recommendedRam); 285 286 if (m_pBaseMemoryEditor && !m_userSetWidgets.contains(m_pBaseMemoryEditor)) 287 { 288 m_pBaseMemoryEditor->blockSignals(true); 289 m_pBaseMemoryEditor->setValue(recommendedRam); 290 m_pBaseMemoryEditor->blockSignals(false); 291 } 292 293 KFirmwareType fwType = type.GetRecommendedFirmware(); 294 if (m_pEFICheckBox && !m_userSetWidgets.contains(m_pEFICheckBox)) 295 { 296 m_pEFICheckBox->blockSignals(true); 297 m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS); 298 m_pEFICheckBox->blockSignals(false); 299 } 272 300 273 301 /* Prepare initial disk choice: */ 274 if (type.GetRecommendedHDD() != 0) 275 { 276 if (m_pDiskCreate) 277 { 278 m_pDiskCreate->setFocus(); 279 m_pDiskCreate->setChecked(true); 280 } 281 m_fRecommendedNoDisk = false; 282 } 283 else 284 { 285 if (m_pDiskSkip) 286 { 287 m_pDiskSkip->setFocus(); 288 m_pDiskSkip->setChecked(true); 289 } 290 m_fRecommendedNoDisk = true; 291 } 292 if (m_pDiskSelector) 293 m_pDiskSelector->setCurrentIndex(0); 294 295 disableEnableUnattendedRelatedWidgets(isUnattendedEnabled()); 302 if (!m_userSetWidgets.contains(m_pDiskCreate) && 303 !m_userSetWidgets.contains(m_pDiskCreate) && 304 !m_userSetWidgets.contains(m_pDiskPresent)) 305 { 306 if (type.GetRecommendedHDD() != 0) 307 { 308 if (m_pDiskCreate) 309 { 310 m_pDiskCreate->setFocus(); 311 m_pDiskCreate->setChecked(true); 312 } 313 m_fRecommendedNoDisk = false; 314 } 315 else 316 { 317 if (m_pDiskSkip) 318 { 319 m_pDiskSkip->setFocus(); 320 m_pDiskSkip->setChecked(true); 321 } 322 m_fRecommendedNoDisk = true; 323 } 324 if (m_pDiskSelector) 325 m_pDiskSelector->setCurrentIndex(0); 326 } 327 296 328 if (m_pProductKeyLabel) 297 329 m_pProductKeyLabel->setEnabled(isProductKeyWidgetEnabled()); 298 330 if (m_pProductKeyLineEdit) 299 331 m_pProductKeyLineEdit->setEnabled(isProductKeyWidgetEnabled()); 332 } 333 334 void UIWizardNewVMPageExpert::initializePage() 335 { 336 /* Translate page: */ 337 retranslateUi(); 338 setOSTypeDependedValues(); 339 disableEnableUnattendedRelatedWidgets(isUnattendedEnabled()); 300 340 } 301 341 … … 458 498 disableEnableGAWidgets(isGAInstallEnabled()); 459 499 } 500 501 void UIWizardNewVMPageExpert::sltValueModified() 502 { 503 QWidget *pSenderWidget = qobject_cast<QWidget*>(sender()); 504 if (!pSenderWidget) 505 return; 506 507 m_userSetWidgets << pSenderWidget; 508 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r87589 r87612 21 21 # pragma once 22 22 #endif 23 24 /* Qt includes: */ 25 #include <QSet> 23 26 24 27 /* Local includes: */ … … 60 63 Q_PROPERTY(QString productKey READ productKey); 61 64 Q_PROPERTY(int VCPUCount READ VCPUCount); 65 Q_PROPERTY(bool EFIEnabled READ EFIEnabled); 62 66 63 67 public: … … 88 92 void sltInstallGACheckBoxToggle(bool fEnabled); 89 93 94 void sltValueModified(); 95 90 96 private: 91 97 … … 104 110 void createConnections(); 105 111 void initializePage(); 112 void initializeWidgets(); 113 /** Set the values of the widget if they depend on OS 114 * type like recommended RAM size. The widgets whose values are 115 * are explicitly modified are exempt from this. */ 116 void setOSTypeDependedValues(); 106 117 void cleanupPage(); 107 118 … … 117 128 UIToolBox *m_pToolBox; 118 129 QGroupBox *m_pInstallationISOContainer; 130 131 /** Set of widgets which user explicitly modified their values. They are exempt from 132 * adjusting when OS type changes. */ 133 QSet<QWidget*> m_userSetWidgets; 119 134 }; 120 135
Note:
See TracChangeset
for help on using the changeset viewer.