Changeset 87057 in vbox for trunk/src/VBox
- Timestamp:
- Dec 9, 2020 7:53:33 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141822
- 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
r85168 r87057 186 186 , m_pStartHeadlessLabel(0) 187 187 , m_pStartHeadlessCheckBox(0) 188 , m_pNameAndSystemEditor(0) 188 , m_pNameAndFolderEditor(0) 189 , m_pSystemTypeEditor(0) 189 190 , m_pUnattendedLabel(0) 190 191 , m_pNameOSTypeLabel(0) … … 206 207 if (strNewName.contains(gs_OSTypePattern[i].pattern)) 207 208 { 208 if (m_p NameAndSystemEditor)209 m_p NameAndSystemEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));209 if (m_pSystemTypeEditor) 210 m_pSystemTypeEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId)); 210 211 break; 211 212 } … … 216 217 /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore. 217 218 * So simply disconnect the text-edit signal. */ 218 if (m_pNameAnd SystemEditor)219 m_pNameAnd SystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));219 if (m_pNameAndFolderEditor) 220 m_pNameAndFolderEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &))); 220 221 } 221 222 … … 250 251 void UIWizardNewVMPage1::composeMachineFilePath() 251 252 { 252 if (!m_pNameAnd SystemEditor)253 if (!m_pNameAndFolderEditor) 253 254 return; 254 if (m_pNameAnd SystemEditor->name().isEmpty() || m_pNameAndSystemEditor->path().isEmpty())255 if (m_pNameAndFolderEditor->name().isEmpty() || m_pNameAndFolderEditor->path().isEmpty()) 255 256 return; 256 257 /* Get VBox: */ … … 258 259 259 260 /* Compose machine filename: */ 260 m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAnd SystemEditor->name(),261 m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndFolderEditor->name(), 261 262 m_strGroup, 262 263 QString(), 263 m_pNameAnd SystemEditor->path());264 m_pNameAndFolderEditor->path()); 264 265 /* Compose machine folder/basename: */ 265 266 const QFileInfo fileInfo(m_strMachineFilePath); … … 283 284 if (pGridLayout) 284 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 285 298 if (fCreateLabels) 286 299 { 287 300 m_pUnattendedLabel = new QIRichTextLabel; 288 301 if (m_pUnattendedLabel) 289 pGridLayout->addWidget(m_pUnattendedLabel, 0, 0, 1, 3);302 pGridLayout->addWidget(m_pUnattendedLabel, iLayoutRow++, 0, 1, 3); 290 303 } 291 304 … … 297 310 { 298 311 m_pButtonSimple->setChecked(true); 299 pGridLayout->addWidget(m_pButtonSimple, 1, 0, 1, 3);312 pGridLayout->addWidget(m_pButtonSimple, iLayoutRow++, 0, 1, 3); 300 313 } 301 314 m_pButtonUnattended = new QRadioButton; 302 315 if (m_pButtonUnattended) 303 316 { 304 QStyleOptionButton options;305 options.initFrom(m_pButtonUnattended);306 const int iWidth = m_pButtonUnattended->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth,307 &options, m_pButtonUnattended);308 pGridLayout->setColumnMinimumWidth(0, iWidth);309 pGridLayout->addWidget(m_pButtonUnattended, 2, 0, 1, 3);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); 310 323 } 311 324 … … 320 333 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 321 334 m_pISOSelectorLabel->setEnabled(false); 322 pGridLayout->addWidget(m_pISOSelectorLabel, 3, 1);335 pGridLayout->addWidget(m_pISOSelectorLabel, iLayoutRow++, 1); 323 336 } 324 337 m_pISOFilePathSelector = new UIFilePathSelector; … … 330 343 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 331 344 m_pISOFilePathSelector->setEnabled(false); 332 pGridLayout->addWidget(m_pISOFilePathSelector, 3, 2);345 pGridLayout->addWidget(m_pISOFilePathSelector, iLayoutRow++, 2); 333 346 } 334 347 … … 339 352 m_pStartHeadlessLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 340 353 m_pStartHeadlessLabel->setEnabled(false); 341 pGridLayout->addWidget(m_pStartHeadlessLabel, 4, 1);354 pGridLayout->addWidget(m_pStartHeadlessLabel, iLayoutRow++, 1); 342 355 } 343 356 m_pStartHeadlessCheckBox = new QCheckBox; … … 345 358 { 346 359 m_pStartHeadlessCheckBox->setEnabled(false); 347 pGridLayout->addWidget(m_pStartHeadlessCheckBox, 4, 2); 348 } 349 350 if (fCreateLabels) 351 { 352 m_pNameOSTypeLabel = new QIRichTextLabel; 353 if (m_pNameOSTypeLabel) 354 pGridLayout->addWidget(m_pNameOSTypeLabel, 5, 0, 1, 3); 355 } 356 357 m_pNameAndSystemEditor = new UINameAndSystemEditor(0, true, true, true); 358 if (m_pNameAndSystemEditor) 359 { 360 pGridLayout->addWidget(m_pNameAndSystemEditor, 6, 1, 1, 2); 361 } 360 pGridLayout->addWidget(m_pStartHeadlessCheckBox, iLayoutRow++, 2); 361 } 362 363 m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true); 364 if (m_pSystemTypeEditor) 365 pGridLayout->addWidget(m_pSystemTypeEditor, iLayoutRow++, 1, 1, 2); 362 366 } 363 367 } … … 365 369 bool UIWizardNewVMPage1::createMachineFolder() 366 370 { 367 if (!m_pNameAnd SystemEditor)371 if (!m_pNameAndFolderEditor) 368 372 return false; 369 373 /* Cleanup previosly created folder if any: */ … … 452 456 QString UIWizardNewVMPage1::guestOSFamiyId() const 453 457 { 454 if (!m_p NameAndSystemEditor)458 if (!m_pSystemTypeEditor) 455 459 return QString(); 456 return m_p NameAndSystemEditor->familyId();460 return m_pSystemTypeEditor->familyId(); 457 461 } 458 462 … … 493 497 if (m_pISOFilePathSelector) 494 498 m_pISOFilePathSelector->mark(!isISOFileSelectorComplete()); 495 if (m_pNameAnd SystemEditor)496 m_pNameAnd SystemEditor->markNameLineEdit(m_pNameAndSystemEditor->name().isEmpty());499 if (m_pNameAndFolderEditor) 500 m_pNameAndFolderEditor->markNameLineEdit(m_pNameAndFolderEditor->name().isEmpty()); 497 501 } 498 502 … … 509 513 { 510 514 m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty")); 511 m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed thereby leaving the virtual machine's 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.")); 512 517 } 513 518 if (m_pButtonUnattended) 514 519 { 515 520 m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install")); 516 m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS installation will be started after this wizard is closed.")); 521 m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS installation will be started " 522 "after this wizard is closed.")); 517 523 } 518 524 … … 525 531 { 526 532 m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("Start VM Headless")); 527 m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual machine in headless mode.")); 533 m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual " 534 "machine in headless mode after the guest OS install.")); 528 535 } 529 536 … … 539 546 { 540 547 QGridLayout *pMainLayout = new QGridLayout(this);; 541 createNameOSTypeWidgets(pMainLayout );548 createNameOSTypeWidgets(pMainLayout, false); 542 549 createConnections(); 543 550 /* Register fields: */ 544 registerField("name*", m_pNameAnd SystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));545 registerField("type", m_p NameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));551 registerField("name*", m_pNameAndFolderEditor, "name", SIGNAL(sigNameChanged(const QString &))); 552 registerField("type", m_pSystemTypeEditor, "type", SIGNAL(sigOsTypeChanged())); 546 553 registerField("machineFilePath", this, "machineFilePath"); 547 554 registerField("machineFolder", this, "machineFolder"); … … 559 566 this, &UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle); 560 567 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic1::sltISOPathChanged); 561 connect(m_pNameAnd SystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged);562 connect(m_pNameAnd SystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged);563 connect(m_p NameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged);568 connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged); 569 connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged); 570 connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged); 564 571 } 565 572 … … 575 582 { 576 583 markWidgets(); 577 if (m_pNameAnd SystemEditor->name().isEmpty())584 if (m_pNameAndFolderEditor->name().isEmpty()) 578 585 return false; 579 586 return isISOFileSelectorComplete(); … … 627 634 628 635 if (m_pUnattendedLabel) 629 m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install " 630 "in which case you will have to select a valid installation medium. If not " 631 "your virtual disk will have an empty virtual hard disk. " 632 "Additionally you can choose to start the unattended install as a headless vm process.")); 636 m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please decide whether you want to start an unattended guest os install " 637 "in which case you will have to select a valid installation medium. If not, " 638 "your virtual disk will have an empty virtual hard disk.")); 633 639 634 640 … … 639 645 "to identify this machine.")); 640 646 641 if ( m_pNameAndSystemEditor 647 if ( m_pNameAndFolderEditor 648 && m_pSystemTypeEditor 642 649 && m_pISOSelectorLabel 643 650 && m_pStartHeadlessLabel) … … 646 653 iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width()); 647 654 iMinWidthHint = qMax(iMinWidthHint, m_pStartHeadlessLabel->minimumSizeHint().width()); 648 m_pNameAndSystemEditor->setMinimumLayoutIndent(iMinWidthHint); 655 m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint); 656 m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint); 649 657 } 650 658 } … … 654 662 /* Translate page: */ 655 663 retranslateUi(); 656 if (m_pNameAnd SystemEditor)657 m_pNameAnd SystemEditor->setFocus();664 if (m_pNameAndFolderEditor) 665 m_pNameAndFolderEditor->setFocus(); 658 666 } 659 667 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r85168 r87057 97 97 QCheckBox *m_pStartHeadlessCheckBox; 98 98 /** Provides a path selector and a line edit field for path and name entry. */ 99 UINameAndSystemEditor *m_pNameAndSystemEditor; 99 UINameAndSystemEditor *m_pNameAndFolderEditor; 100 UINameAndSystemEditor *m_pSystemTypeEditor; 100 101 QIRichTextLabel *m_pUnattendedLabel; 101 102 QIRichTextLabel *m_pNameOSTypeLabel; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r86086 r87057 73 73 qRegisterMetaType<CMedium>(); 74 74 /* Register fields: */ 75 registerField("name*", m_pNameAnd SystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));76 registerField("type", m_p NameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));75 registerField("name*", m_pNameAndFolderEditor, "name", SIGNAL(sigNameChanged(const QString &))); 76 registerField("type", m_pSystemTypeEditor, "type", SIGNAL(sigOsTypeChanged())); 77 77 registerField("machineFilePath", this, "machineFilePath"); 78 78 registerField("machineFolder", this, "machineFolder"); … … 107 107 onNameChanged(strNewText); 108 108 109 /* Fetch recommended RAM value: */110 CGuestOSType type = m_pNameAndSystemEditor->type();111 112 109 composeMachineFilePath(); 113 110 /* Broadcast complete-change: */ … … 127 124 128 125 /* Fetch recommended RAM value: */ 129 CGuestOSType type = m_p NameAndSystemEditor->type();126 CGuestOSType type = m_pSystemTypeEditor->type(); 130 127 m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM()); 131 128 … … 204 201 { 205 202 /* Connections for Name, OS Type, and unattended install stuff: */ 206 if (m_pNameAnd SystemEditor)207 { 208 connect(m_pNameAnd SystemEditor, &UINameAndSystemEditor::sigNameChanged,203 if (m_pNameAndFolderEditor) 204 { 205 connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigNameChanged, 209 206 this, &UIWizardNewVMPageExpert::sltNameChanged); 210 connect(m_pNameAnd SystemEditor, &UINameAndSystemEditor::sigPathChanged,207 connect(m_pNameAndFolderEditor, &UINameAndSystemEditor::sigPathChanged, 211 208 this, &UIWizardNewVMPageExpert::sltPathChanged); 212 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, 209 } 210 if (m_pSystemTypeEditor) 211 { 212 connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOsTypeChanged, 213 213 this, &UIWizardNewVMPageExpert::sltOsTypeChanged); 214 connect(m_p NameAndSystemEditor, &UINameAndSystemEditor::sigOSFamilyChanged,214 connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOSFamilyChanged, 215 215 this, &UIWizardNewVMPageExpert::sltOSFamilyTypeChanged); 216 216 }
Note:
See TracChangeset
for help on using the changeset viewer.