Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp	(revision 37644)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp	(revision 37645)
@@ -18,9 +18,5 @@
  */
 
-/* Qt includes */
-#include <QTimer>
-#include <QCompleter>
-
-/* Local includes */
+/* Local includes: */
 #include "QIWidgetValidator.h"
 #include "QIArrowButtonSwitch.h"
@@ -35,5 +31,10 @@
 
 /* Empty item extra-code: */
-const char *emptyItemCode = "#empty#";
+const char *pEmptyItemCode = "#empty#";
+
+QString wipedOutString(const QString &strInputString)
+{
+    return strInputString.isEmpty() ? QString() : strInputString;
+}
 
 UIMachineSettingsNetwork::UIMachineSettingsNetwork(UIMachineSettingsNetworkPage *pParent)
@@ -42,5 +43,4 @@
     , m_pValidator(0)
     , m_iSlot(-1)
-    , m_fPolished(false)
 {
     /* Apply UI decorations: */
@@ -53,7 +53,12 @@
 
     /* Setup connections: */
-    connect(m_pAdvancedArrow, SIGNAL(clicked()), this, SLOT(sltToggleAdvanced()));
+    connect(m_pEnableAdapterCheckBox, SIGNAL(toggled(bool)), this, SLOT(sltHandleAdapterActivityChange()));
+    connect(m_pAttachmentTypeComboBox, SIGNAL(activated(int)), this, SLOT(sltHandleAttachmentTypeChange()));
+    connect(m_pAdapterNameCombo, SIGNAL(activated(int)), this, SLOT(sltHandleAlternativeNameChange()));
+    connect(m_pAdapterNameCombo, SIGNAL(editTextChanged(const QString&)), this, SLOT(sltHandleAlternativeNameChange()));
+    connect(m_pAdvancedArrow, SIGNAL(clicked()), this, SLOT(sltHandleAdvancedButtonStateChange()));
     connect(m_pMACButton, SIGNAL(clicked()), this, SLOT(sltGenerateMac()));
     connect(m_pPortForwardingButton, SIGNAL(clicked()), this, SLOT(sltOpenPortForwardingDlg()));
+    connect(this, SIGNAL(sigTabUpdated()), m_pParent, SLOT(sltHandleUpdatedTab()));
 
     /* Applying language settings: */
@@ -61,10 +66,210 @@
 }
 
