Changeset 87062 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 9, 2020 10:46:58 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141827
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r87060 r87062 182 182 : m_pISOSelectorLabel(0) 183 183 , m_pISOFilePathSelector(0) 184 , m_pStartHeadlessLabel(0)185 184 , m_pEnableUnattendedInstallCheckBox(0) 186 185 , m_pStartHeadlessCheckBox(0) … … 279 278 } 280 279 281 void UIWizardNewVMPage1::createNameOSTypeWidgets(QGridLayout *pGridLayout, bool fCreateLabels /* = true */) 282 { 283 if (pGridLayout) 284 { 285 int iLayoutRow = 0; 286 if (fCreateLabels) 287 { 288 m_pNameOSTypeLabel = new QIRichTextLabel; 289 if (m_pNameOSTypeLabel) 290 pGridLayout->addWidget(m_pNameOSTypeLabel, iLayoutRow++, 0, 1, 3); 291 } 292 293 m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false); 294 if (m_pNameAndFolderEditor) 295 pGridLayout->addWidget(m_pNameAndFolderEditor, iLayoutRow++, 1, 1, 2); 296 297 if (fCreateLabels) 298 { 299 m_pUnattendedLabel = new QIRichTextLabel; 300 if (m_pUnattendedLabel) 301 pGridLayout->addWidget(m_pUnattendedLabel, iLayoutRow++, 0, 1, 3); 302 } 303 304 m_pEnableUnattendedInstallCheckBox = new QCheckBox; 305 pGridLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iLayoutRow++, 0, 1, 3); 306 307 m_pISOSelectorLabel = new QLabel; 308 if (m_pISOSelectorLabel) 309 { 310 m_pISOSelectorLabel->setAlignment(Qt::AlignRight); 311 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 312 m_pISOSelectorLabel->setEnabled(false); 313 pGridLayout->addWidget(m_pISOSelectorLabel, iLayoutRow++, 1); 314 } 315 m_pISOFilePathSelector = new UIFilePathSelector; 316 if (m_pISOFilePathSelector) 317 { 318 m_pISOFilePathSelector->setResetEnabled(false); 319 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 320 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 321 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 322 m_pISOFilePathSelector->setEnabled(false); 323 pGridLayout->addWidget(m_pISOFilePathSelector, iLayoutRow++, 2); 324 } 325 326 m_pStartHeadlessLabel = new QLabel; 327 if (m_pStartHeadlessLabel) 328 { 329 m_pStartHeadlessLabel->setAlignment(Qt::AlignRight); 330 m_pStartHeadlessLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 331 m_pStartHeadlessLabel->setEnabled(false); 332 pGridLayout->addWidget(m_pStartHeadlessLabel, iLayoutRow++, 1); 333 } 334 m_pStartHeadlessCheckBox = new QCheckBox; 335 if (m_pStartHeadlessCheckBox) 336 { 337 m_pStartHeadlessCheckBox->setEnabled(false); 338 pGridLayout->addWidget(m_pStartHeadlessCheckBox, iLayoutRow++, 2); 339 } 340 341 m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true); 342 if (m_pSystemTypeEditor) 343 pGridLayout->addWidget(m_pSystemTypeEditor, iLayoutRow++, 1, 1, 2); 344 } 280 void UIWizardNewVMPage1::createNameOSTypeWidgets(QWidget *pContainerWidget, bool fCreateLabels /* = true */) 281 { 282 AssertReturnVoid(pContainerWidget); 283 QGridLayout *pGridLayout = new QGridLayout(pContainerWidget); 284 AssertReturnVoid(pGridLayout); 285 286 int iLayoutRow = 0; 287 if (fCreateLabels) 288 { 289 m_pNameOSTypeLabel = new QIRichTextLabel; 290 if (m_pNameOSTypeLabel) 291 pGridLayout->addWidget(m_pNameOSTypeLabel, iLayoutRow++, 0, 1, 3); 292 } 293 294 m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false); 295 if (m_pNameAndFolderEditor) 296 pGridLayout->addWidget(m_pNameAndFolderEditor, iLayoutRow++, 1, 1, 2); 297 298 if (fCreateLabels) 299 { 300 m_pUnattendedLabel = new QIRichTextLabel; 301 if (m_pUnattendedLabel) 302 pGridLayout->addWidget(m_pUnattendedLabel, iLayoutRow++, 0, 1, 3); 303 } 304 305 m_pEnableUnattendedInstallCheckBox = new QCheckBox; 306 pGridLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iLayoutRow++, 0, 1, 3); 307 308 m_pISOSelectorLabel = new QLabel; 309 if (m_pISOSelectorLabel) 310 { 311 m_pISOSelectorLabel->setAlignment(Qt::AlignRight); 312 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 313 m_pISOSelectorLabel->setEnabled(false); 314 pGridLayout->addWidget(m_pISOSelectorLabel, iLayoutRow, 1); 315 } 316 m_pISOFilePathSelector = new UIFilePathSelector; 317 if (m_pISOFilePathSelector) 318 { 319 m_pISOFilePathSelector->setResetEnabled(false); 320 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 321 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 322 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 323 m_pISOFilePathSelector->setEnabled(false); 324 pGridLayout->addWidget(m_pISOFilePathSelector, iLayoutRow++, 2); 325 } 326 327 m_pStartHeadlessCheckBox = new QCheckBox; 328 if (m_pStartHeadlessCheckBox) 329 { 330 m_pStartHeadlessCheckBox->setEnabled(false); 331 pGridLayout->addWidget(m_pStartHeadlessCheckBox, iLayoutRow++, 2); 332 } 333 334 m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true); 335 if (m_pSystemTypeEditor) 336 pGridLayout->addWidget(m_pSystemTypeEditor, iLayoutRow++, 1, 1, 2); 345 337 } 346 338 … … 497 489 498 490 if (m_pISOSelectorLabel) 499 m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Image:")); 500 501 if (m_pStartHeadlessLabel) 502 m_pStartHeadlessLabel->setText(UIWizardNewVM::tr("Options:")); 491 m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Installation Medium:")); 492 503 493 if (m_pStartHeadlessCheckBox) 504 494 { … … 507 497 "machine in headless mode after the guest OS install.")); 508 498 } 509 510 499 } 511 500 … … 518 507 void UIWizardNewVMPageBasic1::prepare() 519 508 { 520 QGridLayout *pMainLayout = new QGridLayout(this);; 521 createNameOSTypeWidgets(pMainLayout, false); 509 QWidget *pContainerWidget = new QWidget; 510 QVBoxLayout *pPageLayout = new QVBoxLayout(this); 511 pPageLayout->addWidget(pContainerWidget); 512 createNameOSTypeWidgets(pContainerWidget, false); 513 pPageLayout->addStretch(); 522 514 createConnections(); 523 515 /* Register fields: */ … … 590 582 if (m_pISOFilePathSelector) 591 583 m_pISOFilePathSelector->setEnabled(fEnabled); 592 if (m_pStartHeadlessLabel)593 m_pStartHeadlessLabel->setEnabled(fEnabled);594 584 if (m_pStartHeadlessCheckBox) 595 585 m_pStartHeadlessCheckBox->setEnabled(fEnabled); … … 618 608 if ( m_pNameAndFolderEditor 619 609 && m_pSystemTypeEditor 620 && m_pISOSelectorLabel 621 && m_pStartHeadlessLabel) 610 && m_pISOSelectorLabel) 622 611 { 623 612 int iMinWidthHint = 0; 624 613 iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width()); 625 iMinWidthHint = qMax(iMinWidthHint, m_pStartHeadlessLabel->minimumSizeHint().width()); 626 m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint); 627 m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint); 614 // m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint); 615 // m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint); 628 616 } 629 617 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87060 r87062 75 75 void composeMachineFilePath(); 76 76 /** Creates the page widgets and adds them into the @p pGridLayout. */ 77 void createNameOSTypeWidgets(Q GridLayout *pGridLayout, bool fCreateLabels = true);77 void createNameOSTypeWidgets(QWidget *pContainerWidget, bool fCreateLabels = true); 78 78 void setTypeByISODetectedOSType(const QString &strDetectedOSType); 79 79 /** Colors the widgets red if they cause isComplete to fail. */ … … 87 87 /** Holds the ISO selector editor instance. */ 88 88 mutable UIFilePathSelector *m_pISOFilePathSelector; 89 QLabel *m_pStartHeadlessLabel;90 89 QCheckBox *m_pEnableUnattendedInstallCheckBox; 91 90 QCheckBox *m_pStartHeadlessCheckBox; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87060 r87062 52 52 m_pToolBox = new QToolBox; 53 53 m_pNameAndSystemContainer = new QWidget(this); 54 QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer); 55 createNameOSTypeWidgets(pNameContainerLayout, false); 54 createNameOSTypeWidgets(m_pNameAndSystemContainer, false); 56 55 m_pGAInstallContainer = createGAInstallWidgets(); 57 56 m_pUsernameHostnameContainer = createUserNameHostNameWidgets(); … … 419 418 if (m_pISOFilePathSelector) 420 419 m_pISOFilePathSelector->setEnabled(fEnabled); 421 if (m_pStartHeadlessLabel)422 m_pStartHeadlessLabel->setEnabled(fEnabled);423 420 if (m_pStartHeadlessCheckBox) 424 421 m_pStartHeadlessCheckBox->setEnabled(fEnabled);
Note:
See TracChangeset
for help on using the changeset viewer.