Changeset 93606 in vbox for trunk/src/VBox
- Timestamp:
- Feb 4, 2022 2:48:36 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r93602 r93606 282 282 } 283 283 284 void UINameAndSystemEditor::setEditionNameAndIndices(const QVector<QString> &names, const QVector<ulong> &ids) 285 { 286 AssertReturnVoid(m_pEditionSelector && names.size() == ids.size()); 287 288 m_pEditionSelector->clear(); 289 290 for (int i = 0; i < names.size(); ++i) 291 m_pEditionSelector->addItem(names[i], QVariant::fromValue(ids[i]) /* user data */); 292 } 293 294 void UINameAndSystemEditor::setEditionSelectorEnabled(bool fEnabled) 295 { 296 if (m_pEditionSelector) 297 m_pEditionSelector->setEnabled(fEnabled); 298 if (m_pEditionLabel) 299 m_pEditionLabel->setEnabled(fEnabled); 300 } 301 302 bool UINameAndSystemEditor::isEditionsSelectorEmpty() const 303 { 304 if (m_pEditionSelector) 305 return m_pEditionSelector->count() == 0; 306 return true; 307 } 308 284 309 int UINameAndSystemEditor::firstColumnWidth() const 285 310 { … … 420 445 /* Notifies listeners about OS type change: */ 421 446 emit sigOsTypeChanged(); 447 } 448 449 void UINameAndSystemEditor::sltSelectedEditionsChanged(int) 450 { 451 emit sigEditionChanged(selectedEditionIndex()); 422 452 } 423 453 … … 683 713 connect(m_pImageSelector, &UIFilePathSelector::pathChanged, 684 714 this, &UINameAndSystemEditor::sigImageChanged); 685 } 715 connect(m_pEditionSelector, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged), 716 this, &UINameAndSystemEditor::sltSelectedEditionsChanged); 717 } 718 719 ulong UINameAndSystemEditor::selectedEditionIndex() const 720 { 721 if (!m_pEditionSelector || m_pEditionSelector->count() == 0) 722 return 0; 723 return m_pEditionSelector->currentData().value<ulong>(); 724 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.h
r93602 r93606 72 72 /** Notifies listeners about VM OS family change. */ 73 73 void sigOSFamilyChanged(const QString &strFamilyId); 74 /** Notifies listeners about edition change. */ 75 void sigEditionChanged(ulong selectedEditionIndex); 74 76 75 77 public: … … 132 134 void markImageEditor(bool fError, const QString &strErrorMessage); 133 135 136 /** @p names and @p indices are parallel array storing edition names and their indices, respectively.*/ 137 void setEditionNameAndIndices(const QVector<QString> &names, const QVector<ulong> &ids); 138 139 void setEditionSelectorEnabled(bool fEnabled); 140 bool isEditionsSelectorEmpty() const; 141 134 142 /** Returns 1st column width. */ 135 143 int firstColumnWidth() const; … … 146 154 /** Handles VM OS type @a iIndex change. */ 147 155 void sltTypeChanged(int iIndex); 156 void sltSelectedEditionsChanged(int); 148 157 149 158 private: … … 162 171 void prepareConnections(); 163 172 /** @} */ 173 174 ulong selectedEditionIndex() const; 164 175 165 176 /** Holds the current family ID list. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
r93545 r93606 47 47 , m_pFormatComboBox(0) 48 48 , m_pSizeAndLocationGroup(0) 49 , m_pWindowsISOImageSelector(0)50 49 , m_pNameAndSystemEditor(0) 51 50 , m_pSkipUnattendedCheckBox(0) … … 164 163 165 164 /* Populate the windows ISO images selector: */ 166 if (m_p WindowsISOImageSelector)167 m_p WindowsISOImageSelector->setImageNamesAndIndices(pWizard->detectedWindowsImageNames(),168 165 if (m_pNameAndSystemEditor) 166 m_pNameAndSystemEditor->setEditionNameAndIndices(pWizard->detectedWindowsImageNames(), 167 pWizard->detectedWindowsImageIndices()); 169 168 setSkipCheckBoxEnable(); 170 169 disableEnableUnattendedRelatedWidgets(isUnattendedEnabled()); … … 244 243 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged, 245 244 this, &UIWizardNewVMExpertPage::sltISOPathChanged); 245 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigEditionChanged, 246 this, &UIWizardNewVMExpertPage::sltSelectedEditionChanged); 246 247 } 247 248 … … 281 282 this, &UIWizardNewVMExpertPage::sltStartHeadlessChanged); 282 283 } 283 284 if (m_pWindowsISOImageSelector)285 connect(m_pWindowsISOImageSelector, &UIWindowsISOImageSelector::sigSelectedWindowsImageChanged,286 this, &UIWizardNewVMExpertPage::sltSelectedWindowsImageChanged);287 284 288 285 /* Virtual disk related connections: */ … … 478 475 AssertReturn(m_pGAInstallationISOContainer, 0); 479 476 pLayout->addWidget(m_pGAInstallationISOContainer, iRow, 0, 1, 4); 480 481 m_pWindowsISOImageSelector = new UIWindowsISOImageSelector;482 AssertReturn(m_pWindowsISOImageSelector, 0);483 pLayout->addWidget(m_pWindowsISOImageSelector, iRow, 0, 1, 5);484 477 485 478 return pContainerWidget; … … 687 680 if (m_pGAInstallationISOContainer) 688 681 m_pGAInstallationISOContainer->setEnabled(fEnabled); 689 if (m_p WindowsISOImageSelector)690 m_p WindowsISOImageSelector->setEnabled(fEnabled && !m_pWindowsISOImageSelector->isEmpty());682 if (m_pNameAndSystemEditor) 683 m_pNameAndSystemEditor->setEditionSelectorEnabled(fEnabled && !m_pNameAndSystemEditor->isEditionsSelectorEmpty()); 691 684 m_pAdditionalOptionsContainer->disableEnableProductKeyWidgets(isProductKeyWidgetEnabled()); 692 685 } … … 855 848 } 856 849 857 void UIWizardNewVMExpertPage::sltSelected WindowsImageChanged(ulong uImageIndex)858 { 859 AssertReturnVoid(wizardWindow<UIWizardNewVM>()); 860 wizardWindow<UIWizardNewVM>()->setSelectedWindowImageIndex(u ImageIndex);850 void UIWizardNewVMExpertPage::sltSelectedEditionChanged(ulong uEditionIndex) 851 { 852 AssertReturnVoid(wizardWindow<UIWizardNewVM>()); 853 wizardWindow<UIWizardNewVM>()->setSelectedWindowImageIndex(uEditionIndex); 861 854 } 862 855 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.h
r93545 r93606 46 46 class UIToolBox; 47 47 class UIUserNamePasswordGroupBox; 48 class UIWindowsISOImageSelector;49 48 50 49 /** Expert page of the New Virtual Machine wizard. */ … … 83 82 void sltProductKeyChanged(const QString &strProductKey); 84 83 void sltStartHeadlessChanged(bool fStartHeadless); 85 void sltSelected WindowsImageChanged(ulong uImageIndex);84 void sltSelectedEditionChanged(ulong uEditionIndex); 86 85 87 86 private: … … 135 134 UIDiskFormatsComboBox *m_pFormatComboBox; 136 135 UIMediumSizeAndPathGroupBox *m_pSizeAndLocationGroup; 137 UIWindowsISOImageSelector *m_pWindowsISOImageSelector;138 136 UINameAndSystemEditor *m_pNameAndSystemEditor; 139 137 QCheckBox *m_pSkipUnattendedCheckBox; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPage.cpp
r93546 r93606 41 41 , m_pGAInstallationISOContainer(0) 42 42 , m_pUserNamePasswordGroupBox(0) 43 , m_pWindowsISOImageSelector(0)44 43 { 45 44 prepare(); … … 65 64 AssertReturnVoid(m_pGAInstallationISOContainer); 66 65 pMainLayout->addWidget(m_pGAInstallationISOContainer, 2, 0, 1, 2); 67 68 m_pWindowsISOImageSelector = new UIWindowsISOImageSelector;69 AssertReturnVoid(m_pWindowsISOImageSelector);70 pMainLayout->addWidget(m_pWindowsISOImageSelector, 3, 0, 1, 2);71 66 72 67 pMainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 4, 0, 1, 2); … … 101 96 this, &UIWizardNewVMUnattendedPage::sltStartHeadlessChanged); 102 97 } 103 104 if (m_pWindowsISOImageSelector)105 connect(m_pWindowsISOImageSelector, &UIWindowsISOImageSelector::sigSelectedWindowsImageChanged,106 this, &UIWizardNewVMUnattendedPage::sltSelectedWindowsImageChanged);107 98 } 108 99 … … 164 155 m_pGAInstallationISOContainer->blockSignals(false); 165 156 } 166 if (m_pWindowsISOImageSelector)167 {168 m_pWindowsISOImageSelector->setImageNamesAndIndices(pWizard->detectedWindowsImageNames(),169 pWizard->detectedWindowsImageIndices());170 m_pWindowsISOImageSelector->setEnabled(!m_pWindowsISOImageSelector->isEmpty());171 }172 157 } 173 158 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPage.h
r93546 r93606 75 75 UIGAInstallationGroupBox *m_pGAInstallationISOContainer; 76 76 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 77 UIWindowsISOImageSelector *m_pWindowsISOImageSelector;78 77 /** @} */ 79 78 QSet<QString> m_userModifiedParameters;
Note:
See TracChangeset
for help on using the changeset viewer.