+void UIMachineSettingsNetwork::fetchAdapterCache(const UICacheSettingsMachineNetworkAdapter &adapterCache)
+{
+    /* Get adapter data: */
+    const UIDataSettingsMachineNetworkAdapter &adapterData = adapterCache.base();
+
+    /* Load slot number: */
+    m_iSlot = adapterData.m_iSlot;
+
+    /* Load adapter activity state: */
+    m_pEnableAdapterCheckBox->setChecked(adapterData.m_fAdapterEnabled);
+    /* Handle adapter activity change: */
+    sltHandleAdapterActivityChange();
+
+    /* Load attachment type: */
+    m_pAttachmentTypeComboBox->setCurrentIndex(position(m_pAttachmentTypeComboBox, adapterData.m_attachmentType));
+    /* Load alternative name: */
+    m_strBridgedAdapterName = wipedOutString(adapterData.m_strBridgedAdapterName);
+    m_strInternalNetworkName = wipedOutString(adapterData.m_strInternalNetworkName);
+    m_strHostInterfaceName = wipedOutString(adapterData.m_strHostInterfaceName);
+    m_strGenericDriverName = wipedOutString(adapterData.m_strGenericDriverName);
+    /* Handle attachment type change: */
+    sltHandleAttachmentTypeChange();
+
+    /* Load adapter type: */
+    m_pAdapterTypeCombo->setCurrentIndex(position(m_pAdapterTypeCombo, adapterData.m_adapterType));
+
+    /* Load promiscuous mode type: */
+    m_pPromiscuousModeCombo->setCurrentIndex(position(m_pPromiscuousModeCombo, adapterData.m_promiscuousMode));
+
+    /* Other options: */
+    m_pMACEditor->setText(adapterData.m_strMACAddress);
+    m_pGenericPropertiesTextEdit->setText(adapterData.m_strGenericProperties);
+    m_pCableConnectedCheckBox->setChecked(adapterData.m_fCableConnected);
+
+    /* Load port forwarding rules: */
+    m_portForwardingRules = adapterData.m_redirects;
+}
+
+void UIMachineSettingsNetwork::uploadAdapterCache(UICacheSettingsMachineNetworkAdapter &adapterCache)
+{
+    /* Prepare adapter data: */
+    UIDataSettingsMachineNetworkAdapter adapterData = adapterCache.base();
+
+    /* Save adapter activity state: */
+    adapterData.m_fAdapterEnabled = m_pEnableAdapterCheckBox->isChecked();
+
+    /* Save attachment type & alternative name: */
+    adapterData.m_attachmentType = attachmentType();
+    switch (adapterData.m_attachmentType)
+    {
+        case KNetworkAttachmentType_Null:
+            break;
+        case KNetworkAttachmentType_NAT:
+            break;
+        case KNetworkAttachmentType_Bridged:
+            adapterData.m_strBridgedAdapterName = alternativeName();
+            break;
+        case KNetworkAttachmentType_Internal:
+            adapterData.m_strInternalNetworkName = alternativeName();
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            adapterData.m_strHostInterfaceName = alternativeName();
+            break;
+        case KNetworkAttachmentType_Generic:
+            adapterData.m_strGenericDriverName = alternativeName();
+            adapterData.m_strGenericProperties = m_pGenericPropertiesTextEdit->toPlainText();
+            break;
+        default:
+            break;
+    }
+
+    /* Save adapter type: */
+    adapterData.m_adapterType = (KNetworkAdapterType)m_pAdapterTypeCombo->itemData(m_pAdapterTypeCombo->currentIndex()).toInt();
+
+    /* Save promiscuous mode type: */
+    adapterData.m_promiscuousMode = (KNetworkAdapterPromiscModePolicy)m_pPromiscuousModeCombo->itemData(m_pPromiscuousModeCombo->currentIndex()).toInt();
+
+    /* Other options: */
+    adapterData.m_strMACAddress = m_pMACEditor->text().isEmpty() ? QString() : m_pMACEditor->text();
+    adapterData.m_fCableConnected = m_pCableConnectedCheckBox->isChecked();
+
+    /* Save port forwarding rules: */
+    adapterData.m_redirects = m_portForwardingRules;
+
+    /* Cache adapter data: */
+    adapterCache.cacheCurrentData(adapterData);
+}
+
+void UIMachineSettingsNetwork::setValidator(QIWidgetValidator *pValidator)
+{
+    m_pValidator = pValidator;
+}
+
+bool UIMachineSettingsNetwork::revalidate(QString &strWarning, QString &strTitle)
+{
+    /* 'True' for disabled adapter: */
+    if (!m_pEnableAdapterCheckBox->isChecked())
+        return true;
+
+    /* Validate alternatives: */
+    bool fValid = true;
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+        {
+            if (alternativeName().isNull())
+            {
+                strWarning = tr("no bridged network adapter is selected");
+                fValid = false;
+            }
+            break;
+        }
+        case KNetworkAttachmentType_Internal:
+        {
+            if (alternativeName().isNull())
+            {
+                strWarning = tr("no internal network name is specified");
+                fValid = false;
+            }
+            break;
+        }
+        case KNetworkAttachmentType_HostOnly:
+        {
+            if (alternativeName().isNull())
+            {
+                strWarning = tr("no host-only network adapter is selected");
+                fValid = false;
+            }
+            break;
+        }
+        case KNetworkAttachmentType_Generic:
+        {
+            if (alternativeName().isNull())
+            {
+                strWarning = tr("no generic driver is selected");
+                fValid = false;
+            }
+            break;
+        }
+        default:
+            break;
+    }
+    if (!fValid)
+        strTitle += ": " + vboxGlobal().removeAccelMark(tabTitle());
+
+    return fValid;
+}
+
+QWidget* UIMachineSettingsNetwork::setOrderAfter(QWidget *pAfter)
+{
+    setTabOrder(pAfter, m_pEnableAdapterCheckBox);
+    setTabOrder(m_pEnableAdapterCheckBox, m_pAttachmentTypeComboBox);
+    setTabOrder(m_pAttachmentTypeComboBox, m_pAdapterNameCombo);
+    setTabOrder(m_pAdapterNameCombo, m_pAdvancedArrow);
+    setTabOrder(m_pAdvancedArrow, m_pAdapterTypeCombo);
+    setTabOrder(m_pAdapterTypeCombo, m_pPromiscuousModeCombo);
+    setTabOrder(m_pPromiscuousModeCombo, m_pMACEditor);
+    setTabOrder(m_pMACEditor, m_pMACButton);
+    setTabOrder(m_pMACButton, m_pGenericPropertiesTextEdit);
+    setTabOrder(m_pGenericPropertiesTextEdit, m_pCableConnectedCheckBox);
+    setTabOrder(m_pCableConnectedCheckBox, m_pPortForwardingButton);
+    return m_pPortForwardingButton;
+}
+
+QString UIMachineSettingsNetwork::tabTitle() const
+{
+    return VBoxGlobal::tr("Adapter %1").arg(QString("&%1").arg(m_iSlot + 1));
+}
+
+KNetworkAttachmentType UIMachineSettingsNetwork::attachmentType() const
+{
+    return (KNetworkAttachmentType)m_pAttachmentTypeComboBox->itemData(m_pAttachmentTypeComboBox->currentIndex()).toInt();
+}
+
+QString UIMachineSettingsNetwork::alternativeName(int iType) const
+{
+    if (iType == -1)
+        iType = attachmentType();
+    QString strResult;
+    switch (iType)
+    {
+        case KNetworkAttachmentType_Bridged:
+            strResult = m_strBridgedAdapterName;
+            break;
+        case KNetworkAttachmentType_Internal:
+            strResult = m_strInternalNetworkName;
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            strResult = m_strHostInterfaceName;
+            break;
+        case KNetworkAttachmentType_Generic:
+            strResult = m_strGenericDriverName;
+            break;
+        default:
+            break;
+    }
+    Assert(strResult.isNull() || !strResult.isEmpty());
+    return strResult;
+}
+
 void UIMachineSettingsNetwork::polishTab()
 {
     /* Basic attributes: */
-    mCbEnableAdapter->setEnabled(m_pParent->isMachineOffline());
+    m_pEnableAdapterCheckBox->setEnabled(m_pParent->isMachineOffline());
     m_pAttachmentTypeLabel->setEnabled(m_pParent->isMachineInValidMode());
-    m_pAttachmentTypeCombo->setEnabled(m_pParent->isMachineInValidMode());
+    m_pAttachmentTypeComboBox->setEnabled(m_pParent->isMachineInValidMode());
     m_pAdapterNameLabel->setEnabled(m_pParent->isMachineInValidMode() &&
                                     attachmentType() != KNetworkAttachmentType_Null &&
@@ -89,5 +294,5 @@
     m_pMACEditor->setEnabled(m_pParent->isMachineOffline());
     m_pMACButton->setEnabled(m_pParent->isMachineOffline());
-
+    m_pGenericPropertiesTextEdit->setEnabled(m_pParent->isMachineOffline());
     m_pPortForwardingButton->setEnabled(m_pParent->isMachineInValidMode() &&
                                         attachmentType() == KNetworkAttachmentType_NAT);
@@ -96,229 +301,13 @@
     if ((m_pParent->isMachineSaved() || m_pParent->isMachineOnline()) && !m_pAdvancedArrow->isExpanded())
         m_pAdvancedArrow->animateClick();
-    sltToggleAdvanced();
-}
-
-void UIMachineSettingsNetwork::fetchAdapterCache(const UICacheSettingsMachineNetworkAdapter &adapterCache)
-{
-    /* Get adapter data: */
-    const UIDataSettingsMachineNetworkAdapter &adapterData = adapterCache.base();
-
-    /* Load slot number: */
-    m_iSlot = adapterData.m_iSlot;
-
-    /* Load adapter activity state: */
-    mCbEnableAdapter->setChecked(adapterData.m_fAdapterEnabled);
-
-    /* Load attachment type: */
-    int iAttachmentPos = m_pAttachmentTypeCombo->findData(adapterData.m_attachmentType);
-    m_pAttachmentTypeCombo->setCurrentIndex(iAttachmentPos == -1 ? 0 : iAttachmentPos);
-
-    /* Load alternative name: */
-    m_strBrgName = adapterData.m_strBridgedAdapterName;
-    if (m_strBrgName.isEmpty())
-        m_strBrgName = QString();
-
-    m_strIntName = adapterData.m_strInternalNetworkName;
-    if (m_strIntName.isEmpty())
-        m_strIntName = QString();
-
-    m_strHoiName = adapterData.m_strHostInterfaceName;
-    if (m_strHoiName.isEmpty())
-        m_strHoiName = QString();
-
-    m_strGenericDriver = adapterData.m_strGenericDriver;
-    if (m_strGenericDriver.isEmpty())
-        m_strGenericDriver = QString();
-
-    sltUpdateAttachmentAlternative();
-
-    /* Load adapter type: */
-    int iAdapterPos = m_pAdapterTypeCombo->findData(adapterData.m_adapterType);
-    m_pAdapterTypeCombo->setCurrentIndex(iAdapterPos == -1 ? 0 : iAdapterPos);
-
-    /* Load promiscuous mode type: */
-    int iPromiscuousModePos = m_pPromiscuousModeCombo->findData(adapterData.m_promiscuousMode);
-    m_pPromiscuousModeCombo->setCurrentIndex(iPromiscuousModePos == -1 ? 0 : iPromiscuousModePos);
-
-    /* Other options: */
-    m_pMACEditor->setText(adapterData.m_strMACAddress);
-    m_pGenericPropertiesTextEdit->setText(adapterData.m_strGenericProperties);
-    m_pCableConnectedCheckBox->setChecked(adapterData.m_fCableConnected);
-
-    /* Load port forwarding rules: */
-    m_portForwardingRules = adapterData.m_redirects;
-}
-
-void UIMachineSettingsNetwork::uploadAdapterCache(UICacheSettingsMachineNetworkAdapter &adapterCache)
-{
-    /* Prepare adapter data: */
-    UIDataSettingsMachineNetworkAdapter adapterData = adapterCache.base();
-
-    /* Save adapter activity state: */
-    adapterData.m_fAdapterEnabled = mCbEnableAdapter->isChecked();
-
-    /* Save attachment type & alternative name: */
-    adapterData.m_attachmentType = attachmentType();
-    switch (adapterData.m_attachmentType)
-    {
-        case KNetworkAttachmentType_Null:
-            break;
-        case KNetworkAttachmentType_NAT:
-            break;
-        case KNetworkAttachmentType_Bridged:
-            adapterData.m_strBridgedAdapterName = alternativeName();
-            break;
-        case KNetworkAttachmentType_Internal:
-            adapterData.m_strInternalNetworkName = alternativeName();
-            break;
-        case KNetworkAttachmentType_HostOnly:
-            adapterData.m_strHostInterfaceName = alternativeName();
-            break;
-        case KNetworkAttachmentType_Generic:
-            adapterData.m_strGenericDriver = alternativeName();
-            adapterData.m_strGenericProperties = m_pGenericPropertiesTextEdit->toPlainText();
-            break;
-        default:
-            break;
-    }
-
-    /* Save adapter type: */
-    adapterData.m_adapterType = (KNetworkAdapterType)m_pAdapterTypeCombo->itemData(m_pAdapterTypeCombo->currentIndex()).toInt();
-
-    /* Save promiscuous mode type: */
-    adapterData.m_promiscuousMode = (KNetworkAdapterPromiscModePolicy)m_pPromiscuousModeCombo->itemData(m_pPromiscuousModeCombo->currentIndex()).toInt();
-
-    /* Other options: */
-    adapterData.m_strMACAddress = m_pMACEditor->text().isEmpty() ? QString() : m_pMACEditor->text();
-    adapterData.m_fCableConnected = m_pCableConnectedCheckBox->isChecked();
-
-    /* Save port forwarding rules: */
-    adapterData.m_redirects = m_portForwardingRules;
-
-    /* Cache adapter data: */
-    adapterCache.cacheCurrentData(adapterData);
-}
-
-void UIMachineSettingsNetwork::setValidator(QIWidgetValidator *pValidator)
-{
-    m_pValidator = pValidator;
-
-    connect(mCbEnableAdapter, SIGNAL(toggled(bool)), m_pValidator, SLOT(revalidate()));
-    connect(m_pAttachmentTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(sltUpdateAttachmentAlternative()));
-    connect(m_pAdapterNameCombo, SIGNAL(activated(const QString&)), this, SLOT(sltUpdateAlternativeName()));
-    connect(m_pAdapterNameCombo, SIGNAL(editTextChanged(const QString&)), this, SLOT(sltUpdateAlternativeName()));
-
-    m_pValidator->revalidate();
-}
-
-bool UIMachineSettingsNetwork::revalidate(QString &strWarning, QString &strTitle)
-{
-    /* 'True' for disabled adapter: */
-    if (!mCbEnableAdapter->isChecked())
-        return true;
-
-    /* Validate alternatives: */
-    bool fValid = true;
-    switch (attachmentType())
-    {
-        case KNetworkAttachmentType_Bridged:
-            if (alternativeName().isNull())
-            {
-                strWarning = tr("no bridged network adapter is selected");
-                fValid = false;
-            }
-            break;
-        case KNetworkAttachmentType_Internal:
-            if (alternativeName().isNull())
-            {
-                strWarning = tr("no internal network name is specified");
-                fValid = false;
-            }
-            break;
-        case KNetworkAttachmentType_HostOnly:
-            if (alternativeName().isNull())
-            {
-                strWarning = tr("no host-only network adapter is selected");
-                fValid = false;
-            }
-            break;
-        case KNetworkAttachmentType_Generic:
-            if (alternativeName().isNull())
-            {
-                strWarning = tr("no generic driver is selected");
-                fValid = false;
-            }
-            break;
-        default:
-            break;
-    }
-    if (!fValid)
-        strTitle += ": " + vboxGlobal().removeAccelMark(pageTitle());
-
-    return fValid;
-}
-
-QWidget* UIMachineSettingsNetwork::setOrderAfter(QWidget *pAfter)
-{
-    setTabOrder(pAfter, mCbEnableAdapter);
-    setTabOrder(mCbEnableAdapter, m_pAttachmentTypeCombo);
-    setTabOrder(m_pAttachmentTypeCombo, m_pAdapterNameCombo);
-    setTabOrder(m_pAdapterNameCombo, m_pAdvancedArrow);
-    setTabOrder(m_pAdvancedArrow, m_pAdapterTypeCombo);
-    setTabOrder(m_pAdapterTypeCombo, m_pPromiscuousModeCombo);
-    setTabOrder(m_pPromiscuousModeCombo, m_pMACEditor);
-    setTabOrder(m_pMACEditor, m_pMACButton);
-    setTabOrder(m_pMACButton, m_pCableConnectedCheckBox);
-    setTabOrder(m_pCableConnectedCheckBox, m_pPortForwardingButton);
-    return m_pPortForwardingButton;
-}
-
-QString UIMachineSettingsNetwork::pageTitle() const
-{
-    return VBoxGlobal::tr("Adapter %1", "network").arg(QString("&%1").arg(m_iSlot + 1));;
-}
-
-KNetworkAttachmentType UIMachineSettingsNetwork::attachmentType() const
-{
-    return (KNetworkAttachmentType)m_pAttachmentTypeCombo->itemData(m_pAttachmentTypeCombo->currentIndex()).toInt();
-}
-
-QString UIMachineSettingsNetwork::alternativeName(int type) const
-{
-    if (type == -1)
-        type = attachmentType();
-    QString strResult;
-    switch (type)
-    {
-        case KNetworkAttachmentType_Bridged:
-            strResult = m_strBrgName;
-            break;
-        case KNetworkAttachmentType_Internal:
-            strResult = m_strIntName;
-            break;
-        case KNetworkAttachmentType_HostOnly:
-            strResult = m_strHoiName;
-            break;
-        case KNetworkAttachmentType_Generic:
-            strResult = m_strGenericDriver;
-            break;
-        default:
-            break;
-    }
-    Assert(strResult.isNull() || !strResult.isEmpty());
-    return strResult;
-}
-
-void UIMachineSettingsNetwork::showEvent(QShowEvent *pEvent)
-{
-    /* Polish page if necessary: */
-    if (!m_fPolished)
-    {
-        m_fPolished = true;
-        /* Give the minimum size hint to the first layout column: */
-        m_pNetworkChildGridLayout->setColumnMinimumWidth (0, m_pAttachmentTypeLabel->width());
-    }
-    /* Call for base-class: */
-    QWidget::showEvent(pEvent);
+    sltHandleAdvancedButtonStateChange();
+}
+
+void UIMachineSettingsNetwork::reloadAlternative()
+{
+    /* Repopulate alternative-name combo-box content: */
+    updateAlternativeList();
+    /* Select previous or default alternative-name combo-box item: */
+    updateAlternativeName();
 }
 
@@ -332,12 +321,18 @@
 
     /* Translate attachment info: */
-    sltUpdateAttachmentAlternative();
-}
-
-void UIMachineSettingsNetwork::sltUpdateAttachmentAlternative()
-{
-    /* Blocking signals to change content manually: */
-    m_pAdapterNameCombo->blockSignals(true);
-
+    sltHandleAttachmentTypeChange();
+}
+
+void UIMachineSettingsNetwork::sltHandleAdapterActivityChange()
+{
+    /* Update availability: */
+    m_pAdapterOptionsContainer->setEnabled(m_pEnableAdapterCheckBox->isChecked());
+    /* Revalidate if possible: */
+    if (m_pValidator)
+        m_pValidator->revalidate();
+}
+
+void UIMachineSettingsNetwork::sltHandleAttachmentTypeChange()
+{
     /* Update alternative-name combo-box availability: */
     m_pAdapterNameLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
@@ -345,4 +340,5 @@
     m_pAdapterNameCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
                                     attachmentType() != KNetworkAttachmentType_NAT);
