VirtualBox

Ignore:
Timestamp:
Oct 27, 2023 4:17:24 PM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10513: Machine settings / Network page: Adjust attachment type editor for Basic experience mode to have only NAT and Bridged types.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINetworkAttachmentEditor.cpp

    r101563 r101637  
    198198#endif /* VBOX_WITH_VMNET */
    199199
     200void UINetworkAttachmentEditor::filterOut(bool fExpertMode, const QString &strFilter)
     201{
     202    /* Call to base-class: */
     203    UIEditor::filterOut(fExpertMode, strFilter);
     204
     205    /* Repopulate type combo to make
     206     * sure excessive types removed: */
     207    populateTypeCombo();
     208}
     209
    200210void UINetworkAttachmentEditor::retranslateUi()
    201211{
     
    358368    CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();
    359369    QVector<KNetworkAttachmentType> supportedTypes = comProperties.GetSupportedNetworkAttachmentTypes();
     370    /* Filter out types unrelated to current experience mode: */
     371    if (!m_fInExpertMode)
     372    {
     373        /* Keep only allowed types but in the same order they came from CSystemProperties: */
     374        const QVector<KNetworkAttachmentType> allowedTypes =  QVector<KNetworkAttachmentType>()
     375                                                           << KNetworkAttachmentType_NAT
     376                                                           << KNetworkAttachmentType_Bridged;
     377        QVector<KNetworkAttachmentType> resultingTypes;
     378        foreach (KNetworkAttachmentType enmType, supportedTypes)
     379            if (allowedTypes.contains(enmType))
     380                resultingTypes << enmType;
     381        supportedTypes = resultingTypes;
     382    }
    360383    /* Take currently requested type into account if it's different from initial one: */
    361384    if (!supportedTypes.contains(m_enmType) && m_enmType != KNetworkAttachmentType_Max)
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINetworkAttachmentEditor.h

    r101011 r101637  
    102102protected:
    103103
     104    /** Filters out contents.
     105      * @param  fExpertMode  Brings whether settings expert mode is requested.
     106      * @param  strFilter    Brings the filter description should correspond to. */
     107    virtual void filterOut(bool fExpertMode, const QString &strFilter) RT_OVERRIDE;
     108
    104109    /** Handles translation event. */
    105110    virtual void retranslateUi() RT_OVERRIDE;
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