Changeset 87073 in vbox
- Timestamp:
- Dec 9, 2020 5:30:53 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141845
- 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
r87062 r87073 278 278 } 279 279 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; 280 void UIWizardNewVMPage1::createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels /* = true */) 281 { 282 AssertReturnVoid(pLayout); 283 287 284 if (fCreateLabels) 288 285 { 289 286 m_pNameOSTypeLabel = new QIRichTextLabel; 290 287 if (m_pNameOSTypeLabel) 291 p GridLayout->addWidget(m_pNameOSTypeLabel, iLayoutRow++, 0, 1, 3);288 pLayout->addWidget(m_pNameOSTypeLabel); 292 289 } 293 290 294 291 m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false); 295 292 if (m_pNameAndFolderEditor) 296 p GridLayout->addWidget(m_pNameAndFolderEditor, iLayoutRow++, 1, 1, 2);293 pLayout->addWidget(m_pNameAndFolderEditor); 297 294 298 295 if (fCreateLabels) … … 300 297 m_pUnattendedLabel = new QIRichTextLabel; 301 298 if (m_pUnattendedLabel) 302 pGridLayout->addWidget(m_pUnattendedLabel, iLayoutRow++, 0, 1, 3); 303 } 304 299 pLayout->addWidget(m_pUnattendedLabel); 300 } 301 302 QGridLayout *pUnattendedInstall = new QGridLayout; 305 303 m_pEnableUnattendedInstallCheckBox = new QCheckBox; 306 p GridLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iLayoutRow++, 0, 1, 3);304 pUnattendedInstall->addWidget(m_pEnableUnattendedInstallCheckBox, 0, 0, 1, 4, Qt::AlignLeft); 307 305 308 306 m_pISOSelectorLabel = new QLabel; … … 310 308 { 311 309 m_pISOSelectorLabel->setAlignment(Qt::AlignRight); 312 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::M inimum, QSizePolicy::Fixed);310 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 313 311 m_pISOSelectorLabel->setEnabled(false); 314 p GridLayout->addWidget(m_pISOSelectorLabel, iLayoutRow, 1);312 pUnattendedInstall->addWidget(m_pISOSelectorLabel, 1, 0, 1, 1, Qt::AlignRight); 315 313 } 316 314 m_pISOFilePathSelector = new UIFilePathSelector; … … 320 318 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 321 319 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 322 m_pISOFilePathSelector->setSizePolicy(QSizePolicy:: MinimumExpanding, QSizePolicy::Fixed);320 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 323 321 m_pISOFilePathSelector->setEnabled(false); 324 p GridLayout->addWidget(m_pISOFilePathSelector, iLayoutRow++, 2);322 pUnattendedInstall->addWidget(m_pISOFilePathSelector, 1, 1, 1, 4); 325 323 } 326 324 … … 329 327 { 330 328 m_pStartHeadlessCheckBox->setEnabled(false); 331 p GridLayout->addWidget(m_pStartHeadlessCheckBox, iLayoutRow++, 2);332 } 333 329 pUnattendedInstall->addWidget(m_pStartHeadlessCheckBox, 2, 1, 1, 1); 330 } 331 pLayout->addLayout(pUnattendedInstall); 334 332 m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true); 335 333 if (m_pSystemTypeEditor) 336 pGridLayout->addWidget(m_pSystemTypeEditor, iLayoutRow++, 1, 1, 2); 334 pLayout->addWidget(m_pSystemTypeEditor); 335 337 336 } 338 337 … … 489 488 490 489 if (m_pISOSelectorLabel) 491 m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Install ation Medium:"));490 m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Installer:")); 492 491 493 492 if (m_pStartHeadlessCheckBox) … … 507 506 void UIWizardNewVMPageBasic1::prepare() 508 507 { 509 QWidget *pContainerWidget = new QWidget;510 508 QVBoxLayout *pPageLayout = new QVBoxLayout(this); 511 pPageLayout->addWidget(pContainerWidget); 512 createNameOSTypeWidgets(pContainerWidget, false); 509 createNameOSTypeWidgets(pPageLayout, false); 513 510 pPageLayout->addStretch(); 514 511 createConnections(); … … 606 603 "to identify this machine.")); 607 604 608 if ( m_pNameAndFolderEditor609 && m_pSystemTypeEditor610 && m_pISOSelectorLabel)611 {612 int iMinWidthHint = 0;613 iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width());614 //m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint);615 //m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint);616 }605 // if ( m_pNameAndFolderEditor 606 // && m_pSystemTypeEditor 607 // && m_pISOSelectorLabel) 608 // { 609 // int iMinWidthHint = 0; 610 // iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width()); 611 // m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint); 612 // m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint); 613 // } 617 614 } 618 615 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87062 r87073 27 27 /* Forward declarations: */ 28 28 class QCheckBox; 29 class QGridLayout;30 29 class QLabel; 31 30 class QRadioButton; 31 class QVBoxLayout; 32 32 class QIRichTextLabel; 33 33 class UIFilePathSelector; … … 75 75 void composeMachineFilePath(); 76 76 /** Creates the page widgets and adds them into the @p pGridLayout. */ 77 void createNameOSTypeWidgets(Q Widget *pContainerWidget, bool fCreateLabels = true);77 void createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels = true); 78 78 void setTypeByISODetectedOSType(const QString &strDetectedOSType); 79 79 /** Colors the widgets red if they cause isComplete to fail. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87062 r87073 52 52 m_pToolBox = new QToolBox; 53 53 m_pNameAndSystemContainer = new QWidget(this); 54 createNameOSTypeWidgets(m_pNameAndSystemContainer, false); 54 QVBoxLayout *pNameContainerLayout = new QVBoxLayout(m_pNameAndSystemContainer); 55 createNameOSTypeWidgets(pNameContainerLayout, false); 55 56 m_pGAInstallContainer = createGAInstallWidgets(); 56 57 m_pUsernameHostnameContainer = createUserNameHostNameWidgets();
Note:
See TracChangeset
for help on using the changeset viewer.