+    /* Update promiscuous-mode combo-box availability: */
     m_pPromiscuousModeLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&
                                         attachmentType() != KNetworkAttachmentType_Generic &&
@@ -351,85 +347,105 @@
                                         attachmentType() != KNetworkAttachmentType_Generic &&
                                         attachmentType() != KNetworkAttachmentType_NAT);
-
-    /* Refresh list: */
-    m_pAdapterNameCombo->clear();
+    /* Update generic-properties editor visibility: */
+    m_pGenericPropertiesLabel->setVisible(attachmentType() == KNetworkAttachmentType_Generic &&
+                                          m_pAdvancedArrow->isExpanded());
+    m_pGenericPropertiesTextEdit->setVisible(attachmentType() == KNetworkAttachmentType_Generic &&
+                                             m_pAdvancedArrow->isExpanded());
+    /* Update forwarding-rules button availability: */
+    m_pPortForwardingButton->setEnabled(attachmentType() == KNetworkAttachmentType_NAT);
+    /* Update alternative-name combo-box whats-this and editable state: */
     switch (attachmentType())
     {
         case KNetworkAttachmentType_Bridged:
+        {
             m_pAdapterNameCombo->setWhatsThis(tr("Selects the network adapter on the host system that traffic "
                                                  "to and from this network card will go through."));
-            m_pAdapterNameCombo->insertItems(0, m_pParent->brgList());
             m_pAdapterNameCombo->setEditable(false);
             break;
+        }
         case KNetworkAttachmentType_Internal:
+        {
             m_pAdapterNameCombo->setWhatsThis(tr("Enter the name of the internal network that this network card "
                                                  "will be connected to. You can create a new internal network by "
                                                  "choosing a name which is not used by any other network cards "
                                                  "in this virtual machine or others."));
-            m_pAdapterNameCombo->insertItems(0, m_pParent->fullIntList());
             m_pAdapterNameCombo->setEditable(true);
-            m_pAdapterNameCombo->setCompleter(0);
-            break;
+            break;
+        }
         case KNetworkAttachmentType_HostOnly:
+        {
             m_pAdapterNameCombo->setWhatsThis(tr("Selects the virtual network adapter on the host system that traffic "
                                                  "to and from this network card will go through. "
                                                  "You can create and remove adapters using the global network "
                                                  "settings in the virtual machine manager window."));
-            m_pAdapterNameCombo->insertItems(0, m_pParent->hoiList());
             m_pAdapterNameCombo->setEditable(false);
             break;
+        }
         case KNetworkAttachmentType_Generic:
+        {
             m_pAdapterNameCombo->setWhatsThis(tr("Selects the driver to be used with this network card."));
-            m_pAdapterNameCombo->insertItem(0, alternativeName());
             m_pAdapterNameCombo->setEditable(true);
-            m_pAdapterNameCombo->setCompleter(0);
-            break;
+            break;
+        }
         default:
+        {
             m_pAdapterNameCombo->setWhatsThis(QString());
             break;
-    }
-
-    /* Prepend 'empty' or 'default' item: */
-    if (m_pAdapterNameCombo->count() == 0)
-    {
-        switch (attachmentType())
-        {
-            case KNetworkAttachmentType_Bridged:
-            case KNetworkAttachmentType_HostOnly:
+        }
+    }
+
+    /* Update alternative combo: */
+    reloadAlternative();
+
+    /* Handle alternative-name cange: */
+    sltHandleAlternativeNameChange();
+}
+
+void UIMachineSettingsNetwork::sltHandleAlternativeNameChange()
+{
+    /* Remember new name if its changed,
+     * Call for other pages update, if necessary: */
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+        {
+            QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == QString(pEmptyItemCode) ||
+                            m_pAdapterNameCombo->currentText().isEmpty() ? QString() : m_pAdapterNameCombo->currentText());
+            if (m_strBridgedAdapterName != newName)
+                m_strBridgedAdapterName = newName;
+            break;
+        }
+        case KNetworkAttachmentType_Internal:
+        {
+            QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == QString(pEmptyItemCode) &&
+                             m_pAdapterNameCombo->currentText() == m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) ||
+                             m_pAdapterNameCombo->currentText().isEmpty() ? QString() : m_pAdapterNameCombo->currentText());
+            if (m_strInternalNetworkName != newName)
             {
-                /* Adapters list 'empty': */
-                int pos = m_pAdapterNameCombo->findData(emptyItemCode);
-                if (pos == -1)
-                    m_pAdapterNameCombo->insertItem(0, tr("Not selected", "network adapter name"), emptyItemCode);
-                else
-                    m_pAdapterNameCombo->setItemText(pos, tr("Not selected", "network adapter name"));
-                break;
+                m_strInternalNetworkName = newName;
+                if (!m_strInternalNetworkName.isNull())
+                    emit sigTabUpdated();
             }
