Changeset 87294 in vbox
- Timestamp:
- Jan 18, 2021 11:12:13 AM (4 years ago)
- 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
r87249 r87294 184 184 , m_pEnableUnattendedInstallCheckBox(0) 185 185 , m_pStartHeadlessCheckBox(0) 186 , m_pNameAndFolderEditor(0) 187 , m_pSystemTypeEditor(0) 186 , m_pNameAndSystemEditor(0) 188 187 , m_pUnattendedLabel(0) 189 188 , m_pNameOSTypeLabel(0) … … 205 204 if (strNewName.contains(gs_OSTypePattern[i].pattern)) 206 205 { 207 if (m_p SystemTypeEditor)208 m_p SystemTypeEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId));206 if (m_pNameAndSystemEditor) 207 m_pNameAndSystemEditor->setType(uiCommon().vmGuestOSType(gs_OSTypePattern[i].pcstId)); 209 208 break; 210 209 } … … 215 214 /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore. 216 215 * So simply disconnect the text-edit signal. */ 217 if (m_pNameAnd FolderEditor)218 m_pNameAnd FolderEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));216 if (m_pNameAndSystemEditor) 217 m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &))); 219 218 } 220 219 … … 249 248 void UIWizardNewVMPage1::composeMachineFilePath() 250 249 { 251 if (!m_pNameAnd FolderEditor)250 if (!m_pNameAndSystemEditor) 252 251 return; 253 if (m_pNameAnd FolderEditor->name().isEmpty() || m_pNameAndFolderEditor->path().isEmpty())252 if (m_pNameAndSystemEditor->name().isEmpty() || m_pNameAndSystemEditor->path().isEmpty()) 254 253 return; 255 254 /* Get VBox: */ … … 257 256 258 257 /* Compose machine filename: */ 259 m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAnd FolderEditor->name(),258 m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(), 260 259 m_strGroup, 261 260 QString(), 262 m_pNameAnd FolderEditor->path());261 m_pNameAndSystemEditor->path()); 263 262 /* Compose machine folder/basename: */ 264 263 const QFileInfo fileInfo(m_strMachineFilePath); … … 299 298 m_pNameOSTypeLabel = new QIRichTextLabel; 300 299 if (m_pNameOSTypeLabel) 301 pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 4);302 } 303 304 m_pNameAnd FolderEditor = new UINameAndSystemEditor(0, true, true, false);305 if (m_pNameAnd FolderEditor)306 pLayout->addWidget(m_pNameAnd FolderEditor, iRow++, 0, 1, 4);307 308 pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4);300 pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 6); 301 } 302 303 m_pNameAndSystemEditor = new UINameAndSystemEditor(0, true, true, true); 304 if (m_pNameAndSystemEditor) 305 pLayout->addWidget(m_pNameAndSystemEditor, iRow++, 0, 1, 6); 306 307 pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 6); 309 308 310 309 if (fCreateLabels) … … 312 311 m_pUnattendedLabel = new QIRichTextLabel; 313 312 if (m_pUnattendedLabel) 314 pLayout->addWidget(m_pUnattendedLabel, iRow++, 0, 1, 4);313 pLayout->addWidget(m_pUnattendedLabel, iRow++, 0, 1, 6); 315 314 } 316 315 317 316 m_pEnableUnattendedInstallCheckBox = new QCheckBox; 318 pLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iRow++, 0, 1, 2, Qt::AlignLeft);317 pLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iRow++, 0, 1, 1); 319 318 320 319 m_pISOSelectorLabel = new QLabel; … … 324 323 m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 325 324 m_pISOSelectorLabel->setEnabled(false); 326 pLayout->addWidget(m_pISOSelectorLabel, iRow, 0, 1, 1, Qt::AlignRight);325 pLayout->addWidget(m_pISOSelectorLabel, iRow, 1, 1, 1); 327 326 } 328 327 m_pISOFilePathSelector = new UIFilePathSelector; … … 332 331 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 333 332 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 334 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);335 333 m_pISOFilePathSelector->setEnabled(false); 336 pLayout->addWidget(m_pISOFilePathSelector, iRow++, 1, 1, 3);334 pLayout->addWidget(m_pISOFilePathSelector, iRow++, 2, 1, 4); 337 335 } 338 336 … … 341 339 { 342 340 m_pStartHeadlessCheckBox->setEnabled(false); 343 pLayout->addWidget(m_pStartHeadlessCheckBox, iRow++, 1, 1, 1);341 pLayout->addWidget(m_pStartHeadlessCheckBox, iRow++, 1, 1, 5); 344 342 } 345 343 346 344 pLayout->addWidget(horizontalLine(), iRow++, 0, 1, 4); 347 345 348 m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true);349 if (m_pSystemTypeEditor)350 pLayout->addWidget(m_pSystemTypeEditor, iRow++, 0, 1, 4);351 346 return pContainer; 352 347 } … … 354 349 bool UIWizardNewVMPage1::createMachineFolder() 355 350 { 356 if (!m_pNameAnd FolderEditor)351 if (!m_pNameAndSystemEditor) 357 352 return false; 358 353 /* Cleanup previosly created folder if any: */ … … 441 436 QString UIWizardNewVMPage1::guestOSFamiyId() const 442 437 { 443 if (!m_p SystemTypeEditor)438 if (!m_pNameAndSystemEditor) 444 439 return QString(); 445 return m_p SystemTypeEditor->familyId();440 return m_pNameAndSystemEditor->familyId(); 446 441 } 447 442 … … 482 477 if (m_pISOFilePathSelector) 483 478 m_pISOFilePathSelector->mark(!isISOFileSelectorComplete()); 484 if (m_pNameAnd FolderEditor)485 m_pNameAnd FolderEditor->markNameLineEdit(m_pNameAndFolderEditor->name().isEmpty());479 if (m_pNameAndSystemEditor) 480 m_pNameAndSystemEditor->markNameLineEdit(m_pNameAndSystemEditor->name().isEmpty()); 486 481 } 487 482 … … 528 523 createConnections(); 529 524 /* Register fields: */ 530 registerField("name*", m_pNameAnd FolderEditor, "name", SIGNAL(sigNameChanged(const QString &)));531 registerField("type", m_p SystemTypeEditor, "type", SIGNAL(sigOsTypeChanged()));525 registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &))); 526 registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged())); 532 527 registerField("machineFilePath", this, "machineFilePath"); 533 528 registerField("machineFolder", this, "machineFolder"); … … 544 539 connect(m_pEnableUnattendedInstallCheckBox, &QCheckBox::clicked, this, &UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle); 545 540 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic1::sltISOPathChanged); 546 connect(m_pNameAnd FolderEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged);547 connect(m_pNameAnd FolderEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged);548 connect(m_p SystemTypeEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged);541 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged); 542 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged); 543 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged); 549 544 } 550 545 … … 560 555 { 561 556 markWidgets(); 562 if (m_pNameAnd FolderEditor->name().isEmpty())557 if (m_pNameAndSystemEditor->name().isEmpty()) 563 558 return false; 564 559 return isISOFileSelectorComplete(); … … 620 615 "to identify this machine.")); 621 616 622 // if ( m_pNameAnd FolderEditor617 // if ( m_pNameAndSystemEditor 623 618 // && m_pSystemTypeEditor 624 619 // && m_pISOSelectorLabel) … … 626 621 // int iMinWidthHint = 0; 627 622 // iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width()); 628 // m_pNameAnd FolderEditor->setMinimumLayoutIndent(iMinWidthHint);623 // m_pNameAndSystemEditor->setMinimumLayoutIndent(iMinWidthHint); 629 624 // m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint); 630 625 // } … … 635 630 /* Translate page: */ 636 631 retranslateUi(); 637 if (m_pNameAnd FolderEditor)638 m_pNameAnd FolderEditor->setFocus();632 if (m_pNameAndSystemEditor) 633 m_pNameAndSystemEditor->setFocus(); 639 634 } 640 635 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87249 r87294 95 95 /** We have two UINameAndSystemEditor instance since name/vm path fields and OS type fields 96 96 * are separated. */ 97 UINameAndSystemEditor *m_pNameAndFolderEditor; 98 UINameAndSystemEditor *m_pSystemTypeEditor; 97 UINameAndSystemEditor *m_pNameAndSystemEditor; 99 98 QIRichTextLabel *m_pUnattendedLabel; 100 99 QIRichTextLabel *m_pNameOSTypeLabel; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87249 r87294 69 69 qRegisterMetaType<CMedium>(); 70 70 /* Register fields: */ 71 registerField("name*", m_pNameAnd FolderEditor, "name", SIGNAL(sigNameChanged(const QString &)));72 registerField("type", m_p SystemTypeEditor, "type", SIGNAL(sigOsTypeChanged()));71 registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &))); 72 registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged())); 73 73 registerField("machineFilePath", this, "machineFilePath"); 74 74 registerField("machineFolder", this, "machineFolder"); … … 91 91 registerField("VCPUCount", this, "VCPUCount"); 92 92 93 const QPalette pal = palette(); 94 QColor tabBackgroundColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(110); 95 QColor textColor = pal.color(QPalette::Active, QPalette::Text).lighter(); 96 QColor disabledTextColor = pal.color(QPalette::Disabled, QPalette::Text).lighter(); 97 93 98 m_pToolBox->setStyleSheet(QString::fromUtf8("QToolBox::tab {\n" 94 " background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,\n" 95 " stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,\n" 96 " stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);\n" 99 " background: %1; \n" 97 100 " border-radius: 5px;\n" 98 " color: black;\n"101 " color: %2;\n" 99 102 "}\n" 100 103 "\n" … … 108 111 "QToolBox::tab:disabled {\n" 109 112 " font: italic;\n" 110 " color: gray;\n"111 "}") );113 " color: %3;\n" 114 "}").arg(tabBackgroundColor.name()).arg(textColor.name()).arg(disabledTextColor.name())); 112 115 113 116 if (m_pEnableUnattendedInstallCheckBox) … … 137 140 138 141 /* Fetch recommended RAM value: */ 139 CGuestOSType type = m_p SystemTypeEditor->type();142 CGuestOSType type = m_pNameAndSystemEditor->type(); 140 143 m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM()); 141 144 … … 213 216 { 214 217 /* Connections for Name, OS Type, and unattended install stuff: */ 215 if (m_pNameAnd FolderEditor)216 { 217 connect(m_pNameAnd FolderEditor, &UINameAndSystemEditor::sigNameChanged,218 if (m_pNameAndSystemEditor) 219 { 220 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, 218 221 this, &UIWizardNewVMPageExpert::sltNameChanged); 219 connect(m_pNameAnd FolderEditor, &UINameAndSystemEditor::sigPathChanged,222 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, 220 223 this, &UIWizardNewVMPageExpert::sltPathChanged); 221 } 222 if (m_pSystemTypeEditor) 223 { 224 connect(m_pSystemTypeEditor, &UINameAndSystemEditor::sigOsTypeChanged, 224 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, 225 225 this, &UIWizardNewVMPageExpert::sltOsTypeChanged); 226 connect(m_p SystemTypeEditor, &UINameAndSystemEditor::sigOSFamilyChanged,226 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOSFamilyChanged, 227 227 this, &UIWizardNewVMPageExpert::sltOSFamilyTypeChanged); 228 228 }
Note:
See TracChangeset
for help on using the changeset viewer.