Changeset 85104 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 8, 2020 8:48:27 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
r85052 r85104 333 333 /* Unlock the signals of m_pComboType: */ 334 334 m_pComboType->blockSignals(false); 335 336 /* Notify listeners about this change: */ 337 emit sigOSFamilyChanged(); 335 338 } 336 339 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h
r85052 r85104 64 64 /** Notifies listeners about VM OS type change. */ 65 65 void sigOsTypeChanged(); 66 /** Notifies listeners about VM OS family change. */ 67 void sigOSFamilyChanged(); 66 68 67 69 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r85090 r85104 128 128 class UIWizardNewVMPageBasic1 : public UIWizardPage, public UIWizardNewVMPage1 129 129 { 130 130 131 Q_OBJECT; 131 132 Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath); … … 137 138 Q_PROPERTY(bool startHeadless READ startHeadless); 138 139 Q_PROPERTY(QString detectedOSTypeId READ detectedOSTypeId); 139 140 140 141 141 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r85090 r85104 285 285 QWidget *pProductKeyWidget = m_pToolBox->widget(ToolBoxItems_ProductKey); 286 286 if (pProductKeyWidget) 287 pProductKeyWidget->setEnabled(isProductKeyWidget Visible());287 pProductKeyWidget->setEnabled(isProductKeyWidgetEnabled()); 288 288 } 289 289 UIWizardPage::showEvent(pEvent); … … 305 305 } 306 306 307 bool UIWizardNewVMPageBasic2::isProductKeyWidget Visible() const307 bool UIWizardNewVMPageBasic2::isProductKeyWidgetEnabled() const 308 308 { 309 309 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h
r85090 r85104 123 123 bool isComplete() const; 124 124 /** Returns true if we show the widgets for guest os product key. */ 125 bool isProductKeyWidget Visible() const;125 bool isProductKeyWidgetEnabled() const; 126 126 127 127 QIRichTextLabel *m_pLabel; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r85090 r85104 55 55 QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer); 56 56 createNameOSTypeWidgets(pNameContainerLayout, false); 57 m_pGAInstallContainer = createGAInstallWidgets(); 58 m_pUsernameHostnameContainer = createUserNameHostNameWidgets(); 59 57 60 m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, m_pNameAndSystemContainer, ""); 58 m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, createUserNameHostNameWidgets(), "");59 m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, createGAInstallWidgets(), "");61 m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, m_pUsernameHostnameContainer, ""); 62 m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, m_pGAInstallContainer, ""); 60 63 m_pToolBox->insertItem(ExpertToolboxItems_ProductKey, createProductKeyWidgets(), ""); 61 64 m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets(), ""); … … 143 146 void UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle() 144 147 { 145 const bool fEnabled = m_pButtonUnattended->isChecked(); 146 if (m_pISOSelectorLabel) 147 m_pISOSelectorLabel->setEnabled(fEnabled); 148 if (m_pISOFilePathSelector) 149 m_pISOFilePathSelector->setEnabled(fEnabled); 150 if (m_pStartHeadlessLabel) 151 m_pStartHeadlessLabel->setEnabled(fEnabled); 152 if (m_pStartHeadlessCheckBox) 153 m_pStartHeadlessCheckBox->setEnabled(fEnabled); 148 if (m_pButtonUnattended) 149 disableEnableUnattendedRelatedWidgets(m_pButtonUnattended->isChecked()); 154 150 emit completeChanged(); 155 151 } … … 175 171 Q_UNUSED(strPath); 176 172 emit completeChanged(); 173 } 174 175 void UIWizardNewVMPageExpert::sltOSFamilyTypeChanged() 176 { 177 if (m_pProductKeyLabel) 178 m_pProductKeyLabel->setEnabled(isProductKeyWidgetEnabled()); 179 if (m_pProductKeyLineEdit) 180 m_pProductKeyLineEdit->setEnabled(isProductKeyWidgetEnabled()); 177 181 } 178 182 … … 238 242 { 239 243 /* Connections for Name, OS Type, and unattended install stuff: */ 240 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, 241 this, &UIWizardNewVMPageExpert::sltNameChanged); 242 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, 243 this, &UIWizardNewVMPageExpert::sltPathChanged); 244 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, 245 this, &UIWizardNewVMPageExpert::sltOsTypeChanged); 246 connect(m_pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 247 this, &UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle); 248 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, 249 this, &UIWizardNewVMPageExpert::sltISOPathChanged); 244 if (m_pNameAndSystemEditor) 245 { 246 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, 247 this, &UIWizardNewVMPageExpert::sltNameChanged); 248 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, 249 this, &UIWizardNewVMPageExpert::sltPathChanged); 250 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, 251 this, &UIWizardNewVMPageExpert::sltOsTypeChanged); 252 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOSFamilyChanged, 253 this, &UIWizardNewVMPageExpert::sltOSFamilyTypeChanged); 254 } 255 if (m_pButtonGroup) 256 connect(m_pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 257 this, &UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle); 258 if (m_pISOFilePathSelector) 259 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, 260 this, &UIWizardNewVMPageExpert::sltISOPathChanged); 250 261 251 262 /* Connections for username, password, and hostname: */ 252 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged, 253 this, &UIWizardNewVMPageExpert::completeChanged); 254 connect(m_pInstallGACheckBox, &QCheckBox::toggled, this, 255 &UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle); 256 connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, 257 this, &UIWizardNewVMPageExpert::sltGAISOPathChanged); 263 if (m_pUserNamePasswordEditor) 264 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged, 265 this, &UIWizardNewVMPageExpert::completeChanged); 266 if (m_pInstallGACheckBox) 267 connect(m_pInstallGACheckBox, &QCheckBox::toggled, this, 268 &UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle); 269 if (m_pGAISOFilePathSelector) 270 connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged, 271 this, &UIWizardNewVMPageExpert::sltGAISOPathChanged); 258 272 259 273 /* Connections for disk and hardware stuff: */ 260 connect(m_pDiskSkip, &QRadioButton::toggled, 261 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 262 connect(m_pDiskCreate, &QRadioButton::toggled, 263 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 264 connect(m_pDiskPresent, &QRadioButton::toggled, 265 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 266 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 267 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 268 connect(m_pVMMButton, &QIToolButton::clicked, 269 this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog); 274 if (m_pDiskSkip) 275 connect(m_pDiskSkip, &QRadioButton::toggled, 276 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 277 if (m_pDiskCreate) 278 connect(m_pDiskCreate, &QRadioButton::toggled, 279 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 280 if (m_pDiskPresent) 281 connect(m_pDiskPresent, &QRadioButton::toggled, 282 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 283 if (m_pDiskSelector) 284 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 285 this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged); 286 if (m_pVMMButton) 287 connect(m_pVMMButton, &QIToolButton::clicked, 288 this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog); 270 289 } 271 290 … … 301 320 if (m_pDiskSelector) 302 321 m_pDiskSelector->setCurrentIndex(0); 322 323 if (m_pButtonUnattended) 324 disableEnableUnattendedRelatedWidgets(m_pButtonUnattended->isChecked()); 325 m_pProductKeyLabel->setEnabled(isProductKeyWidgetEnabled()); 326 m_pProductKeyLineEdit->setEnabled(isProductKeyWidgetEnabled()); 303 327 } 304 328 … … 356 380 return fResult; 357 381 } 382 383 bool UIWizardNewVMPageExpert::isProductKeyWidgetEnabled() const 384 { 385 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard()); 386 if (!pWizard || !pWizard->isUnattendedInstallEnabled() || !pWizard->isGuestOSTypeWindows()) 387 return false; 388 return true; 389 } 390 391 void UIWizardNewVMPageExpert::disableEnableUnattendedRelatedWidgets(bool fEnabled) 392 { 393 if (m_pISOSelectorLabel) 394 m_pISOSelectorLabel->setEnabled(fEnabled); 395 if (m_pISOFilePathSelector) 396 m_pISOFilePathSelector->setEnabled(fEnabled); 397 if (m_pStartHeadlessLabel) 398 m_pStartHeadlessLabel->setEnabled(fEnabled); 399 if (m_pStartHeadlessCheckBox) 400 m_pStartHeadlessCheckBox->setEnabled(fEnabled); 401 if (m_pGAInstallContainer) 402 m_pGAInstallContainer->setEnabled(fEnabled); 403 if (m_pUsernameHostnameContainer) 404 m_pUsernameHostnameContainer->setEnabled(fEnabled); 405 if (m_pProductKeyLabel) 406 m_pProductKeyLabel->setEnabled(isProductKeyWidgetEnabled()); 407 if (m_pProductKeyLineEdit) 408 m_pProductKeyLineEdit->setEnabled(isProductKeyWidgetEnabled()); 409 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r85090 r85104 83 83 void sltInstallGACheckBoxToggle(bool fChecked); 84 84 void sltGAISOPathChanged(const QString &strPath); 85 void sltOSFamilyTypeChanged(); 85 86 86 87 private: … … 107 108 bool validatePage(); 108 109 110 bool isProductKeyWidgetEnabled() const; 111 void disableEnableUnattendedRelatedWidgets(bool fEnabled); 112 109 113 /** Widgets. */ 110 114 QWidget *m_pNameAndSystemContainer; 115 QWidget *m_pGAInstallContainer; 116 QWidget *m_pUsernameHostnameContainer; 111 117 QToolBox *m_pToolBox; 112 118 };
Note:
See TracChangeset
for help on using the changeset viewer.