-            case KNetworkAttachmentType_Internal:
+            break;
+        }
+        case KNetworkAttachmentType_HostOnly:
+        {
+            QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == QString(pEmptyItemCode) ||
+                            m_pAdapterNameCombo->currentText().isEmpty() ? QString() : m_pAdapterNameCombo->currentText());
+            if (m_strHostInterfaceName != newName)
+                m_strHostInterfaceName = newName;
+            break;
+        }
+        case KNetworkAttachmentType_Generic:
+        {
+            QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() == QString(pEmptyItemCode) &&
+                             m_pAdapterNameCombo->currentText() == m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) ||
+                             m_pAdapterNameCombo->currentText().isEmpty() ? QString() : m_pAdapterNameCombo->currentText());
+            if (m_strGenericDriverName != newName)
             {
-                /* Internal network 'default' name: */
-                if (m_pAdapterNameCombo->findText("intnet") == -1)
-                    m_pAdapterNameCombo->insertItem(0, "intnet");
-                break;
+                m_strGenericDriverName = newName;
+                if (!m_strGenericDriverName.isNull())
+                    emit sigTabUpdated();
             }
-            default:
-                break;
-        }
-    }
-
-    /* Select previous or default item: */
-    switch (attachmentType())
-    {
-        case KNetworkAttachmentType_Bridged:
-        case KNetworkAttachmentType_HostOnly:
-        {
-            int pos = m_pAdapterNameCombo->findText(alternativeName());
-            m_pAdapterNameCombo->setCurrentIndex(pos == -1 ? 0 : pos);
-            break;
-        }
-        case KNetworkAttachmentType_Internal:
-        {
-            int pos = m_pAdapterNameCombo->findText(alternativeName());
-            m_pAdapterNameCombo->setCurrentIndex(pos == -1 ? 0 : pos);
             break;
         }
@@ -438,82 +454,12 @@
     }
 
