Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp	(revision 80000)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp	(revision 80042)
@@ -45,9 +45,11 @@
         : m_iCurrentVRAM(0)
         , m_cGuestScreenCount(0)
+        , m_graphicsControllerType(KGraphicsControllerType_Null)
+#ifdef VBOX_WITH_CRHGSMI
         , m_f3dAccelerationEnabled(false)
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
-        , m_f2dAccelerationEnabled(false)
-#endif /* VBOX_WITH_VIDEOHWACCEL */
-        , m_graphicsControllerType(KGraphicsControllerType_Null)
+        , m_f2dVideoAccelerationEnabled(false)
+#endif
         , m_fRemoteDisplayServerSupported(false)
         , m_fRemoteDisplayServerEnabled(false)
@@ -73,9 +75,11 @@
                && (m_cGuestScreenCount == other.m_cGuestScreenCount)
                && (m_scaleFactors == other.m_scaleFactors)
+               && (m_graphicsControllerType == other.m_graphicsControllerType)
+#ifdef VBOX_WITH_CRHGSMI
                && (m_f3dAccelerationEnabled == other.m_f3dAccelerationEnabled)
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
-               && (m_f2dAccelerationEnabled == other.m_f2dAccelerationEnabled)
-#endif /* VBOX_WITH_VIDEOHWACCEL */
-               && (m_graphicsControllerType == other.m_graphicsControllerType)
+               && (m_f2dVideoAccelerationEnabled == other.m_f2dVideoAccelerationEnabled)
+#endif
                && (m_fRemoteDisplayServerSupported == other.m_fRemoteDisplayServerSupported)
                && (m_fRemoteDisplayServerEnabled == other.m_fRemoteDisplayServerEnabled)
@@ -237,12 +241,14 @@
     /** Holds the guest screen scale-factor. */
     QList<double>            m_scaleFactors;
+    /** Holds the graphics controller type. */
+    KGraphicsControllerType  m_graphicsControllerType;
+#ifdef VBOX_WITH_CRHGSMI
     /** Holds whether the 3D acceleration is enabled. */
     bool                     m_f3dAccelerationEnabled;
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
     /** Holds whether the 2D video acceleration is enabled. */
-    bool                     m_f2dAccelerationEnabled;
-#endif /* VBOX_WITH_VIDEOHWACCEL */
-    /** Holds the graphics controller type. */
-    KGraphicsControllerType  m_graphicsControllerType;
+    bool                     m_f2dVideoAccelerationEnabled;
+#endif
     /** Holds whether the remote display server is supported. */
     bool                     m_fRemoteDisplayServerSupported;
@@ -280,14 +286,15 @@
 
 UIMachineSettingsDisplay::UIMachineSettingsDisplay()
-    : m_iMinVRAM(0)
+    : m_comGuestOSType(CGuestOSType())
+    , m_iMinVRAM(0)
     , m_iMaxVRAM(0)
     , m_iMaxVRAMVisible(0)
     , m_iInitialVRAM(0)
+#ifdef VBOX_WITH_CRHGSMI
+    , m_fWddmModeSupported(false)
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
     , m_f2DVideoAccelerationSupported(false)
