Index: trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 71923)
+++ trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 71924)
@@ -565,5 +565,4 @@
 	src/widgets/UIMiniToolBar.h \
 	src/widgets/VBoxOSTypeSelectorButton.h \
-	src/widgets/UINameAndSystemEditor.h \
 	src/widgets/UIWarningPane.h \
 	src/widgets/graphics/UIGraphicsButton.h \
@@ -686,4 +685,5 @@
 	src/widgets/UIMediumSizeEditor.h \
 	src/widgets/UIMenuBar.h \
+	src/widgets/UINameAndSystemEditor.h \
 	src/widgets/UIPopupBox.h \
 	src/widgets/UIPopupPane.h \
@@ -780,4 +780,5 @@
 	src/widgets/UIMediumSizeEditor.h \
 	src/widgets/UIMenuBar.h \
+	src/widgets/UINameAndSystemEditor.h \
 	src/widgets/UIPopupBox.h \
 	src/widgets/UIPopupPane.h \
@@ -1058,5 +1059,4 @@
 	src/widgets/UIMiniToolBar.cpp \
 	src/widgets/VBoxOSTypeSelectorButton.cpp \
-	src/widgets/UINameAndSystemEditor.cpp \
 	src/widgets/UIWarningPane.cpp \
 	src/widgets/graphics/UIGraphicsButton.cpp \
@@ -1218,4 +1218,5 @@
 	src/widgets/UIMediumSizeEditor.cpp \
 	src/widgets/UIMenuBar.cpp \
+	src/widgets/UINameAndSystemEditor.cpp \
 	src/widgets/UIPopupBox.cpp \
 	src/widgets/UIPopupPane.cpp \
@@ -1338,4 +1339,5 @@
 	src/widgets/UIMediumSizeEditor.cpp \
 	src/widgets/UIMenuBar.cpp \
+	src/widgets/UINameAndSystemEditor.cpp \
 	src/widgets/UIPopupBox.cpp \
 	src/widgets/UIPopupPane.cpp \
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 71923)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 71924)
@@ -26,7 +26,8 @@
 /* GUI includes: */
 # include "QIWidgetValidator.h"
+# include "VBoxGlobal.h"
 # include "UIConverter.h"
+# include "UIErrorString.h"
 # include "UIMachineSettingsGeneral.h"
-# include "UIErrorString.h"
 # include "UIModalWindowManager.h"
 # include "UIProgressDialog.h"
Index: trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp	(revision 71923)
+++ trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp	(revision 71924)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2008-2017 Oracle Corporation
+ * Copyright (C) 2008-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -21,13 +21,14 @@
 
 /* Qt includes: */
+# include <QComboBox>
 # include <QGridLayout>
-# include <QVBoxLayout>
 # include <QLabel>
 # include <QLineEdit>
-# include <QComboBox>
+# include <QVBoxLayout>
 
 /* GUI includes: */
+# include "VBoxGlobal.h"
+# include "UIFilePathSelector.h"
 # include "UINameAndSystemEditor.h"
-# include "UIFilePathSelector.h"
 
 /* COM includes: */
@@ -35,4 +36,5 @@
 
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
 
 /** Defines the VM OS type ID. */
@@ -61,4 +63,139 @@
 }
 