-    /* Remember selected item: */
-    sltUpdateAlternativeName();
-
-    /* Update visibility of "generic" properties editor: */
-    m_pGenericPropertiesLabel->setVisible(attachmentType() == KNetworkAttachmentType_Generic &&
-                                          m_pAdvancedArrow->isExpanded());
-    m_pGenericPropertiesTextEdit->setVisible(attachmentType() == KNetworkAttachmentType_Generic &&
-                                             m_pAdvancedArrow->isExpanded());
-
-    /* Update Forwarding rules button availability: */
-    m_pPortForwardingButton->setEnabled(attachmentType() == KNetworkAttachmentType_NAT);
-
-    /* Unblocking signals as content is changed already: */
-    m_pAdapterNameCombo->blockSignals(false);
-}
-
-void UIMachineSettingsNetwork::sltUpdateAlternativeName()
-{
-    switch (attachmentType())
-    {
-        case KNetworkAttachmentType_Bridged:
-        {
-            QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
-                            QString(emptyItemCode) ||
-                            m_pAdapterNameCombo->currentText().isEmpty() ?
-                            QString::null : m_pAdapterNameCombo->currentText());
-            if (m_strBrgName != newName)
-                m_strBrgName = newName;
-            break;
-        }
-        case KNetworkAttachmentType_Internal:
-        {
-            QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
-                             QString(emptyItemCode) &&
-                             m_pAdapterNameCombo->currentText() ==
-                             m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) ||
-                             m_pAdapterNameCombo->currentText().isEmpty() ?
-                             QString::null : m_pAdapterNameCombo->currentText());
-            if (m_strIntName != newName)
-            {
-                m_strIntName = newName;
-                if (!m_strIntName.isNull())
-                    QTimer::singleShot(0, m_pParent, SLOT (updatePages()));
-            }
-            break;
-        }
-        case KNetworkAttachmentType_HostOnly:
-        {
-            QString newName(m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
-                            QString(emptyItemCode) ||
-                            m_pAdapterNameCombo->currentText().isEmpty() ?
-                            QString::null : m_pAdapterNameCombo->currentText());
-            if (m_strHoiName != newName)
-                m_strHoiName = newName;
-            break;
-        }
-        case KNetworkAttachmentType_Generic:
-        {
-            QString newName((m_pAdapterNameCombo->itemData(m_pAdapterNameCombo->currentIndex()).toString() ==
-                             QString(emptyItemCode) &&
-                             m_pAdapterNameCombo->currentText() ==
-                             m_pAdapterNameCombo->itemText(m_pAdapterNameCombo->currentIndex())) ||
-                             m_pAdapterNameCombo->currentText().isEmpty() ?
-                             QString::null : m_pAdapterNameCombo->currentText());
-            if (m_strGenericDriver != newName)
-                m_strGenericDriver = newName;
-            break;
-        }
-        default:
-            break;
-    }
-
+    /* Revalidate if possible: */
     if (m_pValidator)
         m_pValidator->revalidate();
 }
 
-void UIMachineSettingsNetwork::sltToggleAdvanced()
-{
+void UIMachineSettingsNetwork::sltHandleAdvancedButtonStateChange()
+{
+    /* Update visibility of advanced options: */
     m_pAdapterTypeLabel->setVisible(m_pAdvancedArrow->isExpanded());
     m_pAdapterTypeCombo->setVisible(m_pAdvancedArrow->isExpanded());
@@ -548,38 +494,38 @@
     {
         /* Remember the currently selected attachment type: */
-        int iCurrentAttachment = m_pAttachmentTypeCombo->currentIndex();
+        int iCurrentAttachment = m_pAttachmentTypeComboBox->currentIndex();
 
         /* Clear the attachments combo-box: */
-        m_pAttachmentTypeCombo->clear();
+        m_pAttachmentTypeComboBox->clear();
 
         /* Populate attachments: */
         int iAttachmentTypeIndex = 0;
-        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Null));
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Null);
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Null));
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Null);
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
         ++iAttachmentTypeIndex;
-        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_NAT));
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NAT);
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_NAT));
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NAT);
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
         ++iAttachmentTypeIndex;
-        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Bridged));
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Bridged);
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Bridged));
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Bridged);
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
         ++iAttachmentTypeIndex;
-        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Internal));
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Internal);
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Internal));
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Internal);
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
         ++iAttachmentTypeIndex;
-        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_HostOnly));
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_HostOnly);
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_HostOnly));
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_HostOnly);
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
         ++iAttachmentTypeIndex;
-        m_pAttachmentTypeCombo->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Generic));
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Generic);
-        m_pAttachmentTypeCombo->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeCombo->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, vboxGlobal().toString(KNetworkAttachmentType_Generic));
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Generic);
+        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
         ++iAttachmentTypeIndex;
 
         /* Restore the previously selected attachment type: */
-        m_pAttachmentTypeCombo->setCurrentIndex(iCurrentAttachment);
+        m_pAttachmentTypeComboBox->setCurrentIndex(iCurrentAttachment == -1 ? 0 : iCurrentAttachment);
     }
 
@@ -651,9 +597,103 @@
 
         /* Restore the previously selected promiscuous mode type: */
-        m_pPromiscuousModeCombo->setCurrentIndex(iCurrentPromiscuousMode);
-    }
-}
-
-/* UIMachineSettingsNetworkPage Stuff */
+        m_pPromiscuousModeCombo->setCurrentIndex(iCurrentPromiscuousMode == -1 ? 0 : iCurrentPromiscuousMode);
+    }
+}
+
+void UIMachineSettingsNetwork::updateAlternativeList()
+{
+    /* Block signals initially: */
+    m_pAdapterNameCombo->blockSignals(true);
+
+    /* Repopulate alternative-name combo: */
+    m_pAdapterNameCombo->clear();
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+            m_pAdapterNameCombo->insertItems(0, m_pParent->bridgedAdapterList());
+            break;
+        case KNetworkAttachmentType_Internal:
+            m_pAdapterNameCombo->insertItems(0, m_pParent->internalNetworkList());
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            m_pAdapterNameCombo->insertItems(0, m_pParent->hostInterfaceList());
+            break;
+        case KNetworkAttachmentType_Generic:
+            m_pAdapterNameCombo->insertItems(0, m_pParent->genericDriverList());
+            break;
+        default:
+            break;
+    }
+
+    /* Prepend 'empty' or 'default' item to alternative-name combo: */
+    if (m_pAdapterNameCombo->count() == 0)
+    {
+        switch (attachmentType())
+        {
+            case KNetworkAttachmentType_Bridged:
+            case KNetworkAttachmentType_HostOnly:
+            {
+                /* If adapter list is empty => add 'Not selected' item: */
+                int pos = m_pAdapterNameCombo->findData(pEmptyItemCode);
+                if (pos == -1)
+                    m_pAdapterNameCombo->insertItem(0, tr("Not selected", "network adapter name"), pEmptyItemCode);
+                else
+                    m_pAdapterNameCombo->setItemText(pos, tr("Not selected", "network adapter name"));
+                break;
+            }
+            case KNetworkAttachmentType_Internal:
+            {
+                /* Internal network list should have a default item: */
+                if (m_pAdapterNameCombo->findText("intnet") == -1)
+                    m_pAdapterNameCombo->insertItem(0, "intnet");
+                break;
+            }
+            default:
+                break;
+        }
+    }
+
+    /* Unblock signals finally: */
+    m_pAdapterNameCombo->blockSignals(false);
+}
+
+void UIMachineSettingsNetwork::updateAlternativeName()
+{
+    /* Block signals initially: */
+    m_pAdapterNameCombo->blockSignals(true);
+
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+        case KNetworkAttachmentType_Internal:
+        case KNetworkAttachmentType_HostOnly:
+        case KNetworkAttachmentType_Generic:
+        {
+            m_pAdapterNameCombo->setCurrentIndex(position(m_pAdapterNameCombo, alternativeName()));
+            break;
+        }
+        default:
+            break;
+    }
+
+    /* Unblock signals finally: */
+    m_pAdapterNameCombo->blockSignals(false);
+}
+
+/* static */
+int UIMachineSettingsNetwork::position(QComboBox *pComboBox, int iData)
+{
+    int iPosition = pComboBox->findData(iData);
+    return iPosition == -1 ? 0 : iPosition;
+}
+
+/* static */
+int UIMachineSettingsNetwork::position(QComboBox *pComboBox, const QString &strText)
+{
+    int iPosition = pComboBox->findText(strText);
+    return iPosition == -1 ? 0 : iPosition;
+}
+
+/* UIMachineSettingsNetworkPage Stuff: */
 UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage()
     : m_pValidator(0)
@@ -673,88 +713,8 @@
     for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
     {
-        /* Creating adapter page: */
-        UIMachineSettingsNetwork *pPage = new UIMachineSettingsNetwork(this);
-        m_pTwAdapters->addTab(pPage, pPage->pageTitle());
-    }
-}
-
-QStringList UIMachineSettingsNetworkPage::brgList(bool fRefresh)
-{
-    if (fRefresh)
-    {
-        /* Load & filter interface list: */
-        m_brgList.clear();
-        CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
-        for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin();
-             it != interfaces.end(); ++it)
-        {
-            if (it->GetInterfaceType() == KHostNetworkInterfaceType_Bridged)
-                m_brgList << it->GetName();
-        }
-    }
-
-    return m_brgList;
-}
-
-QStringList UIMachineSettingsNetworkPage::intList(bool fRefresh)
-{
-    if (fRefresh)
-    {
-        /* Load total network list of all VMs: */
-        m_intList.clear();
-        CVirtualBox vbox = vboxGlobal().virtualBox();
-        ulong count = qMin ((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
-        CMachineVector vec = vbox.GetMachines();
-        for (CMachineVector::ConstIterator m = vec.begin(); m != vec.end(); ++m)
-        {
-            if (m->GetAccessible())
-            {
-                for (ulong slot = 0; slot < count; ++slot)
-                {
-                    QString strName = m->GetNetworkAdapter(slot).GetInternalNetwork();
-                    if (!strName.isEmpty() && !m_intList.contains(strName))
-                        m_intList << strName;
-                }
-            }
-        }
-    }
-
-    return m_intList;
-}
-
-QStringList UIMachineSettingsNetworkPage::fullIntList(bool fRefresh)
-{
-    QStringList list(intList(fRefresh));
-    /* Append network list with names from all the pages: */
-    for (int index = 0; index < m_pTwAdapters->count(); ++index)
-    {
-        UIMachineSettingsNetwork *pPage =
-            qobject_cast <UIMachineSettingsNetwork*>(m_pTwAdapters->widget(index));
-        if (pPage)
-        {
-            QString strName = pPage->alternativeName(KNetworkAttachmentType_Internal);
-            if (!strName.isEmpty() && !list.contains(strName))
-                list << strName;
-        }
-    }
-    return list;
-}
-
-QStringList UIMachineSettingsNetworkPage::hoiList(bool fRefresh)
-{
-    if (fRefresh)
-    {
-        /* Load & filter interface list: */
-        m_hoiList.clear();
-        CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
-        for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin();
-             it != interfaces.end(); ++it)
-        {
-            if (it->GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
-                m_hoiList << it->GetName();
-        }
-    }
-
-    return m_hoiList;
+        /* Creating adapter tab: */
+        UIMachineSettingsNetwork *pTab = new UIMachineSettingsNetwork(this);
+        m_pTwAdapters->addTab(pTab, pTab->tabTitle());
+    }
 }
 
@@ -769,8 +729,9 @@
     m_cache.clear();
 
-    /* Cache names lists: */
-    brgList(true);
-    intList(true);
-    hoiList(true);
+    /* Cache name lists: */
+    refreshBridgedAdapterList();
+    refreshInternalNetworkList(true);
+    refreshHostInterfaceList();
+    refreshGenericDriverList(true);
 
     /* For each network adapter: */
@@ -788,20 +749,8 @@
             adapterData.m_fAdapterEnabled = adapter.GetEnabled();
             adapterData.m_attachmentType = adapter.GetAttachmentType();
-
-            adapterData.m_strBridgedAdapterName = adapter.GetBridgedInterface();
-            if (adapterData.m_strBridgedAdapterName.isEmpty())
-                adapterData.m_strBridgedAdapterName = QString();
-
-            adapterData.m_strInternalNetworkName = adapter.GetInternalNetwork();
-            if (adapterData.m_strInternalNetworkName.isEmpty())
-                adapterData.m_strInternalNetworkName = QString();
-
-            adapterData.m_strHostInterfaceName = adapter.GetHostOnlyInterface();
-            if (adapterData.m_strHostInterfaceName.isEmpty())
-                adapterData.m_strHostInterfaceName = QString();
-
-            adapterData.m_strGenericDriver = adapter.GetGenericDriver();
-            if (adapterData.m_strGenericDriver.isEmpty())
-                adapterData.m_strGenericDriver = QString();
+            adapterData.m_strBridgedAdapterName = wipedOutString(adapter.GetBridgedInterface());
+            adapterData.m_strInternalNetworkName = wipedOutString(adapter.GetInternalNetwork());
+            adapterData.m_strHostInterfaceName = wipedOutString(adapter.GetHostOnlyInterface());
+            adapterData.m_strGenericDriverName = wipedOutString(adapter.GetGenericDriver());
 
             /* Gather advanced options: */
@@ -848,14 +797,14 @@
     {
         /* Get adapter page: */
-        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
 
         /* Load adapter data to page: */
-        pPage->fetchAdapterCache(m_cache.child(iSlot));
+        pTab->fetchAdapterCache(m_cache.child(iSlot));
 
         /* Setup page validation: */
-        pPage->setValidator(m_pValidator);
+        pTab->setValidator(m_pValidator);
 
         /* Setup tab order: */
-        pLastFocusWidget = pPage->setOrderAfter(pLastFocusWidget);
+        pLastFocusWidget = pTab->setOrderAfter(pLastFocusWidget);
     }
 
@@ -879,8 +828,8 @@
     {
         /* Get adapter page: */
-        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
 
         /* Gather & cache adapter data: */
-        pPage->uploadAdapterCache(m_cache.child(iSlot));
+        pTab->uploadAdapterCache(m_cache.child(iSlot));
     }
 }
@@ -933,5 +882,5 @@
                                 break;
                             case KNetworkAttachmentType_Generic:
-                                adapter.SetGenericDriver(adapterData.m_strGenericDriver);
+                                adapter.SetGenericDriver(adapterData.m_strGenericDriverName);
                                 updateGenericProperties(adapter, adapterData.m_strGenericProperties);
                                 break;
