Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp	(revision 60707)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp	(revision 60708)
@@ -42,9 +42,33 @@
     : QIWithRetranslateUI<QWidget>(pParent)
 {
-    /* Register CGuestOSType type: */
-    qRegisterMetaType<CGuestOSType>();
-
+    /* Prepare: */
+    prepare();
+}
+
+void UINameAndSystemEditor::prepare()
+{
+    /* Prepare this: */
+    prepareThis();
+    /* Prepare widgets: */
+    prepareWidgets();
+    /* Prepare connections: */
+    prepareConnections();
+    /* Retranslate: */
+    retranslateUi();
+}
+
+void UINameAndSystemEditor::prepareThis()
+{
+    /* Check if host supports (AMD-V or VT-x) and long mode: */
+    CHost host = vboxGlobal().host();
+    m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
+    m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
+}
+
+void UINameAndSystemEditor::prepareWidgets()
+{
     /* Create main-layout: */
     QGridLayout *pMainLayout = new QGridLayout(this);
+    AssertPtrReturnVoid(pMainLayout);
     {
         /* Configure main-layout: */
@@ -53,4 +77,5 @@
         /* Create VM name label: */
         m_pLabelName = new QLabel;
+        AssertPtrReturnVoid(m_pLabelName);
         {
             /* Configure VM name label: */
@@ -63,4 +88,5 @@
         /* Create VM name editor: */
         m_pEditorName = new QLineEdit;
+        AssertPtrReturnVoid(m_pEditorName);
         {
             /* Configure VM name editor: */
@@ -73,4 +99,5 @@
         /* Create VM OS family label: */
         m_pLabelFamily = new QLabel;
+        AssertPtrReturnVoid(m_pLabelFamily);
         {
             /* Configure VM OS family label: */
@@ -83,4 +110,5 @@
         /* Create VM OS family combo: */
         m_pComboFamily = new QComboBox;
+        AssertPtrReturnVoid(m_pComboFamily);
         {
             /* Configure VM OS family combo: */
@@ -93,4 +121,5 @@
         /* Create VM OS type label: */
         m_pLabelType = new QLabel;
+        AssertPtrReturnVoid(m_pLabelType);
         {
             /* Configure VM OS type label: */
@@ -103,4 +132,5 @@
         /* Create VM OS type combo: */
         m_pComboType = new QComboBox;
+        AssertPtrReturnVoid(m_pComboType);
         {
             /* Configure VM OS type combo: */
@@ -113,7 +143,9 @@
         /* Create sub-layout: */
         QVBoxLayout *pLayoutIcon = new QVBoxLayout;
+        AssertPtrReturnVoid(pLayoutIcon);
         {
             /* Create VM OS type icon: */
             m_pIconType = new QLabel;
+            AssertPtrReturnVoid(m_pIconType);
             {
                 /* Configure VM OS type icon: */
@@ -122,4 +154,5 @@
                 pLayoutIcon->addWidget(m_pIconType);
             }
+
             /* Add stretch to sub-layout: */
             pLayoutIcon->addStretch();
@@ -129,10 +162,12 @@
     }
 
-    /* Check if host supports (AMD-V or VT-x) and long mode: */
-    CHost host = vboxGlobal().host();
-    m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
-    m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
-
-    /* Fill OS family selector: */
+    /* Initialize VM OS family combo
+     * after all widgets were created: */
+    prepareFamilyCombo();
+}
+
+void UINameAndSystemEditor::prepareFamilyCombo()
+{
+    /* Populate VM OS family combo: */
     const QList<CGuestOSType> families = vboxGlobal().vmGuestOSFamilyList();
     for (int i = 0; i < families.size(); ++i)
@@ -142,14 +177,17 @@
         m_pComboFamily->setItemData(i, families.at(i).GetFamilyId(), TypeID);
     }
+
+    /* Choose the 1st item to be the current: */
     m_pComboFamily->setCurrentIndex(0);
+    /* And update the linked widgets accordingly: */
     sltFamilyChanged(m_pComboFamily->currentIndex());
-
-    /* Setup connections: */
+}
+
+void UINameAndSystemEditor::prepareConnections()
+{
+    /* Prepare connections: */
     connect(m_pEditorName, SIGNAL(textChanged(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)));
-
-    /* Retranslate: */
-    retranslateUi();
 }
 
@@ -261,5 +299,5 @@
 void UINameAndSystemEditor::sltTypeChanged(int iIndex)
 {
-    /* Save the new selected OS Type: */
+    /* Save the new selected OS type: */
     m_type = vboxGlobal().vmGuestOSType(m_pComboType->itemData(iIndex, TypeID).toString(),
                                         m_pComboFamily->itemData(m_pComboFamily->currentIndex(), TypeID).toString());
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h	(revision 60707)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h	(revision 60708)
@@ -66,4 +66,18 @@
 protected:
 
+    /** @name Prepare cascade.
+      * @{ */
+        /** Prepares all. */
+        void prepare();
+        /** Prepares this. */
+        void prepareThis();
+        /** Prepares widgets. */
+        void prepareWidgets();
+        /** Prepares VM OS family combo. */
+        void prepareFamilyCombo();
+        /** Prepares connections. */
+        void prepareConnections();
+    /** @} */
+
     /** Handles translation event. */
     virtual void retranslateUi() /* override */;
