Changeset 87240 in vbox
- Timestamp:
- Jan 13, 2021 2:41:41 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 3 edited
-
UIWizardNewVMPageBasic1.cpp (modified) (6 diffs)
-
UIWizardNewVMPageBasic1.h (modified) (3 diffs)
-
UIWizardNewVMPageExpert.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r87081 r87240 278 278 } 279 279 280 void UIWizardNewVMPage1::addLine(QBoxLayout *pLayout)280 QFrame *UIWizardNewVMPage1::horizontalLine() 281 281 { 282 282 QFrame *line = new QFrame; 283 283 line->setFrameShape(QFrame::HLine); 284 284 line->setFrameShadow(QFrame::Sunken); 285 pLayout->addWidget(line);286 } 287 288 void UIWizardNewVMPage1::createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels /* = true */)289 { 290 AssertReturn Void(pLayout);291 285 return line; 286 } 287 288 int UIWizardNewVMPage1::createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels /* = true */) 289 { 290 AssertReturn(pLayout, 0); 291 int iRow = 0; 292 292 if (fCreateLabels) 293 293 { 294 294 m_pNameOSTypeLabel = new QIRichTextLabel; 295 295 if (m_pNameOSTypeLabel) 296 pLayout->addWidget(m_pNameOSTypeLabel );296 pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 4); 297 297 } 298 298 299 299 m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false); 300 300 if (m_pNameAndFolderEditor) 301 pLayout->addWidget(m_pNameAndFolderEditor );302 303 addLine(pLayout);301 pLayout->addWidget(m_pNameAndFolderEditor, iRow++, 0, 1, 4); 302 303 pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4); 304 304 305 305 if (fCreateLabels) … … 307 307 m_pUnattendedLabel = new QIRichTextLabel; 308 308 if (m_pUnattendedLabel) 309 pLayout->addWidget(m_pUnattendedLabel); 310 } 311 312 QGridLayout *pUnattendedInstall = new QGridLayout; 309 pLayout->addWidget(m_pUnattendedLabel, iRow++, 0, 1, 4); 310 } 311 313 312 m_pEnableUnattendedInstallCheckBox = new QCheckBox; 314 p UnattendedInstall->addWidget(m_pEnableUnattendedInstallCheckBox, 0, 0, 1, 4, Qt::AlignLeft);313 pLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iRow++, 0, 1, 2, Qt::AlignLeft); 315 314 316 315 m_pISOSelectorLabel = new QLabel; … … 320 319 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 321 320 m_pISOSelectorLabel->setEnabled(false); 322 p UnattendedInstall->addWidget(m_pISOSelectorLabel, 1, 0, 1, 1, Qt::AlignRight);321 pLayout->addWidget(m_pISOSelectorLabel, iRow, 0, 1, 1, Qt::AlignRight); 323 322 } 324 323 m_pISOFilePathSelector = new UIFilePathSelector; … … 330 329 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 331 330 m_pISOFilePathSelector->setEnabled(false); 332 p UnattendedInstall->addWidget(m_pISOFilePathSelector, 1, 1, 1, 4);331 pLayout->addWidget(m_pISOFilePathSelector, iRow++, 1, 1, 3); 333 332 } 334 333 … … 337 336 { 338 337 m_pStartHeadlessCheckBox->setEnabled(false); 339 pUnattendedInstall->addWidget(m_pStartHeadlessCheckBox, 2, 1, 1, 1); 340 } 341 pLayout->addLayout(pUnattendedInstall); 342 addLine(pLayout); 338 pLayout->addWidget(m_pStartHeadlessCheckBox, iRow++, 1, 1, 1); 339 } 340 341 pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4); 342 343 343 m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true); 344 344 if (m_pSystemTypeEditor) 345 pLayout->addWidget(m_pSystemTypeEditor );346 345 pLayout->addWidget(m_pSystemTypeEditor, iRow++, 0, 1, 4); 346 return iRow; 347 347 } 348 348 … … 517 517 void UIWizardNewVMPageBasic1::prepare() 518 518 { 519 QVBoxLayout *pPageLayout = new QVBoxLayout(this); 520 createNameOSTypeWidgets(pPageLayout, false); 521 pPageLayout->addStretch(); 519 QGridLayout *pPageLayout = new QGridLayout(this); 520 int iRow = createNameOSTypeWidgets(pPageLayout, false); 521 pPageLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Expanding), 522 iRow, 0, 1, 4); 522 523 createConnections(); 523 524 /* Register fields: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87081 r87240 28 28 class QBoxLayout; 29 29 class QCheckBox; 30 class QFrame; 30 31 class QLabel; 31 32 class QRadioButton; 32 class Q VBoxLayout;33 class QGridLayout; 33 34 class QIRichTextLabel; 34 35 class UIFilePathSelector; … … 76 77 void composeMachineFilePath(); 77 78 /** Creates the page widgets and adds them into the @p pGridLayout. */ 78 void createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels = true);79 int createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels = true); 79 80 void setTypeByISODetectedOSType(const QString &strDetectedOSType); 80 81 /** Colors the widgets red if they cause isComplete to fail. */ … … 103 104 104 105 bool checkISOFile() const; 105 void addLine(QBoxLayout *pLayout);106 QFrame *horizontalLine(); 106 107 107 108 /** Full path (including the file name) of the machine's configuration file. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87073 r87240 52 52 m_pToolBox = new QToolBox; 53 53 m_pNameAndSystemContainer = new QWidget(this); 54 Q VBoxLayout *pNameContainerLayout = new QVBoxLayout(m_pNameAndSystemContainer);54 QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer); 55 55 createNameOSTypeWidgets(pNameContainerLayout, false); 56 56 m_pGAInstallContainer = createGAInstallWidgets();
Note:
See TracChangeset
for help on using the changeset viewer.