@@ -977,7 +926,7 @@
     for (int i = 0; i < m_pTwAdapters->count(); ++i)
     {
-        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
-        Assert(pPage);
-        fValid = pPage->revalidate(strWarning, strTitle);
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
+        Assert(pTab);
+        fValid = pTab->revalidate(strWarning, strTitle);
         if (!fValid)
             break;
@@ -991,21 +940,44 @@
     for (int i = 0; i < m_pTwAdapters->count(); ++ i)
     {
-        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
-        Assert(pPage);
-        m_pTwAdapters->setTabText(i, pPage->pageTitle());
-    }
-}
-
-void UIMachineSettingsNetworkPage::updatePages()
-{
-    for (int i = 0; i < m_pTwAdapters->count(); ++ i)
-    {
-        /* Get the iterated page: */
-        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
-        Assert(pPage);
-
-        /* Update the page if the attachment type is 'internal network' */
-        if (pPage->attachmentType() == KNetworkAttachmentType_Internal)
-            QTimer::singleShot(0, pPage, SLOT(sltUpdateAttachmentAlternative()));
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i));
+        Assert(pTab);
+        m_pTwAdapters->setTabText(i, pTab->tabTitle());
+    }
+}
+
+void UIMachineSettingsNetworkPage::sltHandleUpdatedTab()
+{
+    /* Determine the sender: */
+    UIMachineSettingsNetwork *pSender = qobject_cast<UIMachineSettingsNetwork*>(sender());
+    AssertMsg(pSender, ("This slot should be called only through signal<->slot mechanism from one of UIMachineSettingsNetwork tabs!\n"));
+
+    /* Determine sender's attachment type: */
+    KNetworkAttachmentType senderAttachmentType = pSender->attachmentType();
+    switch (senderAttachmentType)
+    {
+        case KNetworkAttachmentType_Internal:
+        {
+            refreshInternalNetworkList();
+            break;
+        }
+        case KNetworkAttachmentType_Generic:
+        {
+            refreshGenericDriverList();
+            break;
+        }
+        default:
+            break;
+    }
+
+    /* Update all the tabs except the sender: */
+    for (int iSlot = 0; iSlot < m_pTwAdapters->count(); ++iSlot)
+    {
+        /* Get the iterated tab: */
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iSlot));
+        AssertMsg(pTab, ("All the tabs of m_pTwAdapters should be of the UIMachineSettingsNetwork type!\n"));
+
+        /* Update all the tabs (except sender) with the same attachment type as sender have: */
+        if (pTab != pSender && pTab->attachmentType() == senderAttachmentType)
+            pTab->reloadAlternative();
     }
 }
@@ -1022,4 +994,118 @@
         pTab->polishTab();
     }
+}
+
+void UIMachineSettingsNetworkPage::refreshBridgedAdapterList()
+{
+    /* Reload bridged interface list: */
+    m_bridgedAdapterList.clear();
+    const CHostNetworkInterfaceVector &ifaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
+    for (int i = 0; i < ifaces.size(); ++i)
+    {
+        const CHostNetworkInterface &iface = ifaces[i];
+        if (iface.GetInterfaceType() == KHostNetworkInterfaceType_Bridged && !m_bridgedAdapterList.contains(iface.GetName()))
+            m_bridgedAdapterList << iface.GetName();
+    }
+}
+
+void UIMachineSettingsNetworkPage::refreshInternalNetworkList(bool fFullRefresh /* = false */)
+{
+    /* Reload internal network list: */
+    m_internalNetworkList.clear();
+    /* Get internal network names from other VMs: */
+    if (fFullRefresh)
+        m_internalNetworkList << otherInternalNetworkList();
+    /* Append internal network list with names from all the tabs: */
+    for (int iTab = 0; iTab < m_pTwAdapters->count(); ++iTab)
+    {
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iTab));
+        if (pTab)
+        {
+            QString strName = pTab->alternativeName(KNetworkAttachmentType_Internal);
+            if (!strName.isEmpty() && !m_internalNetworkList.contains(strName))
+                m_internalNetworkList << strName;
+        }
+    }
+}
+
+void UIMachineSettingsNetworkPage::refreshHostInterfaceList()
+{
+    /* Reload host-only interface list: */
+    m_hostInterfaceList.clear();
+    const CHostNetworkInterfaceVector &ifaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
+    for (int i = 0; i < ifaces.size(); ++i)
+    {
+        const CHostNetworkInterface &iface = ifaces[i];
+        if (iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly && !m_hostInterfaceList.contains(iface.GetName()))
+            m_hostInterfaceList << iface.GetName();
+    }
+}
+
+void UIMachineSettingsNetworkPage::refreshGenericDriverList(bool fFullRefresh /* = false */)
+{
+    /* Load generic driver list: */
+    m_genericDriverList.clear();
+    /* Get generic driver names from other VMs: */
+    if (fFullRefresh)
+        m_genericDriverList << otherGenericDriverList();
+    /* Append generic driver list with names from all the tabs: */
+    for (int iTab = 0; iTab < m_pTwAdapters->count(); ++iTab)
+    {
+        UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(iTab));
+        if (pTab)
+        {
+            QString strName = pTab->alternativeName(KNetworkAttachmentType_Generic);
+            if (!strName.isEmpty() && !m_genericDriverList.contains(strName))
+                m_genericDriverList << strName;
+        }
+    }
+}
+
+/* static */
+QStringList UIMachineSettingsNetworkPage::otherInternalNetworkList()
+{
+    /* Load total internal network list of all VMs: */
+    QStringList otherInternalNetworks;
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    ulong uCount = qMin((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
+    const CMachineVector &machines = vbox.GetMachines();
+    for (int i = 0; i < machines.size(); ++i)
+    {
+        const CMachine &machine = machines[i];
+        if (machine.GetAccessible())
+        {
+            for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
+            {
+                QString strName = machine.GetNetworkAdapter(uSlot).GetInternalNetwork();
+                if (!strName.isEmpty() && !otherInternalNetworks.contains(strName))
+                    otherInternalNetworks << strName;
+            }
+        }
+    }
+    return otherInternalNetworks;
+}
+
+/* static */
+QStringList UIMachineSettingsNetworkPage::otherGenericDriverList()
+{
+    /* Load total generic driver list of all VMs: */
+    QStringList otherGenericDrivers;
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    ulong uCount = qMin((ULONG) 4, vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3));
+    const CMachineVector &machines = vbox.GetMachines();
+    for (int i = 0; i < machines.size(); ++i)
+    {
+        const CMachine &machine = machines[i];
+        if (machine.GetAccessible())
+        {
+            for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
+            {
+                QString strName = machine.GetNetworkAdapter(uSlot).GetGenericDriver();
+                if (!strName.isEmpty() && !otherGenericDrivers.contains(strName))
+                    otherGenericDrivers << strName;
+            }
+        }
+    }
+    return otherGenericDrivers;
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h	(revision 37644)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h	(revision 37645)
@@ -20,11 +20,10 @@
 #define __UIMachineSettingsNetwork_h__
 
-/* Local includes */
-#include "COMDefs.h"
+/* Local includes: */
 #include "UISettingsPage.h"
 #include "UIMachineSettingsNetwork.gen.h"
 #include "UIMachineSettingsPortForwardingDlg.h"
 
-/* Forward declarations */
+/* Forward declarations: */
 class UIMachineSettingsNetworkPage;
 class QITabWidget;
@@ -43,5 +42,5 @@
         , m_strInternalNetworkName(QString())
         , m_strHostInterfaceName(QString())
-        , m_strGenericDriver(QString())
+        , m_strGenericDriverName(QString())
         , m_strGenericProperties(QString())
         , m_strMACAddress(QString())
@@ -59,5 +58,5 @@
                (m_strInternalNetworkName == other.m_strInternalNetworkName) &&
                (m_strHostInterfaceName == other.m_strHostInterfaceName) &&
-               (m_strGenericDriver == other.m_strGenericDriver) &&
+               (m_strGenericDriverName == other.m_strGenericDriverName) &&
                (m_strGenericProperties == other.m_strGenericProperties) &&
                (m_strMACAddress == other.m_strMACAddress) &&
@@ -77,5 +76,5 @@
     QString m_strInternalNetworkName;
     QString m_strHostInterfaceName;
-    QString m_strGenericDriver;
+    QString m_strGenericDriverName;
     QString m_strGenericProperties;
     QString m_strMACAddress;
@@ -97,6 +96,5 @@
 
 /* Machine settings / Network page / Adapter tab: */
-class UIMachineSettingsNetwork : public QIWithRetranslateUI<QWidget>,
-                                 public Ui::UIMachineSettingsNetwork
+class UIMachineSettingsNetwork : public QIWithRetranslateUI<QWidget>, public Ui::UIMachineSettingsNetwork
 {
     Q_OBJECT;
@@ -104,32 +102,42 @@
 public:
 
+    /* Constructor: */
     UIMachineSettingsNetwork(UIMachineSettingsNetworkPage *pParent);
 
-    void polishTab();
-
+    /* Load / Save API: */
     void fetchAdapterCache(const UICacheSettingsMachineNetworkAdapter &adapterCache);
     void uploadAdapterCache(UICacheSettingsMachineNetworkAdapter &adapterCache);
 
+    /* Validation stuff: */
     void setValidator(QIWidgetValidator *pValidator);
     bool revalidate(QString &strWarning, QString &strTitle);
 
+    /* Navigation stuff: */
     QWidget* setOrderAfter(QWidget *pAfter);
 
-    QString pageTitle() const;
-
+    /* Other public stuff: */
+    QString tabTitle() const;
     KNetworkAttachmentType attachmentType() const;
-    QString alternativeName(int type = -1) const;
+    QString alternativeName(int iType = -1) const;
+    void polishTab();
+    void reloadAlternative();
+
+signals:
+
+    /* Signal to notify listeners about tab content changed: */
+    void sigTabUpdated();
 
 protected:
 
-    void showEvent(QShowEvent *pEvent);
-
+    /* Translation stuff: */
     void retranslateUi();
 
 private slots:
 
-    void sltUpdateAttachmentAlternative();
-    void sltUpdateAlternativeName();
-    void sltToggleAdvanced();
+    /* Different handlers: */
+    void sltHandleAdapterActivityChange();
+    void sltHandleAttachmentTypeChange();
+    void sltHandleAlternativeNameChange();
+    void sltHandleAdvancedButtonStateChange();
     void sltGenerateMac();
     void sltOpenPortForwardingDlg();
@@ -137,16 +145,25 @@
 private:
 
+    /* Helping stuff: */
     void populateComboboxes();
-
+    void updateAlternativeList();
+    void updateAlternativeName();
+
+    /* Various static stuff: */
+    static int position(QComboBox *pComboBox, int iData);
+    static int position(QComboBox *pComboBox, const QString &strText);
+
+    /* Parent page: */
     UIMachineSettingsNetworkPage *m_pParent;
+
+    /* Validator: */
     QIWidgetValidator *m_pValidator;
 
+    /* Other variables: */
     int m_iSlot;
-    QString m_strBrgName;
-    QString m_strIntName;
-    QString m_strHoiName;
-    QString m_strGenericDriver;
-
-    bool m_fPolished;
+    QString m_strBridgedAdapterName;
+    QString m_strInternalNetworkName;
+    QString m_strHostInterfaceName;
+    QString m_strGenericDriverName;
     UIPortForwardingDataList m_portForwardingRules;
 };
@@ -159,10 +176,15 @@
 public:
 
+    /* Constructor: */
     UIMachineSettingsNetworkPage();
 
-    QStringList brgList(bool aRefresh = false);
-    QStringList intList(bool aRefresh = false);
-    QStringList fullIntList(bool aRefresh = false);
-    QStringList hoiList(bool aRefresh = false);
+    /* Bridged adapter list: */
+    const QStringList& bridgedAdapterList() const { return m_bridgedAdapterList; }
+    /* Internal network list: */
+    const QStringList& internalNetworkList() const { return m_internalNetworkList; }
+    /* Host-only interface list: */
+    const QStringList& hostInterfaceList() const { return m_hostInterfaceList; }
+    /* Generic driver list: */
+    const QStringList& genericDriverList() const { return m_genericDriverList; }
 
 protected:
@@ -185,26 +207,42 @@
     bool changed() const { return m_cache.wasChanged(); }
 
+    /* Validation stuff: */
     void setValidator(QIWidgetValidator *pValidator);
     bool revalidate(QString &strWarning, QString &strTitle);
 
+    /* Translation stuff: */
     void retranslateUi();
 
 private slots:
 
-    void updatePages();
+    /* Handles tab updates: */
+    void sltHandleUpdatedTab();
 
 private:
 
+    /* Private helpers: */
     void polishPage();
-
+    void refreshBridgedAdapterList();
+    void refreshInternalNetworkList(bool fFullRefresh = false);
+    void refreshHostInterfaceList();
+    void refreshGenericDriverList(bool fFullRefresh = false);
+
+    /* Various static stuff: */
+    static QStringList otherInternalNetworkList();
+    static QStringList otherGenericDriverList();
     static QString summarizeGenericProperties(const CNetworkAdapter &adapter);
     static void updateGenericProperties(CNetworkAdapter &adapter, const QString &strPropText);
 
+    /* Validator: */
     QIWidgetValidator *m_pValidator;
+
+    /* Tab holder: */
     QITabWidget *m_pTwAdapters;
 
-    QStringList m_brgList;
-    QStringList m_intList;
-    QStringList m_hoiList;
+    /* Alternative-name lists: */
+    QStringList m_bridgedAdapterList;
+    QStringList m_internalNetworkList;
+    QStringList m_hostInterfaceList;
+    QStringList m_genericDriverList;
 
     /* Cache: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui	(revision 37644)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui	(revision 37645)
@@ -19,11 +19,11 @@
     <x>0</x>
     <y>0</y>
-    <width>431</width>
-    <height>248</height>
+    <width>430</width>
+    <height>250</height>
    </rect>
   </property>
-  <layout class="QGridLayout" name="VBoxVMSettingsNetworkGridLayout">
+  <layout class="QGridLayout" name="m_pMainLayout">
    <item row="0" column="0" colspan="2">
-    <widget class="QCheckBox" name="mCbEnableAdapter">
+    <widget class="QCheckBox" name="m_pEnableAdapterCheckBox">
      <property name="whatsThis">
       <string>When checked, plugs this virtual network adapter into the virtual machine.</string>
@@ -31,7 +31,4 @@
      <property name="text">
       <string>&amp;Enable Network Adapter</string>
-     </property>
-     <property name="checked">
-      <bool>true</bool>
      </property>
     </widget>
@@ -54,6 +51,6 @@
    </item>
    <item row="1" column="1">
-    <widget class="QWidget" name="m_pNetworkChild" native="1">
-     <layout class="QGridLayout" name="m_pNetworkChildGridLayout">
+    <widget class="QWidget" name="m_pAdapterOptionsContainer" native="1">
+     <layout class="QGridLayout" name="m_pAdapterOptionsLayout">
       <property name="margin">
        <number>0</number>
@@ -68,10 +65,10 @@
         </property>
         <property name="buddy">
-         <cstring>m_pAttachmentTypeCombo</cstring>
+         <cstring>m_pAttachmentTypeComboBox</cstring>
         </property>
        </widget>
       </item>
       <item row="0" column="1">
-       <widget class="QComboBox" name="m_pAttachmentTypeCombo">
+       <widget class="QComboBox" name="m_pAttachmentTypeComboBox">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -306,21 +303,4 @@
   <include location="../VirtualBox1.qrc"/>
  </resources>
- <connections>
-  <connection>
-   <sender>mCbEnableAdapter</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>m_pNetworkChild</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>184</x>
-     <y>28</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>196</x>
-     <y>111</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>