-#endif /* VBOX_WITH_VIDEOHWACCEL */
-#ifdef VBOX_WITH_CRHGSMI
-    , m_fWddmModeSupported(false)
-#endif /* VBOX_WITH_CRHGSMI */
+#endif
     , m_pCache(0)
 {
@@ -304,11 +311,16 @@
 void UIMachineSettingsDisplay::setGuestOSType(CGuestOSType comGuestOSType)
 {
-    /* Check if guest os type changed: */
+    /* Check if guest OS type changed: */
     if (m_comGuestOSType == comGuestOSType)
         return;
 
-    /* Remember new guest os type: */
+    /* Remember new guest OS type: */
     m_comGuestOSType = comGuestOSType;
 
+#ifdef VBOX_WITH_CRHGSMI
+    /* Check if WDDM mode supported by the guest OS type: */
+    const QString strGuestOSTypeId = m_comGuestOSType.isNotNull() ? m_comGuestOSType.GetId() : QString();
+    m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(strGuestOSTypeId);
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
     /* Check if 2D video acceleration supported by the guest OS type: */
@@ -316,9 +328,4 @@
     m_f2DVideoAccelerationSupported = strGuestOSTypeFamily == "Windows";
 #endif
-#ifdef VBOX_WITH_CRHGSMI
-    /* Check if WDDM mode supported by the guest OS type: */
-    const QString strGuestOSTypeId = m_comGuestOSType.isNotNull() ? m_comGuestOSType.GetId() : QString();
-    m_fWddmModeSupported = UICommon::isWddmCompatibleOsType(strGuestOSTypeId);
-#endif
 
     /* Recheck video RAM requirement: */
@@ -356,9 +363,11 @@
     oldDisplayData.m_cGuestScreenCount = m_machine.GetMonitorCount();
     oldDisplayData.m_scaleFactors = gEDataManager->scaleFactors(m_machine.GetId());
+    oldDisplayData.m_graphicsControllerType = m_machine.GetGraphicsControllerType();
+#ifdef VBOX_WITH_CRHGSMI
     oldDisplayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled();
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
-    oldDisplayData.m_f2dAccelerationEnabled = m_machine.GetAccelerate2DVideoEnabled();
-#endif
-    oldDisplayData.m_graphicsControllerType = m_machine.GetGraphicsControllerType();
+    oldDisplayData.m_f2dVideoAccelerationEnabled = m_machine.GetAccelerate2DVideoEnabled();
+#endif
     /* Check whether remote display server is valid: */
     const CVRDEServer &vrdeServer = m_machine.GetVRDEServer();
@@ -420,10 +429,12 @@
     m_pScaleFactorEditor->setScaleFactors(oldDisplayData.m_scaleFactors);
     m_pScaleFactorEditor->setMonitorCount(oldDisplayData.m_cGuestScreenCount);
+    m_pComboGraphicsControllerType->setCurrentIndex(m_pComboGraphicsControllerType->findText(gpConverter->toString(oldDisplayData.m_graphicsControllerType)));
+#ifdef VBOX_WITH_CRHGSMI
     m_pCheckbox3D->setChecked(oldDisplayData.m_f3dAccelerationEnabled);
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
-    m_pCheckbox2DVideo->setChecked(oldDisplayData.m_f2dAccelerationEnabled);
-#endif
-    m_pComboGraphicsControllerType->setCurrentIndex(m_pComboGraphicsControllerType->findText(gpConverter->toString(oldDisplayData.m_graphicsControllerType)));
-    // Should be the last one for this tab:
+    m_pCheckbox2DVideo->setChecked(oldDisplayData.m_f2dVideoAccelerationEnabled);
+#endif
+    // Should be the last one for this tab, since it depends on some of others:
     m_pEditorVideoMemorySize->setValue(oldDisplayData.m_iCurrentVRAM);
 
@@ -479,9 +490,11 @@
     newDisplayData.m_cGuestScreenCount = m_pEditorVideoScreenCount->value();
     newDisplayData.m_scaleFactors = m_pScaleFactorEditor->scaleFactors();
+    newDisplayData.m_graphicsControllerType = gpConverter->fromString<KGraphicsControllerType>(m_pComboGraphicsControllerType->currentText());
+#ifdef VBOX_WITH_CRHGSMI
     newDisplayData.m_f3dAccelerationEnabled = m_pCheckbox3D->isChecked();
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
-    newDisplayData.m_f2dAccelerationEnabled = m_pCheckbox2DVideo->isChecked();
-#endif
-    newDisplayData.m_graphicsControllerType = gpConverter->fromString<KGraphicsControllerType>(m_pComboGraphicsControllerType->currentText());
+    newDisplayData.m_f2dVideoAccelerationEnabled = m_pCheckbox2DVideo->isChecked();
+#endif
     /* If remote display server is supported: */
     newDisplayData.m_fRemoteDisplayServerSupported = m_pCache->base().m_fRemoteDisplayServerSupported;
@@ -565,12 +578,4 @@
         message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(0));
 
-        /* 3D acceleration test: */
-        if (m_pCheckbox3D->isChecked() && !uiCommon().is3DAvailable())
-        {
-            message.second << tr("The virtual machine is set up to use hardware graphics acceleration. "
-                                 "However the host system does not currently provide this, "
-                                 "so you will not be able to start the machine.");
-        }
-
         /* Video RAM amount test: */
         if (shouldWeWarnAboutLowVRAM() && !m_comGuestOSType.isNull())
@@ -585,17 +590,4 @@
                                      .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp));
             }