+QString UINameAndSystemEditor::name() const
+{
+    if (!m_fChooseLocation)
+        return m_pEditorName->text();
+    else
+        return m_pEditorLocation->path();
+}
+
+void UINameAndSystemEditor::setName(const QString &strName)
+{
+    if (!m_fChooseLocation)
+        m_pEditorName->setText(strName);
+    else
+        m_pEditorLocation->setPath(strName);
+}
+
+CGuestOSType UINameAndSystemEditor::type() const
+{
+    return m_enmType;
+}
+
+void UINameAndSystemEditor::setType(const CGuestOSType &enmType)
+{
+    // WORKAROUND:
+    // We're getting here with a NULL enmType when creating new VMs.
+    // Very annoying, so just workarounded for now.
+    /** @todo find out the reason and way to fix that.. */
+    if (enmType.isNull())
+        return;
+
+    /* Initialize variables: */
+    const QString strFamilyId = enmType.GetFamilyId();
+    const QString strTypeId = enmType.GetId();
+
+    /* Get/check family index: */
+    const int iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);
+    AssertMsg(iFamilyIndex != -1, ("Invalid family ID: '%s'", strFamilyId.toLatin1().constData()));
+    if (iFamilyIndex != -1)
+        m_pComboFamily->setCurrentIndex(iFamilyIndex);
+
+    /* Get/check type index: */
+    const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);
+    AssertMsg(iTypeIndex != -1, ("Invalid type ID: '%s'", strTypeId.toLatin1().constData()));
+    if (iTypeIndex != -1)
+        m_pComboType->setCurrentIndex(iTypeIndex);
+}
+
+void UINameAndSystemEditor::retranslateUi()
+{
+    m_pLabelName->setText(tr("N&ame:"));
+    m_pLabelFamily->setText(tr("&Type:"));
+    m_pLabelType->setText(tr("&Version:"));
+    if (!m_fChooseLocation)
+        m_pEditorName->setWhatsThis(tr("Holds the name of the virtual machine."));
+    else
+        m_pEditorLocation->setWhatsThis(tr("Holds the location of the virtual machine."));
+    m_pComboFamily->setWhatsThis(tr("Selects the operating system family that "
+                                    "you plan to install into this virtual machine."));
+    m_pComboType->setWhatsThis(tr("Selects the operating system type that "
+                                  "you plan to install into this virtual machine "
+                                  "(called a guest operating system)."));
+}
+
+void UINameAndSystemEditor::sltFamilyChanged(int iIndex)
+{
+    /* Lock the signals of m_pComboType to prevent it's reaction on clearing: */
+    m_pComboType->blockSignals(true);
+    m_pComboType->clear();
+
+    /* Populate combo-box with OS types related to currently selected family id: */
+    const QString strFamilyId = m_pComboFamily->itemData(iIndex, TypeID).toString();
+    const QList<CGuestOSType> types = vboxGlobal().vmGuestOSTypeList(strFamilyId);
+    for (int i = 0; i < types.size(); ++i)
+    {
+        /* Skip 64bit OS types is hardware virtualization or long mode is not supported: */
+        if (types.at(i).GetIs64Bit() && (!m_fSupportsHWVirtEx || !m_fSupportsLongMode))
+            continue;
+        const int iIndex = m_pComboType->count();
+        m_pComboType->insertItem(iIndex, types[i].GetDescription());
+        m_pComboType->setItemData(iIndex, types[i].GetId(), TypeID);
+    }
+
+    /* Select the most recently chosen item: */
+    if (m_currentIds.contains(strFamilyId))
+    {
+        const QString strTypeId = m_currentIds.value(strFamilyId);
+        const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);
+        if (iTypeIndex != -1)
+            m_pComboType->setCurrentIndex(iTypeIndex);
+    }
+    /* Or select Windows 7 item for Windows family as default: */
+    else if (strFamilyId == "Windows")
+    {
+        QString strDefaultID = "Windows7";
+        if (ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode)
+            strDefaultID += "_64";
+        const int iIndexWin7 = m_pComboType->findData(strDefaultID, TypeID);
+        if (iIndexWin7 != -1)
+            m_pComboType->setCurrentIndex(iIndexWin7);
+    }
+    /* Or select Oracle Linux item for Linux family as default: */
+    else if (strFamilyId == "Linux")
+    {
+        QString strDefaultID = "Oracle";
+        if (ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode)
+            strDefaultID += "_64";
+        const int iIndexUbuntu = m_pComboType->findData(strDefaultID, TypeID);
+        if (iIndexUbuntu != -1)
+            m_pComboType->setCurrentIndex(iIndexUbuntu);
+    }
+    /* Else simply select the first one present: */
+    else
+        m_pComboType->setCurrentIndex(0);
+
+    /* Update all the stuff: */
+    sltTypeChanged(m_pComboType->currentIndex());
+
+    /* Unlock the signals of m_pComboType: */
+    m_pComboType->blockSignals(false);
+}
+
+void UINameAndSystemEditor::sltTypeChanged(int iIndex)
+{
+    /* Save the new selected OS type: */
+    m_enmType = vboxGlobal().vmGuestOSType(m_pComboType->itemData(iIndex, TypeID).toString(),
+                                        m_pComboFamily->itemData(m_pComboFamily->currentIndex(), TypeID).toString());
+    m_pIconType->setPixmap(vboxGlobal().vmGuestOSTypePixmapDefault(m_enmType.GetId()));
+
+    /* Save the most recently used item: */
+    m_currentIds[m_enmType.GetFamilyId()] = m_enmType.GetId();
+
+    /* Notifies listeners about OS type change: */
+    emit sigOsTypeChanged();
+}
+
 void UINameAndSystemEditor::prepare()
 {
@@ -85,5 +222,5 @@
     /* Create main-layout: */
     QGridLayout *pMainLayout = new QGridLayout(this);
-    AssertPtrReturnVoid(pMainLayout);
+    if (pMainLayout)
     {
         /* Configure main-layout: */
@@ -92,5 +229,5 @@
         /* Create VM name label: */
         m_pLabelName = new QLabel;
-        AssertPtrReturnVoid(m_pLabelName);
+        if (m_pLabelName)
         {
             /* Configure VM name label: */
@@ -105,5 +242,5 @@
             /* Create VM name editor: */
             m_pEditorName = new QLineEdit;
-            AssertPtrReturnVoid(m_pEditorName);
+            if (m_pEditorName)
             {
                 /* Configure VM name editor: */
@@ -118,5 +255,5 @@
             /* Create VM location editor: */
             m_pEditorLocation = new UIFilePathSelector;
-            AssertPtrReturnVoid(m_pEditorLocation);
+            if (m_pEditorLocation)
             {
                 /* Configure advanced VM name editor: */
@@ -133,5 +270,5 @@
         /* Create VM OS family label: */
         m_pLabelFamily = new QLabel;
-        AssertPtrReturnVoid(m_pLabelFamily);
+        if (m_pLabelFamily)
         {
             /* Configure VM OS family label: */
@@ -144,5 +281,5 @@
         /* Create VM OS family combo: */
         m_pComboFamily = new QComboBox;
-        AssertPtrReturnVoid(m_pComboFamily);
+        if (m_pComboFamily)
         {
             /* Configure VM OS family combo: */
@@ -155,5 +292,5 @@
         /* Create VM OS type label: */
         m_pLabelType = new QLabel;
-        AssertPtrReturnVoid(m_pLabelType);
+        if (m_pLabelType)
         {
             /* Configure VM OS type label: */
@@ -166,5 +303,5 @@
         /* Create VM OS type combo: */
         m_pComboType = new QComboBox;
-        AssertPtrReturnVoid(m_pComboType);
+        if (m_pComboType)
         {
             /* Configure VM OS type combo: */
@@ -177,9 +314,9 @@
         /* Create sub-layout: */
         QVBoxLayout *pLayoutIcon = new QVBoxLayout;
-        AssertPtrReturnVoid(pLayoutIcon);
+        if (pLayoutIcon)
         {
             /* Create VM OS type icon: */
             m_pIconType = new QLabel;
-            AssertPtrReturnVoid(m_pIconType);
+            if (m_pIconType)
             {
                 /* Configure VM OS type icon: */
@@ -222,143 +359,12 @@
     /* Prepare connections: */
     if (!m_fChooseLocation)
-        connect(m_pEditorName, SIGNAL(textChanged(const QString &)), this, SIGNAL(sigNameChanged(const QString &)));
-    else
-        connect(m_pEditorLocation, SIGNAL(pathChanged(const QString &)), this, SIGNAL(sigNameChanged(const QString &)));
-    connect(m_pComboFamily, SIGNAL(currentIndexChanged(int)), this, SLOT(sltFamilyChanged(int)));
-    connect(m_pComboType, SIGNAL(currentIndexChanged(int)), this, SLOT(sltTypeChanged(int)));
-}
-
-QString UINameAndSystemEditor::name() const
-{
-    if (!m_fChooseLocation)
-        return m_pEditorName->text();
-    else
-        return m_pEditorLocation->path();
-}
-
-void UINameAndSystemEditor::setName(const QString &strName)
-{
-    if (!m_fChooseLocation)
-        m_pEditorName->setText(strName);
-    else
-        m_pEditorLocation->setPath(strName);
-}
-
-CGuestOSType UINameAndSystemEditor::type() const
-{
-    return m_type;
-}
-
-void UINameAndSystemEditor::setType(const CGuestOSType &type)
-{
-    /** @todo We're getting here with a NULL type when creating new VMs.  Very
-     *        annoying, so I've just shut it up for now.  Sergey and Santosh can try
-     *        figure out why this happens now with Qt5. */
-    if (type.isNotNull())
-    {
-        /* Initialize variables: */
-        const QString strFamilyId = type.GetFamilyId();
-        const QString strTypeId = type.GetId();
-
-        /* Get/check family index: */
-        const int iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);
-        AssertMsg(iFamilyIndex != -1, ("Invalid family ID: '%s'", strFamilyId.toLatin1().constData()));
-        if (iFamilyIndex != -1)
-            m_pComboFamily->setCurrentIndex(iFamilyIndex);
-
-        /* Get/check type index: */
-        const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);
-        AssertMsg(iTypeIndex != -1, ("Invalid type ID: '%s'", strTypeId.toLatin1().constData()));
-        if (iTypeIndex != -1)
-            m_pComboType->setCurrentIndex(iTypeIndex);
-    }
-}
-
-void UINameAndSystemEditor::retranslateUi()
-{
-    m_pLabelName->setText(tr("N&ame:"));
-    m_pLabelFamily->setText(tr("&Type:"));
-    m_pLabelType->setText(tr("&Version:"));
-    if (!m_fChooseLocation)
-        m_pEditorName->setWhatsThis(tr("Holds the name of the virtual machine."));
-    else
-        m_pEditorLocation->setWhatsThis(tr("Holds the location of the virtual machine."));
-    m_pComboFamily->setWhatsThis(tr("Selects the operating system family that "
-                                    "you plan to install into this virtual machine."));
-    m_pComboType->setWhatsThis(tr("Selects the operating system type that "
-                                  "you plan to install into this virtual machine "
-                                  "(called a guest operating system)."));
-}
-
-void UINameAndSystemEditor::sltFamilyChanged(int iIndex)
-{
-    /* Lock the signals of m_pComboType to prevent it's reaction on clearing: */
-    m_pComboType->blockSignals(true);
-    m_pComboType->clear();
-
-    /* Populate combo-box with OS types related to currently selected family id: */
-    const QString strFamilyId = m_pComboFamily->itemData(iIndex, TypeID).toString();
-    const QList<CGuestOSType> types = vboxGlobal().vmGuestOSTypeList(strFamilyId);
-    for (int i = 0; i < types.size(); ++i)
-    {
-        /* Skip 64bit OS types is hardware virtualization or long mode is not supported: */
-        if (types.at(i).GetIs64Bit() && (!m_fSupportsHWVirtEx || !m_fSupportsLongMode))
-            continue;
-        const int iIndex = m_pComboType->count();
-        m_pComboType->insertItem(iIndex, types[i].GetDescription());
-        m_pComboType->setItemData(iIndex, types[i].GetId(), TypeID);
-    }
-
-    /* Select the most recently chosen item: */
-    if (m_currentIds.contains(strFamilyId))
-    {
-        const QString strTypeId = m_currentIds.value(strFamilyId);
-        const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);
-        if (iTypeIndex != -1)
-            m_pComboType->setCurrentIndex(iTypeIndex);
-    }
-    /* Or select Windows 7 item for Windows family as default: */
-    else if (strFamilyId == "Windows")
-    {
-        QString strDefaultID = "Windows7";
-        if (ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode)
-            strDefaultID += "_64";
-        const int iIndexWin7 = m_pComboType->findData(strDefaultID, TypeID);
-        if (iIndexWin7 != -1)
-            m_pComboType->setCurrentIndex(iIndexWin7);
-    }
-    /* Or select Oracle Linux item for Linux family as default: */
-    else if (strFamilyId == "Linux")
-    {
-        QString strDefaultID = "Oracle";
-        if (ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode)
-            strDefaultID += "_64";
-        const int iIndexUbuntu = m_pComboType->findData(strDefaultID, TypeID);
-        if (iIndexUbuntu != -1)
-            m_pComboType->setCurrentIndex(iIndexUbuntu);
-    }
-    /* Else simply select the first one present: */
-    else
-        m_pComboType->setCurrentIndex(0);
-
-    /* Update all the stuff: */
-    sltTypeChanged(m_pComboType->currentIndex());
-
-    /* Unlock the signals of m_pComboType: */
-    m_pComboType->blockSignals(false);
-}
-
-void UINameAndSystemEditor::sltTypeChanged(int iIndex)
-{
-    /* Save the new selected OS type: */
-    m_type = vboxGlobal().vmGuestOSType(m_pComboType->itemData(iIndex, TypeID).toString(),
-                                        m_pComboFamily->itemData(m_pComboFamily->currentIndex(), TypeID).toString());
-    m_pIconType->setPixmap(vboxGlobal().vmGuestOSTypePixmapDefault(m_type.GetId()));
-
-    /* Save the most recently used item: */
-    m_currentIds[m_type.GetFamilyId()] = m_type.GetId();
-
-    /* Notifies listeners about OS type change: */
-    emit sigOsTypeChanged();
-}
-
+        connect(m_pEditorName, &QLineEdit::textChanged,
+                this, &UINameAndSystemEditor::sigNameChanged);
+    else
+        connect(m_pEditorLocation, &UIFilePathSelector::pathChanged,
+                this, &UINameAndSystemEditor::sigNameChanged);
+    connect(m_pComboFamily, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+            this, &UINameAndSystemEditor::sltFamilyChanged);
+    connect(m_pComboType, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+            this, &UINameAndSystemEditor::sltTypeChanged);
+}
Index: trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h	(revision 71923)
+++ trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h	(revision 71924)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2008-2017 Oracle Corporation
+ * Copyright (C) 2008-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,14 +24,19 @@
 /* GUI includes: */
 #include "QIWithRetranslateUI.h"
-#include "VBoxGlobal.h"
+#include "UILibraryDefs.h"
+
+/* COM includes: */
+#include "COMEnums.h"
+#include "CGuestOSType.h"
 
 /* Forward declarations: */
+class QComboBox;
 class QLabel;
 class QLineEdit;
-class QComboBox;
+class QString;
 class UIFilePathSelector;
 
-/** QWidget extension providing complex editor for basic VM parameters. */
-class UINameAndSystemEditor : public QIWithRetranslateUI<QWidget>
+/** QWidget subclass providing complex editor for basic VM parameters. */
+class SHARED_LIBRARY_STUFF UINameAndSystemEditor : public QIWithRetranslateUI<QWidget>
 {
     Q_OBJECT;
@@ -49,12 +54,12 @@
 public:
 
-    /** Constructs VM parameters editor on the basis of passed @a pParent.
-      * @param fChooseFullPath determine whether we should propose to choose location. */
+    /** Constructs VM parameters editor passing @a pParent to the base-class.
+      * @param  fChooseFullPath  Brings whether we should propose to choose location. */
     UINameAndSystemEditor(QWidget *pParent, bool fChooseLocation = false);
 
     /** Returns the VM name editor. */
-    QLineEdit* nameEditor() const { return m_pEditorName; }
+    QLineEdit *nameEditor() const { return m_pEditorName; }
     /** Returns the VM location editor. */
-    UIFilePathSelector* locationEditor() const { return m_pEditorLocation; }
+    UIFilePathSelector *locationEditor() const { return m_pEditorLocation; }
 
     /** Returns the VM name. */
@@ -65,8 +70,21 @@
     /** Returns the VM OS type. */
     CGuestOSType type() const;
-    /** Defines the VM OS @a type. */
-    void setType(const CGuestOSType &type);
+    /** Defines the VM OS @a enmType. */
+    void setType(const CGuestOSType &enmType);
 
 protected:
+
+    /** Handles translation event. */
+    virtual void retranslateUi() /* override */;
+
+private slots:
+
+    /** Handles VM OS family @a iIndex change. */
+    void sltFamilyChanged(int iIndex);
+
+    /** Handles VM OS type @a iIndex change. */
+    void sltTypeChanged(int iIndex);
+
+private:
 
     /** @name Prepare cascade.
@@ -84,19 +102,6 @@
     /** @} */
 
-    /** Handles translation event. */
-    virtual void retranslateUi() /* override */;
-
-private slots:
-
-    /** Handles VM OS family @a iIndex change. */
-    void sltFamilyChanged(int iIndex);
-
-    /** Handles VM OS type @a iIndex change. */
-    void sltTypeChanged(int iIndex);
-
-private:
-
     /** Holds the VM OS type. */
-    CGuestOSType            m_type;
+    CGuestOSType            m_enmType;
     /** Holds the currently chosen OS type IDs on per-family basis. */
     QMap<QString, QString>  m_currentIds;
@@ -127,3 +132,2 @@
 
 #endif /* !___UINameAndSystemEditor_h___ */
-
Index: trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp	(revision 71923)
+++ trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp	(revision 71924)
@@ -22,16 +22,18 @@
 /* Qt includes: */
 # include <QDir>
+# include <QLineEdit>
+# include <QHBoxLayout>
 # include <QVBoxLayout>
-# include <QHBoxLayout>
-# include <QLineEdit>
 
 /* GUI includes: */
+# include "QIRichTextLabel.h"
+# include "VBoxGlobal.h"
+# include "UIMessageCenter.h"
+# include "UINameAndSystemEditor.h"
 # include "UIWizardNewVMPageBasic1.h"
 # include "UIWizardNewVM.h"
-# include "UIMessageCenter.h"
-# include "UINameAndSystemEditor.h"
-# include "QIRichTextLabel.h"
 
 /* COM includes: */
+# include "CHost.h"
 # include "CSystemProperties.h"
 
