VirtualBox

Changeset 93606 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 4, 2022 2:48:36 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Removing image index selector from new vm wizard.

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  
    282282}
    283283
     284void 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
     294void 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
     302bool UINameAndSystemEditor::isEditionsSelectorEmpty() const
     303{
     304    if (m_pEditionSelector)
     305        return m_pEditionSelector->count() == 0;
     306    return true;
     307}
     308
    284309int UINameAndSystemEditor::firstColumnWidth() const
    285310{
     
    420445    /* Notifies listeners about OS type change: */
    421446    emit sigOsTypeChanged();
     447}
     448
     449void UINameAndSystemEditor::sltSelectedEditionsChanged(int)
     450{
     451    emit sigEditionChanged(selectedEditionIndex());
    422452}
    423453
     
    683713        connect(m_pImageSelector, &UIFilePathSelector::pathChanged,
    684714                this, &UINameAndSystemEditor::sigImageChanged);
    685 }
     715    connect(m_pEditionSelector, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged),
     716            this, &UINameAndSystemEditor::sltSelectedEditionsChanged);
     717}
     718
     719ulong 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  
    7272    /** Notifies listeners about VM OS family change. */
    7373    void sigOSFamilyChanged(const QString &strFamilyId);
     74    /** Notifies listeners about edition change. */
     75    void sigEditionChanged(ulong selectedEditionIndex);
    7476
    7577public:
     
    132134    void markImageEditor(bool fError, const QString &strErrorMessage);
    133135
     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
    134142    /** Returns 1st column width. */
    135143    int firstColumnWidth() const;
     
    146154    /** Handles VM OS type @a iIndex change. */
    147155    void sltTypeChanged(int iIndex);
     156    void sltSelectedEditionsChanged(int);
    148157
    149158private:
     
    162171        void prepareConnections();
    163172    /** @} */
     173
     174    ulong selectedEditionIndex() const;
    164175
    165176    /** Holds the current family ID list. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r93545 r93606  
    4747    , m_pFormatComboBox(0)
    4848    , m_pSizeAndLocationGroup(0)
    49     , m_pWindowsISOImageSelector(0)
    5049    , m_pNameAndSystemEditor(0)
    5150    , m_pSkipUnattendedCheckBox(0)
     
    164163
    165164    /* Populate the windows ISO images selector: */
    166     if (m_pWindowsISOImageSelector)
    167         m_pWindowsISOImageSelector->setImageNamesAndIndices(pWizard->detectedWindowsImageNames(),
    168                                                             pWizard->detectedWindowsImageIndices());
     165    if (m_pNameAndSystemEditor)
     166        m_pNameAndSystemEditor->setEditionNameAndIndices(pWizard->detectedWindowsImageNames(),
     167                                                         pWizard->detectedWindowsImageIndices());
    169168    setSkipCheckBoxEnable();
    170169    disableEnableUnattendedRelatedWidgets(isUnattendedEnabled());
     
    244243        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged,
    245244                this, &UIWizardNewVMExpertPage::sltISOPathChanged);
     245        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigEditionChanged,
     246                this, &UIWizardNewVMExpertPage::sltSelectedEditionChanged);
    246247    }
    247248
     
    281282                this, &UIWizardNewVMExpertPage::sltStartHeadlessChanged);
    282283    }
    283 
    284     if (m_pWindowsISOImageSelector)
    285         connect(m_pWindowsISOImageSelector, &UIWindowsISOImageSelector::sigSelectedWindowsImageChanged,
    286                 this, &UIWizardNewVMExpertPage::sltSelectedWindowsImageChanged);
    287284
    288285    /* Virtual disk related connections: */
     
    478475    AssertReturn(m_pGAInstallationISOContainer, 0);
    479476    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);
    484477
    485478    return pContainerWidget;
     
    687680    if (m_pGAInstallationISOContainer)
    688681        m_pGAInstallationISOContainer->setEnabled(fEnabled);
    689     if (m_pWindowsISOImageSelector)
    690         m_pWindowsISOImageSelector->setEnabled(fEnabled && !m_pWindowsISOImageSelector->isEmpty());
     682    if (m_pNameAndSystemEditor)
     683        m_pNameAndSystemEditor->setEditionSelectorEnabled(fEnabled && !m_pNameAndSystemEditor->isEditionsSelectorEmpty());
    691684    m_pAdditionalOptionsContainer->disableEnableProductKeyWidgets(isProductKeyWidgetEnabled());
    692685}
     
    855848}
    856849
    857 void UIWizardNewVMExpertPage::sltSelectedWindowsImageChanged(ulong uImageIndex)
    858 {
    859     AssertReturnVoid(wizardWindow<UIWizardNewVM>());
    860     wizardWindow<UIWizardNewVM>()->setSelectedWindowImageIndex(uImageIndex);
     850void UIWizardNewVMExpertPage::sltSelectedEditionChanged(ulong uEditionIndex)
     851{
     852    AssertReturnVoid(wizardWindow<UIWizardNewVM>());
     853    wizardWindow<UIWizardNewVM>()->setSelectedWindowImageIndex(uEditionIndex);
    861854}
    862855
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.h

    r93545 r93606  
    4646class UIToolBox;
    4747class UIUserNamePasswordGroupBox;
    48 class UIWindowsISOImageSelector;
    4948
    5049/** Expert page of the New Virtual Machine wizard. */
     
    8382    void sltProductKeyChanged(const QString &strProductKey);
    8483    void sltStartHeadlessChanged(bool fStartHeadless);
    85     void sltSelectedWindowsImageChanged(ulong uImageIndex);
     84    void sltSelectedEditionChanged(ulong uEditionIndex);
    8685
    8786private:
     
    135134        UIDiskFormatsComboBox *m_pFormatComboBox;
    136135        UIMediumSizeAndPathGroupBox *m_pSizeAndLocationGroup;
    137         UIWindowsISOImageSelector *m_pWindowsISOImageSelector;
    138136        UINameAndSystemEditor *m_pNameAndSystemEditor;
    139137        QCheckBox *m_pSkipUnattendedCheckBox;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPage.cpp

    r93546 r93606  
    4141    , m_pGAInstallationISOContainer(0)
    4242    , m_pUserNamePasswordGroupBox(0)
    43     , m_pWindowsISOImageSelector(0)
    4443{
    4544    prepare();
     
    6564    AssertReturnVoid(m_pGAInstallationISOContainer);
    6665    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);
    7166
    7267    pMainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 4, 0, 1, 2);
     
    10196                this, &UIWizardNewVMUnattendedPage::sltStartHeadlessChanged);
    10297    }
    103 
    104     if (m_pWindowsISOImageSelector)
    105         connect(m_pWindowsISOImageSelector, &UIWindowsISOImageSelector::sigSelectedWindowsImageChanged,
    106                 this, &UIWizardNewVMUnattendedPage::sltSelectedWindowsImageChanged);
    10798}
    10899
     
    164155        m_pGAInstallationISOContainer->blockSignals(false);
    165156    }
    166     if (m_pWindowsISOImageSelector)
    167     {
    168         m_pWindowsISOImageSelector->setImageNamesAndIndices(pWizard->detectedWindowsImageNames(),
    169                                                             pWizard->detectedWindowsImageIndices());
    170         m_pWindowsISOImageSelector->setEnabled(!m_pWindowsISOImageSelector->isEmpty());
    171     }
    172157}
    173158
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPage.h

    r93546 r93606  
    7575        UIGAInstallationGroupBox *m_pGAInstallationISOContainer;
    7676        UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox;
    77         UIWindowsISOImageSelector *m_pWindowsISOImageSelector;
    7877    /** @} */
    7978    QSet<QString> m_userModifiedParameters;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette