Index: trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp	(revision 78518)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp	(revision 78519)
@@ -76,4 +76,7 @@
 const char *UIExtraDataDefs::GUI_RecentListCD = "GUI/RecentListCD";
 const char *UIExtraDataDefs::GUI_RecentListFD = "GUI/RecentListFD";
+
+/* Settings: Network: */
+const char *UIExtraDataDefs::GUI_RestrictedNetworkAttachmentTypes = "GUI/RestrictedNetworkAttachmentTypes";
 
 /* VISO Creator: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h	(revision 78518)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h	(revision 78519)
@@ -144,5 +144,11 @@
     /** @} */
 
-    /** @name Settings: VISO Creator
+    /** @name Settings: Network
+      * @{ */
+        /** Holds the list of restricted network attachment types. */
+        SHARED_LIBRARY_STUFF extern const char *GUI_RestrictedNetworkAttachmentTypes;
+    /** @} */
+
+    /** @name VISO Creator
       * @{ */
         /** Holds recent folder for VISO creation content. */
Index: trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 78518)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 78519)
@@ -1960,4 +1960,5 @@
            << GUI_VISOCreator_RecentFolder << GUI_VISOCreator_DialogGeometry
            << GUI_RecentListHD << GUI_RecentListCD << GUI_RecentListFD
+           << GUI_RestrictedNetworkAttachmentTypes
            << GUI_LastSelectorWindowPosition << GUI_SplitterSizes
            << GUI_Toolbar << GUI_Toolbar_Text
@@ -2664,4 +2665,21 @@
 }
 
+UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork UIExtraDataManager::restrictedNetworkAttachmentTypes()
+{
+    /* Prepare result: */
+    UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork enmResult =
+        UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid;
+    /* Get restricted network attachment types: */
+    foreach (const QString &strValue, extraDataStringList(GUI_RestrictedNetworkAttachmentTypes))
+    {
+        const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork enmValue =
+            gpConverter->fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork>(strValue);
+        if (enmValue != UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid && !(enmResult & enmValue))
+            enmResult = static_cast<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork>(enmResult | enmValue);
+    }
+    /* Return result: */
+    return enmResult;
+}
+
 QString UIExtraDataManager::visoCreatorRecentFolder()
 {
Index: trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h	(revision 78518)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h	(revision 78519)
@@ -288,4 +288,10 @@
         /** Defines the list of recently used floppy-disks as @a value. */
         void setRecentListOfFloppyDisks(const QStringList &value);
+    /** @} */
+
+    /** @name Settings: Network
+      * @{ */
+        /** Returns the list of restricted network attachment types. */
+        UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork restrictedNetworkAttachmentTypes();
     /** @} */
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp	(revision 78518)
+++ trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp	(revision 78519)
@@ -772,5 +772,6 @@
         {
             pHorizontalHeader->setHighlightSections(false);
-            pHorizontalHeader->setSectionResizeMode(QHeaderView::Stretch);
+            pHorizontalHeader->setSectionResizeMode(QHeaderView::ResizeToContents);
+            pHorizontalHeader->setStretchLastSection(true);
         }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp	(revision 78518)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp	(revision 78519)
@@ -24,4 +24,5 @@
 #include "UIMachineSettingsNetwork.h"
 #include "UIErrorString.h"
+#include "UIExtraDataManager.h"
 #include "VBoxGlobal.h"
 
@@ -757,4 +758,18 @@
 }
 
+UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork toInternalNetworkAdapterEnum(KNetworkAttachmentType comEnum)
+{
+    switch (comEnum)
+    {
+        case KNetworkAttachmentType_NAT:        return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT;
+        case KNetworkAttachmentType_Bridged:    return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgetAdapter;
+        case KNetworkAttachmentType_Internal:   return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork;
+        case KNetworkAttachmentType_HostOnly:   return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter;
+        case KNetworkAttachmentType_Generic:    return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver;
+        case KNetworkAttachmentType_NATNetwork: return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork;
+        default:                                return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid;
+    }
+}
+
 void UIMachineSettingsNetwork::populateComboboxes()
 {
@@ -768,33 +783,22 @@
 
         /* Populate attachments: */
+        const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork enmRestrictedNetworkAttachmentTypes =
+            gEDataManager->restrictedNetworkAttachmentTypes();
         int iAttachmentTypeIndex = 0;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Null));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Null);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_NAT));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NAT);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_NATNetwork));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_NATNetwork);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Bridged));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Bridged);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Internal));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Internal);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_HostOnly));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_HostOnly);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
-        m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(KNetworkAttachmentType_Generic));
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, KNetworkAttachmentType_Generic);
-        m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
-        ++iAttachmentTypeIndex;
+        /* We want some hardcoded order, so prepare a list of enum values: */
+        QList<KNetworkAttachmentType> attachmentTypes  = QList<KNetworkAttachmentType>() << KNetworkAttachmentType_Null
+                                                      << KNetworkAttachmentType_NAT << KNetworkAttachmentType_NATNetwork
+                                                      << KNetworkAttachmentType_Bridged << KNetworkAttachmentType_Internal
+                                                      << KNetworkAttachmentType_HostOnly << KNetworkAttachmentType_Generic;
+        for (int i = 0; i < attachmentTypes.size(); ++i)
+        {
+            const KNetworkAttachmentType enmType = attachmentTypes.at(i);
+            if (enmRestrictedNetworkAttachmentTypes & toInternalNetworkAdapterEnum(enmType))
+                continue;
+            m_pAttachmentTypeComboBox->insertItem(iAttachmentTypeIndex, gpConverter->toString(enmType));
+            m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, enmType);
+            m_pAttachmentTypeComboBox->setItemData(iAttachmentTypeIndex, m_pAttachmentTypeComboBox->itemText(iAttachmentTypeIndex), Qt::ToolTipRole);
+            ++iAttachmentTypeIndex;
+        }
 
         /* Restore the previously selected attachment type: */
@@ -1639,3 +1643,2 @@
 
 # include "UIMachineSettingsNetwork.moc"
-
