Changeset 90033 in vbox
- Timestamp:
- Jul 5, 2021 3:38:36 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r88239 r90033 386 386 387 387 /* Notify listeners about this change: */ 388 emit sigOSFamilyChanged( );388 emit sigOSFamilyChanged(m_strFamilyId); 389 389 } 390 390 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.h
r88150 r90033 70 70 void sigOsTypeChanged(); 71 71 /** Notifies listeners about VM OS family change. */ 72 void sigOSFamilyChanged( );72 void sigOSFamilyChanged(const QString &strFamilyId); 73 73 74 74 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r90018 r90033 61 61 , m_iSASCount(0) 62 62 , m_iUSBCount(0) 63 , m_fInstallGuestAdditions(false) 63 64 { 64 65 #ifndef VBOX_WS_MAC … … 714 715 } 715 716 717 const QString &UIWizardNewVM::guestOSFamilyId() const 718 { 719 return m_strGuestOSFamilyId; 720 } 721 722 void UIWizardNewVM::setGuestOSFamilyId(const QString &strGuestOSFamilyId) 723 { 724 m_strGuestOSFamilyId = strGuestOSFamilyId; 725 } 726 727 bool UIWizardNewVM::installGuestAdditions() const 728 { 729 return m_fInstallGuestAdditions; 730 } 731 732 void UIWizardNewVM::setInstallGuestAdditions(bool fInstallGA) 733 { 734 m_fInstallGuestAdditions = fInstallGA; 735 } 736 716 737 const UIUnattendedInstallData &UIWizardNewVM::unattendedInstallData() const 717 738 { … … 746 767 } 747 768 748 //bool UIWizardNewVM::isGuestOSTypeWindows() const749 //{750 // return getStringFieldValue("guestOSFamiyId").contains("windows", Qt::CaseInsensitive);751 //}769 bool UIWizardNewVM::isGuestOSTypeWindows() const 770 { 771 return m_strGuestOSFamilyId.contains("windows", Qt::CaseInsensitive); 772 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r90018 r90033 83 83 const UIUnattendedInstallData &unattendedInstallData() const; 84 84 bool isUnattendedEnabled() const; 85 //bool isGuestOSTypeWindows() const;85 bool isGuestOSTypeWindows() const; 86 86 CMedium &virtualDisk(); 87 87 void setVirtualDisk(const CMedium &medium); … … 105 105 void setDetectedOSTypeId(const QString &strDetectedOSTypeId); 106 106 107 const QString &guestOSFamilyId() const; 108 void setGuestOSFamilyId(const QString &strGuestOSFamilyId); 109 110 bool installGuestAdditions() const; 111 void setInstallGuestAdditions(bool fInstallGA); 112 107 113 protected: 108 114 … … 116 122 void configureVM(const QString &strGuestTypeId, const CGuestOSType &comGuestType); 117 123 bool attachDefaultDevices(const CGuestOSType &comGuestType); 118 119 friend class UIWizardNewVMPageDisk;120 friend class UIWizardNewVMPageExpert;121 124 122 125 private slots: … … 165 168 /** Type Id od the OS detected from the ISO file by IUnattended. */ 166 169 QString m_strDetectedOSTypeId; 170 171 /** Holds the VM OS family ID. */ 172 QString m_strGuestOSFamilyId; 173 174 /** True if guest additions are to be installed during unattended install. */ 175 bool m_fInstallGuestAdditions; 167 176 }; 168 177 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.cpp
r90019 r90033 293 293 // } 294 294 295 // QString UIWizardNewVMNameOSTypePage::guestOSFamiyId() const296 // {297 // if (!m_pNameAndSystemEditor)298 // return QString();299 // return m_pNameAndSystemEditor->familyId();300 // }301 302 295 303 296 // QString UIWizardNewVMNameOSTypePage::ISOFilePath() const … … 392 385 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltOsTypeChanged); 393 386 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltISOPathChanged); 387 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOSFamilyChanged, this, &UIWizardNewVMNameOSTypePageBasic::sltGuestOSFamilChanged); 394 388 } 395 389 } … … 405 399 void UIWizardNewVMNameOSTypePageBasic::sltNameChanged(const QString &strNewName) 406 400 { 407 Q_UNUSED(strNewName);408 401 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, strNewName); 409 402 UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, m_pWizard); … … 451 444 if (m_pNameAndSystemEditor) 452 445 m_pNameAndSystemEditor->setFocus(); 453 //setSkipCheckBoxEnable();454 } 455 456 void UIWizardNewVMNameOSTypePageBasic::cleanupPage()457 {458 //cleanupMachineFolder();459 ///* Call to base-class: */460 //UIWizardPage::cleanupPage();461 }446 setSkipCheckBoxEnable(); 447 } 448 449 // void UIWizardNewVMNameOSTypePageBasic::cleanupPage() 450 // { 451 // cleanupMachineFolder(); 452 // /* Call to base-class: */ 453 // UIWizardPage::cleanupPage(); 454 // } 462 455 463 456 bool UIWizardNewVMNameOSTypePageBasic::validatePage() … … 476 469 if (fileInfo.exists() && fileInfo.isReadable()) 477 470 uiCommon().updateRecentlyUsedMediumListAndFolder(UIMediumDeviceType_DVD, strPath); 478 // setSkipCheckBoxEnable(); 479 // emit completeChanged(); 471 setSkipCheckBoxEnable(); 472 emit completeChanged(); 473 } 474 475 void UIWizardNewVMNameOSTypePageBasic::sltGuestOSFamilChanged(const QString &strGuestOSFamilyId) 476 { 477 if (m_pWizard) 478 m_pWizard->setGuestOSFamilyId(strGuestOSFamilyId); 480 479 } 481 480 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.h
r90018 r90033 102 102 void sltOsTypeChanged(); 103 103 void sltISOPathChanged(const QString &strPath); 104 void sltGuestOSFamilChanged(const QString &strGuestOSFamilyId); 104 105 105 106 private: … … 112 113 void createConnections(); 113 114 void initializePage(); 114 void cleanupPage();115 //void cleanupPage(); 115 116 QWidget *createNameOSTypeWidgets(); 116 117 void markWidgets() const; 117 118 void setSkipCheckBoxEnable(); 118 119 bool isUnattendedEnabled() const; 119 120 120 121 121 UIWizardNewVM *m_pWizard; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
r90003 r90033 84 84 // } 85 85 86 // bool UIWizardNewVMUnattendedPage::installGuestAdditions() const87 // {88 // if (!m_pGAInstallationISOContainer)89 // return false;90 // return m_pGAInstallationISOContainer->isChecked();91 // }92 86 93 87 // void UIWizardNewVMUnattendedPage::setInstallGuestAdditions(bool fInstallGA) … … 118 112 119 113 120 // bool UIWizardNewVMUnattendedPage::checkGAISOFile() const 121 // { 122 // if (!m_pGAISOFilePathSelector) 123 // return false; 124 // /* GA ISO selector should not be empty since GA install check box is checked at this point: */ 125 // const QString &strPath = m_pGAISOFilePathSelector->path(); 126 // if (strPath.isNull() || strPath.isEmpty()) 127 // return false; 128 // QFileInfo fileInfo(strPath); 129 // if (!fileInfo.exists() || !fileInfo.isReadable()) 130 // return false; 131 // return true; 132 // } 133 134 // void UIWizardNewVMUnattendedPage::markWidgets() const 135 // { 136 // if (installGuestAdditions()) 137 // m_pGAISOFilePathSelector->mark(!checkGAISOFile()); 138 // } 139 140 141 // void UIWizardNewVMUnattendedPage::disableEnableGAWidgets(bool fEnabled) 142 // { 143 // if (m_pGAISOPathLabel) 144 // m_pGAISOPathLabel->setEnabled(fEnabled); 145 // if (m_pGAISOFilePathSelector) 146 // m_pGAISOFilePathSelector->setEnabled(fEnabled); 147 // } 148 149 // void UIWizardNewVMUnattendedPage::disableEnableProductKeyWidgets(bool fEnabled) 150 // { 151 // if (m_pProductKeyLabel) 152 // m_pProductKeyLabel->setEnabled(fEnabled); 153 // if (m_pProductKeyLineEdit) 154 // m_pProductKeyLineEdit->setEnabled(fEnabled); 155 // } 114 bool UIWizardNewVMUnattendedPage::checkGAISOFile(UIFilePathSelector *pGAISOFilePathSelector) 115 { 116 if (!pGAISOFilePathSelector) 117 return false; 118 /* GA ISO selector should not be empty since GA install check box is checked at this point: */ 119 const QString &strPath = pGAISOFilePathSelector->path(); 120 if (strPath.isNull() || strPath.isEmpty()) 121 return false; 122 QFileInfo fileInfo(strPath); 123 if (!fileInfo.exists() || !fileInfo.isReadable()) 124 return false; 125 return true; 126 } 127 128 156 129 157 130 // bool UIWizardNewVMUnattendedPage::startHeadless() const … … 162 135 // } 163 136 164 165 // bool UIWizardNewVMUnattendedPage::isGAInstallEnabled() const166 // {167 // if (m_pGAInstallationISOContainer && m_pGAInstallationISOContainer->isChecked())168 // return true;169 // return false;170 // }171 137 172 138 UIWizardNewVMUnattendedPageBasic::UIWizardNewVMUnattendedPageBasic() … … 184 150 , m_pProductKeyLabel(0) 185 151 { 152 m_pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 186 153 prepare(); 187 154 } … … 199 166 pMainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 3, 0, 1, 2); 200 167 201 202 // createConnections(); 168 createConnections(); 203 169 } 204 170 205 171 void UIWizardNewVMUnattendedPageBasic::createConnections() 206 172 { 207 //if (m_pUserNamePasswordEditor)208 //connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,209 //this, &UIWizardNewVMUnattendedPageBasic::completeChanged);210 //if (m_pGAISOFilePathSelector)211 //connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged,212 //this, &UIWizardNewVMUnattendedPageBasic::sltGAISOPathChanged);213 //if (m_pGAISOFilePathSelector)214 //connect(m_pGAInstallationISOContainer, &QGroupBox::toggled,215 //this, &UIWizardNewVMUnattendedPageBasic::sltInstallGACheckBoxToggle);173 if (m_pUserNamePasswordEditor) 174 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged, 175 this, &UIWizardNewVMUnattendedPageBasic::completeChanged); 176 if (m_pGAISOFilePathSelector) 177 connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged, 178 this, &UIWizardNewVMUnattendedPageBasic::sltGAISOPathChanged); 179 if (m_pGAISOFilePathSelector) 180 connect(m_pGAInstallationISOContainer, &QGroupBox::toggled, 181 this, &UIWizardNewVMUnattendedPageBasic::sltInstallGACheckBoxToggle); 216 182 } 217 183 … … 254 220 void UIWizardNewVMUnattendedPageBasic::initializePage() 255 221 { 256 //disableEnableProductKeyWidgets(isProductKeyWidgetEnabled());257 //disableEnableGAWidgets(m_pGAInstallationISOContainer ? m_pGAInstallationISOContainer->isChecked() : false);258 //retranslateUi();222 disableEnableProductKeyWidgets(isProductKeyWidgetEnabled()); 223 disableEnableGAWidgets(m_pGAInstallationISOContainer ? m_pGAInstallationISOContainer->isChecked() : false); 224 retranslateUi(); 259 225 } 260 226 261 227 bool UIWizardNewVMUnattendedPageBasic::isComplete() const 262 228 { 263 // markWidgets(); 264 // if (isGAInstallEnabled() && !checkGAISOFile()) 265 // return false; 266 // // bool fIsComplete = true; 267 // // if (!checkGAISOFile()) 268 // // { 269 // // m_pToolBox->setItemIcon(ToolBoxItems_GAInstall, UIIconPool::iconSet(":/status_error_16px.png")); 270 // // fIsComplete = false; 271 // // } 272 // if (m_pUserNamePasswordEditor && !m_pUserNamePasswordEditor->isComplete()) 273 // return false; 274 // // { 275 // // m_pToolBox->setItemIcon(ToolBoxItems_UserNameHostname, UIIconPool::iconSet(":/status_error_16px.png")); 276 // // fIsComplete = false; 277 // // } 278 // // return fIsComplete; 229 markWidgets(); 230 if (m_pWizard && m_pWizard->installGuestAdditions() && 231 !UIWizardNewVMUnattendedPage::checkGAISOFile(m_pGAISOFilePathSelector)) 232 return false; 233 if (m_pUserNamePasswordEditor && !m_pUserNamePasswordEditor->isComplete()) 234 return false; 279 235 return true; 280 236 } … … 286 242 void UIWizardNewVMUnattendedPageBasic::showEvent(QShowEvent *pEvent) 287 243 { 288 Q_UNUSED(pEvent); 289 // if (m_pToolBox) 290 // m_pToolBox->setItemEnabled(ToolBoxItems_ProductKey, isProductKeyWidgetEnabled()); 291 //UIWizardPage::showEvent(pEvent); 244 UINativeWizardPage::showEvent(pEvent); 292 245 } 293 246 294 247 void UIWizardNewVMUnattendedPageBasic::sltInstallGACheckBoxToggle(bool fEnabled) 295 248 { 296 Q_UNUSED(fEnabled); 297 // disableEnableGAWidgets(fEnabled); 298 // emit completeChanged(); 249 disableEnableGAWidgets(fEnabled); 250 if (m_pWizard) 251 m_pWizard->setInstallGuestAdditions(fEnabled); 252 emit completeChanged(); 299 253 } 300 254 … … 302 256 { 303 257 Q_UNUSED(strPath); 304 //emit completeChanged();258 emit completeChanged(); 305 259 } 306 260 307 261 bool UIWizardNewVMUnattendedPageBasic::isProductKeyWidgetEnabled() const 308 262 { 309 // UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 310 // if (!pWizard || !pWizard->isUnattendedEnabled() || !pWizard->isGuestOSTypeWindows()) 311 // return false; 263 if (!m_pWizard || !m_pWizard->isUnattendedEnabled() || !m_pWizard->isGuestOSTypeWindows()) 264 return false; 312 265 return true; 313 266 } … … 419 372 return m_pGAInstallationISOContainer; 420 373 } 374 375 void UIWizardNewVMUnattendedPageBasic::disableEnableGAWidgets(bool fEnabled) 376 { 377 if (m_pGAISOPathLabel) 378 m_pGAISOPathLabel->setEnabled(fEnabled); 379 if (m_pGAISOFilePathSelector) 380 m_pGAISOFilePathSelector->setEnabled(fEnabled); 381 } 382 383 void UIWizardNewVMUnattendedPageBasic::disableEnableProductKeyWidgets(bool fEnabled) 384 { 385 if (m_pProductKeyLabel) 386 m_pProductKeyLabel->setEnabled(fEnabled); 387 if (m_pProductKeyLineEdit) 388 m_pProductKeyLineEdit->setEnabled(fEnabled); 389 } 390 391 void UIWizardNewVMUnattendedPageBasic::markWidgets() const 392 { 393 if (m_pWizard && m_pWizard->installGuestAdditions()) 394 m_pGAISOFilePathSelector->mark(!UIWizardNewVMUnattendedPage::checkGAISOFile(m_pGAISOFilePathSelector)); 395 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
r90003 r90033 32 32 class QLabel; 33 33 class QLineEdit; 34 class QToolBox;35 34 class QIRichTextLabel; 36 35 class UIFilePathSelector; 37 36 class UIUserNamePasswordEditor; 37 class UIWizardNewVM; 38 38 struct UIUnattendedInstallData; 39 39 40 40 41 // class UIWizardNewVMUnattendedPage : public UIWizardPageBase 42 // { 43 // public: 44 41 namespace UIWizardNewVMUnattendedPage 42 { 43 bool checkGAISOFile(UIFilePathSelector *pGAISOFilePathSelector); 45 44 // UIWizardNewVMUnattendedPage(); 46 45 … … 53 52 // QString hostname() const; 54 53 // void setHostname(const QString &strHostName); 55 // bool installGuestAdditions() const;56 // void setInstallGuestAdditions(bool fInstallGA);57 54 // QString guestAdditionsISOPath() const; 58 55 // void setGuestAdditionsISOPath(const QString &strISOPath); … … 60 57 // /** @} */ 61 58 62 // protected:63 // enum64 // {65 // ToolBoxItems_UserNameHostname,66 // ToolBoxItems_GAInstall,67 // ToolBoxItems_ProductKey68 // };69 70 59 71 60 // /** Returns false if ISO path selector is non empty but has invalid file path. */ 72 61 // bool checkGAISOFile() const; 73 // void markWidgets() const; 62 74 63 // void retranslateWidgets(); 75 // void disableEnableGAWidgets(bool fEnabled); 76 // void disableEnableProductKeyWidgets(bool fEnabled); 64 77 65 78 66 // bool startHeadless() const; 79 67 80 // bool isGAInstallEnabled() const;81 68 82 83 // private: 84 85 // friend class UIWizardNewVM; 86 // }; 69 } 87 70 88 71 class UIWizardNewVMUnattendedPageBasic : public UINativeWizardPage … … 118 101 /** Returns true if we show the widgets for guest os product key. */ 119 102 bool isProductKeyWidgetEnabled() const; 103 void disableEnableProductKeyWidgets(bool fEnabled); 104 void disableEnableGAWidgets(bool fEnabled); 105 void markWidgets() const; 120 106 121 QIRichTextLabel *m_pLabel;107 UIWizardNewVM *m_pWizard; 122 108 123 109 /** @name Widgets 124 110 * @{ */ 111 QIRichTextLabel *m_pLabel; 125 112 QGroupBox *m_pUserNameContainer; 126 113 QGroupBox *m_pAdditionalOptionsContainer;
Note:
See TracChangeset
for help on using the changeset viewer.