-#ifdef VBOX_WITH_VIDEOHWACCEL
-            /* 2D acceleration video RAM amount test: */
-            else if (m_pCheckbox2DVideo->isChecked() && m_f2DVideoAccelerationSupported)
-            {
-                uNeedBytes += VBox2DHelpers::required2DOffscreenVideoMemory();
-                if ((quint64)m_pEditorVideoMemorySize->value() * _1M < uNeedBytes)
-                {
-                    message.second << tr("The virtual machine is currently assigned less than <b>%1</b> of video memory "
-                                         "which is the minimum amount required for High Definition Video to be played efficiently.")
-                                         .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp));
-                }
-            }
-#endif /* VBOX_WITH_VIDEOHWACCEL */
 #ifdef VBOX_WITH_CRHGSMI
             /* 3D acceleration video RAM amount test: */
@@ -612,5 +604,28 @@
             }
 #endif /* VBOX_WITH_CRHGSMI */
-        }
+#ifdef VBOX_WITH_VIDEOHWACCEL
+            /* 2D acceleration video RAM amount test: */
+            else if (m_pCheckbox2DVideo->isChecked() && m_f2DVideoAccelerationSupported)
+            {
+                uNeedBytes += VBox2DHelpers::required2DOffscreenVideoMemory();
+                if ((quint64)m_pEditorVideoMemorySize->value() * _1M < uNeedBytes)
+                {
+                    message.second << tr("The virtual machine is currently assigned less than <b>%1</b> of video memory "
+                                         "which is the minimum amount required for High Definition Video to be played efficiently.")
+                                         .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp));
+                }
+            }
+#endif /* VBOX_WITH_VIDEOHWACCEL */
+        }
+
+#ifdef VBOX_WITH_CRHGSMI
+        /* 3D acceleration test: */
+        if (m_pCheckbox3D->isChecked() && !uiCommon().is3DAvailable())
+        {
+            message.second << tr("The virtual machine is set up to use hardware graphics acceleration. "
+                                 "However the host system does not currently provide this, "
+                                 "so you will not be able to start the machine.");
+        }
+#endif /* VBOX_WITH_CRHGSMI */
 
 #ifdef VBOX_WITH_VIDEOHWACCEL
@@ -678,11 +693,6 @@
     setTabOrder(m_pEditorVideoMemorySize, m_pSliderVideoScreenCount);
     setTabOrder(m_pSliderVideoScreenCount, m_pEditorVideoScreenCount);
-#ifdef VBOX_WITH_VIDEOHWACCEL
-    setTabOrder(m_pCheckbox3D, m_pCheckbox2DVideo);
-    setTabOrder(m_pCheckbox2DVideo, m_pComboGraphicsControllerType);
-#else /* VBOX_WITH_VIDEOHWACCEL */
-    setTabOrder(m_pCheckbox3D, m_pComboGraphicsControllerType);
-#endif /* !VBOX_WITH_VIDEOHWACCEL */
-    setTabOrder(m_pComboGraphicsControllerType, m_pCheckboxRemoteDisplay);
+    setTabOrder(m_pEditorVideoScreenCount, m_pScaleFactorEditor);
+    setTabOrder(m_pScaleFactorEditor, m_pComboGraphicsControllerType);
 
     /* Remote Display tab-order: */
@@ -764,10 +774,14 @@
     m_pScaleFactorEditor->setEnabled(isMachineInValidMode());
     m_pLabelVideoOptions->setEnabled(isMachineOffline());
