- Timestamp:
- Dec 9, 2020 10:05:23 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 4 edited
-
UIWizardNewVMPageBasic1.cpp (modified) (7 diffs)
-
UIWizardNewVMPageBasic1.h (modified) (2 diffs)
-
UIWizardNewVMPageExpert.cpp (modified) (4 diffs)
-
UIWizardNewVMPageExpert.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r87057 r87060 180 180 181 181 UIWizardNewVMPage1::UIWizardNewVMPage1(const QString &strGroup) 182 : m_pButtonSimple(0) 183 , m_pButtonUnattended(0) 184 , m_pISOSelectorLabel(0) 182 : m_pISOSelectorLabel(0) 185 183 , m_pISOFilePathSelector(0) 186 184 , m_pStartHeadlessLabel(0) 185 , m_pEnableUnattendedInstallCheckBox(0) 187 186 , m_pStartHeadlessCheckBox(0) 188 187 , m_pNameAndFolderEditor(0) … … 271 270 bool UIWizardNewVMPage1::checkISOFile() const 272 271 { 273 if (m_p ButtonUnattended && m_pButtonUnattended->isChecked())272 if (m_pEnableUnattendedInstallCheckBox && m_pEnableUnattendedInstallCheckBox->isChecked()) 274 273 { 275 274 QString strISOFilePath = m_pISOFilePathSelector ? m_pISOFilePathSelector->path() : QString(); … … 303 302 } 304 303 305 m_pButtonGroup = new QButtonGroup; 306 if (m_pButtonGroup) 307 { 308 m_pButtonSimple = new QRadioButton; 309 if (m_pButtonSimple) 310 { 311 m_pButtonSimple->setChecked(true); 312 pGridLayout->addWidget(m_pButtonSimple, iLayoutRow++, 0, 1, 3); 313 } 314 m_pButtonUnattended = new QRadioButton; 315 if (m_pButtonUnattended) 316 { 317 // QStyleOptionButton options; 318 // options.initFrom(m_pButtonUnattended); 319 // const int iWidth = m_pButtonUnattended->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, 320 // &options, m_pButtonUnattended); 321 // pGridLayout->setColumnMinimumWidth(0, iWidth); 322 pGridLayout->addWidget(m_pButtonUnattended, iLayoutRow++, 0, 1, 3); 323 } 324 325 m_pButtonGroup->addButton(m_pButtonSimple); 326 m_pButtonGroup->addButton(m_pButtonUnattended); 327 } 304 m_pEnableUnattendedInstallCheckBox = new QCheckBox; 305 pGridLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iLayoutRow++, 0, 1, 3); 328 306 329 307 m_pISOSelectorLabel = new QLabel; … … 470 448 bool UIWizardNewVMPage1::isUnattendedEnabled() const 471 449 { 472 if (!m_p ButtonUnattended)473 return false; 474 return m_p ButtonUnattended->isChecked();450 if (!m_pEnableUnattendedInstallCheckBox) 451 return false; 452 return m_pEnableUnattendedInstallCheckBox->isChecked(); 475 453 } 476 454 … … 510 488 void UIWizardNewVMPage1::retranslateWidgets() 511 489 { 512 if (m_pButtonSimple) 513 { 514 m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty")); 515 m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed" 516 " thereby leaving the virtual machine's disk empty.")); 517 } 518 if (m_pButtonUnattended) 519 { 520 m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install")); 521 m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS installation will be started " 522 "after this wizard is closed.")); 490 if (m_pEnableUnattendedInstallCheckBox) 491 { 492 m_pEnableUnattendedInstallCheckBox->setText(UIWizardNewVM::tr("Unattended Install")); 493 m_pEnableUnattendedInstallCheckBox->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS installation will be started " 494 "after this wizard is closed if not the virtual machine's disk will " 495 "be left empty.")); 523 496 } 524 497 … … 563 536 void UIWizardNewVMPageBasic1::createConnections() 564 537 { 565 connect(m_pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 566 this, &UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle); 538 connect(m_pEnableUnattendedInstallCheckBox, &QCheckBox::clicked, this, &UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle); 567 539 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic1::sltISOPathChanged); 568 540 connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged); … … 612 584 } 613 585 614 void UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle() 615 { 616 const bool fEnabled = m_pButtonUnattended->isChecked(); 586 void UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle(bool fEnabled) 587 { 617 588 if (m_pISOSelectorLabel) 618 589 m_pISOSelectorLabel->setEnabled(fEnabled); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87057 r87060 84 84 /** @name Widgets 85 85 * @{ */ 86 /** Holds the simple variant button instance. */87 QRadioButton *m_pButtonSimple;88 /** Holds the unattended variant button instance. */89 QRadioButton *m_pButtonUnattended;90 /** Holds the ISO selector label instance. */91 86 QLabel *m_pISOSelectorLabel; 92 87 /** Holds the ISO selector editor instance. */ 93 88 mutable UIFilePathSelector *m_pISOFilePathSelector; 94 /** Holds the headless start label instance. */95 89 QLabel *m_pStartHeadlessLabel; 96 /** Holds the headless start checkbox instance. */90 QCheckBox *m_pEnableUnattendedInstallCheckBox; 97 91 QCheckBox *m_pStartHeadlessCheckBox; 98 /** Provides a path selector and a line edit field for path and name entry. */ 92 /** We have two UINameAndSystemEditor instance since name/vm path fields and OS type fields 93 * are separated. */ 99 94 UINameAndSystemEditor *m_pNameAndFolderEditor; 100 95 UINameAndSystemEditor *m_pSystemTypeEditor; 101 96 QIRichTextLabel *m_pUnattendedLabel; 102 97 QIRichTextLabel *m_pNameOSTypeLabel; 103 QButtonGroup *m_pButtonGroup;104 98 /** @} */ 105 99 … … 162 156 void sltOsTypeChanged(); 163 157 void sltISOPathChanged(const QString &strPath); 164 void sltUnattendedCheckBoxToggle( );158 void sltUnattendedCheckBoxToggle(bool fEnable); 165 159 166 160 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87057 r87060 98 98 //m_pToolBox->setStyleSheet("QToolBox::tab:hover { font: bold; }"); 99 99 //qApp->setStyleSheet("QWidget#bla { background: blue; }"); 100 if (m_p ButtonUnattended)101 disableEnableUnattendedRelatedWidgets(m_p ButtonUnattended->isChecked());100 if (m_pEnableUnattendedInstallCheckBox) 101 disableEnableUnattendedRelatedWidgets(m_pEnableUnattendedInstallCheckBox->isChecked()); 102 102 } 103 103 … … 146 146 } 147 147 148 void UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle() 149 { 150 if (m_pButtonUnattended) 151 disableEnableUnattendedRelatedWidgets(m_pButtonUnattended->isChecked()); 148 void UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle(bool fEnabled) 149 { 150 disableEnableUnattendedRelatedWidgets(fEnabled); 152 151 emit completeChanged(); 153 152 } … … 215 214 this, &UIWizardNewVMPageExpert::sltOSFamilyTypeChanged); 216 215 } 217 if (m_p ButtonGroup)218 connect(m_p ButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),216 if (m_pEnableUnattendedInstallCheckBox) 217 connect(m_pEnableUnattendedInstallCheckBox, &QCheckBox::clicked, 219 218 this, &UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle); 220 219 if (m_pISOFilePathSelector) … … 286 285 m_pDiskSelector->setCurrentIndex(0); 287 286 288 if (m_p ButtonUnattended)289 disableEnableUnattendedRelatedWidgets(m_p ButtonUnattended->isChecked());287 if (m_pEnableUnattendedInstallCheckBox) 288 disableEnableUnattendedRelatedWidgets(m_pEnableUnattendedInstallCheckBox->isChecked()); 290 289 m_pProductKeyLabel->setEnabled(isProductKeyWidgetEnabled()); 291 290 m_pProductKeyLineEdit->setEnabled(isProductKeyWidgetEnabled()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r85157 r87060 79 79 void sltVirtualDiskSourceChanged(); 80 80 void sltGetWithFileOpenDialog(); 81 void sltUnattendedCheckBoxToggle( );81 void sltUnattendedCheckBoxToggle(bool fEnable); 82 82 void sltISOPathChanged(const QString &strPath); 83 83 void sltInstallGACheckBoxToggle(bool fChecked);
Note:
See TracChangeset
for help on using the changeset viewer.

