Changeset 87355 in vbox
- Timestamp:
- Jan 21, 2021 4:24:07 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r87322 r87355 525 525 setField("password", m_unattendedInstallData.m_strPassword); 526 526 setField("hostname", m_unattendedInstallData.m_strHostname); 527 setField("installGuestAdditions", m_unattendedInstallData.m_fInstallGuestAdditions); 527 528 setField("guestAdditionsISOPath", m_unattendedInstallData.m_strGuestAdditionsISOPath); 528 529 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r87348 r87355 37 37 , m_pHostnameLineEdit(0) 38 38 , m_pHostnameLabel(0) 39 , m_pGAInstallCheckBox(0) 39 40 , m_pGAISOPathLabel(0) 40 41 , m_pGAISOFilePathSelector(0) … … 86 87 bool UIWizardNewVMPage2::installGuestAdditions() const 87 88 { 88 if (!m_pGAI SOFilePathSelector)89 if (!m_pGAInstallCheckBox) 89 90 return false; 90 return m_pGAISOFilePathSelector->isValid(); 91 return m_pGAInstallCheckBox->isChecked(); 92 } 93 94 void UIWizardNewVMPage2::setInstallGuestAdditions(bool fInstallGA) 95 { 96 if (m_pGAInstallCheckBox) 97 m_pGAInstallCheckBox->setChecked(fInstallGA); 91 98 } 92 99 … … 175 182 bool UIWizardNewVMPage2::checkGAISOFile() const 176 183 { 184 if (!m_pGAISOFilePathSelector) 185 return false; 177 186 const QString &strPath = m_pGAISOFilePathSelector->path(); 178 187 if (strPath.isNull() || strPath.isEmpty()) 179 188 return true; 180 QFile fileInfo(strPath);189 QFileInfo fileInfo(strPath); 181 190 if (!fileInfo.exists() || !fileInfo.isReadable()) 182 191 return false; … … 199 208 if (m_pGAISOFilePathSelector) 200 209 m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)")); 210 if (m_pGAInstallCheckBox) 211 m_pGAInstallCheckBox->setText(UIWizardNewVM::tr("Install Guest Additions")); 201 212 if (m_pProductKeyLabel) 202 213 m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:")); 214 } 215 216 void UIWizardNewVMPage2::disableEnableGAWidgets(bool fEnabled) 217 { 218 if (m_pGAISOPathLabel) 219 m_pGAISOPathLabel->setEnabled(fEnabled); 220 if (m_pGAISOFilePathSelector) 221 m_pGAISOFilePathSelector->setEnabled(fEnabled); 203 222 } 204 223 … … 305 324 void UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle(bool fEnabled) 306 325 { 307 if (m_pGAISOPathLabel) 308 m_pGAISOPathLabel->setEnabled(fEnabled); 309 if (m_pGAISOFilePathSelector) 310 m_pGAISOFilePathSelector->setEnabled(fEnabled); 326 disableEnableGAWidgets(fEnabled); 311 327 emit completeChanged(); 312 328 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h
r87322 r87355 53 53 void setHostname(const QString &strHostName); 54 54 bool installGuestAdditions() const; 55 void setInstallGuestAdditions(bool fInstallGA); 55 56 QString guestAdditionsISOPath() const; 56 57 void setGuestAdditionsISOPath(const QString &strISOPath); … … 74 75 void markWidgets() const; 75 76 void retranslateWidgets(); 77 void disableEnableGAWidgets(bool fEnabled); 76 78 77 79 /** @name Widgets … … 80 82 QLineEdit *m_pHostnameLineEdit; 81 83 QLabel *m_pHostnameLabel; 84 QCheckBox *m_pGAInstallCheckBox; 82 85 QLabel *m_pGAISOPathLabel; 83 86 UIFilePathSelector *m_pGAISOFilePathSelector; … … 86 89 QLabel *m_pProductKeyLabel; 87 90 /** @} */ 88 89 91 }; 90 92 … … 95 97 Q_PROPERTY(QString password READ password WRITE setPassword); 96 98 Q_PROPERTY(QString hostname READ hostname WRITE setHostname); 97 Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions );99 Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions WRITE setInstallGuestAdditions); 98 100 Q_PROPERTY(QString guestAdditionsISOPath READ guestAdditionsISOPath WRITE setGuestAdditionsISOPath); 99 101 Q_PROPERTY(QString productKey READ productKey); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87348 r87355 201 201 m_pAdditionalOptionsContainer->setTitle(UIWizardNewVM::tr("Additional options")); 202 202 if (m_pGAInstallationISOContainer) 203 m_pGAInstallationISOContainer->setTitle(UIWizardNewVM::tr("Guest Additions Installation Medium (ISO)"));203 m_pGAInstallationISOContainer->setTitle(UIWizardNewVM::tr("Guest Additions")); 204 204 if (m_pToolBox) 205 205 { … … 209 209 m_pToolBox->setItemText(ExpertToolboxItems_Hardware, UIWizardNewVM::tr("Hardware")); 210 210 } 211 } 212 213 void UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle(bool fEnabled) 214 { 215 disableEnableGAWidgets(fEnabled); 216 emit completeChanged(); 211 217 } 212 218 … … 237 243 connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged, 238 244 this, &UIWizardNewVMPageExpert::sltGAISOPathChanged); 245 246 if (m_pGAInstallCheckBox) 247 connect(m_pGAInstallCheckBox, &QCheckBox::toggled, 248 this, &UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle); 239 249 240 250 /* Connections for disk and hardware stuff: */ … … 382 392 pAdditionalOptionsContainerLayout->addWidget(m_pHostnameLineEdit, 2, 1, 1, 3); 383 393 384 // pAdditionalOptionsContainerLayout->addWidget(createHostNameWidgets());385 386 // pAdditionalOptionsContainerLayout->addStretch();387 394 pLayout->addWidget(m_pAdditionalOptionsContainer, iRow, 2, 1, 2); 388 395 } … … 391 398 { 392 399 m_pGAInstallationISOContainer = new QGroupBox; 393 QHBoxLayout *pGAInstallationISOContainer = new QHBoxLayout(m_pGAInstallationISOContainer); 400 QGridLayout *pGAInstallationISOContainer = new QGridLayout(m_pGAInstallationISOContainer); 401 m_pGAInstallCheckBox = new QCheckBox; 402 if (m_pGAInstallCheckBox) 403 pGAInstallationISOContainer->addWidget(m_pGAInstallCheckBox, 0, 0, 1, 8); 404 m_pGAISOPathLabel = new QLabel; 405 if (m_pGAISOPathLabel) 406 pGAInstallationISOContainer->addWidget(m_pGAISOPathLabel, 1, 1, 1, 1); 407 394 408 m_pGAISOFilePathSelector = new UIFilePathSelector; 395 409 { … … 398 412 m_pGAISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 399 413 m_pGAISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 400 pGAInstallationISOContainer->addWidget(m_pGAISOFilePathSelector );414 pGAInstallationISOContainer->addWidget(m_pGAISOFilePathSelector, 1, 2, 1, 6); 401 415 } 402 416 pLayout->addWidget(m_pGAInstallationISOContainer, iRow, 0, 1, 4); … … 440 454 if (!checkGAISOFile()) 441 455 { 442 //m_pToolBox->setItemIcon(ExpertToolboxItems_Unattended,443 //UIIconPool::iconSet(":/status_error_16px.png"));456 m_pToolBox->setItemIcon(ExpertToolboxItems_Unattended, 457 UIIconPool::iconSet(":/status_error_16px.png")); 444 458 fIsComplete = false; 445 459 } … … 499 513 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 500 514 if (!pWizard || !pWizard->isUnattendedEnabled() || !pWizard->isGuestOSTypeWindows()) 515 return false; 516 return true; 517 } 518 519 bool UIWizardNewVMPageExpert::isGAInstallEnabled() const 520 { 521 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 522 if (!pWizard || !isUnattendedEnabled() || !m_pGAInstallCheckBox->isChecked()) 501 523 return false; 502 524 return true; … … 512 534 m_pGAInstallationISOContainer->setEnabled(fEnabled); 513 535 disableEnableProductKeyWidgets(isProductKeyWidgetEnabled()); 536 disableEnableGAWidgets(isGAInstallEnabled()); 514 537 } 515 538 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r87348 r87355 53 53 Q_PROPERTY(QString password READ password WRITE setPassword); 54 54 Q_PROPERTY(QString hostname READ hostname WRITE setHostname); 55 Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions );55 Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions WRITE setInstallGuestAdditions); 56 56 Q_PROPERTY(QString guestAdditionsISOPath READ guestAdditionsISOPath WRITE setGuestAdditionsISOPath); 57 57 Q_PROPERTY(QString productKey READ productKey); … … 83 83 void sltGAISOPathChanged(const QString &strPath); 84 84 void sltOSFamilyTypeChanged(); 85 void sltInstallGACheckBoxToggle(bool fEnabled); 85 86 86 87 private: … … 106 107 107 108 bool isProductKeyWidgetEnabled() const; 109 bool isGAInstallEnabled() const; 108 110 void disableEnableUnattendedRelatedWidgets(bool fEnabled); 109 111 void disableEnableProductKeyWidgets(bool fEnabled);
Note:
See TracChangeset
for help on using the changeset viewer.