+#ifdef VBOX_WITH_CRHGSMI
     m_pCheckbox3D->setEnabled(isMachineOffline());
+#else
+    m_pCheckbox3D->hide();
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
     m_pCheckbox2DVideo->setEnabled(isMachineOffline() && VBox2DHelpers::isAcceleration2DVideoAvailable());
-#else /* !VBOX_WITH_VIDEOHWACCEL */
+#else
     m_pCheckbox2DVideo->hide();
-#endif /* !VBOX_WITH_VIDEOHWACCEL */
+#endif
     m_pComboGraphicsControllerType->setEnabled(isMachineOffline());
 
@@ -1208,8 +1222,11 @@
     connect(m_pSliderVideoScreenCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenCountSliderChange()));
     connect(m_pEditorVideoScreenCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenCountEditorChange()));
-
-    connect(m_pCheckbox3D, SIGNAL(stateChanged(int)), this, SLOT(revalidate()));
+#ifdef VBOX_WITH_CRHGSMI
+    connect(m_pCheckbox3D, &QCheckBox::stateChanged,
+            this, &UIMachineSettingsDisplay::revalidate);
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
-    connect(m_pCheckbox2DVideo, SIGNAL(stateChanged(int)), this, SLOT(revalidate()));
+    connect(m_pCheckbox2DVideo, &QCheckBox::stateChanged,
+            this, &UIMachineSettingsDisplay::revalidate);
 #endif
 
@@ -1420,4 +1437,11 @@
             fSuccess = m_machine.isOk();
         }
+        /* Save the Graphics Controller Type: */
+        if (fSuccess && isMachineOffline() && newDisplayData.m_graphicsControllerType != oldDisplayData.m_graphicsControllerType)
+        {
+            m_machine.SetGraphicsControllerType(newDisplayData.m_graphicsControllerType);
+            fSuccess = m_machine.isOk();
+        }
+#ifdef VBOX_WITH_CRHGSMI
         /* Save whether 3D acceleration is enabled: */
         if (fSuccess && isMachineOffline() && newDisplayData.m_f3dAccelerationEnabled != oldDisplayData.m_f3dAccelerationEnabled)
@@ -1426,18 +1450,13 @@
             fSuccess = m_machine.isOk();
         }
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
         /* Save whether 2D video acceleration is enabled: */
-        if (fSuccess && isMachineOffline() && newDisplayData.m_f2dAccelerationEnabled != oldDisplayData.m_f2dAccelerationEnabled)
-        {
-            m_machine.SetAccelerate2DVideoEnabled(newDisplayData.m_f2dAccelerationEnabled);
+        if (fSuccess && isMachineOffline() && newDisplayData.m_f2dVideoAccelerationEnabled != oldDisplayData.m_f2dVideoAccelerationEnabled)
+        {
+            m_machine.SetAccelerate2DVideoEnabled(newDisplayData.m_f2dVideoAccelerationEnabled);
             fSuccess = m_machine.isOk();
         }
 #endif
-        /* Save the Graphics Controller Type: */
-        if (fSuccess && isMachineOffline() && newDisplayData.m_graphicsControllerType != oldDisplayData.m_graphicsControllerType)
-        {
-            m_machine.SetGraphicsControllerType(newDisplayData.m_graphicsControllerType);
-            fSuccess = m_machine.isOk();
-        }
 
         /* Get machine ID for further activities: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h	(revision 80000)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h	(revision 80042)
@@ -172,11 +172,11 @@
     /** Holds the initial VRAM value when the dialog is opened. */
     int           m_iInitialVRAM;
+#ifdef VBOX_WITH_CRHGSMI
+    /** Holds whether the guest OS supports WDDM. */
+    bool          m_fWddmModeSupported;
+#endif
 #ifdef VBOX_WITH_VIDEOHWACCEL
     /** Holds whether the guest OS supports 2D Video Acceleration. */
     bool          m_f2DVideoAccelerationSupported;
-#endif
-#ifdef VBOX_WITH_CRHGSMI
-    /** Holds whether the guest OS supports WDDM. */
-    bool          m_fWddmModeSupported;
 #endif
 
