Changeset 85055 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 3, 2020 12:41:08 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138958
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 deleted
- 7 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r85044 r85055 650 650 src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h \ 651 651 src/wizards/newvm/UIWizardNewVM.h \ 652 src/wizards/newvm/UIWizardNewVMPageBasicUserNameHostname.h \653 652 src/wizards/newvm/UIWizardNewVMPageBasic1.h \ 654 src/wizards/newvm/UIWizardNewVMPageBasic GAInstall.h \653 src/wizards/newvm/UIWizardNewVMPageBasic2.h \ 655 654 src/wizards/newvm/UIWizardNewVMPageBasicHardware.h \ 656 src/wizards/newvm/UIWizardNewVMPageBasicProductKey.h \657 655 src/wizards/newvm/UIWizardNewVMPageBasicDisk.h \ 658 656 src/wizards/newvm/UIWizardNewVMPageExpert.h \ … … 1115 1113 src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp \ 1116 1114 src/wizards/newvm/UIWizardNewVM.cpp \ 1117 src/wizards/newvm/UIWizardNewVMPageBasicUserNameHostname.cpp \1118 1115 src/wizards/newvm/UIWizardNewVMPageBasic1.cpp \ 1119 src/wizards/newvm/UIWizardNewVMPageBasic GAInstall.cpp \1116 src/wizards/newvm/UIWizardNewVMPageBasic2.cpp \ 1120 1117 src/wizards/newvm/UIWizardNewVMPageBasicHardware.cpp \ 1121 src/wizards/newvm/UIWizardNewVMPageBasicProductKey.cpp \1122 1118 src/wizards/newvm/UIWizardNewVMPageBasicDisk.cpp \ 1123 1119 src/wizards/newvm/UIWizardNewVMPageExpert.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r85044 r85055 20 20 #include "UIWizardNewVM.h" 21 21 #include "UIWizardNewVMPageBasic1.h" 22 #include "UIWizardNewVMPageBasic2.h" 22 23 #include "UIWizardNewVMPageBasicHardware.h" 23 #include "UIWizardNewVMPageBasicProductKey.h"24 #include "UIWizardNewVMPageBasicGAInstall.h"25 24 #include "UIWizardNewVMPageBasicDisk.h" 26 25 #include "UIWizardNewVMPageExpert.h" 27 #include "UIWizardNewVMPageBasicUserNameHostname.h"28 26 #include "UIMessageCenter.h" 29 27 #include "UIMedium.h" … … 77 75 case WizardMode_Basic: 78 76 { 79 setPage(Page1, new UIWizardNewVMPageBasicNameType(m_strGroup)); 80 setPage(PageUserNameHostname, new UIWizardNewVMPageBasicUserNameHostname); 81 setPage(PageGAInstall, new UIWizardNewVMPageBasicGAInstall); 82 setPage(PageProductKey, new UIWizardNewVMPageBasicProductKey); 77 setPage(Page1, new UIWizardNewVMPageBasic1(m_strGroup)); 78 setPage(Page2, new UIWizardNewVMPageBasic2); 83 79 setPage(PageHardware, new UIWizardNewVMPageBasicHardware); 84 80 setPage(PageDisk, new UIWizardNewVMPageBasicDisk); … … 406 402 case WizardMode_Basic: 407 403 { 408 UIWizardNewVMPageBasic NameType *pPage = qobject_cast<UIWizardNewVMPageBasicNameType*> (page(Page1));404 UIWizardNewVMPageBasic1 *pPage = qobject_cast<UIWizardNewVMPageBasic1*> (page(Page1)); 409 405 /* Make sure that we were able to find the page that created the folder. */ 410 406 Assert(pPage); … … 427 423 void UIWizardNewVM::sltHandleDetectedOSTypeChange() 428 424 { 429 UIWizardNewVMPageBasic NameType *pPage = qobject_cast<UIWizardNewVMPageBasicNameType*>(page(Page1));425 UIWizardNewVMPageBasic1 *pPage = qobject_cast<UIWizardNewVMPageBasic1*>(page(Page1)); 430 426 if (!pPage) 431 427 return; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r85044 r85055 61 61 { 62 62 Page1, 63 PageUserNameHostname, 64 PageGAInstall, 65 PageProductKey, 63 Page2, 66 64 PageHardware, 67 65 PageDisk, -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r85053 r85055 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic NameTypeclass implementation.3 * VBox Qt GUI - UIWizardNewVMPageBasic1 class implementation. 4 4 */ 5 5 … … 179 179 }; 180 180 181 UIWizardNewVMPage NameType::UIWizardNewVMPageNameType(const QString &strGroup)181 UIWizardNewVMPage1::UIWizardNewVMPage1(const QString &strGroup) 182 182 : m_pButtonSimple(0) 183 183 , m_pButtonUnattended(0) … … 194 194 } 195 195 196 void UIWizardNewVMPage NameType::onNameChanged(QString strNewName)196 void UIWizardNewVMPage1::onNameChanged(QString strNewName) 197 197 { 198 198 /* Do not forget about achitecture bits, if not yet specified: */ … … 214 214 } 215 215 216 void UIWizardNewVMPage NameType::onOsTypeChanged()216 void UIWizardNewVMPage1::onOsTypeChanged() 217 217 { 218 218 /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore. … … 222 222 } 223 223 224 bool UIWizardNewVMPage NameType::determineOSType(const QString &strISOPath)224 bool UIWizardNewVMPage1::determineOSType(const QString &strISOPath) 225 225 { 226 226 QFileInfo isoFileInfo(strISOPath); … … 250 250 } 251 251 252 void UIWizardNewVMPage NameType::composeMachineFilePath()252 void UIWizardNewVMPage1::composeMachineFilePath() 253 253 { 254 254 if (!m_pNameAndSystemEditor) … … 270 270 } 271 271 272 bool UIWizardNewVMPage NameType::checkISOFile() const272 bool UIWizardNewVMPage1::checkISOFile() const 273 273 { 274 274 if (m_pButtonUnattended && m_pButtonUnattended->isChecked()) … … 281 281 } 282 282 283 bool UIWizardNewVMPage NameType::createMachineFolder()283 bool UIWizardNewVMPage1::createMachineFolder() 284 284 { 285 285 if (!m_pNameAndSystemEditor) … … 319 319 } 320 320 321 bool UIWizardNewVMPage NameType::cleanupMachineFolder(bool fWizardCancel /* = false */)321 bool UIWizardNewVMPage1::cleanupMachineFolder(bool fWizardCancel /* = false */) 322 322 { 323 323 /* Make sure folder was previosly created: */ … … 338 338 } 339 339 340 QString UIWizardNewVMPage NameType::machineFilePath() const340 QString UIWizardNewVMPage1::machineFilePath() const 341 341 { 342 342 return m_strMachineFilePath; 343 343 } 344 344 345 void UIWizardNewVMPage NameType::setMachineFilePath(const QString &strMachineFilePath)345 void UIWizardNewVMPage1::setMachineFilePath(const QString &strMachineFilePath) 346 346 { 347 347 m_strMachineFilePath = strMachineFilePath; 348 348 } 349 349 350 QString UIWizardNewVMPage NameType::machineFolder() const350 QString UIWizardNewVMPage1::machineFolder() const 351 351 { 352 352 return m_strMachineFolder; 353 353 } 354 354 355 void UIWizardNewVMPage NameType::setMachineFolder(const QString &strMachineFolder)355 void UIWizardNewVMPage1::setMachineFolder(const QString &strMachineFolder) 356 356 { 357 357 m_strMachineFolder = strMachineFolder; 358 358 } 359 359 360 QString UIWizardNewVMPage NameType::machineBaseName() const360 QString UIWizardNewVMPage1::machineBaseName() const 361 361 { 362 362 return m_strMachineBaseName; 363 363 } 364 364 365 void UIWizardNewVMPage NameType::setMachineBaseName(const QString &strMachineBaseName)365 void UIWizardNewVMPage1::setMachineBaseName(const QString &strMachineBaseName) 366 366 { 367 367 m_strMachineBaseName = strMachineBaseName; 368 368 } 369 369 370 QString UIWizardNewVMPage NameType::guestOSFamiyId() const370 QString UIWizardNewVMPage1::guestOSFamiyId() const 371 371 { 372 372 if (!m_pNameAndSystemEditor) … … 375 375 } 376 376 377 QString UIWizardNewVMPage NameType::ISOFilePath() const377 QString UIWizardNewVMPage1::ISOFilePath() const 378 378 { 379 379 if (!m_pISOFilePathSelector) … … 382 382 } 383 383 384 bool UIWizardNewVMPage NameType::isUnattendedEnabled() const384 bool UIWizardNewVMPage1::isUnattendedEnabled() const 385 385 { 386 386 if (!m_pButtonUnattended) … … 389 389 } 390 390 391 bool UIWizardNewVMPage NameType::startHeadless() const391 bool UIWizardNewVMPage1::startHeadless() const 392 392 { 393 393 if (!m_pStartHeadlessCheckBox) … … 396 396 } 397 397 398 const QString &UIWizardNewVMPage NameType::detectedOSTypeId() const398 const QString &UIWizardNewVMPage1::detectedOSTypeId() const 399 399 { 400 400 return m_strDetectedOSTypeId; 401 401 } 402 402 403 UIWizardNewVMPageBasic NameType::UIWizardNewVMPageBasicNameType(const QString &strGroup)404 : UIWizardNewVMPage NameType(strGroup)403 UIWizardNewVMPageBasic1::UIWizardNewVMPageBasic1(const QString &strGroup) 404 : UIWizardNewVMPage1(strGroup) 405 405 { 406 406 prepare(); 407 407 } 408 408 409 void UIWizardNewVMPageBasic NameType::prepare()409 void UIWizardNewVMPageBasic1::prepare() 410 410 { 411 411 QGridLayout *pMainLayout = new QGridLayout(this); … … 439 439 pButtonGroup->addButton(m_pButtonUnattended); 440 440 connect(pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 441 this, &UIWizardNewVMPageBasic NameType::sltUnattendedCheckBoxToggle);441 this, &UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle); 442 442 } 443 443 … … 458 458 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 459 459 m_pISOFilePathSelector->setEnabled(false); 460 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic NameType::sltISOPathChanged);460 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic1::sltISOPathChanged); 461 461 pMainLayout->addWidget(m_pISOFilePathSelector, 3, 2); 462 462 } … … 484 484 if (m_pNameAndSystemEditor) 485 485 { 486 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic NameType::sltNameChanged);487 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic NameType::sltPathChanged);488 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic NameType::sltOsTypeChanged);486 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged); 487 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged); 488 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged); 489 489 pMainLayout->addWidget(m_pNameAndSystemEditor, 6, 1, 1, 2); 490 490 } … … 504 504 } 505 505 506 int UIWizardNewVMPageBasic NameType::nextId() const506 int UIWizardNewVMPageBasic1::nextId() const 507 507 { 508 508 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 509 509 if (!pWizard || !pWizard->isUnattendedInstallEnabled()) 510 510 return UIWizardNewVM::PageHardware; 511 return UIWizardNewVM::Page UserNameHostname;512 } 513 514 void UIWizardNewVMPageBasic NameType::setTypeByISODetectedOSType(const QString &strDetectedOSType)511 return UIWizardNewVM::Page2; 512 } 513 514 void UIWizardNewVMPageBasic1::setTypeByISODetectedOSType(const QString &strDetectedOSType) 515 515 { 516 516 if (!strDetectedOSType.isEmpty()) … … 518 518 } 519 519 520 bool UIWizardNewVMPageBasic NameType::isComplete() const520 bool UIWizardNewVMPageBasic1::isComplete() const 521 521 { 522 522 if (m_pNameAndSystemEditor->name().isEmpty()) … … 525 525 } 526 526 527 void UIWizardNewVMPageBasic NameType::sltNameChanged(const QString &strNewName)527 void UIWizardNewVMPageBasic1::sltNameChanged(const QString &strNewName) 528 528 { 529 529 onNameChanged(strNewName); … … 531 531 } 532 532 533 void UIWizardNewVMPageBasic NameType::sltPathChanged(const QString &strNewPath)533 void UIWizardNewVMPageBasic1::sltPathChanged(const QString &strNewPath) 534 534 { 535 535 Q_UNUSED(strNewPath); … … 537 537 } 538 538 539 void UIWizardNewVMPageBasic NameType::sltOsTypeChanged()539 void UIWizardNewVMPageBasic1::sltOsTypeChanged() 540 540 { 541 541 /* Call to base-class: */ … … 543 543 } 544 544 545 void UIWizardNewVMPageBasic NameType::sltISOPathChanged(const QString &strPath)545 void UIWizardNewVMPageBasic1::sltISOPathChanged(const QString &strPath) 546 546 { 547 547 determineOSType(strPath); … … 550 550 } 551 551 552 void UIWizardNewVMPageBasic NameType::sltUnattendedCheckBoxToggle()552 void UIWizardNewVMPageBasic1::sltUnattendedCheckBoxToggle() 553 553 { 554 554 const bool fEnabled = m_pButtonUnattended->isChecked(); … … 567 567 568 568 569 void UIWizardNewVMPageBasic NameType::retranslateUi()569 void UIWizardNewVMPageBasic1::retranslateUi() 570 570 { 571 571 /* Translate page: */ … … 617 617 } 618 618 619 void UIWizardNewVMPageBasic NameType::initializePage()619 void UIWizardNewVMPageBasic1::initializePage() 620 620 { 621 621 /* Translate page: */ … … 625 625 } 626 626 627 void UIWizardNewVMPageBasic NameType::cleanupPage()627 void UIWizardNewVMPageBasic1::cleanupPage() 628 628 { 629 629 /* Cleanup: */ … … 633 633 } 634 634 635 bool UIWizardNewVMPageBasic NameType::validatePage()635 bool UIWizardNewVMPageBasic1::validatePage() 636 636 { 637 637 /* Try to create machine folder: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r85053 r85055 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic NameTypeclass declaration.3 * VBox Qt GUI - UIWizardNewVMPageBasic1 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic NameType_h19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic NameType_h18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic1_h 19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic1_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 34 34 35 35 /* 1st page of the New Virtual Machine wizard (base part): */ 36 class UIWizardNewVMPage NameType: public UIWizardPageBase36 class UIWizardNewVMPage1 : public UIWizardPageBase 37 37 { 38 38 protected: 39 39 40 40 /* Constructor: */ 41 UIWizardNewVMPage NameType(const QString &strGroup);41 UIWizardNewVMPage1(const QString &strGroup); 42 42 43 43 /* Handlers: */ … … 117 117 118 118 /* 1st page of the New Virtual Machine wizard (basic extension): */ 119 class UIWizardNewVMPageBasic NameType : public UIWizardPage, public UIWizardNewVMPageNameType119 class UIWizardNewVMPageBasic1 : public UIWizardPage, public UIWizardNewVMPage1 120 120 { 121 121 Q_OBJECT; … … 133 133 134 134 /* Constructor: */ 135 UIWizardNewVMPageBasic NameType(const QString &strGroup);135 UIWizardNewVMPageBasic1(const QString &strGroup); 136 136 virtual int nextId() const /* override */; 137 137 void setTypeByISODetectedOSType(const QString &strDetectedOSType); … … 170 170 }; 171 171 172 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic NameType_h */172 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic1_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r85054 r85055 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic UserNameHostnameclass implementation.3 * VBox Qt GUI - UIWizardNewVMPageBasic2 class implementation. 4 4 */ 5 5 … … 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 20 #include <QFileInfo> 19 21 #include <QGridLayout> 20 22 #include <QLabel> 23 #include <QToolBox> 21 24 #include <QVBoxLayout> 22 25 23 26 /* GUI includes: */ 24 27 #include "QIRichTextLabel.h" 28 #include "UIFilePathSelector.h" 25 29 #include "UIUserNamePasswordEditor.h" 26 #include "UIWizardNewVMPageBasic UserNameHostname.h"30 #include "UIWizardNewVMPageBasic2.h" 27 31 #include "UIWizardNewVM.h" 28 32 29 33 30 UIWizardNewVMPageUserNameHostname::UIWizardNewVMPageUserNameHostname() 31 : m_pUserNamePasswordEditor(0) 34 UIWizardNewVMPage2::UIWizardNewVMPage2() 35 : m_pToolBox(0) 36 , m_pUserNamePasswordEditor(0) 32 37 , m_pHostnameLineEdit(0) 33 38 , m_pHostnameLabel(0) 34 { 35 } 36 37 QString UIWizardNewVMPageUserNameHostname::userName() const 39 , m_pInstallGACheckBox(0) 40 , m_pISOPathLabel(0) 41 , m_pISOFilePathSelector(0) 42 , m_pProductKeyLineEdit(0) 43 , m_pProductKeyLabel(0) 44 45 { 46 } 47 48 QString UIWizardNewVMPage2::userName() const 38 49 { 39 50 if (m_pUserNamePasswordEditor) … … 42 53 } 43 54 44 void UIWizardNewVMPage UserNameHostname::setUserName(const QString &strName)55 void UIWizardNewVMPage2::setUserName(const QString &strName) 45 56 { 46 57 if (m_pUserNamePasswordEditor) … … 48 59 } 49 60 50 QString UIWizardNewVMPage UserNameHostname::password() const61 QString UIWizardNewVMPage2::password() const 51 62 { 52 63 if (m_pUserNamePasswordEditor) … … 55 66 } 56 67 57 void UIWizardNewVMPage UserNameHostname::setPassword(const QString &strPassword)68 void UIWizardNewVMPage2::setPassword(const QString &strPassword) 58 69 { 59 70 if (m_pUserNamePasswordEditor) … … 61 72 } 62 73 63 QString UIWizardNewVMPage UserNameHostname::hostname() const74 QString UIWizardNewVMPage2::hostname() const 64 75 { 65 76 if (m_pHostnameLineEdit) … … 68 79 } 69 80 70 void UIWizardNewVMPage UserNameHostname::setHostname(const QString &strHostName)81 void UIWizardNewVMPage2::setHostname(const QString &strHostName) 71 82 { 72 83 if (m_pHostnameLineEdit) … … 74 85 } 75 86 76 UIWizardNewVMPageBasicUserNameHostname::UIWizardNewVMPageBasicUserNameHostname() 87 bool UIWizardNewVMPage2::installGuestAdditions() const 88 { 89 if (!m_pInstallGACheckBox) 90 return true; 91 return m_pInstallGACheckBox->isChecked(); 92 } 93 94 void UIWizardNewVMPage2::setInstallGuestAdditions(bool fInstallGA) 95 { 96 if (m_pInstallGACheckBox) 97 m_pInstallGACheckBox->setChecked(fInstallGA); 98 } 99 100 QString UIWizardNewVMPage2::guestAdditionsISOPath() const 101 { 102 if (!m_pISOFilePathSelector) 103 return QString(); 104 return m_pISOFilePathSelector->path(); 105 } 106 107 void UIWizardNewVMPage2::setGuestAdditionsISOPath(const QString &strISOPath) 108 { 109 if (m_pISOFilePathSelector) 110 m_pISOFilePathSelector->setPath(strISOPath); 111 } 112 113 QString UIWizardNewVMPage2::productKey() const 114 { 115 if (!m_pProductKeyLineEdit || !m_pProductKeyLineEdit->hasAcceptableInput()) 116 return QString(); 117 return m_pProductKeyLineEdit->text(); 118 } 119 120 bool UIWizardNewVMPage2::checkGAISOFile() const 121 { 122 if (m_pInstallGACheckBox && m_pInstallGACheckBox->isChecked()) 123 { 124 QString strISOFilePath = m_pISOFilePathSelector ? m_pISOFilePathSelector->path() : QString(); 125 if (!QFileInfo(strISOFilePath).exists()) 126 return false; 127 } 128 return true; 129 } 130 131 UIWizardNewVMPageBasic2::UIWizardNewVMPageBasic2() 77 132 : m_pLabel(0) 78 133 { 134 prepare(); 135 } 136 137 void UIWizardNewVMPageBasic2::prepare() 138 { 79 139 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 140 m_pToolBox = new QToolBox; 141 pMainLayout->addWidget(m_pToolBox); 142 80 143 { 81 144 m_pLabel = new QIRichTextLabel(this); 82 QGridLayout *pGridLayout = new QGridLayout;83 {84 m_pUserNamePasswordEditor = new UIUserNamePasswordEditor;85 pGridLayout->addWidget(m_pUserNamePasswordEditor, 0, 0, 3, 4);86 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,87 this, &UIWizardNewVMPageBasicUserNameHostname::completeChanged);88 m_pHostnameLabel = new QLabel;89 m_pHostnameLineEdit = new QLineEdit;90 pGridLayout->addWidget(m_pHostnameLabel, 3, 0, 1, 1, Qt::AlignRight);91 pGridLayout->addWidget(m_pHostnameLineEdit, 3, 1, 1, 3);92 }93 145 if (m_pLabel) 94 146 pMainLayout->addWidget(m_pLabel); 95 pMainLayout->add Layout(pGridLayout);147 pMainLayout->addWidget(m_pToolBox); 96 148 pMainLayout->addStretch(); 97 149 } 150 151 createUserNameHostNameWidgets(); 152 createGAInstallWidgets(); 153 createProductKeyWidgets(); 98 154 99 155 registerField("userName", this, "userName"); 100 156 registerField("password", this, "password"); 101 157 registerField("hostname", this, "hostname"); 102 } 103 104 void UIWizardNewVMPageBasicUserNameHostname::retranslateUi() 158 registerField("installGuestAdditions", this, "installGuestAdditions"); 159 registerField("guestAdditionsISOPath", this, "guestAdditionsISOPath"); 160 registerField("productKey", this, "productKey"); 161 } 162 163 void UIWizardNewVMPageBasic2::createUserNameHostNameWidgets() 164 { 165 if (!m_pToolBox) 166 return; 167 QWidget *pContainer = new QWidget; 168 QGridLayout *pGridLayout = new QGridLayout(pContainer); 169 170 m_pUserNamePasswordEditor = new UIUserNamePasswordEditor; 171 pGridLayout->addWidget(m_pUserNamePasswordEditor, 0, 0, 3, 4); 172 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged, 173 this, &UIWizardNewVMPageBasic2::completeChanged); 174 m_pHostnameLabel = new QLabel; 175 m_pHostnameLineEdit = new QLineEdit; 176 pGridLayout->addWidget(m_pHostnameLabel, 3, 0, 1, 1, Qt::AlignRight); 177 pGridLayout->addWidget(m_pHostnameLineEdit, 3, 1, 1, 3); 178 179 m_pToolBox->insertItem(Tabs_UserNameHostname, pContainer, QString()); 180 181 } 182 183 void UIWizardNewVMPageBasic2::createGAInstallWidgets() 184 { 185 if (!m_pToolBox) 186 return; 187 QWidget *pContainer = new QWidget; 188 QGridLayout *pContainerLayout = new QGridLayout(pContainer); 189 190 m_pInstallGACheckBox = new QCheckBox; 191 connect(m_pInstallGACheckBox, &QCheckBox::toggled, this, &UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle); 192 m_pISOPathLabel = new QLabel; 193 { 194 m_pISOPathLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); 195 m_pISOPathLabel->setEnabled(false); 196 } 197 m_pISOFilePathSelector = new UIFilePathSelector; 198 { 199 m_pISOFilePathSelector->setResetEnabled(false); 200 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 201 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 202 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 203 m_pISOFilePathSelector->setEnabled(false); 204 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasic2::sltGAISOPathChanged); 205 } 206 207 pContainerLayout->addWidget(m_pInstallGACheckBox, 0, 0, 1, 5); 208 pContainerLayout->addWidget(m_pISOPathLabel, 1, 1, 1, 1); 209 pContainerLayout->addWidget(m_pISOFilePathSelector, 1, 2, 1, 4); 210 211 m_pToolBox->insertItem(Tabs_GAInstall, pContainer, QString()); 212 } 213 214 void UIWizardNewVMPageBasic2::createProductKeyWidgets() 215 { 216 if (!m_pToolBox) 217 return; 218 QWidget *pContainer = new QWidget; 219 QGridLayout *pGridLayout = new QGridLayout(pContainer); 220 221 222 m_pProductKeyLabel = new QLabel; 223 m_pProductKeyLineEdit = new QLineEdit; 224 m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#"); 225 pGridLayout->addWidget(m_pProductKeyLabel, 0, 0, 1, 1, Qt::AlignRight); 226 pGridLayout->addWidget(m_pProductKeyLineEdit, 0, 1, 1, 3); 227 228 m_pToolBox->insertItem(Tabs_ProductKey, pContainer, QString()); 229 } 230 231 void UIWizardNewVMPageBasic2::retranslateUi() 105 232 { 106 233 setTitle(UIWizardNewVM::tr("User Name/Password and Hostname Settings")); … … 110 237 if (m_pHostnameLabel) 111 238 m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:")); 112 } 113 114 void UIWizardNewVMPageBasicUserNameHostname::initializePage() 239 if (m_pToolBox) 240 { 241 m_pToolBox->setItemText(Tabs_UserNameHostname, UIWizardNewVM::tr("UserName and hostname")); 242 m_pToolBox->setItemText(Tabs_GAInstall, UIWizardNewVM::tr("Guest additions install")); 243 m_pToolBox->setItemText(Tabs_ProductKey, UIWizardNewVM::tr("Product key")); 244 } 245 if (m_pInstallGACheckBox) 246 m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions")); 247 if (m_pISOPathLabel) 248 m_pISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:")); 249 if (m_pISOFilePathSelector) 250 m_pISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)")); 251 if (m_pProductKeyLabel) 252 m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:")); 253 } 254 255 void UIWizardNewVMPageBasic2::initializePage() 115 256 { 116 257 retranslateUi(); 117 258 } 118 259 119 bool UIWizardNewVMPageBasicUserNameHostname::isComplete() const 120 { 260 bool UIWizardNewVMPageBasic2::isComplete() const 261 { 262 if (!checkGAISOFile()) 263 return false; 121 264 if (m_pUserNamePasswordEditor) 122 265 return m_pUserNamePasswordEditor->isComplete(); … … 124 267 } 125 268 126 void UIWizardNewVMPageBasicUserNameHostname::cleanupPage() 127 { 128 } 269 void UIWizardNewVMPageBasic2::cleanupPage() 270 { 271 } 272 273 void UIWizardNewVMPageBasic2::showEvent(QShowEvent *pEvent) 274 { 275 if (m_pToolBox) 276 { 277 QWidget *pProductKeyWidget = m_pToolBox->widget(Tabs_ProductKey); 278 if (pProductKeyWidget) 279 pProductKeyWidget->setEnabled(isProductKeyWidgetVisible()); 280 } 281 UIWizardPage::showEvent(pEvent); 282 } 283 284 void UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle(bool fEnabled) 285 { 286 if (m_pISOPathLabel) 287 m_pISOPathLabel->setEnabled(fEnabled); 288 if (m_pISOFilePathSelector) 289 m_pISOFilePathSelector->setEnabled(fEnabled); 290 emit completeChanged(); 291 } 292 293 void UIWizardNewVMPageBasic2::sltGAISOPathChanged(const QString &strPath) 294 { 295 Q_UNUSED(strPath); 296 emit completeChanged(); 297 } 298 299 bool UIWizardNewVMPageBasic2::isProductKeyWidgetVisible() const 300 { 301 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 302 if (!pWizard || !pWizard->isUnattendedInstallEnabled() || !pWizard->isGuestOSTypeWindows()) 303 return false; 304 return true; 305 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h
r85054 r85055 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic UserNameHostnameclass declaration.3 * VBox Qt GUI - UIWizardNewVMPageBasic2 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic UserNameHostname_h19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic UserNameHostname_h18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic2_h 19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic2_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 27 27 28 28 /* Forward declarations: */ 29 class QCheckBox; 29 30 class QGridLayout; 30 31 class QLabel; 31 32 class QLineEdit; 33 class QToolBox; 32 34 class QIRichTextLabel; 35 class UIFilePathSelector; 33 36 class UIUserNamePasswordEditor; 34 37 struct UIUnattendedInstallData; 35 38 36 39 37 class UIWizardNewVMPage UserNameHostname: public UIWizardPageBase40 class UIWizardNewVMPage2 : public UIWizardPageBase 38 41 { 39 42 public: 40 43 41 UIWizardNewVMPage UserNameHostname();44 UIWizardNewVMPage2(); 42 45 43 46 /** @name Property getters/setters … … 49 52 QString hostname() const; 50 53 void setHostname(const QString &strHostName); 54 bool installGuestAdditions() const; 55 void setInstallGuestAdditions(bool fInstallGA); 56 QString guestAdditionsISOPath() const; 57 void setGuestAdditionsISOPath(const QString &strISOPath); 58 QString productKey() const; 51 59 /** @} */ 52 60 53 61 protected: 62 enum Tabs 63 { 64 Tabs_UserNameHostname, 65 Tabs_GAInstall, 66 Tabs_ProductKey, 67 Tabs_Max 68 }; 54 69 55 UIUserNamePasswordEditor *m_pUserNamePasswordEditor; 56 QLineEdit *m_pHostnameLineEdit; 57 QLabel *m_pHostnameLabel; 70 bool checkGAISOFile() const; 71 72 /** @name Widgets 73 * @{ */ 74 QToolBox *m_pToolBox; 75 UIUserNamePasswordEditor *m_pUserNamePasswordEditor; 76 QLineEdit *m_pHostnameLineEdit; 77 QLabel *m_pHostnameLabel; 78 /** Guest additions iso selection widgets. */ 79 QCheckBox *m_pInstallGACheckBox; 80 QLabel *m_pISOPathLabel; 81 UIFilePathSelector *m_pISOFilePathSelector; 82 /** Product key stuff. */ 83 QLineEdit *m_pProductKeyLineEdit; 84 QLabel *m_pProductKeyLabel; 85 /** @} */ 86 58 87 }; 59 88 60 class UIWizardNewVMPageBasic UserNameHostname : public UIWizardPage, public UIWizardNewVMPageUserNameHostname89 class UIWizardNewVMPageBasic2 : public UIWizardPage, public UIWizardNewVMPage2 61 90 { 62 91 Q_OBJECT; … … 64 93 Q_PROPERTY(QString password READ password WRITE setPassword); 65 94 Q_PROPERTY(QString hostname READ hostname WRITE setHostname); 95 Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions WRITE setInstallGuestAdditions); 96 Q_PROPERTY(QString guestAdditionsISOPath READ guestAdditionsISOPath WRITE setGuestAdditionsISOPath); 97 Q_PROPERTY(QString productKey READ productKey); 98 66 99 67 100 public: 68 101 69 UIWizardNewVMPageBasicUserNameHostname(); 102 UIWizardNewVMPageBasic2(); 103 104 protected: 105 106 virtual void showEvent(QShowEvent *pEvent) /* override */; 70 107 71 108 private slots: 72 109 110 void sltInstallGACheckBoxToggle(bool fChecked); 111 void sltGAISOPathChanged(const QString &strPath); 112 73 113 private: 74 114 115 void prepare(); 116 void createUserNameHostNameWidgets(); 117 void createGAInstallWidgets(); 118 void createProductKeyWidgets(); 75 119 void retranslateUi(); 76 120 void initializePage(); 77 121 bool isComplete() const; 122 /** Returns true if we show the widgets for guest os product key. */ 123 bool isProductKeyWidgetVisible() const; 78 124 79 125 /** Override the default behavior which resets the fields to proginal values. */ … … 83 129 }; 84 130 85 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic UserNameHostname_h */131 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic2_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r84886 r85055 40 40 41 41 UIWizardNewVMPageExpert::UIWizardNewVMPageExpert(const QString &strGroup) 42 : UIWizardNewVMPage NameType(strGroup)42 : UIWizardNewVMPage1(strGroup) 43 43 { 44 44 /* Create widgets: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r85044 r85055 32 32 /* Expert page of the New Virtual Machine wizard: */ 33 33 class UIWizardNewVMPageExpert : public UIWizardPage, 34 public UIWizardNewVMPage NameType,34 public UIWizardNewVMPage1, 35 35 public UIWizardNewVMPageHardware, 36 36 public UIWizardNewVMPageDisk
Note:
See TracChangeset
for help on using the changeset viewer.