VirtualBox

Changeset 36104 in vbox


Ignore:
Timestamp:
Feb 28, 2011 4:55:24 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: VM Settings / Network page: coding-style rework, promiscuous combo-box integration for defect 5570.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r35940 r36104  
    77
    88/*
    9  * Copyright (C) 2006-2010 Oracle Corporation
     9 * Copyright (C) 2006-2011 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    29732973        tr ("VDE Adapter", "NetworkAttachmentType");
    29742974#endif
     2975
     2976    mNetworkAdapterPromiscModePolicyTypes [KNetworkAdapterPromiscModePolicy_Deny] =
     2977        tr ("Deny", "NetworkAdapterPromiscModePolicyType");
     2978    mNetworkAdapterPromiscModePolicyTypes [KNetworkAdapterPromiscModePolicy_AllowNetwork] =
     2979        tr ("Allow Network", "NetworkAdapterPromiscModePolicyType");
     2980    mNetworkAdapterPromiscModePolicyTypes [KNetworkAdapterPromiscModePolicy_AllowAll] =
     2981        tr ("Allow All", "NetworkAdapterPromiscModePolicyType");
    29752982
    29762983    mNATProtocolTypes [KNATProtocol_UDP] =
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r35940 r36104  
    66
    77/*
    8  * Copyright (C) 2006-2010 Oracle Corporation
     8 * Copyright (C) 2006-2011 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    482482    }
    483483
     484    QString toString (KNetworkAdapterPromiscModePolicy t) const
     485    {
     486        AssertMsg (!mNetworkAdapterPromiscModePolicyTypes.value (t).isNull(), ("No text for %d", t));
     487        return mNetworkAdapterPromiscModePolicyTypes.value (t);
     488    }
     489
     490    KNetworkAdapterPromiscModePolicy toNetworkAdapterPromiscModePolicyType (const QString &s) const
     491    {
     492        QULongStringHash::const_iterator it =
     493            qFind (mNetworkAdapterPromiscModePolicyTypes.begin(), mNetworkAdapterPromiscModePolicyTypes.end(), s);
     494        AssertMsg (it != mNetworkAdapterPromiscModePolicyTypes.end(), ("No value for {%s}",
     495                                                                       s.toLatin1().constData()));
     496        return KNetworkAdapterPromiscModePolicy (it.key());
     497    }
     498
    484499    QString toString (KNATProtocol t) const
    485500    {
     
    854869    QULongStringHash mNetworkAdapterTypes;
    855870    QULongStringHash mNetworkAttachmentTypes;
     871    QULongStringHash mNetworkAdapterPromiscModePolicyTypes;
    856872    QULongStringHash mNATProtocolTypes;
    857873    QULongStringHash mClipboardTypes;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r35761 r36104  
    77
    88/*
    9  * Copyright (C) 2008-2010 Oracle Corporation
     9 * Copyright (C) 2008-2011 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818 */
    1919
    20 /* VBox Includes */
    21 #ifdef VBOX_WITH_VDE
    22 # include <iprt/ldr.h>
    23 # include <VBox/VDEPlug.h>
    24 #endif
    25 
     20/* Qt includes */
     21#include <QTimer>
     22#include <QCompleter>
     23
     24/* Local includes */
    2625#include "QIWidgetValidator.h"
    2726#include "QIArrowButtonSwitch.h"
     
    3029#include "QITabWidget.h"
    3130
    32 /* Qt Includes */
    33 #include <QTimer>
    34 #include <QCompleter>
    35 
    36 /* Empty item extra-code */
     31#ifdef VBOX_WITH_VDE
     32# include <iprt/ldr.h>
     33# include <VBox/VDEPlug.h>
     34#endif /* VBOX_WITH_VDE */
     35
     36/* Empty item extra-code: */
    3737const char *emptyItemCode = "#empty#";
    3838
    39 /* UIMachineSettingsNetwork Stuff */
    40 UIMachineSettingsNetwork::UIMachineSettingsNetwork (UIMachineSettingsNetworkPage *aParent, bool aDisableStaticControls)
    41     : QIWithRetranslateUI <QWidget> (0)
    42     , mParent (aParent)
    43     , mValidator (0)
     39UIMachineSettingsNetwork::UIMachineSettingsNetwork(UIMachineSettingsNetworkPage *pParent, bool fDisableStaticControls)
     40    : QIWithRetranslateUI<QWidget>(0)
     41    , m_pParent(pParent)
     42    , m_pValidator(0)
    4443    , m_iSlot(-1)
    45     , mPolished (false)
    46     , mDisableStaticControls (false)
    47 {
    48     /* Apply UI decorations */
    49     Ui::UIMachineSettingsNetwork::setupUi (this);
    50 
    51     /* Setup widgets */
    52     mCbAdapterName->setInsertPolicy (QComboBox::NoInsert);
    53     mLeMAC->setValidator (new QRegExpValidator (QRegExp (
    54                           "[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this));
    55     mLeMAC->setMinimumWidthByText (QString().fill ('0', 12));
    56 
    57     /* Setup connections */
    58     connect (mAbsAdvanced, SIGNAL (clicked()), this, SLOT (toggleAdvanced()));
    59     connect (mTbMAC, SIGNAL (clicked()), this, SLOT (generateMac()));
    60     connect (mPbPortForwarding, SIGNAL (clicked()), this, SLOT (sltOpenPortForwardingDlg()));
    61 
    62     /* Applying language settings */
     44    , m_fPolished(false)
     45    , m_fDisableStaticControls(fDisableStaticControls)
     46{
     47    /* Apply UI decorations: */
     48    Ui::UIMachineSettingsNetwork::setupUi(this);
     49
     50    /* Setup widgets: */
     51    m_pAdapterNameCombo->setInsertPolicy(QComboBox::NoInsert);
     52    m_pMACEditor->setValidator(new QRegExpValidator(QRegExp("[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this));
     53    m_pMACEditor->setMinimumWidthByText(QString().fill('0', 12));
     54
     55    /* Setup connections: */
     56    connect(m_pAdvancedArrow, SIGNAL(clicked()), this, SLOT(sltToggleAdvanced()));
     57    connect(m_pMACButton, SIGNAL(clicked()), this, SLOT(sltGenerateMac()));
     58    connect(m_pPortForwardingButton, SIGNAL(clicked()), this, SLOT(sltOpenPortForwardingDlg()));
     59
     60    /* Applying language settings: */
    6361    retranslateUi();
    64 
    65     /* If some controls should be disabled or not when the
    66      * same tab widgets are shown during runtime
    67      */
    68     mDisableStaticControls = aDisableStaticControls;
    6962}
    7063
     
    7871    mCbEnableAdapter->setChecked(data.m_fAdapterEnabled);
    7972
    80     /* Load adapter type: */
    81     int adapterPos = mCbAdapterType->findData(data.m_adapterType);
    82     mCbAdapterType->setCurrentIndex(adapterPos == -1 ? 0 : adapterPos);
    83 
    8473    /* Load attachment type: */
    85     int attachmentPos = mCbAttachmentType->findData(data.m_attachmentType);
    86     mCbAttachmentType->setCurrentIndex(attachmentPos == -1 ? 0 : attachmentPos);
     74    int iAttachmentPos = m_pAttachmentTypeCombo->findData(data.m_attachmentType);
     75    m_pAttachmentTypeCombo->setCurrentIndex(iAttachmentPos == -1 ? 0 : iAttachmentPos);
    8776
    8877    /* Load alternative name: */
     
    9079    {
    9180        case KNetworkAttachmentType_Bridged:
    92             mBrgName = data.m_strBridgedAdapterName;
    93             if (mBrgName.isEmpty()) mBrgName = QString();
     81            m_strBrgName = data.m_strBridgedAdapterName;
     82            if (m_strBrgName.isEmpty()) m_strBrgName = QString();
    9483            break;
    9584        case KNetworkAttachmentType_Internal:
    96             mIntName = data.m_strInternalNetworkName;
    97             if (mIntName.isEmpty()) mIntName = QString();
     85            m_strIntName = data.m_strInternalNetworkName;
     86            if (m_strIntName.isEmpty()) m_strIntName = QString();
    9887            break;
    9988        case KNetworkAttachmentType_HostOnly:
    100             mHoiName = data.m_strHostInterfaceName;
    101             if (mHoiName.isEmpty()) mHoiName = QString();
     89            m_strHoiName = data.m_strHostInterfaceName;
     90            if (m_strHoiName.isEmpty()) m_strHoiName = QString();
    10291            break;
    10392#ifdef VBOX_WITH_VDE
     
    11099            break;
    111100    }
    112     updateAttachmentAlternative();
     101    sltUpdateAttachmentAlternative();
     102
     103    /* Load adapter type: */
     104    int iAdapterPos = m_pAdapterTypeCombo->findData(data.m_adapterType);
     105    m_pAdapterTypeCombo->setCurrentIndex(iAdapterPos == -1 ? 0 : iAdapterPos);
     106
     107    /* Load promiscuous mode type: */
     108    int iPromiscuousModePos = m_pPromiscuousModeCombo->findData(data.m_promiscuousMode);
     109    m_pPromiscuousModeCombo->setCurrentIndex(iPromiscuousModePos == -1 ? 0 : iPromiscuousModePos);
    113110
    114111    /* Other options: */
    115     mLeMAC->setText(data.m_strMACAddress);
    116     mCbCableConnected->setChecked(data.m_fCableConnected);
     112    m_pMACEditor->setText(data.m_strMACAddress);
     113    m_pCableConnectedCheckBox->setChecked(data.m_fCableConnected);
    117114
    118115    /* Load port forwarding rules: */
    119     mPortForwardingRules = data.m_redirects;
     116    m_portForwardingRules = data.m_redirects;
    120117}
    121118
     
    124121    /* Save adapter activity state: */
    125122    data.m_fAdapterEnabled = mCbEnableAdapter->isChecked();
    126 
    127     /* Save adapter type: */
    128     data.m_adapterType = (KNetworkAdapterType)mCbAdapterType->itemData(mCbAdapterType->currentIndex()).toInt();
    129123
    130124    /* Save attachment type & alternative name: */
     
    154148    }
    155149
     150    /* Save adapter type: */
     151    data.m_adapterType = (KNetworkAdapterType)m_pAdapterTypeCombo->itemData(m_pAdapterTypeCombo->currentIndex()).toInt();
     152
     153    /* Save promiscuous mode type: */
     154    data.m_promiscuousMode = (KNetworkAdapterPromiscModePolicy)m_pPromiscuousModeCombo->itemData(m_pPromiscuousModeCombo->currentIndex()).toInt();
     155
    156156    /* Other options: */
    157     data.m_strMACAddress = mLeMAC->text().isEmpty() ? QString() : mLeMAC->text();
    158     data.m_fCableConnected = mCbCableConnected->isChecked();
     157    data.m_strMACAddress = m_pMACEditor->text().isEmpty() ? QString() : m_pMACEditor->text();
     158    data.m_fCableConnected = m_pCableConnectedCheckBox->isChecked();
    159159
    160160    /* Save port forwarding rules: */
    161     data.m_redirects = mPortForwardingRules;
    162 }
    163 
    164 void UIMachineSettingsNetwork::setValidator (QIWidgetValidator *aValidator)
    165 {
    166     mValidator = aValidator;
    167 
    168     if (!mDisableStaticControls)
    169         connect (mCbEnableAdapter, SIGNAL (toggled (bool)),
    170                  mValidator, SLOT (revalidate()));
    171     connect (mCbAttachmentType, SIGNAL (activated (const QString&)),
    172              this, SLOT (updateAttachmentAlternative()));
    173     connect (mCbAdapterName, SIGNAL (activated (const QString&)),
    174              this, SLOT (updateAlternativeName()));
    175     connect (mCbAdapterName, SIGNAL (editTextChanged (const QString&)),
    176              this, SLOT (updateAlternativeName()));
    177 
    178     if (!mDisableStaticControls)
    179         mValidator->revalidate();
    180 }
    181 
    182 bool UIMachineSettingsNetwork::revalidate (QString &aWarning, QString &aTitle)
    183 {
    184     /* 'True' for disabled adapter */
     161    data.m_redirects = m_portForwardingRules;
     162}
     163
     164void UIMachineSettingsNetwork::setValidator(QIWidgetValidator *pValidator)
     165{
     166    m_pValidator = pValidator;
     167
     168    if (!m_fDisableStaticControls)
     169        connect(mCbEnableAdapter, SIGNAL(toggled(bool)), m_pValidator, SLOT(revalidate()));
     170    connect(m_pAttachmentTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(sltUpdateAttachmentAlternative()));
     171    connect(m_pAdapterNameCombo, SIGNAL(activated(const QString&)), this, SLOT(sltUpdateAlternativeName()));
     172    connect(m_pAdapterNameCombo, SIGNAL(editTextChanged(const QString&)), this, SLOT(sltUpdateAlternativeName()));
     173
     174    if (!m_fDisableStaticControls)
     175        m_pValidator->revalidate();
     176}
     177
     178bool UIMachineSettingsNetwork::revalidate(QString &strWarning, QString &strTitle)
     179{
     180    /* 'True' for disabled adapter: */
    185181    if (!mCbEnableAdapter->isChecked())
    186182        return true;
    187183
    188     /* Validate alternatives */
    189     bool valid = true;
     184    /* Validate alternatives: */
     185    bool fValid = true;
    190186    switch (attachmentType())
    191187    {
     
    193189            if (alternativeName().isNull())
    194190            {
    195                 aWarning = tr ("no bridged network adapter is selected");
    196                 valid = false;
     191                strWarning = tr("no bridged network adapter is selected");
     192                fValid = false;
    197193            }
    198194            break;
     
    200196            if (alternativeName().isNull())
    201197            {
    202                 aWarning = tr ("no internal network name is specified");
    203                 valid = false;
     198                strWarning = tr("no internal network name is specified");
     199                fValid = false;
    204200            }
    205201            break;
     
    207203            if (alternativeName().isNull())
    208204            {
    209                 aWarning = tr ("no host-only network adapter is selected");
    210                 valid = false;
     205                strWarning = tr("no host-only network adapter is selected");
     206                fValid = false;
    211207            }
    212208            break;
     
    214210            break;
    215211    }
    216 
    217     if (!valid)
    218         aTitle += ": " + vboxGlobal().removeAccelMark (pageTitle());
    219 
    220     return valid;
    221 }
    222 
    223 QWidget* UIMachineSettingsNetwork::setOrderAfter (QWidget *aAfter)
    224 {
    225     setTabOrder (aAfter, mCbEnableAdapter);
    226     setTabOrder (mCbEnableAdapter, mCbAttachmentType);
    227     setTabOrder (mCbAttachmentType, mCbAdapterName);
    228     setTabOrder (mCbAdapterName, mAbsAdvanced);
    229     setTabOrder (mAbsAdvanced, mCbAdapterType);
    230     setTabOrder (mCbAdapterType, mLeMAC);
    231     setTabOrder (mLeMAC, mTbMAC);
    232     setTabOrder (mTbMAC, mCbCableConnected);
    233     setTabOrder (mCbCableConnected, mPbPortForwarding);
    234     return mPbPortForwarding;
     212    if (!fValid)
     213        strTitle += ": " + vboxGlobal().removeAccelMark(pageTitle());
     214
     215    return fValid;
     216}
     217
     218QWidget* UIMachineSettingsNetwork::setOrderAfter(QWidget *pAfter)
     219{
     220    setTabOrder(pAfter, mCbEnableAdapter);
     221    setTabOrder(mCbEnableAdapter, m_pAttachmentTypeCombo);
     222    setTabOrder(m_pAttachmentTypeCombo, m_pAdapterNameCombo);
     223    setTabOrder(m_pAdapterNameCombo, m_pAdvancedArrow);
     224    setTabOrder(m_pAdvancedArrow, m_pAdapterTypeCombo);
     225    setTabOrder(m_pAdapterTypeCombo, m_pPromiscuousModeCombo);
     226    setTabOrder(m_pPromiscuousModeCombo, m_pMACEditor);
     227    setTabOrder(m_pMACEditor, m_pMACButton);
     228    setTabOrder(m_pMACButton, m_pCableConnectedCheckBox);
     229    setTabOrder(m_pCableConnectedCheckBox, m_pPortForwardingButton);
     230    return m_pPortForwardingButton;
    235231}
    236232
     
    242238KNetworkAttachmentType UIMachineSettingsNetwork::attachmentType() const
    243239{
    244     return (KNetworkAttachmentType) mCbAttachmentType->itemData (
    245            mCbAttachmentType->currentIndex()).toInt();
    246 }
    247 
    248 QString UIMachineSettingsNetwork::alternativeName (int aType) const
    249 {
    250     if (aType == -1) aType = attachmentType();
    251     QString result;
    252     switch (aType)
     240    return (KNetworkAttachmentType)m_pAttachmentTypeCombo->itemData(m_pAttachmentTypeCombo->currentIndex()).toInt();
     241}
     242
     243QString UIMachineSettingsNetwork::alternativeName(int type) const
     244{
     245    if (type == -1)
     246        type = attachmentType();
     247    QString strResult;
     248    switch (type)
    253249    {
    254250        case KNetworkAttachmentType_Bridged:
    255             result = mBrgName;
     251            strResult = m_strBrgName;
    256252            break;
    257253        case KNetworkAttachmentType_Internal:
    258             result = mIntName;
     254            strResult = m_strIntName;
    259255            break;
    260256        case KNetworkAttachmentType_HostOnly:
    261             result = mHoiName;
     257            strResult = m_strHoiName;
    262258            break;
    263259#ifdef VBOX_WITH_VDE
    264260        case KNetworkAttachmentType_VDE:
    265             result = mVDEName;
     261            strResult = mVDEName;
    266262            break;
    267263#endif
     
    269265            break;
    270266    }
    271     Assert (result.isNull() || !result.isEmpty());
    272     return result;
    273 }
    274 
    275 void UIMachineSettingsNetwork::showEvent (QShowEvent *aEvent)
    276 {
    277     if (!mPolished)
    278     {
    279         mPolished = true;
    280 
    281         /* Give the minimum size hint to the first layout column */
    282         mNetworkChildGridLayout->setColumnMinimumWidth (0, mLbAttachmentType->width());
    283 
    284         if (mDisableStaticControls)
    285         {
    286             /* Disable controls for dynamically displayed page */
    287             mCbEnableAdapter->setEnabled (false);
    288             mCbAdapterType->setEnabled (false);
    289             mLeMAC->setEnabled (false);
    290             mTbMAC->setEnabled (false);
    291             mLbAdapterType->setEnabled (false);
    292             mLbMAC->setEnabled (false);
    293             mAbsAdvanced->animateClick();
     267    Assert(strResult.isNull() || !strResult.isEmpty());
     268    return strResult;
     269}
     270
     271void UIMachineSettingsNetwork::showEvent(QShowEvent *pEvent)
     272{
     273    if (!m_fPolished)
     274    {
     275        m_fPolished = true;
     276
     277        /* Give the minimum size hint to the first layout column: */
     278        m_pNetworkChildGridLayout->setColumnMinimumWidth (0, m_pAttachmentTypeLabel->width());
     279
     280        if (m_fDisableStaticControls)
     281        {
     282            /* Disable controls for dynamically displayed page: */
     283            mCbEnableAdapter->setEnabled(false);
     284            m_pAdapterTypeCombo->setEnabled(false);
     285            m_pPromiscuousModeCombo->setEnabled(false);
     286            m_pMACEditor->setEnabled(false);
     287            m_pMACButton->setEnabled(false);
     288            m_pAdapterTypeLabel->setEnabled(false);
     289            m_pPromiscuousModeLabel->setEnabled(false);
     290            m_pMACLabel->setEnabled(false);
     291            m_pAdvancedArrow->animateClick();
    294292        }
    295293        else
    296294        {
    297             /* Hide advanced items initially */
    298             toggleAdvanced();
    299         }
    300     }
    301     QWidget::showEvent (aEvent);
     295            /* Hide advanced items initially: */
     296            sltToggleAdvanced();
     297        }
     298    }
     299    QWidget::showEvent(pEvent);
    302300}
    303301
    304302void UIMachineSettingsNetwork::retranslateUi()
    305303{
    306     /* Translate uic generated strings */
    307     Ui::UIMachineSettingsNetwork::retranslateUi (this);
    308 
    309     /* Translate combo-boxes content */
     304    /* Translate uic generated strings: */
     305    Ui::UIMachineSettingsNetwork::retranslateUi(this);
     306
     307    /* Translate combo-boxes content: */
    310308    populateComboboxes();
    311309
    312     /* Translate attachment info */
    313     updateAttachmentAlternative();
    314 }
    315 
    316 void UIMachineSettingsNetwork::updateAttachmentAlternative()
    317 {
    318     /* Blocking signals to change content manually */
    319     mCbAdapterName->blockSignals (true);
    320 
    321     /* Update alternative-name combo-box availability */
    322     mLbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
    323                                 attachmentType() != KNetworkAttachmentType_NAT);
    324     mCbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
    325                                 attachmentType() != KNetworkAttachmentType_NAT);
    326 
    327     /* Refresh list */
    328     mCbAdapterName->clear();
     310    /* Translate attachment info: */
     311    sltUpdateAttachmentAlternative();
     312}
     313
     314void UIMachineSettingsNetwork::sltUpdateAttachmentAlternative()
     315{
     316    /* Blocking signals to change content manually: */
     317    m_pAdapterNameCombo->blockSignals(true);
     318
     319    /* Update alternative-name combo-box availability: */
     320    m_pAdapterNameLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
     321                                    attachmentType() != KNetworkAttachmentType_NAT);
     322    m_pAdapterNameCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
     323                                    attachmentType() != KNetworkAttachmentType_NAT);
     324    m_pPromiscuousModeLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
     325                                        attachmentType() != KNetworkAttachmentType_NAT);
     326    m_pPromiscuousModeCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
     327                                        attachmentType() != KNetworkAttachmentType_NAT);
     328
     329    /* Refresh list: */
     330    m_pAdapterNameCombo->clear();
    329331    switch (attachmentType())
    330332    {
    331333        case KNetworkAttachmentType_Bridged:
    332             mCbAdapterName->insertItems (0, mParent->brgList());
    333             mCbAdapterName->setEditable (false);
     334            m_pAdapterNameCombo->insertItems(0, m_pParent->brgList());
     335            m_pAdapterNameCombo->setEditable(false);
    334336            break;
    335337        case KNetworkAttachmentType_Internal:
    336             mCbAdapterName->insertItems (0, mParent->fullIntList());
    337             mCbAdapterName->setEditable (true);
    338             mCbAdapterName->setCompleter (0);
     338            m_pAdapterNameCombo->insertItems(0, m_pParent->fullIntList());
     339            m_pAdapterNameCombo->setEditable(true);
     340            m_pAdapterNameCombo->setCompleter(0);
    339341            break;
    340342        case KNetworkAttachmentType_HostOnly:
    341             mCbAdapterName->insertItems (0, mParent->hoiList());
    342             mCbAdapterName->setEditable (false);
     343            m_pAdapterNameCombo->insertItems(0, m_pParent->hoiList());
     344            m_pAdapterNameCombo->setEditable(false);
    343345            break;
    344346#ifdef VBOX_WITH_VDE
    345347        case KNetworkAttachmentType_VDE:
    346             mCbAdapterName->insertItem(0, alternativeName());
    347             mCbAdapterName->setEditable (true);
    348             mCbAdapterName->setCompleter (0);
     348            m_pAdapterNameCombo->insertItem(0, alternativeName());
     349            m_pAdapterNameCombo->setEditable(true);
     350            m_pAdapterNameCombo->setCompleter(0);
    349351            break;
    350352#endif
     
    353355    }
    354356
    355     /* Prepend 'empty' or 'default' item */
    356     if (mCbAdapterName->count() == 0)
     357    /* Prepend 'empty' or 'default' item: */
     358    if (m_pAdapterNameCombo->count() == 0)
    357359    {
    358360        switch (attachmentType())
     
    361363            case KNetworkAttachmentType_HostOnly:
    362364            {
    363                 /* Adapters list 'empty' */
    364                 int pos = mCbAdapterName->findData (emptyItemCode);
     365                /* Adapters list 'empty': */
     366                int pos = m_pAdapterNameCombo->findData(emptyItemCode);
    365367                if (pos == -1)
    366                     mCbAdapterName->insertItem (0, tr ("Not selected", "network adapter name"), emptyItemCode);
     368                    m_pAdapterNameCombo->insertItem(0, tr("Not selected", "network adapter name"), emptyItemCode);
    367369                else
    368                     mCbAdapterName->setItemText (pos, tr ("Not selected", "network adapter name"));
     370                    m_pAdapterNameCombo->setItemText(pos, tr("Not selected", "network adapter name"));
    369371                break;
    370372            }
    371373            case KNetworkAttachmentType_Internal:
    372374            {
    373                 /* Internal network 'default' name */
    374                 if (mCbAdapterName->findText ("intnet") == -1)
    375                     mCbAdapterName->insertItem (0, "intnet");
     375                /* Internal network 'default' name: */
     376                if (m_pAdapterNameCombo->findText("intnet") == -1)
     377                    m_pAdapterNameCombo->insertItem(0, "intnet");
    376378                break;
    377379            }
     
    381383    }
    382384
    383     /* Select previous or default item */
     385    /* Select previous or default item: */
    384386    switch (attachmentType())
    385387    {
     
    387389        case KNetworkAttachmentType_HostOnly:
    388390        {
    389             int pos = mCbAdapterName->findText (alternativeName());
    390             mCbAdapterName->setCurrentIndex (pos == -1 ? 0 : pos);
     391            int pos = m_pAdapterNameCombo->findText(alternativeName());
     392            m_pAdapterNameCombo->setCurrentIndex(pos == -1 ? 0 : pos);
    391393            break;
    392394        }
    393395        case KNetworkAttachmentType_Internal:
    394396        {
    395             int pos = mCbAdapterName->findText (alternativeName());
    396             mCbAdapterName->setCurrentIndex (pos == -1 ? 0 : pos);
     397            int pos = m_pAdapterNameCombo->findText(alternativeName());
     398            m_pAdapterNameCombo->setCurrentIndex(pos == -1 ? 0 : pos);
    397399            break;
    398400        }
     
    401403    }
    402404
    403     /* Remember selected item */
    404     updateAlternativeName();
     405    /* Remember selected item: */
     406    sltUpdateAlternativeName();
    405407
    406408    /* Update Forwarding rules button availability: */
    407     mPbPortForwarding->setEnabled(attachmentType() == KNetworkAttachmentType_NAT);
    408 
    409     /* Unblocking signals as content is changed already */
    410     mCbAdapterName->blockSignals (false);
    411 }
    412 
    413 void UIMachineSettingsNetwork::updateAlternativeName()
     409    m_pPortForwardingButton->setEnabled(attachmentType() == KNetworkAttachmentType_NAT);
     410
     411    /* Unblocking signals as content is changed already: */
     412    m_pAdapterNameCombo->blockSignals(false);
     413}
     414
     415void UIMachineSettingsNetwork::sltUpdateAlternativeName()
    414416{
    415417    switch (attachmentType())
     
    417419        case KNetworkAttachmentType_Bridged:
    418420        {
    419             QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    420                              QString (emptyItemCode) ||
    421                              mCbAdapterName->currentText().isEmpty() ?
    422                              QString::null : mCbAdapterName->currentText());
    423             if (mBrgName != newName)
    424                 mBrgName = newName;
     421            QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
     422                            QString(emptyItemCode) ||
     423                            m_pAdapterNameCombo->currentText().isEmpty() ?
     424                            QString::null : m_pAdapterNameCombo->currentText());
     425            if (m_strBrgName != newName)
     426                m_strBrgName = newName;
    425427            break;
    426428        }
    427429        case KNetworkAttachmentType_Internal:
    428430        {
    429             QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    430                               QString (emptyItemCode) &&
    431                               mCbAdapterName->currentText() ==
    432                               mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||
    433                               mCbAdapterName->currentText().isEmpty() ?
    434                               QString::null : mCbAdapterName->currentText());
    435             if (mIntName != newName)
     431            QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
     432                             QString(emptyItemCode) &&
     433                             m_pAdapterNameCombo->currentText() ==
     434                             m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) ||
     435                             m_pAdapterNameCombo->currentText().isEmpty() ?
     436                             QString::null : m_pAdapterNameCombo->currentText());
     437            if (m_strIntName != newName)
    436438            {
    437                 mIntName = newName;
    438                 if (!mIntName.isNull())
    439                     QTimer::singleShot (0, mParent, SLOT (updatePages()));
     439                m_strIntName = newName;
     440                if (!m_strIntName.isNull())
     441                    QTimer::singleShot(0, m_pParent, SLOT (updatePages()));
    440442            }
    441443            break;
     
    443445        case KNetworkAttachmentType_HostOnly:
    444446        {
    445             QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    446                              QString (emptyItemCode) ||
    447                              mCbAdapterName->currentText().isEmpty() ?
    448                              QString::null : mCbAdapterName->currentText());
    449             if (mHoiName != newName)
    450                 mHoiName = newName;
     447            QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
     448                            QString(emptyItemCode) ||
     449                            m_pAdapterNameCombo->currentText().isEmpty() ?
     450                            QString::null : m_pAdapterNameCombo->currentText());
     451            if (m_strHoiName != newName)
     452                m_strHoiName = newName;
    451453            break;
    452454        }
     
    454456        case KNetworkAttachmentType_VDE:
    455457        {
    456             QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
    457                               QString (emptyItemCode) &&
    458                               mCbAdapterName->currentText() ==
    459                               mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||
    460                               mCbAdapterName->currentText().isEmpty() ?
    461                               QString::null : mCbAdapterName->currentText());
     458            QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
     459                             QString(emptyItemCode) &&
     460                             m_pAdapterNameCombo->currentText() ==
     461                             m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) ||
     462                             m_pAdapterNameCombo->currentText().isEmpty() ?
     463                             QString::null : m_pAdapterNameCombo->currentText());
    462464            if (mVDEName != newName)
    463465                mVDEName = newName;
     
    469471    }
    470472
    471     if (mValidator)
    472         mValidator->revalidate();
    473 }
    474 
    475 void UIMachineSettingsNetwork::toggleAdvanced()
    476 {
    477     mLbAdapterType->setVisible (mAbsAdvanced->isExpanded());
    478     mCbAdapterType->setVisible (mAbsAdvanced->isExpanded());
    479     mLbMAC->setVisible (mAbsAdvanced->isExpanded());
    480     mLeMAC->setVisible (mAbsAdvanced->isExpanded());
    481     mTbMAC->setVisible (mAbsAdvanced->isExpanded());
    482     mCbCableConnected->setVisible (mAbsAdvanced->isExpanded());
    483     mPbPortForwarding->setVisible (mAbsAdvanced->isExpanded());
    484 }
    485 
    486 void UIMachineSettingsNetwork::generateMac()
     473    if (m_pValidator)
     474        m_pValidator->revalidate();
     475}
     476
     477void UIMachineSettingsNetwork::sltToggleAdvanced()
     478{
     479    m_pAdapterTypeLabel->setVisible(m_pAdvancedArrow->isExpanded());
     480    m_pAdapterTypeCombo->setVisible(m_pAdvancedArrow->isExpanded());
     481    m_pPromiscuousModeLabel->setVisible(m_pAdvancedArrow->isExpanded());
     482    m_pPromiscuousModeCombo->setVisible(m_pAdvancedArrow->isExpanded());
     483    m_pMACLabel->setVisible(m_pAdvancedArrow->isExpanded());
     484    m_pMACEditor->setVisible(m_pAdvancedArrow->isExpanded());
     485    m_pMACButton->setVisible(m_pAdvancedArrow->isExpanded());
     486    m_pCableConnectedCheckBox->setVisible(m_pAdvancedArrow->isExpanded());
     487    m_pPortForwardingButton->setVisible(m_pAdvancedArrow->isExpanded());
     488}
     489
     490void UIMachineSettingsNetwork::sltGenerateMac()
    487491{
    488492    m_adapter.SetMACAddress(QString::null);
    489     mLeMAC->setText(m_adapter.GetMACAddress());
     493    m_pMACEditor->setText(m_adapter.GetMACAddress());
    490494}
    491495
    492496void UIMachineSettingsNetwork::sltOpenPortForwardingDlg()
    493497{
    494     UIMachineSettingsPortForwardingDlg dlg(this, mPortForwardingRules);
     498    UIMachineSettingsPortForwardingDlg dlg(this, m_portForwardingRules);
    495499    if (dlg.exec() == QDialog::Accepted)
    496         mPortForwardingRules = dlg.rules();
     500        m_portForwardingRules = dlg.rules();
    497501}
    498502
    499503void UIMachineSettingsNetwork::populateComboboxes()
    500504{
    501     /* Save the current selected adapter */
    502     int currentAdapter = mCbAdapterType->currentIndex();
    503 
    504     /* Clear the adapters combo-box */
    505     mCbAdapterType->clear();
    506 
    507     /* Populate adapters */
    508     mCbAdapterType->insertItem (0,
    509         vboxGlobal().toString (KNetworkAdapterType_Am79C970A));
    510     mCbAdapterType->setItemData (0,
    511         KNetworkAdapterType_Am79C970A);
    512     mCbAdapterType->setItemData (0,
    513         mCbAdapterType->itemText (0), Qt::ToolTipRole);
    514     mCbAdapterType->insertItem (1,
    515         vboxGlobal().toString (KNetworkAdapterType_Am79C973));
    516     mCbAdapterType->setItemData (1,
    517         KNetworkAdapterType_Am79C973);
    518     mCbAdapterType->setItemData (1,
    519         mCbAdapterType->itemText (1), Qt::ToolTipRole);
     505    /* Attachment type: */
     506    {
     507        /* Remember the currently selected attachment type: */
     508        int iCurrentAttachment = m_pAttachmentTypeCombo->currentIndex();
     509
     510        /* Clear the attachments combo-box: */
     511        m_pAttachmentTypeCombo->clear();
     512
     513        /* Populate attachments: */
     514        int iAttachmentTypeIndex = 0;
     515        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Null));
     516        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Null);
     517        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
     518        ++iAttachmentTypeIndex;
     519        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_NAT));
     520        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NAT);
     521        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
     522        ++iAttachmentTypeIndex;
     523        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Bridged));
     524        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Bridged);
     525        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
     526        ++iAttachmentTypeIndex;
     527        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Internal));
     528        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Internal);
     529        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
     530        ++iAttachmentTypeIndex;
     531        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_HostOnly));
     532        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_HostOnly);
     533        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
     534        ++iAttachmentTypeIndex;
     535#ifdef VBOX_WITH_VDE
     536        RTLDRMOD hLdrDummy;
     537        if (RT_SUCCESS(RTLdrLoad(VBOX_LIB_VDE_PLUG_NAME, &hLdrDummy)))
     538        {
     539            m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_VDE));
     540            m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_VDE);
     541            m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
     542            ++iAttachmentTypeIndex;
     543        }
     544#endif
     545
     546        /* Restore the previously selected attachment type: */
     547        m_pAttachmentTypeCombo->setCurrentIndex(iCurrentAttachment);
     548    }
     549
     550    /* Adapter type: */
     551    {
     552        /* Remember the currently selected adapter type: */
     553        int iCurrentAdapter = m_pAdapterTypeCombo->currentIndex();
     554
     555        /* Clear the adapter type combo-box: */
     556        m_pAdapterTypeCombo->clear();
     557
     558        /* Populate adapter types: */
     559        int iAdapterTypeIndex = 0;
     560        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_Am79C970A));
     561        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Am79C970A);
     562        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     563        ++iAdapterTypeIndex;
     564        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_Am79C973));
     565        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Am79C973);
     566        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     567        ++iAdapterTypeIndex;
    520568#ifdef VBOX_WITH_E1000
    521     mCbAdapterType->insertItem (2,
    522         vboxGlobal().toString (KNetworkAdapterType_I82540EM));
    523     mCbAdapterType->setItemData (2,
    524         KNetworkAdapterType_I82540EM);
    525     mCbAdapterType->setItemData (2,
    526         mCbAdapterType->itemText (2), Qt::ToolTipRole);
    527     mCbAdapterType->insertItem (3,
    528         vboxGlobal().toString (KNetworkAdapterType_I82543GC));
    529     mCbAdapterType->setItemData (3,
    530         KNetworkAdapterType_I82543GC);
    531     mCbAdapterType->setItemData (3,
    532         mCbAdapterType->itemText (3), Qt::ToolTipRole);
    533     mCbAdapterType->insertItem (4,
    534         vboxGlobal().toString (KNetworkAdapterType_I82545EM));
    535     mCbAdapterType->setItemData (4,
    536         KNetworkAdapterType_I82545EM);
    537     mCbAdapterType->setItemData (4,
    538         mCbAdapterType->itemText (4), Qt::ToolTipRole);
     569        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_I82540EM));
     570        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82540EM);
     571        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     572        ++iAdapterTypeIndex;
     573        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_I82543GC));
     574        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82543GC);
     575        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     576        ++iAdapterTypeIndex;
     577        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_I82545EM));
     578        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_I82545EM);
     579        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     580        ++iAdapterTypeIndex;
    539581#endif /* VBOX_WITH_E1000 */
    540582#ifdef VBOX_WITH_VIRTIO
    541     mCbAdapterType->insertItem (5,
    542         vboxGlobal().toString (KNetworkAdapterType_Virtio));
    543     mCbAdapterType->setItemData (5,
    544         KNetworkAdapterType_Virtio);
    545     mCbAdapterType->setItemData (5,
    546         mCbAdapterType->itemText (5), Qt::ToolTipRole);
     583        m_pAdapterTypeCombo->insertItem(iAdapterTypeIndex, vboxGlobal().toString(KNetworkAdapterType_Virtio));
     584        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, KNetworkAdapterType_Virtio);
     585        m_pAdapterTypeCombo->setItemData(iAdapterTypeIndex, m_pAdapterTypeCombo->itemText(iAdapterTypeIndex), Qt::ToolTipRole);
     586        ++iAdapterTypeIndex;
    547587#endif /* VBOX_WITH_VIRTIO */
    548588
    549     /* Set the old value */
    550     mCbAdapterType->setCurrentIndex (currentAdapter == -1 ?
    551                                      0 : currentAdapter);
    552 
    553 
    554     /* Save the current selected attachment type */
    555     int currentAttachment = mCbAttachmentType->currentIndex();
    556 
    557     /* Clear the attachments combo-box */
    558     mCbAttachmentType->clear();
    559 
    560     /* Populate attachments */
    561     mCbAttachmentType->insertItem (0,
    562         vboxGlobal().toString (KNetworkAttachmentType_Null));
    563     mCbAttachmentType->setItemData (0,
    564         KNetworkAttachmentType_Null);
    565     mCbAttachmentType->setItemData (0,
    566         mCbAttachmentType->itemText (0), Qt::ToolTipRole);
    567     mCbAttachmentType->insertItem (1,
    568         vboxGlobal().toString (KNetworkAttachmentType_NAT));
    569     mCbAttachmentType->setItemData (1,
    570         KNetworkAttachmentType_NAT);
    571     mCbAttachmentType->setItemData (1,
    572         mCbAttachmentType->itemText (1), Qt::ToolTipRole);
    573     mCbAttachmentType->insertItem (2,
    574         vboxGlobal().toString (KNetworkAttachmentType_Bridged));
    575     mCbAttachmentType->setItemData (2,
    576         KNetworkAttachmentType_Bridged);
    577     mCbAttachmentType->setItemData (2,
    578         mCbAttachmentType->itemText (2), Qt::ToolTipRole);
    579     mCbAttachmentType->insertItem (3,
    580         vboxGlobal().toString (KNetworkAttachmentType_Internal));
    581     mCbAttachmentType->setItemData (3,
    582         KNetworkAttachmentType_Internal);
    583     mCbAttachmentType->setItemData (3,
    584         mCbAttachmentType->itemText (3), Qt::ToolTipRole);
    585     mCbAttachmentType->insertItem (4,
    586         vboxGlobal().toString (KNetworkAttachmentType_HostOnly));
    587     mCbAttachmentType->setItemData (4,
    588         KNetworkAttachmentType_HostOnly);
    589     mCbAttachmentType->setItemData (4,
    590         mCbAttachmentType->itemText (4), Qt::ToolTipRole);
    591 #ifdef VBOX_WITH_VDE
    592     RTLDRMOD hLdrDummy;
    593     if (RT_SUCCESS(RTLdrLoad(VBOX_LIB_VDE_PLUG_NAME, &hLdrDummy)))
    594     {
    595         mCbAttachmentType->insertItem (5,
    596             vboxGlobal().toString (KNetworkAttachmentType_VDE));
    597         mCbAttachmentType->setItemData (5,
    598             KNetworkAttachmentType_VDE);
    599         mCbAttachmentType->setItemData (5,
    600             mCbAttachmentType->itemText (5), Qt::ToolTipRole);
    601     }
    602 #endif
    603 
    604     /* Set the old value */
    605     mCbAttachmentType->setCurrentIndex (currentAttachment);
     589        /* Restore the previously selected adapter type: */
     590        m_pAdapterTypeCombo->setCurrentIndex(iCurrentAdapter == -1 ? 0 : iCurrentAdapter);
     591    }
     592
     593    /* Promiscuous Mode type: */
     594    {
     595        /* Remember the currently selected promiscuous mode type: */
     596        int iCurrentPromiscuousMode = m_pPromiscuousModeCombo->currentIndex();
     597
     598        /* Clear the promiscuous mode combo-box: */
     599        m_pPromiscuousModeCombo->clear();
     600
     601        /* Populate promiscuous modes: */
     602        int iPromiscuousModeIndex = 0;
     603        m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, vboxGlobal().toString(KNetworkAdapterPromiscModePolicy_Deny));
     604        m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_Deny);
     605        m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole);
     606        ++iPromiscuousModeIndex;
     607        m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, vboxGlobal().toString(KNetworkAdapterPromiscModePolicy_AllowNetwork));
     608        m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_AllowNetwork);
     609        m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole);
     610        ++iPromiscuousModeIndex;
     611        m_pPromiscuousModeCombo->insertItem(iPromiscuousModeIndex, vboxGlobal().toString(KNetworkAdapterPromiscModePolicy_AllowAll));
     612        m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, KNetworkAdapterPromiscModePolicy_AllowAll);
     613        m_pPromiscuousModeCombo->setItemData(iPromiscuousModeIndex, m_pPromiscuousModeCombo->itemText(iPromiscuousModeIndex), Qt::ToolTipRole);
     614        ++iPromiscuousModeIndex;
     615
     616        /* Restore the previously selected promiscuous mode type: */
     617        m_pPromiscuousModeCombo->setCurrentIndex(iCurrentPromiscuousMode);
     618    }
    606619}
    607620
    608621/* UIMachineSettingsNetworkPage Stuff */
    609 UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage(bool aDisableStaticControls)
    610     : mValidator(0)
    611     , mTwAdapters(0)
    612     , mDisableStaticControls(false)
    613 {
    614     /* Setup Main Layout */
    615     QVBoxLayout *mainLayout = new QVBoxLayout (this);
    616     mainLayout->setContentsMargins (0, 5, 0, 5);
    617 
    618     /* Creating Tab Widget */
    619     mTwAdapters = new QITabWidget (this);
    620     mainLayout->addWidget (mTwAdapters);
    621 
    622     /* If some controls should be disabled or not when the
    623      * same tab widgets are shown during runtime
    624      */
    625     mDisableStaticControls = aDisableStaticControls;
    626 
    627     /* How many adapters to display */
     622UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage(bool fDisableStaticControls)
     623    : m_pValidator(0)
     624    , m_pTwAdapters(0)
     625    , m_fDisableStaticControls(fDisableStaticControls)
     626{
     627    /* Setup main layout: */
     628    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     629    pMainLayout->setContentsMargins(0, 5, 0, 5);
     630
     631    /* Creating tab-widget: */
     632    m_pTwAdapters = new QITabWidget(this);
     633    pMainLayout->addWidget(m_pTwAdapters);
     634
     635    /* How many adapters to display: */
    628636    ulong uCount = qMin((ULONG)4, vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
    629     /* Add the tab pages to parent tab widget. Needed for space calculations. */
     637    /* Add the tab pages to parent tab widget. Needed for space calculations: */
    630638    for (ulong iSlot = 0; iSlot < uCount; ++iSlot)
    631639    {
    632640        /* Creating adapter's page: */
    633         UIMachineSettingsNetwork *pPage = new UIMachineSettingsNetwork(this, mDisableStaticControls);
     641        UIMachineSettingsNetwork *pPage = new UIMachineSettingsNetwork(this, m_fDisableStaticControls);
    634642        /* Attach adapter's page to Tab Widget: */
    635         mTwAdapters->addTab(pPage, pPage->pageTitle());
     643        m_pTwAdapters->addTab(pPage, pPage->pageTitle());
    636644    }
    637645}
     
    655663}
    656664
    657 QStringList UIMachineSettingsNetworkPage::brgList (bool aRefresh)
    658 {
    659     if (aRefresh)
    660     {
    661         /* Load & filter interface list */
    662         mBrgList.clear();
    663         CHostNetworkInterfaceVector interfaces =
    664             vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
     665QStringList UIMachineSettingsNetworkPage::brgList(bool fRefresh)
     666{
     667    if (fRefresh)
     668    {
     669        /* Load & filter interface list: */
     670        m_brgList.clear();
     671        CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
    665672        for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin();
    666              it != interfaces.end(); ++ it)
     673             it != interfaces.end(); ++it)
    667674        {
    668675            if (it->GetInterfaceType() == KHostNetworkInterfaceType_Bridged)
    669                 mBrgList << it->GetName();
    670         }
    671     }
    672 
    673     return mBrgList;
    674 }
    675 
    676 QStringList UIMachineSettingsNetworkPage::intList (bool aRefresh)
    677 {
    678     if (aRefresh)
    679     {
    680         /* Load total network list of all VMs */
    681         mIntList.clear();
     676                m_brgList << it->GetName();
     677        }
     678    }
     679
     680    return m_brgList;
     681}
     682
     683QStringList UIMachineSettingsNetworkPage::intList(bool fRefresh)
     684{
     685    if (fRefresh)
     686    {
     687        /* Load total network list of all VMs: */
     688        m_intList.clear();
    682689        CVirtualBox vbox = vboxGlobal().virtualBox();
    683690        ulong count = qMin ((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
    684691        CMachineVector vec = vbox.GetMachines();
    685         for (CMachineVector::ConstIterator m = vec.begin(); m != vec.end(); ++ m)
     692        for (CMachineVector::ConstIterator m = vec.begin(); m != vec.end(); ++m)
    686693        {
    687694            if (m->GetAccessible())
    688695            {
    689                 for (ulong slot = 0; slot < count; ++ slot)
     696                for (ulong slot = 0; slot < count; ++slot)
    690697                {
    691                     QString name = m->GetNetworkAdapter (slot).GetInternalNetwork();
    692                     if (!name.isEmpty() && !mIntList.contains (name))
    693                         mIntList << name;
     698                    QString strName = m->GetNetworkAdapter(slot).GetInternalNetwork();
     699                    if (!strName.isEmpty() && !m_intList.contains(strName))
     700                        m_intList << strName;
    694701                }
    695702            }
     
    697704    }
    698705
    699     return mIntList;
    700 }
    701 
    702 QStringList UIMachineSettingsNetworkPage::fullIntList (bool aRefresh)
    703 {
    704     QStringList list (intList (aRefresh));
    705     /* Append network list with names from all the pages */
    706     for (int index = 0; index < mTwAdapters->count(); ++ index)
    707     {
    708         UIMachineSettingsNetwork *page =
    709             qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (index));
    710         if (page)
    711         {
    712             QString name = page->alternativeName (KNetworkAttachmentType_Internal);
    713             if (!name.isEmpty() && !list.contains (name))
    714                 list << name;
     706    return m_intList;
     707}
     708
     709QStringList UIMachineSettingsNetworkPage::fullIntList(bool fRefresh)
     710{
     711    QStringList list(intList(fRefresh));
     712    /* Append network list with names from all the pages: */
     713    for (int index = 0; index < m_pTwAdapters->count(); ++index)
     714    {
     715        UIMachineSettingsNetwork *pPage =
     716            qobject_cast <UIMachineSettingsNetwork*>(m_pTwAdapters->widget(index));
     717        if (pPage)
     718        {
     719            QString strName = pPage->alternativeName(KNetworkAttachmentType_Internal);
     720            if (!strName.isEmpty() && !list.contains(strName))
     721                list << strName;
    715722        }
    716723    }
     
    718725}
    719726
    720 QStringList UIMachineSettingsNetworkPage::hoiList (bool aRefresh)
    721 {
    722     if (aRefresh)
    723     {
    724         /* Load & filter interface list */
    725         mHoiList.clear();
    726         CHostNetworkInterfaceVector interfaces =
    727             vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
     727QStringList UIMachineSettingsNetworkPage::hoiList(bool fRefresh)
     728{
     729    if (fRefresh)
     730    {
     731        /* Load & filter interface list: */
     732        m_hoiList.clear();
     733        CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
    728734        for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin();
    729              it != interfaces.end(); ++ it)
     735             it != interfaces.end(); ++it)
    730736        {
    731737            if (it->GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
    732                 mHoiList << it->GetName();
    733         }
    734     }
    735 
    736     return mHoiList;
     738                m_hoiList << it->GetName();
     739        }
     740    }
     741
     742    return m_hoiList;
    737743}
    738744
     
    763769        data.m_adapter = adapter;
    764770        data.m_fAdapterEnabled = adapter.GetEnabled();
    765         data.m_adapterType = adapter.GetAdapterType();
    766771        data.m_attachmentType = adapter.GetAttachmentType();
    767772        switch (data.m_attachmentType)
     
    790795
    791796        /* Load advanced options: */
     797        data.m_adapterType = adapter.GetAdapterType();
     798        data.m_promiscuousMode = adapter.GetPromiscModePolicy();
    792799        data.m_strMACAddress = adapter.GetMACAddress();
    793800        data.m_fCableConnected = adapter.GetCableConnected();
     
    821828    /* Setup tab order: */
    822829    Assert(m_pFirstWidget);
    823     setTabOrder(m_pFirstWidget, mTwAdapters->focusProxy());
    824     QWidget *pLastFocusWidget = mTwAdapters->focusProxy();
    825 
    826     int uCount = qMin(mTwAdapters->count(), m_cache.m_items.size());
     830    setTabOrder(m_pFirstWidget, m_pTwAdapters->focusProxy());
     831    QWidget *pLastFocusWidget = m_pTwAdapters->focusProxy();
     832
     833    int uCount = qMin(m_pTwAdapters->count(), m_cache.m_items.size());
    827834    for (int iSlot = 0; iSlot < uCount; ++iSlot)
    828835    {
    829         UIMachineSettingsNetwork *pPage =
    830             qobject_cast<UIMachineSettingsNetwork *>(mTwAdapters->widget(iSlot));
     836        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
    831837        Assert(pPage);
    832838
     
    835841
    836842        /* Disable tab page of disabled adapter if it is being configured dynamically: */
    837         if (mDisableStaticControls && !m_cache.m_items[iSlot].m_fAdapterEnabled)
    838             mTwAdapters->setTabEnabled(iSlot, false);
     843        if (m_fDisableStaticControls && !m_cache.m_items[iSlot].m_fAdapterEnabled)
     844            m_pTwAdapters->setTabEnabled(iSlot, false);
    839845
    840846        /* Setup page validation: */
    841         pPage->setValidator(mValidator);
     847        pPage->setValidator(m_pValidator);
    842848
    843849        /* Setup tab order: */
     
    849855
    850856    /* Revalidate if possible: */
    851     if (mValidator) mValidator->revalidate();
     857    if (m_pValidator) m_pValidator->revalidate();
    852858}
    853859
     
    860866    {
    861867        /* Getting adapter's page: */
    862         UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(mTwAdapters->widget(iSlot));
     868        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
    863869
    864870        /* Loading Adapter's data from page: */
     
    885891        /* Save main options: */
    886892        adapter.SetEnabled(data.m_fAdapterEnabled);
    887         adapter.SetAdapterType(data.m_adapterType);
    888893        switch (data.m_attachmentType)
    889894        {
     
    917922
    918923        /* Save advanced options: */
     924        adapter.SetAdapterType(data.m_adapterType);
     925        adapter.SetPromiscModePolicy(data.m_promiscuousMode);
    919926        adapter.SetMACAddress(data.m_strMACAddress);
    920927        adapter.SetCableConnected(data.m_fCableConnected);
     
    938945}
    939946
    940 void UIMachineSettingsNetworkPage::setValidator (QIWidgetValidator *aVal)
    941 {
    942     mValidator = aVal;
    943 }
    944 
    945 bool UIMachineSettingsNetworkPage::revalidate (QString &aWarning, QString &aTitle)
    946 {
    947     bool valid = true;
    948 
    949     for (int i = 0; i < mTwAdapters->count(); ++ i)
    950     {
    951         UIMachineSettingsNetwork *page =
    952             qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));
    953         Assert (page);
    954         valid = page->revalidate (aWarning, aTitle);
    955         if (!valid) break;
    956     }
    957 
    958     return valid;
     947void UIMachineSettingsNetworkPage::setValidator(QIWidgetValidator *pValidator)
     948{
     949    m_pValidator = pValidator;
     950}
     951
     952bool UIMachineSettingsNetworkPage::revalidate(QString &strWarning, QString &strTitle)
     953{
     954    bool fValid = true;
     955
     956    for (int i = 0; i < m_pTwAdapters->count(); ++i)
     957    {
     958        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
     959        Assert(pPage);
     960        fValid = pPage->revalidate(strWarning, strTitle);
     961        if (!fValid)
     962            break;
     963    }
     964
     965    return fValid;
    959966}
    960967
    961968void UIMachineSettingsNetworkPage::retranslateUi()
    962969{
    963     for (int i = 0; i < mTwAdapters->count(); ++ i)
    964     {
    965         UIMachineSettingsNetwork *page =
    966             qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));
    967         Assert (page);
    968         mTwAdapters->setTabText (i, page->pageTitle());
     970    for (int i = 0; i < m_pTwAdapters->count(); ++ i)
     971    {
     972        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
     973        Assert(pPage);
     974        m_pTwAdapters->setTabText(i, pPage->pageTitle());
    969975    }
    970976}
     
    972978void UIMachineSettingsNetworkPage::updatePages()
    973979{
    974     for (int i = 0; i < mTwAdapters->count(); ++ i)
    975     {
    976         /* Get the iterated page */
    977         UIMachineSettingsNetwork *page =
    978             qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));
    979         Assert (page);
     980    for (int i = 0; i < m_pTwAdapters->count(); ++ i)
     981    {
     982        /* Get the iterated page: */
     983        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
     984        Assert(pPage);
    980985
    981986        /* Update the page if the attachment type is 'internal network' */
    982         if (page->attachmentType() == KNetworkAttachmentType_Internal)
    983             QTimer::singleShot (0, page, SLOT (updateAttachmentAlternative()));
    984     }
    985 }
     987        if (pPage->attachmentType() == KNetworkAttachmentType_Internal)
     988            QTimer::singleShot(0, pPage, SLOT(sltUpdateAttachmentAlternative()));
     989    }
     990}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h

    r33882 r36104  
    66
    77/*
    8  * Copyright (C) 2008-2010 Oracle Corporation
     8 * Copyright (C) 2008-2011 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIMachineSettingsNetwork_h__
    2121
    22 /* VBox Includes */
     22/* Local includes */
    2323#include "COMDefs.h"
    2424#include "UISettingsPage.h"
     
    2626#include "UIMachineSettingsPortForwardingDlg.h"
    2727
    28 /* VBox Forwards */
     28/* Forward declarations */
    2929class UIMachineSettingsNetworkPage;
    3030class QITabWidget;
     
    3939    KNetworkAdapterType m_adapterType;
    4040    KNetworkAttachmentType m_attachmentType;
     41    KNetworkAdapterPromiscModePolicy m_promiscuousMode;
    4142    QString m_strBridgedAdapterName;
    4243    QString m_strInternalNetworkName;
     
    5657};
    5758
    58 class UIMachineSettingsNetwork : public QIWithRetranslateUI <QWidget>,
    59                               public Ui::UIMachineSettingsNetwork
     59/* Machine settings / Network page / Adapter tab: */
     60class UIMachineSettingsNetwork : public QIWithRetranslateUI<QWidget>,
     61                                 public Ui::UIMachineSettingsNetwork
    6062{
    6163    Q_OBJECT;
     
    6365public:
    6466
    65     UIMachineSettingsNetwork (UIMachineSettingsNetworkPage *aParent, bool aDisableStaticControls = false);
     67    UIMachineSettingsNetwork(UIMachineSettingsNetworkPage *pParent, bool fDisableStaticControls = false);
    6668
    6769    void fetchAdapterData(const UINetworkAdapterData &data);
    6870    void uploadAdapterData(UINetworkAdapterData &data);
    6971
    70     void setValidator (QIWidgetValidator *aValidator);
    71     bool revalidate (QString &aWarning, QString &aTitle);
     72    void setValidator(QIWidgetValidator *pValidator);
     73    bool revalidate(QString &strWarning, QString &strTitle);
    7274
    73     QWidget* setOrderAfter (QWidget *aAfter);
     75    QWidget* setOrderAfter(QWidget *pAfter);
    7476
    7577    QString pageTitle() const;
     78
    7679    KNetworkAttachmentType attachmentType() const;
    77     QString alternativeName (int aType = -1) const;
     80    QString alternativeName(int type = -1) const;
    7881
    7982protected:
    8083
    81     void showEvent (QShowEvent *aEvent);
     84    void showEvent(QShowEvent *pEvent);
    8285
    8386    void retranslateUi();
     
    8588private slots:
    8689
    87     void updateAttachmentAlternative();
    88     void updateAlternativeName();
    89     void toggleAdvanced();
    90     void generateMac();
     90    void sltUpdateAttachmentAlternative();
     91    void sltUpdateAlternativeName();
     92    void sltToggleAdvanced();
     93    void sltGenerateMac();
    9194    void sltOpenPortForwardingDlg();
    9295
     
    9598    void populateComboboxes();
    9699
    97     UIMachineSettingsNetworkPage *mParent;
    98     QIWidgetValidator *mValidator;
     100    UIMachineSettingsNetworkPage *m_pParent;
     101    QIWidgetValidator *m_pValidator;
    99102    int m_iSlot;
    100103    CNetworkAdapter m_adapter;
    101104
    102     QString mBrgName;
    103     QString mIntName;
    104     QString mHoiName;
     105    QString m_strBrgName;
     106    QString m_strIntName;
     107    QString m_strHoiName;
    105108#ifdef VBOX_WITH_VDE
    106109    QString mVDEName;
    107 #endif
     110#endif /* VBOX_WITH_VDE */
    108111
    109     bool mPolished;
    110     bool mDisableStaticControls;
    111     UIPortForwardingDataList mPortForwardingRules;
     112    bool m_fPolished;
     113    bool m_fDisableStaticControls;
     114    UIPortForwardingDataList m_portForwardingRules;
    112115};
    113116
     
    119122public:
    120123
    121     UIMachineSettingsNetworkPage (bool aDisableStaticControls = false);
     124    UIMachineSettingsNetworkPage(bool fDisableStaticControls = false);
    122125
    123126    void loadDirectlyFrom(const CMachine &machine);
    124127    void saveDirectlyTo(CMachine &machine);
    125128
    126     QStringList brgList (bool aRefresh = false);
    127     QStringList intList (bool aRefresh = false);
    128     QStringList fullIntList (bool aRefresh = false);
    129     QStringList hoiList (bool aRefresh = false);
     129    QStringList brgList(bool aRefresh = false);
     130    QStringList intList(bool aRefresh = false);
     131    QStringList fullIntList(bool aRefresh = false);
     132    QStringList hoiList(bool aRefresh = false);
    130133
    131134protected:
     
    145148    void saveFromCacheTo(QVariant &data);
    146149
    147     void setValidator (QIWidgetValidator *aValidator);
    148     bool revalidate (QString &aWarning, QString &aTitle);
     150    void setValidator(QIWidgetValidator *pValidator);
     151    bool revalidate(QString &strWarning, QString &strTitle);
    149152
    150153    void retranslateUi();
     
    156159private:
    157160
    158     QIWidgetValidator *mValidator;
    159     QITabWidget *mTwAdapters;
     161    QIWidgetValidator *m_pValidator;
     162    QITabWidget *m_pTwAdapters;
    160163
    161     QStringList mBrgList;
    162     QStringList mIntList;
    163     QStringList mHoiList;
     164    QStringList m_brgList;
     165    QStringList m_intList;
     166    QStringList m_hoiList;
    164167
    165     bool mDisableStaticControls;
     168    bool m_fDisableStaticControls;
    166169
    167170    /* Cache: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui

    r33882 r36104  
    1 <ui version="4.0" >
     1<ui version="4.0">
    22 <comment>
    33 VBox frontends: Qt4 GUI ("VirtualBox"):
    44
    5      Copyright (C) 2008 Oracle Corporation
     5     Copyright (C) 2008-2011 Oracle Corporation
    66
    77     This file is part of VirtualBox Open Source Edition (OSE), as
     
    1414 </comment>
    1515 <class>UIMachineSettingsNetwork</class>
    16  <widget class="QWidget" name="UIMachineSettingsNetwork" >
    17   <property name="geometry" >
     16 <widget class="QWidget" name="UIMachineSettingsNetwork">
     17  <property name="geometry">
    1818   <rect>
    1919    <x>0</x>
     
    2525  <layout class="QGridLayout" name="VBoxVMSettingsNetworkGridLayout">
    2626   <item row="0" column="0" colspan="2">
    27     <widget class="QCheckBox" name="mCbEnableAdapter" >
    28      <property name="whatsThis" >
     27    <widget class="QCheckBox" name="mCbEnableAdapter">
     28     <property name="whatsThis">
    2929      <string>When checked, plugs this virtual network adapter into the virtual machine.</string>
    3030     </property>
    31      <property name="text" >
     31     <property name="text">
    3232      <string>&amp;Enable Network Adapter</string>
    3333     </property>
    34      <property name="checked" >
     34     <property name="checked">
    3535      <bool>true</bool>
    3636     </property>
     
    3838   </item>
    3939   <item row="1" column="0">
    40     <spacer name="horizontalSpacer1">
     40    <spacer name="m_pHorizontalSpacer1">
    4141     <property name="orientation">
    4242      <enum>Qt::Horizontal</enum>
     
    5353    </spacer>
    5454   </item>
    55    <item row="1" column="1" >
    56     <widget class="QWidget" name="mNetworkChild" native="1">
    57      <layout class="QGridLayout" name="mNetworkChildGridLayout">
     55   <item row="1" column="1">
     56    <widget class="QWidget" name="m_pNetworkChild" native="1">
     57     <layout class="QGridLayout" name="m_pNetworkChildGridLayout">
    5858      <property name="margin">
    5959       <number>0</number>
    6060      </property>
    61       <item row="0" column="0" >
    62        <widget class="QLabel" name="mLbAttachmentType">
    63         <property name="text" >
     61      <item row="0" column="0">
     62       <widget class="QLabel" name="m_pAttachmentTypeLabel">
     63        <property name="text">
    6464         <string>&amp;Attached to:</string>
    6565        </property>
    66         <property name="alignment" >
    67          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    68         </property>
    69         <property name="buddy" >
    70          <cstring>mCbAttachmentType</cstring>
     66        <property name="alignment">
     67         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     68        </property>
     69        <property name="buddy">
     70         <cstring>m_pAttachmentTypeCombo</cstring>
    7171        </property>
    7272       </widget>
    7373      </item>
    7474      <item row="0" column="1">
    75        <widget class="QComboBox" name="mCbAttachmentType">
     75       <widget class="QComboBox" name="m_pAttachmentTypeCombo">
    7676        <property name="sizePolicy">
    7777         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
     
    8080         </sizepolicy>
    8181        </property>
    82         <property name="whatsThis" >
     82        <property name="whatsThis">
    8383         <string>Controls how this virtual adapter is attached to the real network of the Host OS.</string>
    8484        </property>
    8585       </widget>
    8686      </item>
    87       <item row="1" column="0" >
    88        <widget class="QLabel" name="mLbAdapterName">
    89         <property name="text" >
     87      <item row="1" column="0">
     88       <widget class="QLabel" name="m_pAdapterNameLabel">
     89        <property name="text">
    9090         <string>&amp;Name:</string>
    9191        </property>
    92         <property name="alignment" >
    93          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    94         </property>
    95         <property name="buddy" >
    96          <cstring>mCbAdapterName</cstring>
     92        <property name="alignment">
     93         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     94        </property>
     95        <property name="buddy">
     96         <cstring>m_pAdapterNameCombo</cstring>
    9797        </property>
    9898       </widget>
    9999      </item>
    100100      <item row="1" column="1" colspan="3">
    101        <widget class="QComboBox" name="mCbAdapterName">
     101       <widget class="QComboBox" name="m_pAdapterNameCombo">
    102102        <property name="sizePolicy">
    103103         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     
    106106         </sizepolicy>
    107107        </property>
    108         <property name="whatsThis" >
     108        <property name="whatsThis">
    109109         <string>Selects the name of the network adapter for &lt;b&gt;Bridged Adapter&lt;/b&gt; or &lt;b&gt;Host-only Adapter&lt;/b&gt; attachments and the name of the network &lt;b&gt;Internal Network&lt;/b&gt; attachments.</string>
    110110        </property>
     
    112112      </item>
    113113      <item row="2" column="0">
    114        <layout class="QHBoxLayout" name="mLtAdvancedBtn">
     114       <layout class="QHBoxLayout" name="m_pAdvancedButtonLayout">
    115115        <property name="margin">
    116116         <number>0</number>
    117117        </property>
    118118        <item>
    119          <spacer name="horizontalSpacer2">
     119         <spacer name="m_pHorizontalSpacer2">
    120120          <property name="orientation">
    121121           <enum>Qt::Horizontal</enum>
     
    130130        </item>
    131131        <item>
    132          <widget class="QIArrowButtonSwitch" native="1" name="mAbsAdvanced">
     132         <widget class="QIArrowButtonSwitch" native="1" name="m_pAdvancedArrow">
    133133          <property name="text">
    134134           <string>A&amp;dvanced</string>
    135135          </property>
    136           <property name="whatsThis" >
     136          <property name="whatsThis">
    137137           <string>Shows or hides additional network adapter options.</string>
    138138          </property>
     
    142142      </item>
    143143      <item row="3" column="0">
    144        <widget class="QLabel" name="mLbAdapterType">
     144       <widget class="QLabel" name="m_pAdapterTypeLabel">
    145145        <property name="text">
    146146         <string>Adapter &amp;Type:</string>
     
    150150        </property>
    151151        <property name="buddy">
    152          <cstring>mCbAdapterType</cstring>
     152         <cstring>m_pAdapterTypeCombo</cstring>
    153153        </property>
    154154       </widget>
    155155      </item>
    156156      <item row="3" column="1" colspan="3">
    157        <widget class="QComboBox" name="mCbAdapterType">
     157       <widget class="QComboBox" name="m_pAdapterTypeCombo">
    158158        <property name="sizePolicy">
    159159         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     
    168168      </item>
    169169      <item row="4" column="0">
    170        <widget class="QLabel" name="mLbMAC">
    171         <property name="text">
    172          <string>&amp;Mac Address:</string>
    173         </property>
    174         <property name="alignment" >
    175          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    176         </property>
    177         <property name="buddy">
    178          <cstring>mLeMAC</cstring>
    179         </property>
    180        </widget>
    181       </item>
    182       <item row="4" column="1" colspan="2">
    183        <widget class="QILineEdit" name="mLeMAC">
     170       <widget class="QLabel" name="m_pPromiscuousModeLabel">
     171        <property name="text">
     172         <string>&amp;Promiscuous Mode:</string>
     173        </property>
     174        <property name="alignment">
     175         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     176        </property>
     177        <property name="buddy">
     178         <cstring>m_pPromiscuousModeCombo</cstring>
     179        </property>
     180       </widget>
     181      </item>
     182      <item row="4" column="1" colspan="3">
     183       <widget class="QComboBox" name="m_pPromiscuousModeCombo">
    184184        <property name="sizePolicy">
    185185         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     
    189189        </property>
    190190        <property name="whatsThis">
     191         <string>Selects the promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.</string>
     192        </property>
     193       </widget>
     194      </item>
     195      <item row="5" column="0">
     196       <widget class="QLabel" name="m_pMACLabel">
     197        <property name="text">
     198         <string>&amp;Mac Address:</string>
     199        </property>
     200        <property name="alignment">
     201         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     202        </property>
     203        <property name="buddy">
     204         <cstring>m_pMACEditor</cstring>
     205        </property>
     206       </widget>
     207      </item>
     208      <item row="5" column="1" colspan="2">
     209       <widget class="QILineEdit" name="m_pMACEditor">
     210        <property name="sizePolicy">
     211         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     212          <horstretch>1</horstretch>
     213          <verstretch>0</verstretch>
     214         </sizepolicy>
     215        </property>
     216        <property name="whatsThis">
    191217         <string>Displays the MAC address of this adapter. It contains exactly 12 characters chosen from {0-9,A-F}. Note that the second character must be an even digit.</string>
    192218        </property>
    193219       </widget>
    194220      </item>
    195       <item row="4" column="3">
    196        <widget class="QIToolButton" name="mTbMAC">
     221      <item row="5" column="3">
     222       <widget class="QIToolButton" name="m_pMACButton">
    197223        <property name="whatsThis">
    198224         <string>Generates a new random MAC address.</string>
     
    207233       </widget>
    208234      </item>
    209       <item row="5" column="1" colspan="3">
    210        <widget class="QCheckBox" name="mCbCableConnected">
     235      <item row="6" column="1" colspan="3">
     236       <widget class="QCheckBox" name="m_pCableConnectedCheckBox">
    211237        <property name="whatsThis">
    212238         <string>Indicates whether the virtual network cable is plugged in on machine startup or not.</string>
     
    217243       </widget>
    218244      </item>
    219       <item row="6" column="1">
    220        <widget class="QPushButton" name="mPbPortForwarding">
     245      <item row="7" column="1">
     246       <widget class="QPushButton" name="m_pPortForwardingButton">
    221247        <property name="whatsThis">
    222248         <string>Opens dialog to manage port forwarding rules.</string>
     
    227253       </widget>
    228254      </item>
    229       <item row="7" column="0" colspan="4">
    230        <spacer name="verticalSpacer">
     255      <item row="8" column="0" colspan="4">
     256       <spacer name="m_pVerticalSpacer">
    231257        <property name="orientation">
    232258         <enum>Qt::Vertical</enum>
     
    270296   <sender>mCbEnableAdapter</sender>
    271297   <signal>toggled(bool)</signal>
    272    <receiver>mNetworkChild</receiver>
     298   <receiver>m_pNetworkChild</receiver>
    273299   <slot>setEnabled(bool)</slot>
    274300   <hints>
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