VirtualBox

Changeset 92762 in vbox


Ignore:
Timestamp:
Dec 6, 2021 12:22:53 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10163: UINetworkManager: Subnet id stuff for Cloud Network page; Committed separately and probably temporary.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/networkmanager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetCloudNetwork.cpp

    r92731 r92762  
    4949    , m_pLabelProfileName(0)
    5050    , m_pComboProfileName(0)
     51    , m_pLabelNetworkId(0)
     52    , m_pEditorNetworkId(0)
    5153    , m_pButtonBoxOptions(0)
    5254{
     
    126128    if (m_pComboProfileName)
    127129        m_pComboProfileName->setToolTip(tr("Holds the cloud profile for this network."));
     130    if (m_pLabelNetworkId)
     131        m_pLabelNetworkId->setText(tr("&Id:"));
     132    if (m_pEditorNetworkId)
     133        m_pEditorNetworkId->setToolTip(tr("Holds the id for this network."));
    128134    if (m_pButtonBoxOptions)
    129135    {
     
    170176}
    171177
     178void UIDetailsWidgetCloudNetwork::sltNetworkIdChanged(const QString &strText)
     179{
     180    m_newData.m_strId = strText;
     181    updateButtonStates();
     182}
     183
    172184void UIDetailsWidgetCloudNetwork::sltHandleButtonBoxClick(QAbstractButton *pButton)
    173185{
     
    272284
    273285                pLayoutOptions->addWidget(m_pComboProfileName, 2, 1);
     286            }
     287
     288            /* Prepare network id label: */
     289            m_pLabelNetworkId = new QLabel(this);
     290            if (m_pLabelNetworkId)
     291            {
     292                m_pLabelNetworkId->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     293                pLayoutOptions->addWidget(m_pLabelNetworkId, 3, 0);
     294            }
     295            /* Prepare network id editor: */
     296            m_pEditorNetworkId = new QLineEdit(this);
     297            if (m_pEditorNetworkId)
     298            {
     299                if (m_pLabelNetworkId)
     300                    m_pLabelNetworkId->setBuddy(m_pEditorNetworkId);
     301                connect(m_pEditorNetworkId, &QLineEdit::textEdited,
     302                        this, &UIDetailsWidgetCloudNetwork::sltNetworkIdChanged);
     303
     304                pLayoutOptions->addWidget(m_pEditorNetworkId, 3, 1);
    274305            }
    275306
     
    416447    m_pLabelProfileName->setEnabled(fIsNetworkExists);
    417448    m_pComboProfileName->setEnabled(fIsNetworkExists);
     449    m_pLabelNetworkId->setEnabled(fIsNetworkExists);
     450    m_pEditorNetworkId->setEnabled(fIsNetworkExists);
    418451
    419452    /* Load fields: */
     
    423456    const int iProfileIndex = m_pComboProfileName->findData(m_newData.m_strProfile);
    424457    m_pComboProfileName->setCurrentIndex(iProfileIndex == -1 ? 0 : iProfileIndex);
    425 }
     458    m_pEditorNetworkId->setText(m_newData.m_strId);
     459}
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetCloudNetwork.h

    r92731 r92762  
    5454        , m_strProvider(QString())
    5555        , m_strProfile(QString())
     56        , m_strId(QString())
    5657    {}
    5758
     
    6566               && (m_strProvider == other.m_strProvider)
    6667               && (m_strProfile == other.m_strProfile)
     68               && (m_strId == other.m_strId)
    6769               ;
    6870    }
     
    8385    /** Holds cloud profile name. */
    8486    QString  m_strProfile;
     87    /** Holds network id. */
     88    QString  m_strId;
    8589};
    8690
     
    139143        /** Handles cloud profile name index change. */
    140144        void sltCloudProfileNameChanged(int iIndex);
     145        /** Handles network id text change. */
     146        void sltNetworkIdChanged(const QString &strText);
    141147
    142148        /** Handles button-box button click. */
     
    189195        /** Holds the cloud profile name combo instance. */
    190196        QIComboBox *m_pComboProfileName;
     197        /** Holds the network id label instance. */
     198        QLabel     *m_pLabelNetworkId;
     199        /** Holds the network id editor instance. */
     200        QLineEdit  *m_pEditorNetworkId;
    191201
    192202        /** Holds the 'Options' button-box instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp

    r92731 r92762  
    783783    oldData.m_strProvider = QString();
    784784    oldData.m_strProfile = QString();
     785    oldData.m_strId = QString();
    785786
    786787    /* Get VirtualBox for further activities: */
     
    808809        if (comNetwork.isOk())
    809810            comNetwork.SetProfile(oldData.m_strProfile);
     811        /* Save cloud network id: */
     812        if (comNetwork.isOk())
     813            comNetwork.SetNetworkId(oldData.m_strId);
    810814
    811815        /* Show error message if necessary: */
     
    14721476            if (comNetwork.isOk() && newData.m_strProfile != oldData.m_strProfile)
    14731477                comNetwork.SetProfile(newData.m_strProfile);
     1478            /* Save cloud network id: */
     1479            if (comNetwork.isOk() && newData.m_strId != oldData.m_strId)
     1480                comNetwork.SetNetworkId(newData.m_strId);
    14741481
    14751482            /* Show error message if necessary: */
     
    20682075    if (comNetwork.isOk())
    20692076        data.m_strProfile = comNetwork.GetProfile();
     2077    if (comNetwork.isOk())
     2078        data.m_strId = comNetwork.GetNetworkId();
    20702079
    20712080    /* Show error message if necessary: */
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