Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 33882)
@@ -169,5 +169,5 @@
 	./src/settings \
 	./src/settings/global \
-	./src/settings/vm \
+	./src/settings/machine \
 	./src/wizards/newvm \
 	./src/wizards/newhd \
@@ -293,23 +293,23 @@
 	src/settings/UISettingsPage.h \
 	src/settings/VBoxSettingsSelector.h \
-	src/settings/global/VBoxGLSettingsGeneral.h \
-	src/settings/global/VBoxGLSettingsInput.h \
-	src/settings/global/VBoxGLSettingsUpdate.h \
-	src/settings/global/VBoxGLSettingsLanguage.h \
-	src/settings/global/VBoxGLSettingsNetwork.h \
-	src/settings/global/VBoxGLSettingsNetworkDetails.h \
-	src/settings/vm/VBoxVMSettingsGeneral.h \
-	src/settings/vm/VBoxVMSettingsSystem.h \
-	src/settings/vm/VBoxVMSettingsDisplay.h \
-	src/settings/vm/VBoxVMSettingsHD.h \
-	src/settings/vm/VBoxVMSettingsAudio.h \
-	src/settings/vm/VBoxVMSettingsNetwork.h \
-	src/settings/vm/VBoxVMSettingsPortForwardingDlg.h \
-	src/settings/vm/VBoxVMSettingsSerial.h \
-	src/settings/vm/VBoxVMSettingsParallel.h \
-	src/settings/vm/VBoxVMSettingsUSB.h \
-	src/settings/vm/VBoxVMSettingsUSBFilterDetails.h \
-	src/settings/vm/VBoxVMSettingsSF.h \
-	src/settings/vm/VBoxVMSettingsSFDetails.h \
+	src/settings/global/UIGlobalSettingsGeneral.h \
+	src/settings/global/UIGlobalSettingsInput.h \
+	src/settings/global/UIGlobalSettingsUpdate.h \
+	src/settings/global/UIGlobalSettingsLanguage.h \
+	src/settings/global/UIGlobalSettingsNetwork.h \
+	src/settings/global/UIGlobalSettingsNetworkDetails.h \
+	src/settings/machine/UIMachineSettingsGeneral.h \
+	src/settings/machine/UIMachineSettingsSystem.h \
+	src/settings/machine/UIMachineSettingsDisplay.h \
+	src/settings/machine/UIMachineSettingsStorage.h \
+	src/settings/machine/UIMachineSettingsAudio.h \
+	src/settings/machine/UIMachineSettingsNetwork.h \
+	src/settings/machine/UIMachineSettingsPortForwardingDlg.h \
+	src/settings/machine/UIMachineSettingsSerial.h \
+	src/settings/machine/UIMachineSettingsParallel.h \
+	src/settings/machine/UIMachineSettingsUSB.h \
+	src/settings/machine/UIMachineSettingsUSBFilterDetails.h \
+	src/settings/machine/UIMachineSettingsSF.h \
+	src/settings/machine/UIMachineSettingsSFDetails.h \
 	src/wizards/newvm/UINewVMWzd.h \
 	src/wizards/newhd/UINewHDWzd.h \
@@ -380,5 +380,5 @@
 	src/selector/UIVMDesktop.cpp \
 	src/settings/UISettingsDialogSpecific.cpp \
-	src/settings/vm/VBoxVMSettingsPortForwardingDlg.cpp \
+	src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp \
 	src/runtime/UIActionsPool.cpp \
 	src/runtime/UIIndicatorsPool.cpp \
@@ -454,23 +454,23 @@
 	src/settings/UISettingsPage.cpp \
 	src/settings/VBoxSettingsSelector.cpp \
-	src/settings/global/VBoxGLSettingsGeneral.cpp \
-	src/settings/global/VBoxGLSettingsInput.cpp \
-	src/settings/global/VBoxGLSettingsUpdate.cpp \
-	src/settings/global/VBoxGLSettingsLanguage.cpp \
-	src/settings/global/VBoxGLSettingsNetwork.cpp \
-	src/settings/global/VBoxGLSettingsNetworkDetails.cpp \
-	src/settings/vm/VBoxVMSettingsGeneral.cpp \
-	src/settings/vm/VBoxVMSettingsSystem.cpp \
-	src/settings/vm/VBoxVMSettingsDisplay.cpp \
-	src/settings/vm/VBoxVMSettingsHD.cpp \
-	src/settings/vm/VBoxVMSettingsAudio.cpp \
-	src/settings/vm/VBoxVMSettingsNetwork.cpp \
-	src/settings/vm/VBoxVMSettingsPortForwardingDlg.cpp \
-	src/settings/vm/VBoxVMSettingsSerial.cpp \
-	src/settings/vm/VBoxVMSettingsParallel.cpp \
-	src/settings/vm/VBoxVMSettingsUSB.cpp \
-	src/settings/vm/VBoxVMSettingsUSBFilterDetails.cpp \
-	src/settings/vm/VBoxVMSettingsSF.cpp \
-	src/settings/vm/VBoxVMSettingsSFDetails.cpp \
+	src/settings/global/UIGlobalSettingsGeneral.cpp \
+	src/settings/global/UIGlobalSettingsInput.cpp \
+	src/settings/global/UIGlobalSettingsUpdate.cpp \
+	src/settings/global/UIGlobalSettingsLanguage.cpp \
+	src/settings/global/UIGlobalSettingsNetwork.cpp \
+	src/settings/global/UIGlobalSettingsNetworkDetails.cpp \
+	src/settings/machine/UIMachineSettingsGeneral.cpp \
+	src/settings/machine/UIMachineSettingsSystem.cpp \
+	src/settings/machine/UIMachineSettingsDisplay.cpp \
+	src/settings/machine/UIMachineSettingsStorage.cpp \
+	src/settings/machine/UIMachineSettingsAudio.cpp \
+	src/settings/machine/UIMachineSettingsNetwork.cpp \
+	src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp \
+	src/settings/machine/UIMachineSettingsSerial.cpp \
+	src/settings/machine/UIMachineSettingsParallel.cpp \
+	src/settings/machine/UIMachineSettingsUSB.cpp \
+	src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp \
+	src/settings/machine/UIMachineSettingsSF.cpp \
+	src/settings/machine/UIMachineSettingsSFDetails.cpp \
 	src/wizards/newvm/UINewVMWzd.cpp \
 	src/wizards/newhd/UINewHDWzd.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 33882)
@@ -29,22 +29,22 @@
     src/VBoxVMLogViewer.ui \
     src/settings/UISettingsDialog.ui \
-    src/settings/vm/VBoxVMSettingsGeneral.ui \
-    src/settings/vm/VBoxVMSettingsSystem.ui \
-    src/settings/vm/VBoxVMSettingsDisplay.ui \
-    src/settings/vm/VBoxVMSettingsHD.ui \
-    src/settings/vm/VBoxVMSettingsAudio.ui \
-    src/settings/vm/VBoxVMSettingsNetwork.ui \
-    src/settings/vm/VBoxVMSettingsSerial.ui \
-    src/settings/vm/VBoxVMSettingsParallel.ui \
-    src/settings/vm/VBoxVMSettingsUSB.ui \
-    src/settings/vm/VBoxVMSettingsUSBFilterDetails.ui \
-    src/settings/vm/VBoxVMSettingsSF.ui \
-    src/settings/vm/VBoxVMSettingsSFDetails.ui \
-    src/settings/global/VBoxGLSettingsGeneral.ui \
-    src/settings/global/VBoxGLSettingsInput.ui \
-    src/settings/global/VBoxGLSettingsUpdate.ui \
-    src/settings/global/VBoxGLSettingsLanguage.ui \
-    src/settings/global/VBoxGLSettingsNetwork.ui \
-    src/settings/global/VBoxGLSettingsNetworkDetails.ui \
+    src/settings/global/UIGlobalSettingsGeneral.ui \
+    src/settings/global/UIGlobalSettingsInput.ui \
+    src/settings/global/UIGlobalSettingsUpdate.ui \
+    src/settings/global/UIGlobalSettingsLanguage.ui \
+    src/settings/global/UIGlobalSettingsNetwork.ui \
+    src/settings/global/UIGlobalSettingsNetworkDetails.ui \
+    src/settings/machine/UIMachineSettingsGeneral.ui \
+    src/settings/machine/UIMachineSettingsSystem.ui \
+    src/settings/machine/UIMachineSettingsDisplay.ui \
+    src/settings/machine/UIMachineSettingsStorage.ui \
+    src/settings/machine/UIMachineSettingsAudio.ui \
+    src/settings/machine/UIMachineSettingsNetwork.ui \
+    src/settings/machine/UIMachineSettingsSerial.ui \
+    src/settings/machine/UIMachineSettingsParallel.ui \
+    src/settings/machine/UIMachineSettingsUSB.ui \
+    src/settings/machine/UIMachineSettingsUSBFilterDetails.ui \
+    src/settings/machine/UIMachineSettingsSF.ui \
+    src/settings/machine/UIMachineSettingsSFDetails.ui \
     src/wizards/newvm/UINewVMWzdPage1.ui \
     src/wizards/newvm/UINewVMWzdPage2.ui \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/precomp.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/precomp.h	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/precomp.h	(revision 33882)
@@ -207,10 +207,10 @@
 #include "VBoxFilePathSelectorWidget.h"
 #include "VBoxFrameBuffer.h"
-#include "VBoxGLSettingsGeneral.h"
-#include "VBoxGLSettingsInput.h"
-#include "VBoxGLSettingsLanguage.h"
-#include "VBoxGLSettingsNetwork.h"
-#include "VBoxGLSettingsNetworkDetails.h"
-#include "VBoxGLSettingsUpdate.h"
+#include "UIGlobalSettingsGeneral.h"
+#include "UIGlobalSettingsInput.h"
+#include "UIGlobalSettingsLanguage.h"
+#include "UIGlobalSettingsNetwork.h"
+#include "UIGlobalSettingsNetworkDetails.h"
+#include "UIGlobalSettingsUpdate.h"
 #include "VBoxGlobal.h"
 #include "VBoxGlobalSettings.h"
@@ -252,16 +252,16 @@
 #include "UIVMListView.h"
 #include "VBoxVMLogViewer.h"
-#include "VBoxVMSettingsAudio.h"
-#include "VBoxVMSettingsDisplay.h"
-#include "VBoxVMSettingsGeneral.h"
-#include "VBoxVMSettingsHD.h"
-#include "VBoxVMSettingsNetwork.h"
-#include "VBoxVMSettingsParallel.h"
-#include "VBoxVMSettingsSF.h"
-#include "VBoxVMSettingsSFDetails.h"
-#include "VBoxVMSettingsSerial.h"
-#include "VBoxVMSettingsSystem.h"
-#include "VBoxVMSettingsUSB.h"
-#include "VBoxVMSettingsUSBFilterDetails.h"
+#include "UIMachineSettingsAudio.h"
+#include "UIMachineSettingsDisplay.h"
+#include "UIMachineSettingsGeneral.h"
+#include "UIMachineSettingsStorage.h"
+#include "UIMachineSettingsNetwork.h"
+#include "UIMachineSettingsParallel.h"
+#include "UIMachineSettingsSF.h"
+#include "UIMachineSettingsSFDetails.h"
+#include "UIMachineSettingsSerial.h"
+#include "UIMachineSettingsSystem.h"
+#include "UIMachineSettingsUSB.h"
+#include "UIMachineSettingsUSBFilterDetails.h"
 
 #ifdef Q_WS_X11
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 33882)
@@ -38,6 +38,6 @@
 #include "VBoxTakeSnapshotDlg.h"
 #include "VBoxVMInformationDlg.h"
-#include "VBoxVMSettingsNetwork.h"
-#include "VBoxVMSettingsSF.h"
+#include "UIMachineSettingsNetwork.h"
+#include "UIMachineSettingsSF.h"
 #ifdef Q_WS_MAC
 # include "DockIconPreview.h"
@@ -112,5 +112,5 @@
 
         /* Setup settings layout */
-        m_pSettings = new VBoxVMSettingsNetworkPage(true);
+        m_pSettings = new UIMachineSettingsNetworkPage(true);
         m_pSettings->setOrderAfter(this);
         VBoxGlobal::setLayoutMargin(m_pSettings->layout(), 0);
@@ -160,5 +160,5 @@
 private:
 
-    VBoxVMSettingsNetworkPage *m_pSettings;
+    UIMachineSettingsNetworkPage *m_pSettings;
     CSession &m_session;
 };
@@ -186,5 +186,5 @@
 
         /* Setup settings layout */
-        m_pSettings = new VBoxVMSettingsSF;
+        m_pSettings = new UIMachineSettingsSF;
         VBoxGlobal::setLayoutMargin(m_pSettings->layout(), 0);
         m_pSettings->loadDirectlyFrom(m_session.GetConsole());
@@ -234,5 +234,5 @@
 private:
 
-    VBoxVMSettingsSF *m_pSettings;
+    UIMachineSettingsSF *m_pSettings;
     CSession &m_session;
 };
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp	(revision 33882)
@@ -32,20 +32,20 @@
 #include "VBoxSettingsSelector.h"
 
-#include "VBoxGLSettingsGeneral.h"
-#include "VBoxGLSettingsInput.h"
-#include "VBoxGLSettingsUpdate.h"
-#include "VBoxGLSettingsLanguage.h"
-#include "VBoxGLSettingsNetwork.h"
-
-#include "VBoxVMSettingsGeneral.h"
-#include "VBoxVMSettingsSystem.h"
-#include "VBoxVMSettingsDisplay.h"
-#include "VBoxVMSettingsHD.h"
-#include "VBoxVMSettingsAudio.h"
-#include "VBoxVMSettingsNetwork.h"
-#include "VBoxVMSettingsSerial.h"
-#include "VBoxVMSettingsParallel.h"
-#include "VBoxVMSettingsUSB.h"
-#include "VBoxVMSettingsSF.h"
+#include "UIGlobalSettingsGeneral.h"
+#include "UIGlobalSettingsInput.h"
+#include "UIGlobalSettingsUpdate.h"
+#include "UIGlobalSettingsLanguage.h"
+#include "UIGlobalSettingsNetwork.h"
+
+#include "UIMachineSettingsGeneral.h"
+#include "UIMachineSettingsSystem.h"
+#include "UIMachineSettingsDisplay.h"
+#include "UIMachineSettingsStorage.h"
+#include "UIMachineSettingsAudio.h"
+#include "UIMachineSettingsNetwork.h"
+#include "UIMachineSettingsSerial.h"
+#include "UIMachineSettingsParallel.h"
+#include "UIMachineSettingsUSB.h"
+#include "UIMachineSettingsSF.h"
 
 #if 0 /* Global USB filters are DISABLED now: */
@@ -303,5 +303,5 @@
                 case GLSettingsPage_General:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxGLSettingsGeneral;
+                    UISettingsPage *pSettingsPage = new UIGlobalSettingsGeneral;
                     pSettingsPage->setId(i);
                     addItem(":/machine_32px.png", ":/machine_disabled_32px.png",
@@ -313,5 +313,5 @@
                 case GLSettingsPage_Input:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxGLSettingsInput;
+                    UISettingsPage *pSettingsPage = new UIGlobalSettingsInput;
                     pSettingsPage->setId(i);
                     addItem(":/hostkey_32px.png", ":/hostkey_disabled_32px.png",
@@ -323,5 +323,5 @@
                 case GLSettingsPage_Update:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxGLSettingsUpdate;
+                    UISettingsPage *pSettingsPage = new UIGlobalSettingsUpdate;
                     pSettingsPage->setId(i);
                     addItem(":/refresh_32px.png", ":/refresh_disabled_32px.png",
@@ -333,5 +333,5 @@
                 case GLSettingsPage_Language:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxGLSettingsLanguage;
+                    UISettingsPage *pSettingsPage = new UIGlobalSettingsLanguage;
                     pSettingsPage->setId(i);
                     addItem(":/site_32px.png", ":/site_disabled_32px.png",
@@ -343,5 +343,5 @@
                 case GLSettingsPage_USB:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsUSB(UISettingsPageType_Global);
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsUSB(UISettingsPageType_Global);
                     pSettingsPage->setId(i);
                     addItem(":/usb_32px.png", ":/usb_disabled_32px.png",
@@ -353,5 +353,5 @@
                 case GLSettingsPage_Network:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxGLSettingsNetwork;
+                    UISettingsPage *pSettingsPage = new UIGlobalSettingsNetwork;
                     pSettingsPage->setId(i);
                     addItem(":/nw_32px.png", ":/nw_disabled_32px.png",
@@ -518,5 +518,5 @@
                 case VMSettingsPage_General:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsGeneral;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsGeneral;
                     pSettingsPage->setId(i);
                     addItem(":/machine_32px.png", ":/machine_disabled_32px.png",
@@ -528,5 +528,5 @@
                 case VMSettingsPage_System:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsSystem;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsSystem;
                     pSettingsPage->setId(i);
                     connect(pSettingsPage, SIGNAL(tableChanged()), this, SLOT(sltResetFirstRunFlag()));
@@ -539,5 +539,5 @@
                 case VMSettingsPage_Display:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsDisplay;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsDisplay;
                     pSettingsPage->setId(i);
                     addItem(":/vrdp_32px.png", ":/vrdp_disabled_32px.png",
@@ -549,5 +549,5 @@
                 case VMSettingsPage_Storage:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsHD;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsStorage;
                     pSettingsPage->setId(i);
                     connect(pSettingsPage, SIGNAL(storageChanged()), this, SLOT(sltResetFirstRunFlag()));
@@ -560,5 +560,5 @@
                 case VMSettingsPage_Audio:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsAudio;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsAudio;
                     pSettingsPage->setId(i);
                     addItem(":/sound_32px.png", ":/sound_disabled_32px.png",
@@ -570,5 +570,5 @@
                 case VMSettingsPage_Network:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsNetworkPage;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsNetworkPage;
                     pSettingsPage->setId(i);
                     addItem(":/nw_32px.png", ":/nw_disabled_32px.png",
@@ -588,5 +588,5 @@
                 case VMSettingsPage_Serial:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsSerialPage;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsSerialPage;
                     pSettingsPage->setId(i);
                     addItem(":/serial_port_32px.png", ":/serial_port_disabled_32px.png",
@@ -598,5 +598,5 @@
                 case VMSettingsPage_Parallel:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsParallelPage;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsParallelPage;
                     pSettingsPage->setId(i);
                     addItem(":/parallel_port_32px.png", ":/parallel_port_disabled_32px.png",
@@ -608,5 +608,5 @@
                 case VMSettingsPage_USB:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsUSB(UISettingsPageType_Machine);
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsUSB(UISettingsPageType_Machine);
                     pSettingsPage->setId(i);
                     addItem(":/usb_32px.png", ":/usb_disabled_32px.png",
@@ -618,5 +618,5 @@
                 case VMSettingsPage_SF:
                 {
-                    UISettingsPage *pSettingsPage = new VBoxVMSettingsSF;
+                    UISettingsPage *pSettingsPage = new UIMachineSettingsSF;
                     pSettingsPage->setId(i);
                     addItem(":/shared_folder_32px.png", ":/shared_folder_disabled_32px.png",
@@ -709,8 +709,8 @@
 
     /* Guest OS type & VT-x/AMD-V option correlation auto-fix: */
-    VBoxVMSettingsGeneral *pGeneralPage =
-        qobject_cast<VBoxVMSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
-    VBoxVMSettingsSystem *pSystemPage =
-        qobject_cast<VBoxVMSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
+    UIMachineSettingsGeneral *pGeneralPage =
+        qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
+    UIMachineSettingsSystem *pSystemPage =
+        qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
     if (pGeneralPage && pSystemPage &&
         pGeneralPage->is64BitOSTypeSelected() && !pSystemPage->isHWVirtExEnabled())
@@ -721,6 +721,6 @@
     if (pGeneralPage && !pGeneralPage->isWindowsOSTypeSelected())
     {
-        VBoxVMSettingsDisplay *pDisplayPage =
-            qobject_cast<VBoxVMSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
+        UIMachineSettingsDisplay *pDisplayPage =
+            qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
         if (pDisplayPage && pDisplayPage->isAcceleration2DVideoSelected())
             m_machine.SetAccelerate2DVideoEnabled(false);
@@ -825,8 +825,8 @@
     {
         /* Get General & System pages: */
-        VBoxVMSettingsGeneral *pGeneralPage =
-            qobject_cast<VBoxVMSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
-        VBoxVMSettingsSystem *pSystemPage =
-            qobject_cast<VBoxVMSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
+        UIMachineSettingsGeneral *pGeneralPage =
+            qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
+        UIMachineSettingsSystem *pSystemPage =
+            qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
 
         /* Guest OS type & VT-x/AMD-V option correlation test: */
@@ -847,8 +847,8 @@
     {
         /* Get General & Display pages: */
-        VBoxVMSettingsGeneral *pGeneralPage =
-            qobject_cast<VBoxVMSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
-        VBoxVMSettingsDisplay *pDisplayPage =
-            qobject_cast<VBoxVMSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
+        UIMachineSettingsGeneral *pGeneralPage =
+            qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
+        UIMachineSettingsDisplay *pDisplayPage =
+            qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
 #ifdef VBOX_WITH_CRHGSMI
         if (pGeneralPage && pDisplayPage)
@@ -875,8 +875,8 @@
     {
         /* Get System & USB pages: */
-        VBoxVMSettingsSystem *pSystemPage =
-            qobject_cast<VBoxVMSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
-        VBoxVMSettingsUSB *pUsbPage =
-            qobject_cast<VBoxVMSettingsUSB*>(m_pSelector->idToPage(VMSettingsPage_USB));
+        UIMachineSettingsSystem *pSystemPage =
+            qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
+        UIMachineSettingsUSB *pUsbPage =
+            qobject_cast<UIMachineSettingsUSB*>(m_pSelector->idToPage(VMSettingsPage_USB));
         if (pSystemPage && pUsbPage &&
             pSystemPage->isHIDEnabled() && !pUsbPage->isOHCIEnabled())
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp	(revision 33882)
@@ -0,0 +1,150 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsGeneral class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Global includes */
+#include <QDir>
+
+/* Local includes */
+#include "UIGlobalSettingsGeneral.h"
+#include "VBoxGlobal.h"
+
+UIGlobalSettingsGeneral::UIGlobalSettingsGeneral()
+{
+    /* Apply UI decorations */
+    Ui::UIGlobalSettingsGeneral::setupUi (this);
+
+#ifndef VBOX_GUI_WITH_SYSTRAY
+    mCbCheckTrayIcon->hide();
+    mWtSpacer1->hide();
+#endif /* !VBOX_GUI_WITH_SYSTRAY */
+#ifndef Q_WS_MAC
+    mCbCheckPresentationMode->hide();
+    mWtSpacer2->hide();
+#endif /* !Q_WS_MAC */
+//#ifndef Q_WS_WIN /* Checkbox hidden for now! */
+    mCbDisableHostScreenSaver->hide();
+    mWtSpacer3->hide();
+//#endif /* !Q_WS_WIN */
+
+    if (mCbCheckTrayIcon->isHidden() &&
+        mCbCheckPresentationMode->isHidden() &&
+        mCbDisableHostScreenSaver->isHidden())
+        mLnSeparator2->hide();
+
+    mPsMach->setHomeDir (vboxGlobal().virtualBox().GetHomeFolder());
+    mPsVRDP->setHomeDir (vboxGlobal().virtualBox().GetHomeFolder());
+    mPsVRDP->setMode (VBoxFilePathSelectorWidget::Mode_File_Open);
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsGeneral::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Load to cache: */
+    m_cache.m_strDefaultMachineFolder = m_properties.GetDefaultMachineFolder();
+    m_cache.m_strVRDEAuthLibrary = m_properties.GetVRDEAuthLibrary();
+    m_cache.m_fTrayIconEnabled = m_settings.trayIconEnabled();
+#ifdef Q_WS_MAC
+    m_cache.m_fPresentationModeEnabled = m_settings.presentationModeEnabled();
+#endif /* Q_WS_MAC */
+    m_cache.m_fHostScreenSaverDisables = m_settings.hostScreenSaverDisabled();
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsGeneral::getFromCache()
+{
+    /* Fetch from cache: */
+    mPsMach->setPath(m_cache.m_strDefaultMachineFolder);
+    mPsVRDP->setPath(m_cache.m_strVRDEAuthLibrary);
+    mCbCheckTrayIcon->setChecked(m_cache.m_fTrayIconEnabled);
+#ifdef Q_WS_MAC
+    mCbCheckPresentationMode->setChecked(m_cache.m_fPresentationModeEnabled);
+#endif /* Q_WS_MAC */
+    mCbDisableHostScreenSaver->setChecked(m_cache.m_fHostScreenSaverDisables);
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsGeneral::putToCache()
+{
+    /* Upload to cache: */
+    m_cache.m_strDefaultMachineFolder = mPsMach->path();
+    m_cache.m_strVRDEAuthLibrary = mPsVRDP->path();
+    m_cache.m_fTrayIconEnabled = mCbCheckTrayIcon->isChecked();
+#ifdef Q_WS_MAC
+    m_cache.m_fPresentationModeEnabled = mCbCheckPresentationMode->isChecked();
+#endif /* Q_WS_MAC */
+    m_cache.m_fHostScreenSaverDisables = mCbDisableHostScreenSaver->isChecked();
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsGeneral::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Save from cache: */
+    if (m_properties.isOk() && mPsMach->isModified())
+        m_properties.SetDefaultMachineFolder(m_cache.m_strDefaultMachineFolder);
+    if (m_properties.isOk() && mPsVRDP->isModified())
+        m_properties.SetVRDEAuthLibrary(m_cache.m_strVRDEAuthLibrary);
+    m_settings.setTrayIconEnabled(m_cache.m_fTrayIconEnabled);
+#ifdef Q_WS_MAC
+    m_settings.setPresentationModeEnabled(m_cache.m_fPresentationModeEnabled);
+#endif /* Q_WS_MAC */
+    m_settings.setHostScreenSaverDisabled(m_cache.m_fHostScreenSaverDisables);
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+void UIGlobalSettingsGeneral::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mPsMach);
+    setTabOrder (mPsMach, mPsVRDP);
+    setTabOrder (mPsVRDP, mCbCheckTrayIcon);
+    setTabOrder (mCbCheckTrayIcon, mCbCheckPresentationMode);
+    setTabOrder (mCbCheckPresentationMode, mCbDisableHostScreenSaver);
+}
+
+void UIGlobalSettingsGeneral::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIGlobalSettingsGeneral::retranslateUi (this);
+
+    mPsMach->setWhatsThis (tr ("Displays the path to the default virtual "
+                               "machine folder. This folder is used, if not "
+                               "explicitly specified otherwise, when creating "
+                               "new virtual machines."));
+    mPsVRDP->setWhatsThis (tr ("Displays the path to the library that "
+                               "provides authentication for Remote Display "
+                               "(VRDP) clients."));
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h	(revision 33882)
@@ -0,0 +1,74 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsGeneral class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIGlobalSettingsGeneral_h__
+#define __UIGlobalSettingsGeneral_h__
+
+#include "UISettingsPage.h"
+#include "UIGlobalSettingsGeneral.gen.h"
+
+/* Global settings / General page / Cache: */
+struct UISettingsCacheGlobalGeneral
+{
+    QString m_strDefaultMachineFolder;
+    QString m_strVRDEAuthLibrary;
+    bool m_fTrayIconEnabled;
+#ifdef Q_WS_MAC
+    bool m_fPresentationModeEnabled;
+#endif /* Q_WS_MAC */
+    bool m_fHostScreenSaverDisables;
+};
+
+/* Global settings / General page: */
+class UIGlobalSettingsGeneral : public UISettingsPageGlobal,
+                              public Ui::UIGlobalSettingsGeneral
+{
+    Q_OBJECT;
+
+public:
+
+    UIGlobalSettingsGeneral();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private:
+
+    /* Cache: */
+    UISettingsCacheGlobalGeneral m_cache;
+};
+
+#endif // __UIGlobalSettingsGeneral_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui	(revision 33882)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
+
+     Copyright (C) 2008-2010 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIGlobalSettingsGeneral</class>
+ <widget class="QWidget" name="UIGlobalSettingsGeneral">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>379</width>
+    <height>173</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item row="0" column="0" colspan="2">
+    <widget class="QLabel" name="mLbMach">
+     <property name="text">
+      <string>Default &amp;Machine Folder:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>mPsMach</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="VBoxFilePathSelectorWidget" name="mPsMach">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" colspan="3">
+    <widget class="Line" name="mLnSeparator">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" colspan="2">
+    <widget class="QLabel" name="mLbVRDP">
+     <property name="text">
+      <string>V&amp;RDP Authentication Library:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>mPsVRDP</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="VBoxFilePathSelectorWidget" name="mPsVRDP">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" colspan="3">
+    <widget class="Line" name="mLnSeparator2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QWidget" name="mWtSpacer1">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumWidth">
+      <number>34</number>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1" colspan="2">
+    <widget class="QCheckBox" name="mCbCheckTrayIcon">
+     <property name="whatsThis">
+      <string>When checked, the application will provide an icon with the context menu in the system tray.</string>
+     </property>
+     <property name="text">
+      <string>&amp;Show System Tray Icon</string>
+     </property>
+     <property name="checked">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0">
+    <widget class="QWidget" name="mWtSpacer2">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumWidth">
+      <number>34</number>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="1" colspan="2">
+    <widget class="QCheckBox" name="mCbCheckPresentationMode">
+     <property name="text">
+      <string>&amp;Auto show Dock and Menubar in fullscreen</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="0">
+    <widget class="QWidget" name="mWtSpacer3">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumWidth">
+      <number>34</number>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1" colspan="2">
+    <widget class="QCheckBox" name="mCbDisableHostScreenSaver">
+     <property name="whatsThis">
+      <string>When checked, the host screen saver will be disabled whenever a virtual machine is running.</string>
+     </property>
+     <property name="text">
+      <string>Disable Host &amp;ScreenSaver</string>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0" colspan="3">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>VBoxFilePathSelectorWidget</class>
+   <extends>QComboBox</extends>
+   <header>VBoxFilePathSelectorWidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp	(revision 33882)
@@ -0,0 +1,92 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsInput class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIGlobalSettingsInput.h"
+#include "VBoxGlobalSettings.h"
+
+UIGlobalSettingsInput::UIGlobalSettingsInput()
+{
+    /* Apply UI decorations */
+    Ui::UIGlobalSettingsInput::setupUi (this);
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsInput::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Load to cache: */
+    m_cache.m_iHostKey = m_settings.hostKey();
+    m_cache.m_fAutoCapture = m_settings.autoCapture();
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsInput::getFromCache()
+{
+    /* Fetch from cache: */
+    mHeHostKey->setKey(m_cache.m_iHostKey);
+    mCbAutoGrab->setChecked(m_cache.m_fAutoCapture);
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsInput::putToCache()
+{
+    /* Upload to cache: */
+    m_cache.m_iHostKey = mHeHostKey->key();
+    m_cache.m_fAutoCapture = mCbAutoGrab->isChecked();
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsInput::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Save from cache: */
+    m_settings.setHostKey(m_cache.m_iHostKey);
+    m_settings.setAutoCapture(m_cache.m_fAutoCapture);
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+void UIGlobalSettingsInput::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mHeHostKey);
+    setTabOrder (mHeHostKey, mTbResetHostKey);
+    setTabOrder (mTbResetHostKey, mCbAutoGrab);
+}
+
+void UIGlobalSettingsInput::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIGlobalSettingsInput::retranslateUi (this);
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.h	(revision 33882)
@@ -0,0 +1,69 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsInput class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIGlobalSettingsInput_h__
+#define __UIGlobalSettingsInput_h__
+
+#include "UISettingsPage.h"
+#include "UIGlobalSettingsInput.gen.h"
+
+/* Global settings / Input page / Cache: */
+struct UISettingsCacheGlobalInput
+{
+    int m_iHostKey;
+    bool m_fAutoCapture;
+};
+
+/* Global settings / Input page: */
+class UIGlobalSettingsInput : public UISettingsPageGlobal,
+                            public Ui::UIGlobalSettingsInput
+{
+    Q_OBJECT;
+
+public:
+
+    UIGlobalSettingsInput();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private:
+
+    /* Cache: */
+    UISettingsCacheGlobalInput m_cache;
+};
+
+#endif // __UIGlobalSettingsInput_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.ui	(revision 33882)
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIGlobalSettingsInput</class>
+ <widget class="QWidget" name="UIGlobalSettingsInput">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>292</width>
+    <height>91</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item row="0" column="0" rowspan="2">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="0" column="1">
+    <widget class="QLabel" name="mLbHostKey">
+     <property name="text">
+      <string>Host &amp;Key:</string>
+     </property>
+     <property name="buddy">
+      <cstring>mHeHostKey</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QIHotKeyEdit" name="mHeHostKey">
+     <property name="whatsThis">
+      <string>Displays the key used as a Host Key in the VM window. Activate the entry field and press a new Host Key. Note that alphanumeric, cursor movement and editing keys cannot be used.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="UIResetButton" name="mTbResetHostKey">
+     <property name="focusPolicy">
+      <enum>Qt::StrongFocus</enum>
+     </property>
+     <property name="toolTip">
+      <string>Reset Host Key</string>
+     </property>
+     <property name="whatsThis">
+      <string>Resets the key used as a Host Key in the VM window.</string>
+     </property>
+     <property name="icon">
+      <iconset><normaloff>:/delete_16px.png</normaloff>:/delete_16px.png</iconset>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="4">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="2" colspan="3">
+    <widget class="QCheckBox" name="mCbAutoGrab">
+     <property name="whatsThis">
+      <string>When checked, the keyboard is automatically captured every time the VM window is activated. When the keyboard is captured, all keystrokes (including system ones like Alt-Tab) are directed to the VM.</string>
+     </property>
+     <property name="text">
+      <string>&amp;Auto Capture Keyboard</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>121</width>
+       <height>271</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QIHotKeyEdit</class>
+   <extends>QLabel</extends>
+   <header>QIHotKeyEdit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>UIResetButton</class>
+   <extends>QAbstractButton</extends>
+   <header>UISpecialControls.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="../VirtualBox1.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>mTbResetHostKey</sender>
+   <signal>clicked(bool)</signal>
+   <receiver>mHeHostKey</receiver>
+   <slot>clear()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>111</x>
+     <y>19</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>124</x>
+     <y>61</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp	(revision 33882)
@@ -0,0 +1,363 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsLanguage class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIGlobalSettingsLanguage.h"
+#include "VBoxGlobalSettings.h"
+#include "VBoxGlobal.h"
+
+#include <QHeaderView>
+#include <QTranslator>
+#include <QDir>
+#include <QPainter>
+
+#include <iprt/err.h>
+#include <iprt/param.h>
+#include <iprt/path.h>
+#include <VBox/version.h>
+
+extern const char *gVBoxLangSubDir;
+extern const char *gVBoxLangFileBase;
+extern const char *gVBoxLangFileExt;
+extern const char *gVBoxLangIDRegExp;
+extern const char *gVBoxBuiltInLangName;
+
+class LanguageItem : public QTreeWidgetItem
+{
+public:
+
+    enum { LanguageItemType = QTreeWidgetItem::UserType + 1 };
+
+    LanguageItem (QTreeWidget *aParent, const QTranslator &aTranslator,
+                  const QString &aId, bool aBuiltIn = false)
+        : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (aBuiltIn)
+    {
+        Assert (!aId.isEmpty());
+
+        /* Note: context/source/comment arguments below must match strings
+         * used in VBoxGlobal::languageName() and friends (the latter are the
+         * source of information for the lupdate tool that generates
+         * translation files) */
+
+        QString nativeLanguage = tratra (aTranslator,
+            "@@@", "English", "Native language name");
+        QString nativeCountry = tratra (aTranslator,
+            "@@@", "--", "Native language country name "
+            "(empty if this language is for all countries)");
+
+        QString englishLanguage = tratra (aTranslator,
+            "@@@", "English", "Language name, in English");
+        QString englishCountry = tratra (aTranslator,
+            "@@@", "--", "Language country name, in English "
+            "(empty if native country name is empty)");
+
+        QString translatorsName = tratra (aTranslator,
+            "@@@", "Oracle Corporation", "Comma-separated list of translators");
+
+        QString itemName = nativeLanguage;
+        QString langName = englishLanguage;
+
+        if (!aBuiltIn)
+        {
+            if (nativeCountry != "--")
+                itemName += " (" + nativeCountry + ")";
+
+            if (englishCountry != "--")
+                langName += " (" + englishCountry + ")";
+
+            if (itemName != langName)
+                langName = itemName + " / " + langName;
+        }
+        else
+        {
+            itemName += UIGlobalSettingsLanguage::tr (" (built-in)", "Language");
+            langName += UIGlobalSettingsLanguage::tr (" (built-in)", "Language");
+        }
+
+        setText (0, itemName);
+        setText (1, aId);
+        setText (2, langName);
+        setText (3, translatorsName);
+
+        /* Current language appears in bold */
+        if (text (1) == VBoxGlobal::languageId())
+        {
+            QFont fnt = font (0);
+            fnt.setBold (true);
+            setFont (0, fnt);
+        }
+    }
+
+    /* Constructs an item for an invalid language ID (i.e. when a language
+     * file is missing or corrupt). */
+    LanguageItem (QTreeWidget *aParent, const QString &aId)
+        : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (false)
+    {
+        Assert (!aId.isEmpty());
+
+        setText (0, QString ("<%1>").arg (aId));
+        setText (1, aId);
+        setText (2, UIGlobalSettingsLanguage::tr ("<unavailable>", "Language"));
+        setText (3, UIGlobalSettingsLanguage::tr ("<unknown>", "Author(s)"));
+
+        /* Invalid language appears in italic */
+        QFont fnt = font (0);
+        fnt.setItalic (true);
+        setFont (0, fnt);
+    }
+
+    /* Constructs an item for the default language ID (column 1 will be set
+     * to QString::null) */
+    LanguageItem (QTreeWidget *aParent)
+        : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (false)
+    {
+        setText (0, UIGlobalSettingsLanguage::tr ("Default", "Language"));
+        setText (1, QString::null);
+        /* Empty strings of some reasonable length to prevent the info part
+         * from being shrinked too much when the list wants to be wider */
+        setText (2, "                ");
+        setText (3, "                ");
+    }
+
+    bool isBuiltIn() const { return mBuiltIn; }
+
+    bool operator< (const QTreeWidgetItem &aOther) const
+    {
+        QString thisId = text (1);
+        QString thatId = aOther.text (1);
+        if (thisId.isNull())
+            return true;
+        if (thatId.isNull())
+            return false;
+        if (mBuiltIn)
+            return true;
+        if (aOther.type() == LanguageItemType && ((LanguageItem*) &aOther)->mBuiltIn)
+            return false;
+        return QTreeWidgetItem::operator< (aOther);
+    }
+
+private:
+
+    QString tratra (const QTranslator &aTranslator, const char *aCtxt,
+                    const char *aSrc, const char *aCmnt)
+    {
+        QString msg = aTranslator.translate (aCtxt, aSrc, aCmnt);
+        /* return the source text if no translation is found */
+        if (msg.isEmpty())
+            msg = QString (aSrc);
+        return msg;
+    }
+
+    bool mBuiltIn : 1;
+};
+
+
+UIGlobalSettingsLanguage::UIGlobalSettingsLanguage()
+    : mLanguageChanged(false)
+{
+    /* Apply UI decorations */
+    Ui::UIGlobalSettingsLanguage::setupUi (this);
+
+    /* Setup dialog */
+    mTwLanguage->header()->hide();
+    mTwLanguage->hideColumn (1);
+    mTwLanguage->hideColumn (2);
+    mTwLanguage->hideColumn (3);
+
+    /* Setup Connections */
+    connect (mTwLanguage, SIGNAL (painted (QTreeWidgetItem *, QPainter *)),
+             this, SLOT (mTwItemPainted (QTreeWidgetItem *, QPainter *)));
+    connect (mTwLanguage, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
+             this, SLOT (mTwLanguageChanged (QTreeWidgetItem *)));
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsLanguage::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Load to cache: */
+    m_cache.m_strLanguageId = m_settings.languageId();
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsLanguage::getFromCache()
+{
+    /* Fetch from cache: */
+    reload(m_cache.m_strLanguageId);
+    mTxName->setFixedHeight(fontMetrics().height() * 4);
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsLanguage::putToCache()
+{
+    /* Upload to cache: */
+    QTreeWidgetItem *pCurrentItem = mTwLanguage->currentItem();
+    Assert(pCurrentItem);
+    if (pCurrentItem)
+        m_cache.m_strLanguageId = pCurrentItem->text(1);
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsLanguage::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Save from cache: */
+    if (mLanguageChanged)
+    {
+        m_settings.setLanguageId(m_cache.m_strLanguageId);
+        VBoxGlobal::loadLanguage(m_cache.m_strLanguageId);
+    }
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+void UIGlobalSettingsLanguage::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mTwLanguage);
+}
+
+void UIGlobalSettingsLanguage::reload (const QString &aLangId)
+{
+    /* Clear languages list */
+    mTwLanguage->clear();
+
+    /* Load languages list */
+    char szNlsPath [RTPATH_MAX];
+    int rc = RTPathAppPrivateNoArch (szNlsPath, sizeof(szNlsPath));
+    AssertRC (rc);
+    QString nlsPath = QString (szNlsPath) + gVBoxLangSubDir;
+    QDir nlsDir (nlsPath);
+    QStringList files = nlsDir.entryList (QStringList (QString ("%1*%2")
+        .arg (gVBoxLangFileBase, gVBoxLangFileExt)), QDir::Files);
+
+    QTranslator translator;
+    /* Add the default language */
+    new LanguageItem (mTwLanguage);
+    /* Add the built-in language */
+    new LanguageItem (mTwLanguage, translator, gVBoxBuiltInLangName, true /* built-in */);
+    /* Add all existing languages */
+    for (QStringList::Iterator it = files.begin(); it != files.end(); ++ it)
+    {
+        QString fileName = *it;
+        QRegExp regExp (QString (gVBoxLangFileBase) + gVBoxLangIDRegExp);
+        int pos = regExp.indexIn (fileName);
+        if (pos == -1)
+            continue;
+
+        /* Skip any English version, cause this is extra handled. */
+        QString lang = regExp.cap (2);
+        if (lang.toLower() == "en")
+            continue;
+
+        bool loadOk = translator.load (fileName, nlsPath);
+        if (!loadOk)
+            continue;
+
+        new LanguageItem (mTwLanguage, translator, regExp.cap (1));
+    }
+
+    /* Adjust selector list */
+#ifdef Q_WS_MAC
+    int width = qMax (static_cast<QAbstractItemView*> (mTwLanguage)
+        ->sizeHintForColumn (0) + 2 * mTwLanguage->frameWidth() +
+        QApplication::style()->pixelMetric (QStyle::PM_ScrollBarExtent),
+        220);
+    mTwLanguage->setFixedWidth (width);
+#else /* Q_WS_MAC */
+    mTwLanguage->setMinimumWidth (static_cast<QAbstractItemView*> (mTwLanguage)
+        ->sizeHintForColumn (0) + 2 * mTwLanguage->frameWidth() +
+        QApplication::style()->pixelMetric (QStyle::PM_ScrollBarExtent));
+#endif /* Q_WS_MAC */
+    mTwLanguage->resizeColumnToContents (0);
+
+    /* Search for necessary language */
+    QList<QTreeWidgetItem*> itemsList =
+        mTwLanguage->findItems (aLangId, Qt::MatchExactly, 1);
+    QTreeWidgetItem *item = itemsList.isEmpty() ? 0 : itemsList [0];
+    if (!item)
+    {
+        /* Add an item for an invalid language to represent it in the list */
+        item = new LanguageItem (mTwLanguage, aLangId);
+        mTwLanguage->resizeColumnToContents (0);
+    }
+    Assert (item);
+    if (item)
+        mTwLanguage->setCurrentItem (item);
+
+    mTwLanguage->sortItems (0, Qt::AscendingOrder);
+    mTwLanguage->scrollToItem (item);
+    mLanguageChanged = false;
+}
+
+void UIGlobalSettingsLanguage::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIGlobalSettingsLanguage::retranslateUi (this);
+    reload (VBoxGlobal::languageId());
+}
+
+void UIGlobalSettingsLanguage::mTwItemPainted (QTreeWidgetItem *aItem, QPainter *aPainter)
+{
+    if (aItem && aItem->type() == LanguageItem::LanguageItemType)
+    {
+        LanguageItem *item = static_cast <LanguageItem*> (aItem);
+        if (item->isBuiltIn())
+        {
+            QRect rect = mTwLanguage->visualItemRect (item);
+            aPainter->setPen (mTwLanguage->palette().color (QPalette::Mid));
+            aPainter->drawLine (rect.x(), rect.y() + rect.height() - 1,
+                                rect.x() + rect.width(), rect.y() + rect.height() - 1);
+        }
+    }
+}
+
+void UIGlobalSettingsLanguage::mTwLanguageChanged (QTreeWidgetItem *aItem)
+{
+    if (!aItem) return;
+
+    /* Disable labels for the Default language item */
+    bool enabled = !aItem->text (1).isNull();
+
+    mTxName->setEnabled (enabled);
+    mTxName->setText (QString ("<table>"
+                               "<tr><td>%1&nbsp;</td><td>%2</td></tr>"
+                               "<tr><td>%3&nbsp;</td><td>%4</td></tr>"
+                               "</table>")
+                      .arg (tr ("Language:"))
+                      .arg (aItem->text (2))
+                      .arg (tr ("Author(s):"))
+                      .arg (aItem->text (3)));
+
+    mLanguageChanged = true;
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.h	(revision 33882)
@@ -0,0 +1,77 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsLanguage class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIGlobalSettingsLanguage_h__
+#define __UIGlobalSettingsLanguage_h__
+
+#include "UISettingsPage.h"
+#include "UIGlobalSettingsLanguage.gen.h"
+
+/* Global settings / Language page / Cache: */
+struct UISettingsCacheGlobalLanguage
+{
+    QString m_strLanguageId;
+};
+
+/* Global settings / Language page: */
+class UIGlobalSettingsLanguage : public UISettingsPageGlobal,
+                               public Ui::UIGlobalSettingsLanguage
+{
+    Q_OBJECT;
+
+public:
+
+    UIGlobalSettingsLanguage();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void reload (const QString &aLangId);
+
+    void retranslateUi();
+
+private slots:
+
+    void mTwItemPainted (QTreeWidgetItem *aItem, QPainter *aPainter);
+    void mTwLanguageChanged (QTreeWidgetItem *aItem);
+
+private:
+
+    bool mLanguageChanged;
+
+    /* Cache: */
+    UISettingsCacheGlobalLanguage m_cache;
+};
+
+#endif // __UIGlobalSettingsLanguage_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.ui	(revision 33882)
@@ -0,0 +1,142 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIGlobalSettingsLanguage</class>
+ <widget class="QWidget" name="UIGlobalSettingsLanguage" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>346</width>
+    <height>246</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="0" column="1" colspan="2" >
+    <widget class="QLabel" name="mGbLanguage" >
+     <property name="text" >
+      <string>&amp;Interface Language:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>mTwLanguage</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="2" >
+    <widget class="QITreeWidget" name="mTwLanguage" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize" >
+      <size>
+       <width>0</width>
+       <height>150</height>
+      </size>
+     </property>
+     <property name="whatsThis" >
+      <string>Lists all available user interface languages. The effective language is written in &lt;b>bold&lt;/b>. Select &lt;i>Default&lt;/i> to reset to the system default language.</string>
+     </property>
+     <property name="rootIsDecorated" >
+      <bool>false</bool>
+     </property>
+     <column>
+      <property name="text" >
+       <string>Name</string>
+      </property>
+     </column>
+     <column>
+      <property name="text" >
+       <string>Id</string>
+      </property>
+     </column>
+     <column>
+      <property name="text" >
+       <string>Language</string>
+      </property>
+     </column>
+     <column>
+      <property name="text" >
+       <string>Author</string>
+      </property>
+     </column>
+    </widget>
+   </item>
+   <item row="2" column="2" >
+    <widget class="QILabel" name="mTxName" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <property name="wordWrap" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QITreeWidget</class>
+   <extends>QTreeWidget</extends>
+   <header>QITreeWidget.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp	(revision 33882)
@@ -0,0 +1,571 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsNetwork class implementation
+ */
+
+/*
+ * Copyright (C) 2009-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Local includes */
+#include "QIWidgetValidator.h"
+#include "UIIconPool.h"
+#include "UIGlobalSettingsNetwork.h"
+#include "UIGlobalSettingsNetworkDetails.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+
+/* Qt includes */
+#include <QHeaderView>
+#include <QHostAddress>
+
+NetworkItem::NetworkItem()
+    : QTreeWidgetItem()
+{
+}
+
+void NetworkItem::fetchNetworkData(const UIHostNetworkData &data)
+{
+    /* Fetch from cache: */
+    m_data = data;
+
+    /* Update tool-tip: */
+    updateInfo();
+}
+
+void NetworkItem::uploadNetworkData(UIHostNetworkData &data)
+{
+    /* Upload to cache: */
+    data = m_data;
+}
+
+bool NetworkItem::revalidate (QString &aWarning, QString & /* aTitle */)
+{
+    /* Host-only Interface validation */
+    if (!m_data.m_interface.m_fDhcpClientEnabled)
+    {
+        if (m_data.m_interface.m_strInterfaceAddress.isEmpty() &&
+            (QHostAddress (m_data.m_interface.m_strInterfaceAddress) == QHostAddress::Any ||
+             QHostAddress (m_data.m_interface.m_strInterfaceAddress).protocol() != QAbstractSocket::IPv4Protocol))
+        {
+            aWarning = UIGlobalSettingsNetwork::tr ("host IPv4 address of <b>%1</b> is wrong").arg (text (0));
+            return false;
+        }
+        if (!m_data.m_interface.m_strInterfaceMask.isEmpty() &&
+            (QHostAddress (m_data.m_interface.m_strInterfaceMask) == QHostAddress::Any ||
+             QHostAddress (m_data.m_interface.m_strInterfaceMask).protocol() != QAbstractSocket::IPv4Protocol))
+        {
+            aWarning = UIGlobalSettingsNetwork::tr ("host IPv4 network mask of <b>%1</b> is wrong").arg (text (0));
+            return false;
+        }
+        if (m_data.m_interface.m_fIpv6Supported)
+        {
+            if (!m_data.m_interface.m_strInterfaceAddress6.isEmpty() &&
+                (QHostAddress (m_data.m_interface.m_strInterfaceAddress6) == QHostAddress::AnyIPv6 ||
+                 QHostAddress (m_data.m_interface.m_strInterfaceAddress6).protocol() != QAbstractSocket::IPv6Protocol))
+            {
+                aWarning = UIGlobalSettingsNetwork::tr ("host IPv6 address of <b>%1</b> is wrong").arg (text (0));
+                return false;
+            }
+        }
+    }
+
+    /* DHCP Server settings */
+    if (m_data.m_dhcpserver.m_fDhcpServerEnabled)
+    {
+        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpServerAddress) == QHostAddress::Any ||
+            QHostAddress (m_data.m_dhcpserver.m_strDhcpServerAddress).protocol() != QAbstractSocket::IPv4Protocol)
+        {
+            aWarning = UIGlobalSettingsNetwork::tr ("DHCP server address of <b>%1</b> is wrong").arg (text (0));
+            return false;
+        }
+        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpServerMask) == QHostAddress::Any ||
+            QHostAddress (m_data.m_dhcpserver.m_strDhcpServerMask).protocol() != QAbstractSocket::IPv4Protocol)
+        {
+            aWarning = UIGlobalSettingsNetwork::tr ("DHCP server network mask of <b>%1</b> is wrong").arg (text (0));
+            return false;
+        }
+        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpLowerAddress) == QHostAddress::Any ||
+            QHostAddress (m_data.m_dhcpserver.m_strDhcpLowerAddress).protocol() != QAbstractSocket::IPv4Protocol)
+        {
+            aWarning = UIGlobalSettingsNetwork::tr ("DHCP lower address bound of <b>%1</b> is wrong").arg (text (0));
+            return false;
+        }
+        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpUpperAddress) == QHostAddress::Any ||
+            QHostAddress (m_data.m_dhcpserver.m_strDhcpUpperAddress).protocol() != QAbstractSocket::IPv4Protocol)
+        {
+            aWarning = UIGlobalSettingsNetwork::tr ("DHCP upper address bound of <b>%1</b> is wrong").arg (text (0));
+            return false;
+        }
+    }
+    return true;
+}
+
+QString NetworkItem::updateInfo()
+{
+    /* Update text: */
+    setText(0, m_data.m_interface.m_strName);
+
+    /* Update information label */
+    QString hdr ("<tr><td><nobr>%1:&nbsp;</nobr></td>"
+                 "<td><nobr>%2</nobr></td></tr>");
+    QString sub ("<tr><td><nobr>&nbsp;&nbsp;%1:&nbsp;</nobr></td>"
+                 "<td><nobr>%2</nobr></td></tr>");
+    QString data, tip, buffer;
+
+    /* Host-only Interface information */
+    buffer = hdr.arg (UIGlobalSettingsNetwork::tr ("Adapter"))
+                .arg (m_data.m_interface.m_fDhcpClientEnabled ? UIGlobalSettingsNetwork::tr ("Automatically configured", "interface")
+                                                              : UIGlobalSettingsNetwork::tr ("Manually configured", "interface"));
+    data += buffer;
+    tip += buffer;
+
+    if (!m_data.m_interface.m_fDhcpClientEnabled)
+    {
+        buffer = sub.arg (UIGlobalSettingsNetwork::tr ("IPv4 Address"))
+                    .arg (m_data.m_interface.m_strInterfaceAddress.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "address")
+                                                                             : m_data.m_interface.m_strInterfaceAddress) +
+                 sub.arg (UIGlobalSettingsNetwork::tr ("IPv4 Network Mask"))
+                    .arg (m_data.m_interface.m_strInterfaceMask.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "mask")
+                                                                          : m_data.m_interface.m_strInterfaceMask);
+        tip += buffer;
+
+        if (m_data.m_interface.m_fIpv6Supported)
+        {
+            buffer = sub.arg (UIGlobalSettingsNetwork::tr ("IPv6 Address"))
+                        .arg (m_data.m_interface.m_strInterfaceAddress6.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "address")
+                                                                                  : m_data.m_interface.m_strInterfaceAddress6) +
+                     sub.arg (UIGlobalSettingsNetwork::tr ("IPv6 Network Mask Length"))
+                        .arg (m_data.m_interface.m_strInterfaceMaskLength6.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "length")
+                                                              : m_data.m_interface.m_strInterfaceMaskLength6);
+            tip += buffer;
+        }
+    }
+
+    /* DHCP Server information */
+    buffer = hdr.arg (UIGlobalSettingsNetwork::tr ("DHCP Server"))
+                .arg (m_data.m_dhcpserver.m_fDhcpServerEnabled ? UIGlobalSettingsNetwork::tr ("Enabled", "server")
+                                                               : UIGlobalSettingsNetwork::tr ("Disabled", "server"));
+    data += buffer;
+    tip += buffer;
+
+    if (m_data.m_dhcpserver.m_fDhcpServerEnabled)
+    {
+        buffer = sub.arg (UIGlobalSettingsNetwork::tr ("Address"))
+                    .arg (m_data.m_dhcpserver.m_strDhcpServerAddress.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "address")
+                                                                               : m_data.m_dhcpserver.m_strDhcpServerAddress) +
+                 sub.arg (UIGlobalSettingsNetwork::tr ("Network Mask"))
+                    .arg (m_data.m_dhcpserver.m_strDhcpServerMask.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "mask")
+                                                                            : m_data.m_dhcpserver.m_strDhcpServerMask) +
+                 sub.arg (UIGlobalSettingsNetwork::tr ("Lower Bound"))
+                    .arg (m_data.m_dhcpserver.m_strDhcpLowerAddress.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "bound")
+                                                                              : m_data.m_dhcpserver.m_strDhcpLowerAddress) +
+                 sub.arg (UIGlobalSettingsNetwork::tr ("Upper Bound"))
+                    .arg (m_data.m_dhcpserver.m_strDhcpUpperAddress.isEmpty() ? UIGlobalSettingsNetwork::tr ("Not set", "bound")
+                                                                              : m_data.m_dhcpserver.m_strDhcpUpperAddress);
+        tip += buffer;
+    }
+
+    setToolTip (0, tip);
+
+    return QString ("<table>") + data + QString ("</table>");
+}
+
+UIGlobalSettingsNetwork::UIGlobalSettingsNetwork()
+    : mValidator(0)
+    , mAddInterface(0), mRemInterface(0), mEditInterface(0)
+    , m_fChanged(false)
+{
+    /* Apply UI decorations */
+    Ui::UIGlobalSettingsNetwork::setupUi (this);
+
+#ifdef Q_WS_MAC
+    /* Make shifting spacer for MAC as we have fixed-size networks list */
+    QSpacerItem *shiftSpacer =
+        new QSpacerItem (0, 1, QSizePolicy::Expanding, QSizePolicy::Preferred);
+    QGridLayout *mainLayout = static_cast <QGridLayout*> (layout());
+    mainLayout->addItem (shiftSpacer, 1, 4);
+    //static_cast <QHBoxLayout*> (mWtActions->layout())->addStretch();
+#endif
+
+    /* Setup tree-widget */
+    mTwInterfaces->header()->hide();
+    mTwInterfaces->setContextMenuPolicy (Qt::CustomContextMenu);
+
+    /* Prepare toolbar */
+    mAddInterface = new QAction (mTwInterfaces);
+    mRemInterface = new QAction (mTwInterfaces);
+    mEditInterface = new QAction (mTwInterfaces);
+
+    mAddInterface->setShortcuts (QList <QKeySequence> ()
+                                 << QKeySequence ("Ins")
+                                 << QKeySequence ("Ctrl+N"));
+    mRemInterface->setShortcuts (QList <QKeySequence> ()
+                                 << QKeySequence ("Del")
+                                 << QKeySequence ("Ctrl+R"));
+    mEditInterface->setShortcuts (QList <QKeySequence> ()
+                                  << QKeySequence ("Space")
+                                  << QKeySequence ("F2"));
+
+    mAddInterface->setIcon(UIIconPool::iconSet(":/add_host_iface_16px.png",
+                                               ":/add_host_iface_disabled_16px.png"));
+    mRemInterface->setIcon(UIIconPool::iconSet(":/remove_host_iface_16px.png",
+                                               ":/remove_host_iface_disabled_16px.png"));
+    mEditInterface->setIcon(UIIconPool::iconSet(":/guesttools_16px.png",
+                                                ":/guesttools_disabled_16px.png"));
+
+    mTbActions->setUsesTextLabel (false);
+    mTbActions->setIconSize (QSize (16, 16));
+    mTbActions->setOrientation (Qt::Vertical);
+    mTbActions->addAction (mAddInterface);
+    mTbActions->addAction (mRemInterface);
+    mTbActions->addAction (mEditInterface);
+    mTbActions->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
+    mTbActions->updateGeometry();
+    mTbActions->setMinimumHeight (mTbActions->sizeHint().height());
+
+    /* Setup connections */
+    connect (mAddInterface, SIGNAL (triggered (bool)), this, SLOT (addInterface()));
+    connect (mRemInterface, SIGNAL (triggered (bool)), this, SLOT (remInterface()));
+    connect (mEditInterface, SIGNAL (triggered (bool)), this, SLOT (editInterface()));
+    connect (mTwInterfaces, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
+             this, SLOT (updateCurrentItem()));
+    connect (mTwInterfaces, SIGNAL (customContextMenuRequested (const QPoint &)),
+             this, SLOT (showContextMenu (const QPoint &)));
+    connect (mTwInterfaces, SIGNAL (itemDoubleClicked (QTreeWidgetItem*, int)),
+             this, SLOT (editInterface()));
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsNetwork::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Load to cache: */
+    const CHostNetworkInterfaceVector &interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
+    for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size(); ++iNetworkIndex)
+    {
+        const CHostNetworkInterface &iface = interfaces[iNetworkIndex];
+        if (iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
+        {
+            /* Initialization: */
+            CDHCPServer dhcp = vboxGlobal().virtualBox().FindDHCPServerByNetworkName(iface.GetNetworkName());
+            if (dhcp.isNull()) vboxGlobal().virtualBox().CreateDHCPServer(iface.GetNetworkName());
+            dhcp = vboxGlobal().virtualBox().FindDHCPServerByNetworkName(iface.GetNetworkName());
+            AssertMsg(!dhcp.isNull(), ("DHCP Server creation failed!\n"));
+            UIHostNetworkData data;
+            /* Host-only interface settings */
+            data.m_interface.m_strName = iface.GetName();
+            data.m_interface.m_fDhcpClientEnabled = iface.GetDhcpEnabled();
+            data.m_interface.m_strInterfaceAddress = iface.GetIPAddress();
+            data.m_interface.m_strInterfaceMask = iface.GetNetworkMask();
+            data.m_interface.m_fIpv6Supported = iface.GetIPV6Supported();
+            data.m_interface.m_strInterfaceAddress6 = iface.GetIPV6Address();
+            data.m_interface.m_strInterfaceMaskLength6 = QString::number(iface.GetIPV6NetworkMaskPrefixLength());
+            /* DHCP server settings: */
+            data.m_dhcpserver.m_fDhcpServerEnabled = dhcp.GetEnabled();
+            data.m_dhcpserver.m_strDhcpServerAddress = dhcp.GetIPAddress();
+            data.m_dhcpserver.m_strDhcpServerMask = dhcp.GetNetworkMask();
+            data.m_dhcpserver.m_strDhcpLowerAddress = dhcp.GetLowerIP();
+            data.m_dhcpserver.m_strDhcpUpperAddress = dhcp.GetUpperIP();
+            /* Cache: */
+            m_cache.m_items << data;
+        }
+    }
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsNetwork::getFromCache()
+{
+    /* Fetch from cache: */
+    for (int iNetworkIndex = 0; iNetworkIndex < m_cache.m_items.size(); ++iNetworkIndex)
+    {
+        const UIHostNetworkData &data = m_cache.m_items[iNetworkIndex];
+        NetworkItem *pItem = new NetworkItem;
+        pItem->fetchNetworkData(data);
+        mTwInterfaces->addTopLevelItem(pItem);
+    }
+    mTwInterfaces->setCurrentItem(mTwInterfaces->topLevelItem(0));
+    updateCurrentItem();
+#ifdef Q_WS_MAC
+    int width = qMax(static_cast<QAbstractItemView*>(mTwInterfaces)->sizeHintForColumn(0) +
+                     2 * mTwInterfaces->frameWidth() + QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
+                     220);
+    mTwInterfaces->setFixedWidth(width);
+    mTwInterfaces->resizeColumnToContents(0);
+#endif /* Q_WS_MAC */
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsNetwork::putToCache()
+{
+    /* Upload to cache: */
+    m_cache.m_items.clear();
+    for (int iNetworkIndex = 0; iNetworkIndex < mTwInterfaces->topLevelItemCount(); ++iNetworkIndex)
+    {
+        UIHostNetworkData data;
+        NetworkItem *pItem = static_cast<NetworkItem*>(mTwInterfaces->topLevelItem(iNetworkIndex));
+        pItem->uploadNetworkData(data);
+        m_cache.m_items << data;
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsNetwork::saveFromCacheTo(QVariant &data)
+{
+    /* Ensure settings were changed: */
+    if (!m_fChanged)
+        return;
+
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Save from cache: */
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    CHost host = vbox.GetHost();
+    const CHostNetworkInterfaceVector &interfaces = host.GetNetworkInterfaces();
+    /* Remove all the old interfaces first: */
+    for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size(); ++iNetworkIndex)
+    {
+        /* Get iterated interface: */
+        const CHostNetworkInterface &iface = interfaces[iNetworkIndex];
+        if (iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
+        {
+            /* Search for this interface's dhcp sserver: */
+            CDHCPServer dhcp = vboxGlobal().virtualBox().FindDHCPServerByNetworkName(iface.GetNetworkName());
+            /* Delete it if its present: */
+            if (!dhcp.isNull())
+                vbox.RemoveDHCPServer(dhcp);
+            /* Delete interface finally: */
+            CProgress progress = host.RemoveHostOnlyNetworkInterface(iface.GetId());
+            if (host.isOk())
+            {
+                progress.WaitForCompletion(-1);
+                // TODO: Fix problem reporter!
+                //vboxProblem().showModalProgressDialog(progress, tr("Performing", "creating/removing host-only network"), this);
+                if (progress.GetResultCode() != 0)
+                    // TODO: Fix problem reporter!
+                    //vboxProblem().cannotRemoveHostInterface(progress, iface, this);
+                    AssertMsgFailed(("Failed to remove Host-only Network Adapter, result code is %d!\n", progress.GetResultCode()));
+            }
+            else
+                // TODO: Fix problem reporter!
+                //vboxProblem().cannotRemoveHostInterface(host, iface, this);
+                AssertMsgFailed(("Failed to remove Host-only Network Adapter!\n"));
+        }
+    }
+    /* Add all the new interfaces finally: */
+    for (int iNetworkIndex = 0; iNetworkIndex < m_cache.m_items.size(); ++iNetworkIndex)
+    {
+        /* Get iterated data: */
+        const UIHostNetworkData &data = m_cache.m_items[iNetworkIndex];
+        CHostNetworkInterface iface;
+        /* Create interface: */
+        CProgress progress = host.CreateHostOnlyNetworkInterface(iface);
+        if (host.isOk())
+        {
+            // TODO: Fix problem reporter!
+            //vboxProblem().showModalProgressDialog(progress, tr("Performing", "creating/removing host-only network"), this);
+            progress.WaitForCompletion(-1);
+            if (progress.GetResultCode() == 0)
+            {
+                /* Create DHCP server: */
+                CDHCPServer dhcp = vbox.FindDHCPServerByNetworkName(iface.GetNetworkName());
+                if (dhcp.isNull()) vbox.CreateDHCPServer(iface.GetNetworkName());
+                dhcp = vbox.FindDHCPServerByNetworkName(iface.GetNetworkName());
+                AssertMsg(!dhcp.isNull(), ("DHCP Server creation failed!\n"));
+                /* Host-only Interface configuring: */
+                if (data.m_interface.m_fDhcpClientEnabled)
+                {
+                    iface.EnableDynamicIpConfig();
+                }
+                else
+                {
+                    AssertMsg(data.m_interface.m_strInterfaceAddress.isEmpty() ||
+                              QHostAddress(data.m_interface.m_strInterfaceAddress).protocol() == QAbstractSocket::IPv4Protocol,
+                              ("Interface IPv4 address must be empty or IPv4-valid!\n"));
+                    AssertMsg(data.m_interface.m_strInterfaceMask.isEmpty() ||
+                              QHostAddress(data.m_interface.m_strInterfaceMask).protocol() == QAbstractSocket::IPv4Protocol,
+                              ("Interface IPv4 network mask must be empty or IPv4-valid!\n"));
+                    iface.EnableStaticIpConfig(data.m_interface.m_strInterfaceAddress, data.m_interface.m_strInterfaceMask);
+                    if (iface.GetIPV6Supported())
+                    {
+                        AssertMsg(data.m_interface.m_strInterfaceAddress6.isEmpty() ||
+                                  QHostAddress(data.m_interface.m_strInterfaceAddress6).protocol() == QAbstractSocket::IPv6Protocol,
+                                  ("Interface IPv6 address must be empty or IPv6-valid!\n"));
+                        iface.EnableStaticIpConfigV6(data.m_interface.m_strInterfaceAddress6, data.m_interface.m_strInterfaceMaskLength6.toULong());
+                    }
+                }
+                /* DHCP Server configuring: */
+                dhcp.SetEnabled(data.m_dhcpserver.m_fDhcpServerEnabled);
+//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpServerAddress).protocol() == QAbstractSocket::IPv4Protocol,
+//                          ("DHCP Server IPv4 address must be IPv4-valid!\n"));
+//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpServerMask).protocol() == QAbstractSocket::IPv4Protocol,
+//                          ("DHCP Server IPv4 network mask must be IPv4-valid!\n"));
+//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpLowerAddress).protocol() == QAbstractSocket::IPv4Protocol,
+//                          ("DHCP Server IPv4 lower bound must be IPv4-valid!\n"));
+//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpUpperAddress).protocol() == QAbstractSocket::IPv4Protocol,
+//                          ("DHCP Server IPv4 upper bound must be IPv4-valid!\n"));
+                if (QHostAddress(data.m_dhcpserver.m_strDhcpServerAddress).protocol() == QAbstractSocket::IPv4Protocol &&
+                    QHostAddress(data.m_dhcpserver.m_strDhcpServerMask).protocol() == QAbstractSocket::IPv4Protocol &&
+                    QHostAddress(data.m_dhcpserver.m_strDhcpLowerAddress).protocol() == QAbstractSocket::IPv4Protocol &&
+                    QHostAddress(data.m_dhcpserver.m_strDhcpUpperAddress).protocol() == QAbstractSocket::IPv4Protocol)
+                    dhcp.SetConfiguration(data.m_dhcpserver.m_strDhcpServerAddress, data.m_dhcpserver.m_strDhcpServerMask,
+                                          data.m_dhcpserver.m_strDhcpLowerAddress, data.m_dhcpserver.m_strDhcpUpperAddress);
+            }
+            else
+                // TODO: Fix problem reporter!
+                //vboxProblem().cannotCreateHostInterface(progress, this);
+                AssertMsgFailed(("Failed to create Host-only Network Adapter, result code is %d!\n", progress.GetResultCode()));
+        }
+        else
+            // TODO: Fix problem reporter!
+            //vboxProblem().cannotCreateHostInterface(host, this);
+            AssertMsgFailed(("Failed to create Host-only Network Adapter!\n"));
+    }
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+void UIGlobalSettingsNetwork::setValidator (QIWidgetValidator *aValidator)
+{
+    mValidator = aValidator;
+}
+
+bool UIGlobalSettingsNetwork::revalidate (QString &aWarning, QString &aTitle)
+{
+    NetworkItem *item = static_cast <NetworkItem*> (mTwInterfaces->currentItem());
+    return item ? item->revalidate (aWarning, aTitle) : true;
+}
+
+void UIGlobalSettingsNetwork::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mTwInterfaces);
+}
+
+void UIGlobalSettingsNetwork::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIGlobalSettingsNetwork::retranslateUi (this);
+
+    /* Translate action tool-tips */
+    mAddInterface->setText (tr ("&Add host-only network"));
+    mRemInterface->setText (tr ("&Remove host-only network"));
+    mEditInterface->setText (tr ("&Edit host-only network"));
+
+    mAddInterface->setToolTip (mAddInterface->text().remove ('&') +
+        QString (" (%1)").arg (mAddInterface->shortcut().toString()));
+    mRemInterface->setToolTip (mRemInterface->text().remove ('&') +
+        QString (" (%1)").arg (mRemInterface->shortcut().toString()));
+    mEditInterface->setToolTip (mEditInterface->text().remove ('&') +
+        QString (" (%1)").arg (mEditInterface->shortcut().toString()));
+}
+
+void UIGlobalSettingsNetwork::addInterface()
+{
+    /* Creating interface item: */
+    NetworkItem *pItem = new NetworkItem;
+    /* Fill item's data: */
+    UIHostNetworkData data;
+    /* Interface data: */
+    // TODO: Make unique name!
+    data.m_interface.m_strName = tr("New Host-Only Interface");
+    data.m_interface.m_fDhcpClientEnabled = true;
+    data.m_interface.m_fIpv6Supported = false;
+    /* DHCP data: */
+    data.m_dhcpserver.m_fDhcpServerEnabled = false;
+    /* Fetch item with data: */
+    pItem->fetchNetworkData(data);
+    /* Add new top-level item: */
+    mTwInterfaces->addTopLevelItem(pItem);
+    mTwInterfaces->sortItems(0, Qt::AscendingOrder);
+    mTwInterfaces->setCurrentItem(pItem);
+    /* Mark dialog as edited: */
+    m_fChanged = true;
+}
+
+void UIGlobalSettingsNetwork::remInterface()
+{
+    /* Get interface item: */
+    NetworkItem *pItem = static_cast<NetworkItem*>(mTwInterfaces->currentItem());
+    AssertMsg(pItem, ("Current item should present!\n"));
+    /* Get interface name: */
+    QString strInterfaceName(pItem->name());
+    /* Asking user about deleting selected network interface: */
+    if (vboxProblem().confirmDeletingHostInterface(strInterfaceName, this) == QIMessageBox::Cancel)
+        return;
+    /* Removing interface: */
+    delete pItem;
+    /* Mark dialog as edited: */
+    m_fChanged = true;
+}
+
+void UIGlobalSettingsNetwork::editInterface()
+{
+    /* Check interface presence */
+    NetworkItem *item = static_cast <NetworkItem*> (mTwInterfaces->currentItem());
+    AssertMsg (item, ("Current item should be selected!\n"));
+    /* Edit current item data */
+    UIGlobalSettingsNetworkDetails details (this);
+    details.getFromItem (item);
+    if (details.exec() == QDialog::Accepted)
+    {
+        details.putBackToItem();
+        item->updateInfo();
+    }
+    updateCurrentItem();
+    mValidator->revalidate();
+    /* Mark dialog as edited: */
+    m_fChanged = true;
+}
+
+void UIGlobalSettingsNetwork::updateCurrentItem()
+{
+    /* Get current item */
+    NetworkItem *item = static_cast <NetworkItem*> (mTwInterfaces->currentItem());
+    /* Set the final label text */
+    mLbInfo->setText (item ? item->updateInfo() : QString());
+    /* Update availability */
+    mRemInterface->setEnabled (item);
+    mEditInterface->setEnabled (item);
+}
+
+void UIGlobalSettingsNetwork::showContextMenu (const QPoint &aPos)
+{
+    QMenu menu;
+
+    if (mTwInterfaces->itemAt (aPos))
+    {
+        menu.addAction (mEditInterface);
+        menu.addAction (mRemInterface);
+    }
+    else
+    {
+        menu.addAction (mAddInterface);
+    }
+
+    menu.exec (mTwInterfaces->mapToGlobal (aPos));
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.h	(revision 33882)
@@ -0,0 +1,166 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsNetwork class declaration
+ */
+
+/*
+ * Copyright (C) 2009-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIGlobalSettingsNetwork_h__
+#define __UIGlobalSettingsNetwork_h__
+
+#include "UISettingsPage.h"
+#include "UIGlobalSettingsNetwork.gen.h"
+
+/* Host interface data: */
+struct UIHostInterfaceData
+{
+    /* Host-only Interface: */
+    QString m_strName;
+    bool m_fDhcpClientEnabled;
+    QString m_strInterfaceAddress;
+    QString m_strInterfaceMask;
+    bool m_fIpv6Supported;
+    QString m_strInterfaceAddress6;
+    QString m_strInterfaceMaskLength6;
+};
+
+/* DHCP server data: */
+struct UIDHCPServerData
+{
+    /* DHCP Server */
+    bool m_fDhcpServerEnabled;
+    QString m_strDhcpServerAddress;
+    QString m_strDhcpServerMask;
+    QString m_strDhcpLowerAddress;
+    QString m_strDhcpUpperAddress;
+};
+
+/* Global network data: */
+struct UIHostNetworkData
+{
+    UIHostInterfaceData m_interface;
+    UIDHCPServerData m_dhcpserver;
+};
+
+/* Global settings / Network page / Cache: */
+struct UISettingsCacheGlobalNetwork
+{
+    QList<UIHostNetworkData> m_items;
+};
+
+class NetworkItem : public QTreeWidgetItem
+{
+public:
+
+    NetworkItem();
+
+    void fetchNetworkData(const UIHostNetworkData &data);
+    void uploadNetworkData(UIHostNetworkData &data);
+
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    QString updateInfo();
+
+    /* Page getters */
+    QString name() const { return m_data.m_interface.m_strName; }
+    bool isDhcpClientEnabled() const { return m_data.m_interface.m_fDhcpClientEnabled; }
+    QString interfaceAddress() const { return m_data.m_interface.m_strInterfaceAddress; }
+    QString interfaceMask() const { return m_data.m_interface.m_strInterfaceMask; }
+    bool isIpv6Supported() const { return m_data.m_interface.m_fIpv6Supported; }
+    QString interfaceAddress6() const { return m_data.m_interface.m_strInterfaceAddress6; }
+    QString interfaceMaskLength6() const { return m_data.m_interface.m_strInterfaceMaskLength6; }
+
+    bool isDhcpServerEnabled() const { return m_data.m_dhcpserver.m_fDhcpServerEnabled; }
+    QString dhcpServerAddress() const { return m_data.m_dhcpserver.m_strDhcpServerAddress; }
+    QString dhcpServerMask() const { return m_data.m_dhcpserver.m_strDhcpServerMask; }
+    QString dhcpLowerAddress() const { return m_data.m_dhcpserver.m_strDhcpLowerAddress; }
+    QString dhcpUpperAddress() const { return m_data.m_dhcpserver.m_strDhcpUpperAddress; }
+
+    /* Page setters */
+    void setDhcpClientEnabled (bool aEnabled) { m_data.m_interface.m_fDhcpClientEnabled = aEnabled; }
+    void setInterfaceAddress (const QString &aValue) { m_data.m_interface.m_strInterfaceAddress = aValue; }
+    void setInterfaceMask (const QString &aValue) { m_data.m_interface.m_strInterfaceMask = aValue; }
+    void setIp6Supported (bool aSupported) { m_data.m_interface.m_fIpv6Supported = aSupported; }
+    void setInterfaceAddress6 (const QString &aValue) { m_data.m_interface.m_strInterfaceAddress6 = aValue; }
+    void setInterfaceMaskLength6 (const QString &aValue) { m_data.m_interface.m_strInterfaceMaskLength6 = aValue; }
+
+    void setDhcpServerEnabled (bool aEnabled) { m_data.m_dhcpserver.m_fDhcpServerEnabled = aEnabled; }
+    void setDhcpServerAddress (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpServerAddress = aValue; }
+    void setDhcpServerMask (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpServerMask = aValue; }
+    void setDhcpLowerAddress (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpLowerAddress = aValue; }
+    void setDhcpUpperAddress (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpUpperAddress = aValue; }
+
+private:
+
+    /* Network data: */
+    UIHostNetworkData m_data;
+};
+
+/* Global settings / Network page: */
+class UIGlobalSettingsNetwork : public UISettingsPageGlobal,
+                              public Ui::UIGlobalSettingsNetwork
+{
+    Q_OBJECT;
+
+public:
+
+    UIGlobalSettingsNetwork();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void addInterface();
+    void remInterface();
+    void editInterface();
+    void updateCurrentItem();
+    void showContextMenu (const QPoint &aPos);
+
+private:
+
+    QIWidgetValidator *mValidator;
+
+    QAction *mAddInterface;
+    QAction *mRemInterface;
+    QAction *mEditInterface;
+
+    bool m_fChanged;
+
+    /* Cache: */
+    UISettingsCacheGlobalNetwork m_cache;
+};
+
+#endif // __UIGlobalSettingsNetwork_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.ui	(revision 33882)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
+
+     Copyright (C) 2009-2010 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIGlobalSettingsNetwork</class>
+ <widget class="QWidget" name="UIGlobalSettingsNetwork">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>218</width>
+    <height>216</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0" rowspan="4">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="0" column="1" colspan="3">
+    <widget class="QLabel" name="mLbPageName">
+     <property name="text">
+      <string>&amp;Host-only Networks:</string>
+     </property>
+     <property name="buddy">
+      <cstring>mTwInterfaces</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QWidget" native="1" name="m_pWidNetwork" >
+     <layout class="QHBoxLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <property name="spacing" >
+       <number>1</number>
+      </property>
+      <item>
+       <widget class="QTreeWidget" name="mTwInterfaces">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>150</height>
+         </size>
+        </property>
+        <property name="whatsThis">
+         <string>Lists all available host-only networks.</string>
+        </property>
+        <property name="rootIsDecorated">
+         <bool>false</bool>
+        </property>
+        <column>
+         <property name="text">
+          <string>Name</string>
+         </property>
+        </column>
+       </widget>
+      </item>
+      <item>
+       <widget class="UIToolBar" name="mTbActions">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="1" rowspan="2">
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="2" colspan="2">
+    <widget class="QLabel" name="mLbInfo">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>UIToolBar</class>
+   <extends>QToolBar</extends>
+   <header>UIToolBar.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.cpp	(revision 33882)
@@ -0,0 +1,208 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsNetworkDetails class implementation
+ */
+
+/*
+ * Copyright (C) 2009 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* VBox Includes */
+#include "UIGlobalSettingsNetwork.h"
+#include "UIGlobalSettingsNetworkDetails.h"
+
+/* Qt Includes */
+#include <QHostAddress>
+#include <QRegExpValidator>
+
+UIGlobalSettingsNetworkDetails::UIGlobalSettingsNetworkDetails (QWidget *aParent)
+    : QIWithRetranslateUI2 <QIDialog> (aParent
+#ifdef Q_WS_MAC
+    ,Qt::Sheet
+#endif /* Q_WS_MAC */
+    )
+    , mItem(0)
+{
+    /* Apply UI decorations */
+    Ui::UIGlobalSettingsNetworkDetails::setupUi (this);
+
+    /* Setup dialog */
+    setWindowIcon (QIcon (":/guesttools_16px.png"));
+
+    /* Setup validators */
+    QString templateIPv4 ("([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
+                          "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
+                          "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
+                          "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])");
+    QString templateIPv6 ("[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
+                          "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
+                          "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
+                          "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}");
+
+    mLeIPv4->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
+    mLeNMv4->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
+    mLeIPv6->setValidator (new QRegExpValidator (QRegExp (templateIPv6), this));
+    mLeNMv6->setValidator (new QRegExpValidator (QRegExp ("[1-9][0-9]|1[0-1][0-9]|12[0-8]"), this));
+    mLeDhcpAddress->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
+    mLeDhcpMask->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
+    mLeDhcpLowerAddress->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
+    mLeDhcpUpperAddress->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
+
+    /* Setup widgets */
+    mLeIPv6->setFixedWidthByText (QString().fill ('X', 32) + QString().fill (':', 7));
+
+#if 0 /* defined (Q_WS_WIN32) */
+    QStyleOption options1;
+    options1.initFrom (mCbManual);
+    QGridLayout *layout1 = qobject_cast <QGridLayout*> (mTwDetails->widget (0)->layout());
+    int wid1 = mCbManual->style()->pixelMetric (QStyle::PM_IndicatorWidth, &options1, mCbManual) +
+               mCbManual->style()->pixelMetric (QStyle::PM_CheckBoxLabelSpacing, &options1, mCbManual) -
+               layout1->spacing() - 1;
+    QSpacerItem *spacer1 = new QSpacerItem (wid1, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
+    layout1->addItem (spacer1, 1, 0, 4);
+#else
+    mCbManual->setVisible (false);
+#endif
+
+    QStyleOption options2;
+    options2.initFrom (mCbDhcpServerEnabled);
+    QGridLayout *layout2 = qobject_cast <QGridLayout*> (mTwDetails->widget (1)->layout());
+    int wid2 = mCbDhcpServerEnabled->style()->pixelMetric (QStyle::PM_IndicatorWidth, &options2, mCbDhcpServerEnabled) +
+               mCbDhcpServerEnabled->style()->pixelMetric (QStyle::PM_CheckBoxLabelSpacing, &options2, mCbDhcpServerEnabled) -
+               layout2->spacing() - 1;
+    QSpacerItem *spacer2 = new QSpacerItem (wid2, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
+    layout2->addItem (spacer2, 1, 0, 4);
+
+    /* Setup connections */
+    connect (mCbManual, SIGNAL (stateChanged (int)),
+             this, SLOT (dhcpClientStatusChanged()));
+    connect (mCbDhcpServerEnabled, SIGNAL (stateChanged (int)),
+             this, SLOT (dhcpServerStatusChanged()));
+
+    /* Applying language settings */
+    retranslateUi();
+
+    /* Fix minimum possible size */
+    resize (minimumSizeHint());
+    qApp->processEvents();
+    setFixedSize (minimumSizeHint());
+}
+
+void UIGlobalSettingsNetworkDetails::getFromItem (NetworkItem *aItem)
+{
+    mItem = aItem;
+
+    /* Host-only Interface */
+    mCbManual->setChecked (!mItem->isDhcpClientEnabled());
+#if !0 /* !defined (Q_WS_WIN32) */
+    /* Disable automatic for all hosts for now */
+    mCbManual->setChecked (true);
+    mCbManual->setEnabled (false);
+#endif
+    dhcpClientStatusChanged();
+
+    /* DHCP Server */
+    mCbDhcpServerEnabled->setChecked (mItem->isDhcpServerEnabled());
+    dhcpServerStatusChanged();
+}
+
+void UIGlobalSettingsNetworkDetails::putBackToItem()
+{
+    /* Host-only Interface */
+    mItem->setDhcpClientEnabled (!mCbManual->isChecked());
+    if (mCbManual->isChecked())
+    {
+        mItem->setInterfaceAddress (mLeIPv4->text());
+        mItem->setInterfaceMask (mLeNMv4->text());
+        if (mItem->isIpv6Supported())
+        {
+            mItem->setInterfaceAddress6 (mLeIPv6->text());
+            mItem->setInterfaceMaskLength6 (mLeNMv6->text());
+        }
+    }
+
+    /* DHCP Server */
+    mItem->setDhcpServerEnabled (mCbDhcpServerEnabled->isChecked());
+    if (mCbDhcpServerEnabled->isChecked())
+    {
+        mItem->setDhcpServerAddress (mLeDhcpAddress->text());
+        mItem->setDhcpServerMask (mLeDhcpMask->text());
+        mItem->setDhcpLowerAddress (mLeDhcpLowerAddress->text());
+        mItem->setDhcpUpperAddress (mLeDhcpUpperAddress->text());
+    }
+}
+
+void UIGlobalSettingsNetworkDetails::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIGlobalSettingsNetworkDetails::retranslateUi (this);
+}
+
+void UIGlobalSettingsNetworkDetails::dhcpClientStatusChanged()
+{
+    bool isManual = mCbManual->isChecked();
+    bool isIpv6Supported = isManual && mItem->isIpv6Supported();
+
+    mLeIPv4->clear();
+    mLeNMv4->clear();
+    mLeIPv6->clear();
+    mLeNMv6->clear();
+
+    mLbIPv4->setEnabled (isManual);
+    mLbNMv4->setEnabled (isManual);
+    mLeIPv4->setEnabled (isManual);
+    mLeNMv4->setEnabled (isManual);
+    mLbIPv6->setEnabled (isIpv6Supported);
+    mLbNMv6->setEnabled (isIpv6Supported);
+    mLeIPv6->setEnabled (isIpv6Supported);
+    mLeNMv6->setEnabled (isIpv6Supported);
+
+    if (isManual)
+    {
+        mLeIPv4->setText (mItem->interfaceAddress());
+        mLeNMv4->setText (mItem->interfaceMask());
+        if (isIpv6Supported)
+        {
+            mLeIPv6->setText (mItem->interfaceAddress6());
+            mLeNMv6->setText (mItem->interfaceMaskLength6());
+        }
+    }
+}
+
+void UIGlobalSettingsNetworkDetails::dhcpServerStatusChanged()
+{
+    bool isEnabled = mCbDhcpServerEnabled->isChecked();
+
+    mLeDhcpAddress->clear();
+    mLeDhcpMask->clear();
+    mLeDhcpLowerAddress->clear();
+    mLeDhcpUpperAddress->clear();
+
+    mLbDhcpAddress->setEnabled (isEnabled);
+    mLbDhcpMask->setEnabled (isEnabled);
+    mLbDhcpLowerAddress->setEnabled (isEnabled);
+    mLbDhcpUpperAddress->setEnabled (isEnabled);
+    mLeDhcpAddress->setEnabled (isEnabled);
+    mLeDhcpMask->setEnabled (isEnabled);
+    mLeDhcpLowerAddress->setEnabled (isEnabled);
+    mLeDhcpUpperAddress->setEnabled (isEnabled);
+
+    if (isEnabled)
+    {
+        mLeDhcpAddress->setText (mItem->dhcpServerAddress());
+        mLeDhcpMask->setText (mItem->dhcpServerMask());
+        mLeDhcpLowerAddress->setText (mItem->dhcpLowerAddress());
+        mLeDhcpUpperAddress->setText (mItem->dhcpUpperAddress());
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.h	(revision 33882)
@@ -0,0 +1,57 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsNetworkDetails class declaration
+ */
+
+/*
+ * Copyright (C) 2009 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIGlobalSettingsNetworkDetails_h__
+#define __UIGlobalSettingsNetworkDetails_h__
+
+/* VBox includes */
+#include "QIDialog.h"
+#include "QIWithRetranslateUI.h"
+#include "UIGlobalSettingsNetworkDetails.gen.h"
+
+/* VBox forwards */
+class NetworkItem;
+
+class UIGlobalSettingsNetworkDetails : public QIWithRetranslateUI2 <QIDialog>,
+                                     public Ui::UIGlobalSettingsNetworkDetails
+{
+    Q_OBJECT;
+
+public:
+
+    UIGlobalSettingsNetworkDetails (QWidget *aParent);
+
+    void getFromItem (NetworkItem *aItem);
+    void putBackToItem();
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void dhcpClientStatusChanged();
+    void dhcpServerStatusChanged();
+
+private:
+
+    NetworkItem *mItem;
+};
+
+#endif // __UIGlobalSettingsNetworkDetails_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetails.ui	(revision 33882)
@@ -0,0 +1,375 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIGlobalSettingsNetworkDetails</class>
+ <widget class="QWidget" name="UIGlobalSettingsNetworkDetails" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>402</width>
+    <height>255</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Host-only Network Details</string>
+  </property>
+  <layout class="QVBoxLayout" >
+   <item>
+    <widget class="QITabWidget" name="mTwDetails" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="currentIndex" >
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="mTabInterface" >
+      <attribute name="title" >
+       <string>&amp;Adapter</string>
+      </attribute>
+      <layout class="QGridLayout" >
+       <item row="0" column="0" colspan="3" >
+        <widget class="QCheckBox" name="mCbManual" >
+         <property name="text" >
+          <string>Manual &amp;Configuration</string>
+         </property>
+         <property name="checked" >
+          <bool>true</bool>
+         </property>
+         <property name="toolTip" >
+          <string>Use manual configuration for this host-only network adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="QLabel" name="mLbIPv4" >
+         <property name="text" >
+          <string>&amp;IPv4 Address:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeIPv4</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2" >
+        <widget class="QILineEdit" name="mLeIPv4" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the host IPv4 address for this adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" >
+        <widget class="QLabel" name="mLbNMv4" >
+         <property name="text" >
+          <string>IPv4 Network &amp;Mask:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeNMv4</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2" >
+        <widget class="QILineEdit" name="mLeNMv4" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the host IPv4 network mask for this adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1" >
+        <widget class="QLabel" name="mLbIPv6" >
+         <property name="text" >
+          <string>I&amp;Pv6 Address:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeIPv6</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2" >
+        <widget class="QILineEdit" name="mLeIPv6" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the host IPv6 address for this adapter if IPv6 is supported.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1" >
+        <widget class="QLabel" name="mLbNMv6" >
+         <property name="text" >
+          <string>IPv6 Network Mask &amp;Length:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeNMv6</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="2" >
+        <widget class="QILineEdit" name="mLeNMv6" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the host IPv6 network mask prefix length for this adapter if IPv6 is supported.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0" colspan="3" >
+        <spacer name="verticalSpacer1" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mTabDhcpServer" >
+      <attribute name="title" >
+       <string>&amp;DHCP Server</string>
+      </attribute>
+      <layout class="QGridLayout" >
+       <item row="0" column="0" colspan="3" >
+        <widget class="QCheckBox" name="mCbDhcpServerEnabled" >
+         <property name="text" >
+          <string>&amp;Enable Server</string>
+         </property>
+         <property name="toolTip" >
+          <string>Indicates whether the DHCP Server is enabled on machine startup or not.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="QLabel" name="mLbDhcpAddress" >
+         <property name="text" >
+          <string>Server Add&amp;ress:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeDhcpAddress</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2" >
+        <widget class="QILineEdit" name="mLeDhcpAddress" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the address of the DHCP server servicing the network associated with this host-only adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" >
+        <widget class="QLabel" name="mLbDhcpMask" >
+         <property name="text" >
+          <string>Server &amp;Mask:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeDhcpMask</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2" >
+        <widget class="QILineEdit" name="mLeDhcpMask" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the network mask of the DHCP server servicing the network associated with this host-only adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1" >
+        <widget class="QLabel" name="mLbDhcpLowerAddress" >
+         <property name="text" >
+          <string>&amp;Lower Address Bound:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeDhcpLowerAddress</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2" >
+        <widget class="QILineEdit" name="mLeDhcpLowerAddress" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the lower address bound offered by the DHCP server servicing the network associated with this host-only adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1" >
+        <widget class="QLabel" name="mLbDhcpUpperAddress" >
+         <property name="text" >
+          <string>&amp;Upper Address Bound:</string>
+         </property>
+         <property name="alignment" >
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy" >
+          <cstring>mLeDhcpUpperAddress</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="2" >
+        <widget class="QILineEdit" name="mLeDhcpUpperAddress" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="toolTip" >
+          <string>Displays the upper address bound offered by the DHCP server servicing the network associated with this host-only adapter.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0" colspan="3" >
+        <spacer name="verticalSpacer2" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <widget class="QIDialogButtonBox" name="mButtonBox" >
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>QILineEdit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIDialogButtonBox</class>
+   <extends>QDialogButtonBox</extends>
+   <header>QIDialogButtonBox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QITabWidget</class>
+   <extends>QTabWidget</extends>
+   <header>QITabWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mButtonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>UIGlobalSettingsNetworkDetails</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>162</x>
+     <y>339</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>162</x>
+     <y>179</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>mButtonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>UIGlobalSettingsNetworkDetails</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>162</x>
+     <y>339</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>162</x>
+     <y>179</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp	(revision 33882)
@@ -0,0 +1,199 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsUpdate class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIGlobalSettingsUpdate.h"
+#include "VBoxGlobal.h"
+
+UIGlobalSettingsUpdate::UIGlobalSettingsUpdate()
+    : mSettingsChanged(false)
+    , mLastChosen(0)
+{
+    /* Apply UI decorations */
+    Ui::UIGlobalSettingsUpdate::setupUi (this);
+
+    /* Setup connections */
+    connect (mCbCheck, SIGNAL (toggled (bool)), this, SLOT (toggleUpdater (bool)));
+    connect (mCbOncePer, SIGNAL (activated (int)), this, SLOT (activatedPeriod (int)));
+    connect (mRbStable, SIGNAL (toggled (bool)), this, SLOT (toggledBranch()));
+    connect (mRbAllRelease, SIGNAL (toggled (bool)), this, SLOT (toggledBranch()));
+    connect (mRbWithBetas, SIGNAL (toggled (bool)), this, SLOT (toggledBranch()));
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsUpdate::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    VBoxUpdateData updateData(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_UpdateDate));
+    m_cache.m_fCheckEnabled = !updateData.isNoNeedToCheck();
+    m_cache.m_periodIndex = updateData.periodIndex();
+    m_cache.m_branchIndex = updateData.branchIndex();
+    m_cache.m_strDate = updateData.date();
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsUpdate::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    mCbCheck->setChecked(m_cache.m_fCheckEnabled);
+    if (mCbCheck->isChecked())
+    {
+        mCbOncePer->setCurrentIndex(m_cache.m_periodIndex);
+        if (m_cache.m_branchIndex == VBoxUpdateData::BranchWithBetas)
+            mRbWithBetas->setChecked(true);
+        else if (m_cache.m_branchIndex == VBoxUpdateData::BranchAllRelease)
+            mRbAllRelease->setChecked(true);
+        else
+            mRbStable->setChecked(true);
+    }
+    mTxDate->setText(m_cache.m_strDate);
+
+    /* Reset settings altering flag: */
+    mSettingsChanged = false;
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIGlobalSettingsUpdate::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    m_cache.m_periodIndex = periodType();
+    m_cache.m_branchIndex = branchType();
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIGlobalSettingsUpdate::saveFromCacheTo(QVariant &data)
+{
+    /* Test settings altering flag: */
+    if (!mSettingsChanged)
+        return;
+
+    /* Fetch data to properties & settings: */
+    UISettingsPageGlobal::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    VBoxUpdateData newData(m_cache.m_periodIndex, m_cache.m_branchIndex);
+    vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_UpdateDate, newData.data());
+
+    /* Upload properties & settings to data: */
+    UISettingsPageGlobal::uploadData(data);
+}
+
+void UIGlobalSettingsUpdate::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mCbCheck);
+    setTabOrder (mCbCheck, mCbOncePer);
+    setTabOrder (mCbOncePer, mRbStable);
+    setTabOrder (mRbStable, mRbAllRelease);
+    setTabOrder (mRbAllRelease, mRbWithBetas);
+}
+
+void UIGlobalSettingsUpdate::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIGlobalSettingsUpdate::retranslateUi (this);
+
+    /* Retranslate mCbOncePer combobox */
+    int ci = mCbOncePer->currentIndex();
+    mCbOncePer->clear();
+    VBoxUpdateData::populate();
+    mCbOncePer->insertItems (0, VBoxUpdateData::list());
+    mCbOncePer->setCurrentIndex (ci == -1 ? 0 : ci);
+}
+
+void UIGlobalSettingsUpdate::toggleUpdater (bool aOn)
+{
+    /* Enable/disable the sub widget */
+    mLbOncePer->setEnabled (aOn);
+    mCbOncePer->setEnabled (aOn);
+    mLbDate->setEnabled (aOn);
+    mTxDate->setEnabled (aOn);
+    mLbFilter->setEnabled (aOn);
+    mRbStable->setEnabled (aOn);
+    mRbAllRelease->setEnabled (aOn);
+    mRbWithBetas->setEnabled (aOn);
+    mRbStable->setAutoExclusive (aOn);
+    mRbAllRelease->setAutoExclusive (aOn);
+    mRbWithBetas->setAutoExclusive (aOn);
+
+    /* Update 'check for new version' time */
+    if (aOn)
+        activatedPeriod (mCbOncePer->currentIndex());
+    else
+    {
+        activatedPeriod (VBoxUpdateData::PeriodNever);
+        mLastChosen = mRbWithBetas->isChecked() ? mRbWithBetas :
+                      mRbAllRelease->isChecked() ? mRbAllRelease : mRbStable;
+    }
+
+    if (mLastChosen)
+        mLastChosen->setChecked (aOn);
+}
+
+void UIGlobalSettingsUpdate::activatedPeriod (int /*aIndex*/)
+{
+    VBoxUpdateData data (periodType(), branchType());
+    mTxDate->setText (data.date());
+    mSettingsChanged = true;
+}
+
+void UIGlobalSettingsUpdate::toggledBranch()
+{
+    mSettingsChanged = true;
+}
+
+void UIGlobalSettingsUpdate::showEvent (QShowEvent *aEvent)
+{
+    UISettingsPage::showEvent (aEvent);
+
+    /* That little hack allows avoid one of qt4 children focusing bug */
+    QWidget *current = QApplication::focusWidget();
+    mCbOncePer->setFocus (Qt::TabFocusReason);
+    if (current)
+        current->setFocus (Qt::TabFocusReason);
+}
+
+VBoxUpdateData::PeriodType UIGlobalSettingsUpdate::periodType() const
+{
+    VBoxUpdateData::PeriodType result = mCbCheck->isChecked() ?
+        (VBoxUpdateData::PeriodType) mCbOncePer->currentIndex() : VBoxUpdateData::PeriodNever;
+    return result == VBoxUpdateData::PeriodUndefined ? VBoxUpdateData::Period1Day : result;
+}
+
+VBoxUpdateData::BranchType UIGlobalSettingsUpdate::branchType() const
+{
+    if (mRbWithBetas->isChecked())
+        return VBoxUpdateData::BranchWithBetas;
+    else if (mRbAllRelease->isChecked())
+        return VBoxUpdateData::BranchAllRelease;
+    else
+        return VBoxUpdateData::BranchStable;
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.h	(revision 33882)
@@ -0,0 +1,86 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIGlobalSettingsUpdate class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIGlobalSettingsUpdate_h__
+#define __UIGlobalSettingsUpdate_h__
+
+#include "UISettingsPage.h"
+#include "UIGlobalSettingsUpdate.gen.h"
+#include "VBoxUpdateDlg.h"
+
+/* Global settings / Update page / Cache: */
+struct UISettingsCacheGlobalUpdate
+{
+    bool m_fCheckEnabled;
+    VBoxUpdateData::PeriodType m_periodIndex;
+    VBoxUpdateData::BranchType m_branchIndex;
+    QString m_strDate;
+};
+
+/* Global settings / Update page: */
+class UIGlobalSettingsUpdate : public UISettingsPageGlobal,
+                             public Ui::UIGlobalSettingsUpdate
+{
+    Q_OBJECT;
+
+public:
+
+    UIGlobalSettingsUpdate();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void toggleUpdater (bool aOn);
+    void activatedPeriod (int aIndex);
+    void toggledBranch();
+
+private:
+
+    void showEvent (QShowEvent *aEvent);
+
+    VBoxUpdateData::PeriodType periodType() const;
+    VBoxUpdateData::BranchType branchType() const;
+
+    bool mSettingsChanged;
+    QRadioButton *mLastChosen;
+
+    /* Cache: */
+    UISettingsCacheGlobalUpdate m_cache;
+};
+
+#endif // __UIGlobalSettingsUpdate_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.ui	(revision 33882)
@@ -0,0 +1,205 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIGlobalSettingsUpdate</class>
+ <widget class="QWidget" name="UIGlobalSettingsUpdate" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>300</width>
+    <height>131</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="leftMargin" >
+    <number>0</number>
+   </property>
+   <property name="topMargin" >
+    <number>0</number>
+   </property>
+   <property name="rightMargin" >
+    <number>0</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item row="0" column="1" colspan="4" >
+    <widget class="QCheckBox" name="mCbCheck" >
+     <property name="whatsThis" >
+      <string>When checked, the application will periodically connect to the VirtualBox website and check whether a new VirtualBox version is available.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Check for updates</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" rowspan="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>16</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="2" >
+    <widget class="QLabel" name="mLbOncePer" >
+     <property name="text" >
+      <string>&amp;Once per:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mCbOncePer</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3" >
+    <widget class="QComboBox" name="mCbOncePer" >
+     <property name="whatsThis" >
+      <string>Specifies how often the new version check should be performed. Note that if you want to completely disable this check, just clear the above check box.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="4" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="2" >
+    <widget class="QLabel" name="mLbDate" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text" >
+      <string>Next Check:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3" colspan="2" >
+    <widget class="QLabel" name="mTxDate" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2" >
+    <widget class="QLabel" name="mLbFilter" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text" >
+      <string>Check for:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3" colspan="2" >
+    <widget class="QRadioButton" name="mRbStable" >
+     <property name="whatsThis" >
+      <string>&lt;p>Choose this if you only wish to be notified about stable updates to VirtualBox.&lt;/p></string>
+     </property>
+     <property name="text" >
+      <string>&amp;Stable release versions</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="3" colspan="2" >
+    <widget class="QRadioButton" name="mRbAllRelease" >
+     <property name="whatsThis" >
+      <string>&lt;p>Choose this if you wish to be notified about all new VirtualBox releases.&lt;/p></string>
+     </property>
+     <property name="text" >
+      <string>&amp;All new releases</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="3" colspan="2" >
+    <widget class="QRadioButton" name="mRbWithBetas" >
+     <property name="whatsThis" >
+      <string>&lt;p>Choose this to be notified about all new VirtualBox releases and pre-release versions of VirtualBox.&lt;/p></string>
+     </property>
+     <property name="text" >
+      <string>All new releases and &amp;pre-releases</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1" colspan="4" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.cpp	(revision 33881)
+++ 	(revision )
@@ -1,150 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsGeneral class implementation
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-/* Global includes */
-#include <QDir>
-
-/* Local includes */
-#include "VBoxGLSettingsGeneral.h"
-#include "VBoxGlobal.h"
-
-VBoxGLSettingsGeneral::VBoxGLSettingsGeneral()
-{
-    /* Apply UI decorations */
-    Ui::VBoxGLSettingsGeneral::setupUi (this);
-
-#ifndef VBOX_GUI_WITH_SYSTRAY
-    mCbCheckTrayIcon->hide();
-    mWtSpacer1->hide();
-#endif /* !VBOX_GUI_WITH_SYSTRAY */
-#ifndef Q_WS_MAC
-    mCbCheckPresentationMode->hide();
-    mWtSpacer2->hide();
-#endif /* !Q_WS_MAC */
-//#ifndef Q_WS_WIN /* Checkbox hidden for now! */
-    mCbDisableHostScreenSaver->hide();
-    mWtSpacer3->hide();
-//#endif /* !Q_WS_WIN */
-
-    if (mCbCheckTrayIcon->isHidden() &&
-        mCbCheckPresentationMode->isHidden() &&
-        mCbDisableHostScreenSaver->isHidden())
-        mLnSeparator2->hide();
-
-    mPsMach->setHomeDir (vboxGlobal().virtualBox().GetHomeFolder());
-    mPsVRDP->setHomeDir (vboxGlobal().virtualBox().GetHomeFolder());
-    mPsVRDP->setMode (VBoxFilePathSelectorWidget::Mode_File_Open);
-
-    /* Applying language settings */
-    retranslateUi();
-}
-
-/* Load data to cashe from corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsGeneral::loadToCacheFrom(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Load to cache: */
-    m_cache.m_strDefaultMachineFolder = m_properties.GetDefaultMachineFolder();
-    m_cache.m_strVRDEAuthLibrary = m_properties.GetVRDEAuthLibrary();
-    m_cache.m_fTrayIconEnabled = m_settings.trayIconEnabled();
-#ifdef Q_WS_MAC
-    m_cache.m_fPresentationModeEnabled = m_settings.presentationModeEnabled();
-#endif /* Q_WS_MAC */
-    m_cache.m_fHostScreenSaverDisables = m_settings.hostScreenSaverDisabled();
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-/* Load data to corresponding widgets from cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsGeneral::getFromCache()
-{
-    /* Fetch from cache: */
-    mPsMach->setPath(m_cache.m_strDefaultMachineFolder);
-    mPsVRDP->setPath(m_cache.m_strVRDEAuthLibrary);
-    mCbCheckTrayIcon->setChecked(m_cache.m_fTrayIconEnabled);
-#ifdef Q_WS_MAC
-    mCbCheckPresentationMode->setChecked(m_cache.m_fPresentationModeEnabled);
-#endif /* Q_WS_MAC */
-    mCbDisableHostScreenSaver->setChecked(m_cache.m_fHostScreenSaverDisables);
-}
-
-/* Save data from corresponding widgets to cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsGeneral::putToCache()
-{
-    /* Upload to cache: */
-    m_cache.m_strDefaultMachineFolder = mPsMach->path();
-    m_cache.m_strVRDEAuthLibrary = mPsVRDP->path();
-    m_cache.m_fTrayIconEnabled = mCbCheckTrayIcon->isChecked();
-#ifdef Q_WS_MAC
-    m_cache.m_fPresentationModeEnabled = mCbCheckPresentationMode->isChecked();
-#endif /* Q_WS_MAC */
-    m_cache.m_fHostScreenSaverDisables = mCbDisableHostScreenSaver->isChecked();
-}
-
-/* Save data from cache to corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsGeneral::saveFromCacheTo(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Save from cache: */
-    if (m_properties.isOk() && mPsMach->isModified())
-        m_properties.SetDefaultMachineFolder(m_cache.m_strDefaultMachineFolder);
-    if (m_properties.isOk() && mPsVRDP->isModified())
-        m_properties.SetVRDEAuthLibrary(m_cache.m_strVRDEAuthLibrary);
-    m_settings.setTrayIconEnabled(m_cache.m_fTrayIconEnabled);
-#ifdef Q_WS_MAC
-    m_settings.setPresentationModeEnabled(m_cache.m_fPresentationModeEnabled);
-#endif /* Q_WS_MAC */
-    m_settings.setHostScreenSaverDisabled(m_cache.m_fHostScreenSaverDisables);
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-void VBoxGLSettingsGeneral::setOrderAfter (QWidget *aWidget)
-{
-    setTabOrder (aWidget, mPsMach);
-    setTabOrder (mPsMach, mPsVRDP);
-    setTabOrder (mPsVRDP, mCbCheckTrayIcon);
-    setTabOrder (mCbCheckTrayIcon, mCbCheckPresentationMode);
-    setTabOrder (mCbCheckPresentationMode, mCbDisableHostScreenSaver);
-}
-
-void VBoxGLSettingsGeneral::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxGLSettingsGeneral::retranslateUi (this);
-
-    mPsMach->setWhatsThis (tr ("Displays the path to the default virtual "
-                               "machine folder. This folder is used, if not "
-                               "explicitly specified otherwise, when creating "
-                               "new virtual machines."));
-    mPsVRDP->setWhatsThis (tr ("Displays the path to the library that "
-                               "provides authentication for Remote Display "
-                               "(VRDP) clients."));
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.h	(revision 33881)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsGeneral class declaration
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxGLSettingsGeneral_h__
-#define __VBoxGLSettingsGeneral_h__
-
-#include "UISettingsPage.h"
-#include "VBoxGLSettingsGeneral.gen.h"
-
-/* Global settings / General page / Cache: */
-struct UISettingsCacheGlobalGeneral
-{
-    QString m_strDefaultMachineFolder;
-    QString m_strVRDEAuthLibrary;
-    bool m_fTrayIconEnabled;
-#ifdef Q_WS_MAC
-    bool m_fPresentationModeEnabled;
-#endif /* Q_WS_MAC */
-    bool m_fHostScreenSaverDisables;
-};
-
-/* Global settings / General page: */
-class VBoxGLSettingsGeneral : public UISettingsPageGlobal,
-                              public Ui::VBoxGLSettingsGeneral
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxGLSettingsGeneral();
-
-protected:
-
-    /* Load data to cashe from corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void loadToCacheFrom(QVariant &data);
-    /* Load data to corresponding widgets from cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void getFromCache();
-
-    /* Save data from corresponding widgets to cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void putToCache();
-    /* Save data from cache to corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void saveFromCacheTo(QVariant &data);
-
-    void setOrderAfter (QWidget *aWidget);
-
-    void retranslateUi();
-
-private:
-
-    /* Cache: */
-    UISettingsCacheGlobalGeneral m_cache;
-};
-
-#endif // __VBoxGLSettingsGeneral_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.ui	(revision 33881)
+++ 	(revision )
@@ -1,184 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
-
-     Copyright (C) 2008-2010 Oracle Corporation
-
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- </comment>
- <class>VBoxGLSettingsGeneral</class>
- <widget class="QWidget" name="VBoxGLSettingsGeneral">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>379</width>
-    <height>173</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0" colspan="2">
-    <widget class="QLabel" name="mLbMach">
-     <property name="text">
-      <string>Default &amp;Machine Folder:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-     <property name="buddy">
-      <cstring>mPsMach</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="2">
-    <widget class="VBoxFilePathSelectorWidget" name="mPsMach">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" colspan="3">
-    <widget class="Line" name="mLnSeparator">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QLabel" name="mLbVRDP">
-     <property name="text">
-      <string>V&amp;RDP Authentication Library:</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-     <property name="buddy">
-      <cstring>mPsVRDP</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="2">
-    <widget class="VBoxFilePathSelectorWidget" name="mPsVRDP">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="0" colspan="3">
-    <widget class="Line" name="mLnSeparator2">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="0">
-    <widget class="QWidget" name="mWtSpacer1">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumWidth">
-      <number>34</number>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="1" colspan="2">
-    <widget class="QCheckBox" name="mCbCheckTrayIcon">
-     <property name="whatsThis">
-      <string>When checked, the application will provide an icon with the context menu in the system tray.</string>
-     </property>
-     <property name="text">
-      <string>&amp;Show System Tray Icon</string>
-     </property>
-     <property name="checked">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="0">
-    <widget class="QWidget" name="mWtSpacer2">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumWidth">
-      <number>34</number>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="1" colspan="2">
-    <widget class="QCheckBox" name="mCbCheckPresentationMode">
-     <property name="text">
-      <string>&amp;Auto show Dock and Menubar in fullscreen</string>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="0">
-    <widget class="QWidget" name="mWtSpacer3">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumWidth">
-      <number>34</number>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="1" colspan="2">
-    <widget class="QCheckBox" name="mCbDisableHostScreenSaver">
-     <property name="whatsThis">
-      <string>When checked, the host screen saver will be disabled whenever a virtual machine is running.</string>
-     </property>
-     <property name="text">
-      <string>Disable Host &amp;ScreenSaver</string>
-     </property>
-    </widget>
-   </item>
-   <item row="7" column="0" colspan="3">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>VBoxFilePathSelectorWidget</class>
-   <extends>QComboBox</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.cpp	(revision 33881)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsInput class implementation
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#include "VBoxGLSettingsInput.h"
-#include "VBoxGlobalSettings.h"
-
-VBoxGLSettingsInput::VBoxGLSettingsInput()
-{
-    /* Apply UI decorations */
-    Ui::VBoxGLSettingsInput::setupUi (this);
-
-    /* Applying language settings */
-    retranslateUi();
-}
-
-/* Load data to cashe from corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsInput::loadToCacheFrom(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Load to cache: */
-    m_cache.m_iHostKey = m_settings.hostKey();
-    m_cache.m_fAutoCapture = m_settings.autoCapture();
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-/* Load data to corresponding widgets from cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsInput::getFromCache()
-{
-    /* Fetch from cache: */
-    mHeHostKey->setKey(m_cache.m_iHostKey);
-    mCbAutoGrab->setChecked(m_cache.m_fAutoCapture);
-}
-
-/* Save data from corresponding widgets to cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsInput::putToCache()
-{
-    /* Upload to cache: */
-    m_cache.m_iHostKey = mHeHostKey->key();
-    m_cache.m_fAutoCapture = mCbAutoGrab->isChecked();
-}
-
-/* Save data from cache to corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsInput::saveFromCacheTo(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Save from cache: */
-    m_settings.setHostKey(m_cache.m_iHostKey);
-    m_settings.setAutoCapture(m_cache.m_fAutoCapture);
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-void VBoxGLSettingsInput::setOrderAfter (QWidget *aWidget)
-{
-    setTabOrder (aWidget, mHeHostKey);
-    setTabOrder (mHeHostKey, mTbResetHostKey);
-    setTabOrder (mTbResetHostKey, mCbAutoGrab);
-}
-
-void VBoxGLSettingsInput::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxGLSettingsInput::retranslateUi (this);
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.h	(revision 33881)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsInput class declaration
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxGLSettingsInput_h__
-#define __VBoxGLSettingsInput_h__
-
-#include "UISettingsPage.h"
-#include "VBoxGLSettingsInput.gen.h"
-
-/* Global settings / Input page / Cache: */
-struct UISettingsCacheGlobalInput
-{
-    int m_iHostKey;
-    bool m_fAutoCapture;
-};
-
-/* Global settings / Input page: */
-class VBoxGLSettingsInput : public UISettingsPageGlobal,
-                            public Ui::VBoxGLSettingsInput
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxGLSettingsInput();
-
-protected:
-
-    /* Load data to cashe from corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void loadToCacheFrom(QVariant &data);
-    /* Load data to corresponding widgets from cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void getFromCache();
-
-    /* Save data from corresponding widgets to cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void putToCache();
-    /* Save data from cache to corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void saveFromCacheTo(QVariant &data);
-
-    void setOrderAfter (QWidget *aWidget);
-
-    void retranslateUi();
-
-private:
-
-    /* Cache: */
-    UISettingsCacheGlobalInput m_cache;
-};
-
-#endif // __VBoxGLSettingsInput_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.ui	(revision 33881)
+++ 	(revision )
@@ -1,150 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
-
-     Copyright (C) 2008 Oracle Corporation
-
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- </comment>
- <class>VBoxGLSettingsInput</class>
- <widget class="QWidget" name="VBoxGLSettingsInput">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>292</width>
-    <height>91</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0" rowspan="2">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="1">
-    <widget class="QLabel" name="mLbHostKey">
-     <property name="text">
-      <string>Host &amp;Key:</string>
-     </property>
-     <property name="buddy">
-      <cstring>mHeHostKey</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="2">
-    <widget class="QIHotKeyEdit" name="mHeHostKey">
-     <property name="whatsThis">
-      <string>Displays the key used as a Host Key in the VM window. Activate the entry field and press a new Host Key. Note that alphanumeric, cursor movement and editing keys cannot be used.</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="3">
-    <widget class="UIResetButton" name="mTbResetHostKey">
-     <property name="focusPolicy">
-      <enum>Qt::StrongFocus</enum>
-     </property>
-     <property name="toolTip">
-      <string>Reset Host Key</string>
-     </property>
-     <property name="whatsThis">
-      <string>Resets the key used as a Host Key in the VM window.</string>
-     </property>
-     <property name="icon">
-      <iconset><normaloff>:/delete_16px.png</normaloff>:/delete_16px.png</iconset>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="4">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="2" colspan="3">
-    <widget class="QCheckBox" name="mCbAutoGrab">
-     <property name="whatsThis">
-      <string>When checked, the keyboard is automatically captured every time the VM window is activated. When the keyboard is captured, all keystrokes (including system ones like Alt-Tab) are directed to the VM.</string>
-     </property>
-     <property name="text">
-      <string>&amp;Auto Capture Keyboard</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="3">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>121</width>
-       <height>271</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QIHotKeyEdit</class>
-   <extends>QLabel</extends>
-   <header>QIHotKeyEdit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>UIResetButton</class>
-   <extends>QAbstractButton</extends>
-   <header>UISpecialControls.h</header>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="../VirtualBox1.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>mTbResetHostKey</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>mHeHostKey</receiver>
-   <slot>clear()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>111</x>
-     <y>19</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>124</x>
-     <y>61</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.cpp	(revision 33881)
+++ 	(revision )
@@ -1,363 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsLanguage class implementation
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#include "VBoxGLSettingsLanguage.h"
-#include "VBoxGlobalSettings.h"
-#include "VBoxGlobal.h"
-
-#include <QHeaderView>
-#include <QTranslator>
-#include <QDir>
-#include <QPainter>
-
-#include <iprt/err.h>
-#include <iprt/param.h>
-#include <iprt/path.h>
-#include <VBox/version.h>
-
-extern const char *gVBoxLangSubDir;
-extern const char *gVBoxLangFileBase;
-extern const char *gVBoxLangFileExt;
-extern const char *gVBoxLangIDRegExp;
-extern const char *gVBoxBuiltInLangName;
-
-class LanguageItem : public QTreeWidgetItem
-{
-public:
-
-    enum { LanguageItemType = QTreeWidgetItem::UserType + 1 };
-
-    LanguageItem (QTreeWidget *aParent, const QTranslator &aTranslator,
-                  const QString &aId, bool aBuiltIn = false)
-        : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (aBuiltIn)
-    {
-        Assert (!aId.isEmpty());
-
-        /* Note: context/source/comment arguments below must match strings
-         * used in VBoxGlobal::languageName() and friends (the latter are the
-         * source of information for the lupdate tool that generates
-         * translation files) */
-
-        QString nativeLanguage = tratra (aTranslator,
-            "@@@", "English", "Native language name");
-        QString nativeCountry = tratra (aTranslator,
-            "@@@", "--", "Native language country name "
-            "(empty if this language is for all countries)");
-
-        QString englishLanguage = tratra (aTranslator,
-            "@@@", "English", "Language name, in English");
-        QString englishCountry = tratra (aTranslator,
-            "@@@", "--", "Language country name, in English "
-            "(empty if native country name is empty)");
-
-        QString translatorsName = tratra (aTranslator,
-            "@@@", "Oracle Corporation", "Comma-separated list of translators");
-
-        QString itemName = nativeLanguage;
-        QString langName = englishLanguage;
-
-        if (!aBuiltIn)
-        {
-            if (nativeCountry != "--")
-                itemName += " (" + nativeCountry + ")";
-
-            if (englishCountry != "--")
-                langName += " (" + englishCountry + ")";
-
-            if (itemName != langName)
-                langName = itemName + " / " + langName;
-        }
-        else
-        {
-            itemName += VBoxGLSettingsLanguage::tr (" (built-in)", "Language");
-            langName += VBoxGLSettingsLanguage::tr (" (built-in)", "Language");
-        }
-
-        setText (0, itemName);
-        setText (1, aId);
-        setText (2, langName);
-        setText (3, translatorsName);
-
-        /* Current language appears in bold */
-        if (text (1) == VBoxGlobal::languageId())
-        {
-            QFont fnt = font (0);
-            fnt.setBold (true);
-            setFont (0, fnt);
-        }
-    }
-
-    /* Constructs an item for an invalid language ID (i.e. when a language
-     * file is missing or corrupt). */
-    LanguageItem (QTreeWidget *aParent, const QString &aId)
-        : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (false)
-    {
-        Assert (!aId.isEmpty());
-
-        setText (0, QString ("<%1>").arg (aId));
-        setText (1, aId);
-        setText (2, VBoxGLSettingsLanguage::tr ("<unavailable>", "Language"));
-        setText (3, VBoxGLSettingsLanguage::tr ("<unknown>", "Author(s)"));
-
-        /* Invalid language appears in italic */
-        QFont fnt = font (0);
-        fnt.setItalic (true);
-        setFont (0, fnt);
-    }
-
-    /* Constructs an item for the default language ID (column 1 will be set
-     * to QString::null) */
-    LanguageItem (QTreeWidget *aParent)
-        : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (false)
-    {
-        setText (0, VBoxGLSettingsLanguage::tr ("Default", "Language"));
-        setText (1, QString::null);
-        /* Empty strings of some reasonable length to prevent the info part
-         * from being shrinked too much when the list wants to be wider */
-        setText (2, "                ");
-        setText (3, "                ");
-    }
-
-    bool isBuiltIn() const { return mBuiltIn; }
-
-    bool operator< (const QTreeWidgetItem &aOther) const
-    {
-        QString thisId = text (1);
-        QString thatId = aOther.text (1);
-        if (thisId.isNull())
-            return true;
-        if (thatId.isNull())
-            return false;
-        if (mBuiltIn)
-            return true;
-        if (aOther.type() == LanguageItemType && ((LanguageItem*) &aOther)->mBuiltIn)
-            return false;
-        return QTreeWidgetItem::operator< (aOther);
-    }
-
-private:
-
-    QString tratra (const QTranslator &aTranslator, const char *aCtxt,
-                    const char *aSrc, const char *aCmnt)
-    {
-        QString msg = aTranslator.translate (aCtxt, aSrc, aCmnt);
-        /* return the source text if no translation is found */
-        if (msg.isEmpty())
-            msg = QString (aSrc);
-        return msg;
-    }
-
-    bool mBuiltIn : 1;
-};
-
-
-VBoxGLSettingsLanguage::VBoxGLSettingsLanguage()
-    : mLanguageChanged(false)
-{
-    /* Apply UI decorations */
-    Ui::VBoxGLSettingsLanguage::setupUi (this);
-
-    /* Setup dialog */
-    mTwLanguage->header()->hide();
-    mTwLanguage->hideColumn (1);
-    mTwLanguage->hideColumn (2);
-    mTwLanguage->hideColumn (3);
-
-    /* Setup Connections */
-    connect (mTwLanguage, SIGNAL (painted (QTreeWidgetItem *, QPainter *)),
-             this, SLOT (mTwItemPainted (QTreeWidgetItem *, QPainter *)));
-    connect (mTwLanguage, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
-             this, SLOT (mTwLanguageChanged (QTreeWidgetItem *)));
-
-    /* Applying language settings */
-    retranslateUi();
-}
-
-/* Load data to cashe from corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsLanguage::loadToCacheFrom(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Load to cache: */
-    m_cache.m_strLanguageId = m_settings.languageId();
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-/* Load data to corresponding widgets from cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsLanguage::getFromCache()
-{
-    /* Fetch from cache: */
-    reload(m_cache.m_strLanguageId);
-    mTxName->setFixedHeight(fontMetrics().height() * 4);
-}
-
-/* Save data from corresponding widgets to cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsLanguage::putToCache()
-{
-    /* Upload to cache: */
-    QTreeWidgetItem *pCurrentItem = mTwLanguage->currentItem();
-    Assert(pCurrentItem);
-    if (pCurrentItem)
-        m_cache.m_strLanguageId = pCurrentItem->text(1);
-}
-
-/* Save data from cache to corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsLanguage::saveFromCacheTo(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Save from cache: */
-    if (mLanguageChanged)
-    {
-        m_settings.setLanguageId(m_cache.m_strLanguageId);
-        VBoxGlobal::loadLanguage(m_cache.m_strLanguageId);
-    }
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-void VBoxGLSettingsLanguage::setOrderAfter (QWidget *aWidget)
-{
-    setTabOrder (aWidget, mTwLanguage);
-}
-
-void VBoxGLSettingsLanguage::reload (const QString &aLangId)
-{
-    /* Clear languages list */
-    mTwLanguage->clear();
-
-    /* Load languages list */
-    char szNlsPath [RTPATH_MAX];
-    int rc = RTPathAppPrivateNoArch (szNlsPath, sizeof(szNlsPath));
-    AssertRC (rc);
-    QString nlsPath = QString (szNlsPath) + gVBoxLangSubDir;
-    QDir nlsDir (nlsPath);
-    QStringList files = nlsDir.entryList (QStringList (QString ("%1*%2")
-        .arg (gVBoxLangFileBase, gVBoxLangFileExt)), QDir::Files);
-
-    QTranslator translator;
-    /* Add the default language */
-    new LanguageItem (mTwLanguage);
-    /* Add the built-in language */
-    new LanguageItem (mTwLanguage, translator, gVBoxBuiltInLangName, true /* built-in */);
-    /* Add all existing languages */
-    for (QStringList::Iterator it = files.begin(); it != files.end(); ++ it)
-    {
-        QString fileName = *it;
-        QRegExp regExp (QString (gVBoxLangFileBase) + gVBoxLangIDRegExp);
-        int pos = regExp.indexIn (fileName);
-        if (pos == -1)
-            continue;
-
-        /* Skip any English version, cause this is extra handled. */
-        QString lang = regExp.cap (2);
-        if (lang.toLower() == "en")
-            continue;
-
-        bool loadOk = translator.load (fileName, nlsPath);
-        if (!loadOk)
-            continue;
-
-        new LanguageItem (mTwLanguage, translator, regExp.cap (1));
-    }
-
-    /* Adjust selector list */
-#ifdef Q_WS_MAC
-    int width = qMax (static_cast<QAbstractItemView*> (mTwLanguage)
-        ->sizeHintForColumn (0) + 2 * mTwLanguage->frameWidth() +
-        QApplication::style()->pixelMetric (QStyle::PM_ScrollBarExtent),
-        220);
-    mTwLanguage->setFixedWidth (width);
-#else /* Q_WS_MAC */
-    mTwLanguage->setMinimumWidth (static_cast<QAbstractItemView*> (mTwLanguage)
-        ->sizeHintForColumn (0) + 2 * mTwLanguage->frameWidth() +
-        QApplication::style()->pixelMetric (QStyle::PM_ScrollBarExtent));
-#endif /* Q_WS_MAC */
-    mTwLanguage->resizeColumnToContents (0);
-
-    /* Search for necessary language */
-    QList<QTreeWidgetItem*> itemsList =
-        mTwLanguage->findItems (aLangId, Qt::MatchExactly, 1);
-    QTreeWidgetItem *item = itemsList.isEmpty() ? 0 : itemsList [0];
-    if (!item)
-    {
-        /* Add an item for an invalid language to represent it in the list */
-        item = new LanguageItem (mTwLanguage, aLangId);
-        mTwLanguage->resizeColumnToContents (0);
-    }
-    Assert (item);
-    if (item)
-        mTwLanguage->setCurrentItem (item);
-
-    mTwLanguage->sortItems (0, Qt::AscendingOrder);
-    mTwLanguage->scrollToItem (item);
-    mLanguageChanged = false;
-}
-
-void VBoxGLSettingsLanguage::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxGLSettingsLanguage::retranslateUi (this);
-    reload (VBoxGlobal::languageId());
-}
-
-void VBoxGLSettingsLanguage::mTwItemPainted (QTreeWidgetItem *aItem, QPainter *aPainter)
-{
-    if (aItem && aItem->type() == LanguageItem::LanguageItemType)
-    {
-        LanguageItem *item = static_cast <LanguageItem*> (aItem);
-        if (item->isBuiltIn())
-        {
-            QRect rect = mTwLanguage->visualItemRect (item);
-            aPainter->setPen (mTwLanguage->palette().color (QPalette::Mid));
-            aPainter->drawLine (rect.x(), rect.y() + rect.height() - 1,
-                                rect.x() + rect.width(), rect.y() + rect.height() - 1);
-        }
-    }
-}
-
-void VBoxGLSettingsLanguage::mTwLanguageChanged (QTreeWidgetItem *aItem)
-{
-    if (!aItem) return;
-
-    /* Disable labels for the Default language item */
-    bool enabled = !aItem->text (1).isNull();
-
-    mTxName->setEnabled (enabled);
-    mTxName->setText (QString ("<table>"
-                               "<tr><td>%1&nbsp;</td><td>%2</td></tr>"
-                               "<tr><td>%3&nbsp;</td><td>%4</td></tr>"
-                               "</table>")
-                      .arg (tr ("Language:"))
-                      .arg (aItem->text (2))
-                      .arg (tr ("Author(s):"))
-                      .arg (aItem->text (3)));
-
-    mLanguageChanged = true;
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.h	(revision 33881)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsLanguage class declaration
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxGLSettingsLanguage_h__
-#define __VBoxGLSettingsLanguage_h__
-
-#include "UISettingsPage.h"
-#include "VBoxGLSettingsLanguage.gen.h"
-
-/* Global settings / Language page / Cache: */
-struct UISettingsCacheGlobalLanguage
-{
-    QString m_strLanguageId;
-};
-
-/* Global settings / Language page: */
-class VBoxGLSettingsLanguage : public UISettingsPageGlobal,
-                               public Ui::VBoxGLSettingsLanguage
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxGLSettingsLanguage();
-
-protected:
-
-    /* Load data to cashe from corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void loadToCacheFrom(QVariant &data);
-    /* Load data to corresponding widgets from cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void getFromCache();
-
-    /* Save data from corresponding widgets to cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void putToCache();
-    /* Save data from cache to corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void saveFromCacheTo(QVariant &data);
-
-    void setOrderAfter (QWidget *aWidget);
-
-    void reload (const QString &aLangId);
-
-    void retranslateUi();
-
-private slots:
-
-    void mTwItemPainted (QTreeWidgetItem *aItem, QPainter *aPainter);
-    void mTwLanguageChanged (QTreeWidgetItem *aItem);
-
-private:
-
-    bool mLanguageChanged;
-
-    /* Cache: */
-    UISettingsCacheGlobalLanguage m_cache;
-};
-
-#endif // __VBoxGLSettingsLanguage_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.ui	(revision 33881)
+++ 	(revision )
@@ -1,142 +1,0 @@
-<ui version="4.0" >
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2008 Oracle Corporation
-
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- </comment>
- <class>VBoxGLSettingsLanguage</class>
- <widget class="QWidget" name="VBoxGLSettingsLanguage" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>346</width>
-    <height>246</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" >
-   <item row="0" column="0" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="1" colspan="2" >
-    <widget class="QLabel" name="mGbLanguage" >
-     <property name="text" >
-      <string>&amp;Interface Language:</string>
-     </property>
-     <property name="buddy" >
-      <cstring>mTwLanguage</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="2" >
-    <widget class="QITreeWidget" name="mTwLanguage" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize" >
-      <size>
-       <width>0</width>
-       <height>150</height>
-      </size>
-     </property>
-     <property name="whatsThis" >
-      <string>Lists all available user interface languages. The effective language is written in &lt;b>bold&lt;/b>. Select &lt;i>Default&lt;/i> to reset to the system default language.</string>
-     </property>
-     <property name="rootIsDecorated" >
-      <bool>false</bool>
-     </property>
-     <column>
-      <property name="text" >
-       <string>Name</string>
-      </property>
-     </column>
-     <column>
-      <property name="text" >
-       <string>Id</string>
-      </property>
-     </column>
-     <column>
-      <property name="text" >
-       <string>Language</string>
-      </property>
-     </column>
-     <column>
-      <property name="text" >
-       <string>Author</string>
-      </property>
-     </column>
-    </widget>
-   </item>
-   <item row="2" column="2" >
-    <widget class="QILabel" name="mTxName" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="alignment" >
-      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-     </property>
-     <property name="wordWrap" >
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QITreeWidget</class>
-   <extends>QTreeWidget</extends>
-   <header>QITreeWidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.cpp	(revision 33881)
+++ 	(revision )
@@ -1,571 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsNetwork class implementation
- */
-
-/*
- * Copyright (C) 2009-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-/* Local includes */
-#include "QIWidgetValidator.h"
-#include "UIIconPool.h"
-#include "VBoxGLSettingsNetwork.h"
-#include "VBoxGLSettingsNetworkDetails.h"
-#include "VBoxGlobal.h"
-#include "VBoxProblemReporter.h"
-
-/* Qt includes */
-#include <QHeaderView>
-#include <QHostAddress>
-
-NetworkItem::NetworkItem()
-    : QTreeWidgetItem()
-{
-}
-
-void NetworkItem::fetchNetworkData(const UIHostNetworkData &data)
-{
-    /* Fetch from cache: */
-    m_data = data;
-
-    /* Update tool-tip: */
-    updateInfo();
-}
-
-void NetworkItem::uploadNetworkData(UIHostNetworkData &data)
-{
-    /* Upload to cache: */
-    data = m_data;
-}
-
-bool NetworkItem::revalidate (QString &aWarning, QString & /* aTitle */)
-{
-    /* Host-only Interface validation */
-    if (!m_data.m_interface.m_fDhcpClientEnabled)
-    {
-        if (m_data.m_interface.m_strInterfaceAddress.isEmpty() &&
-            (QHostAddress (m_data.m_interface.m_strInterfaceAddress) == QHostAddress::Any ||
-             QHostAddress (m_data.m_interface.m_strInterfaceAddress).protocol() != QAbstractSocket::IPv4Protocol))
-        {
-            aWarning = VBoxGLSettingsNetwork::tr ("host IPv4 address of <b>%1</b> is wrong").arg (text (0));
-            return false;
-        }
-        if (!m_data.m_interface.m_strInterfaceMask.isEmpty() &&
-            (QHostAddress (m_data.m_interface.m_strInterfaceMask) == QHostAddress::Any ||
-             QHostAddress (m_data.m_interface.m_strInterfaceMask).protocol() != QAbstractSocket::IPv4Protocol))
-        {
-            aWarning = VBoxGLSettingsNetwork::tr ("host IPv4 network mask of <b>%1</b> is wrong").arg (text (0));
-            return false;
-        }
-        if (m_data.m_interface.m_fIpv6Supported)
-        {
-            if (!m_data.m_interface.m_strInterfaceAddress6.isEmpty() &&
-                (QHostAddress (m_data.m_interface.m_strInterfaceAddress6) == QHostAddress::AnyIPv6 ||
-                 QHostAddress (m_data.m_interface.m_strInterfaceAddress6).protocol() != QAbstractSocket::IPv6Protocol))
-            {
-                aWarning = VBoxGLSettingsNetwork::tr ("host IPv6 address of <b>%1</b> is wrong").arg (text (0));
-                return false;
-            }
-        }
-    }
-
-    /* DHCP Server settings */
-    if (m_data.m_dhcpserver.m_fDhcpServerEnabled)
-    {
-        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpServerAddress) == QHostAddress::Any ||
-            QHostAddress (m_data.m_dhcpserver.m_strDhcpServerAddress).protocol() != QAbstractSocket::IPv4Protocol)
-        {
-            aWarning = VBoxGLSettingsNetwork::tr ("DHCP server address of <b>%1</b> is wrong").arg (text (0));
-            return false;
-        }
-        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpServerMask) == QHostAddress::Any ||
-            QHostAddress (m_data.m_dhcpserver.m_strDhcpServerMask).protocol() != QAbstractSocket::IPv4Protocol)
-        {
-            aWarning = VBoxGLSettingsNetwork::tr ("DHCP server network mask of <b>%1</b> is wrong").arg (text (0));
-            return false;
-        }
-        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpLowerAddress) == QHostAddress::Any ||
-            QHostAddress (m_data.m_dhcpserver.m_strDhcpLowerAddress).protocol() != QAbstractSocket::IPv4Protocol)
-        {
-            aWarning = VBoxGLSettingsNetwork::tr ("DHCP lower address bound of <b>%1</b> is wrong").arg (text (0));
-            return false;
-        }
-        if (QHostAddress (m_data.m_dhcpserver.m_strDhcpUpperAddress) == QHostAddress::Any ||
-            QHostAddress (m_data.m_dhcpserver.m_strDhcpUpperAddress).protocol() != QAbstractSocket::IPv4Protocol)
-        {
-            aWarning = VBoxGLSettingsNetwork::tr ("DHCP upper address bound of <b>%1</b> is wrong").arg (text (0));
-            return false;
-        }
-    }
-    return true;
-}
-
-QString NetworkItem::updateInfo()
-{
-    /* Update text: */
-    setText(0, m_data.m_interface.m_strName);
-
-    /* Update information label */
-    QString hdr ("<tr><td><nobr>%1:&nbsp;</nobr></td>"
-                 "<td><nobr>%2</nobr></td></tr>");
-    QString sub ("<tr><td><nobr>&nbsp;&nbsp;%1:&nbsp;</nobr></td>"
-                 "<td><nobr>%2</nobr></td></tr>");
-    QString data, tip, buffer;
-
-    /* Host-only Interface information */
-    buffer = hdr.arg (VBoxGLSettingsNetwork::tr ("Adapter"))
-                .arg (m_data.m_interface.m_fDhcpClientEnabled ? VBoxGLSettingsNetwork::tr ("Automatically configured", "interface")
-                                                              : VBoxGLSettingsNetwork::tr ("Manually configured", "interface"));
-    data += buffer;
-    tip += buffer;
-
-    if (!m_data.m_interface.m_fDhcpClientEnabled)
-    {
-        buffer = sub.arg (VBoxGLSettingsNetwork::tr ("IPv4 Address"))
-                    .arg (m_data.m_interface.m_strInterfaceAddress.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "address")
-                                                                             : m_data.m_interface.m_strInterfaceAddress) +
-                 sub.arg (VBoxGLSettingsNetwork::tr ("IPv4 Network Mask"))
-                    .arg (m_data.m_interface.m_strInterfaceMask.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "mask")
-                                                                          : m_data.m_interface.m_strInterfaceMask);
-        tip += buffer;
-
-        if (m_data.m_interface.m_fIpv6Supported)
-        {
-            buffer = sub.arg (VBoxGLSettingsNetwork::tr ("IPv6 Address"))
-                        .arg (m_data.m_interface.m_strInterfaceAddress6.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "address")
-                                                                                  : m_data.m_interface.m_strInterfaceAddress6) +
-                     sub.arg (VBoxGLSettingsNetwork::tr ("IPv6 Network Mask Length"))
-                        .arg (m_data.m_interface.m_strInterfaceMaskLength6.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "length")
-                                                              : m_data.m_interface.m_strInterfaceMaskLength6);
-            tip += buffer;
-        }
-    }
-
-    /* DHCP Server information */
-    buffer = hdr.arg (VBoxGLSettingsNetwork::tr ("DHCP Server"))
-                .arg (m_data.m_dhcpserver.m_fDhcpServerEnabled ? VBoxGLSettingsNetwork::tr ("Enabled", "server")
-                                                               : VBoxGLSettingsNetwork::tr ("Disabled", "server"));
-    data += buffer;
-    tip += buffer;
-
-    if (m_data.m_dhcpserver.m_fDhcpServerEnabled)
-    {
-        buffer = sub.arg (VBoxGLSettingsNetwork::tr ("Address"))
-                    .arg (m_data.m_dhcpserver.m_strDhcpServerAddress.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "address")
-                                                                               : m_data.m_dhcpserver.m_strDhcpServerAddress) +
-                 sub.arg (VBoxGLSettingsNetwork::tr ("Network Mask"))
-                    .arg (m_data.m_dhcpserver.m_strDhcpServerMask.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "mask")
-                                                                            : m_data.m_dhcpserver.m_strDhcpServerMask) +
-                 sub.arg (VBoxGLSettingsNetwork::tr ("Lower Bound"))
-                    .arg (m_data.m_dhcpserver.m_strDhcpLowerAddress.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "bound")
-                                                                              : m_data.m_dhcpserver.m_strDhcpLowerAddress) +
-                 sub.arg (VBoxGLSettingsNetwork::tr ("Upper Bound"))
-                    .arg (m_data.m_dhcpserver.m_strDhcpUpperAddress.isEmpty() ? VBoxGLSettingsNetwork::tr ("Not set", "bound")
-                                                                              : m_data.m_dhcpserver.m_strDhcpUpperAddress);
-        tip += buffer;
-    }
-
-    setToolTip (0, tip);
-
-    return QString ("<table>") + data + QString ("</table>");
-}
-
-VBoxGLSettingsNetwork::VBoxGLSettingsNetwork()
-    : mValidator(0)
-    , mAddInterface(0), mRemInterface(0), mEditInterface(0)
-    , m_fChanged(false)
-{
-    /* Apply UI decorations */
-    Ui::VBoxGLSettingsNetwork::setupUi (this);
-
-#ifdef Q_WS_MAC
-    /* Make shifting spacer for MAC as we have fixed-size networks list */
-    QSpacerItem *shiftSpacer =
-        new QSpacerItem (0, 1, QSizePolicy::Expanding, QSizePolicy::Preferred);
-    QGridLayout *mainLayout = static_cast <QGridLayout*> (layout());
-    mainLayout->addItem (shiftSpacer, 1, 4);
-    //static_cast <QHBoxLayout*> (mWtActions->layout())->addStretch();
-#endif
-
-    /* Setup tree-widget */
-    mTwInterfaces->header()->hide();
-    mTwInterfaces->setContextMenuPolicy (Qt::CustomContextMenu);
-
-    /* Prepare toolbar */
-    mAddInterface = new QAction (mTwInterfaces);
-    mRemInterface = new QAction (mTwInterfaces);
-    mEditInterface = new QAction (mTwInterfaces);
-
-    mAddInterface->setShortcuts (QList <QKeySequence> ()
-                                 << QKeySequence ("Ins")
-                                 << QKeySequence ("Ctrl+N"));
-    mRemInterface->setShortcuts (QList <QKeySequence> ()
-                                 << QKeySequence ("Del")
-                                 << QKeySequence ("Ctrl+R"));
-    mEditInterface->setShortcuts (QList <QKeySequence> ()
-                                  << QKeySequence ("Space")
-                                  << QKeySequence ("F2"));
-
-    mAddInterface->setIcon(UIIconPool::iconSet(":/add_host_iface_16px.png",
-                                               ":/add_host_iface_disabled_16px.png"));
-    mRemInterface->setIcon(UIIconPool::iconSet(":/remove_host_iface_16px.png",
-                                               ":/remove_host_iface_disabled_16px.png"));
-    mEditInterface->setIcon(UIIconPool::iconSet(":/guesttools_16px.png",
-                                                ":/guesttools_disabled_16px.png"));
-
-    mTbActions->setUsesTextLabel (false);
-    mTbActions->setIconSize (QSize (16, 16));
-    mTbActions->setOrientation (Qt::Vertical);
-    mTbActions->addAction (mAddInterface);
-    mTbActions->addAction (mRemInterface);
-    mTbActions->addAction (mEditInterface);
-    mTbActions->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
-    mTbActions->updateGeometry();
-    mTbActions->setMinimumHeight (mTbActions->sizeHint().height());
-
-    /* Setup connections */
-    connect (mAddInterface, SIGNAL (triggered (bool)), this, SLOT (addInterface()));
-    connect (mRemInterface, SIGNAL (triggered (bool)), this, SLOT (remInterface()));
-    connect (mEditInterface, SIGNAL (triggered (bool)), this, SLOT (editInterface()));
-    connect (mTwInterfaces, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
-             this, SLOT (updateCurrentItem()));
-    connect (mTwInterfaces, SIGNAL (customContextMenuRequested (const QPoint &)),
-             this, SLOT (showContextMenu (const QPoint &)));
-    connect (mTwInterfaces, SIGNAL (itemDoubleClicked (QTreeWidgetItem*, int)),
-             this, SLOT (editInterface()));
-
-    /* Applying language settings */
-    retranslateUi();
-}
-
-/* Load data to cashe from corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsNetwork::loadToCacheFrom(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Load to cache: */
-    const CHostNetworkInterfaceVector &interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
-    for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size(); ++iNetworkIndex)
-    {
-        const CHostNetworkInterface &iface = interfaces[iNetworkIndex];
-        if (iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
-        {
-            /* Initialization: */
-            CDHCPServer dhcp = vboxGlobal().virtualBox().FindDHCPServerByNetworkName(iface.GetNetworkName());
-            if (dhcp.isNull()) vboxGlobal().virtualBox().CreateDHCPServer(iface.GetNetworkName());
-            dhcp = vboxGlobal().virtualBox().FindDHCPServerByNetworkName(iface.GetNetworkName());
-            AssertMsg(!dhcp.isNull(), ("DHCP Server creation failed!\n"));
-            UIHostNetworkData data;
-            /* Host-only interface settings */
-            data.m_interface.m_strName = iface.GetName();
-            data.m_interface.m_fDhcpClientEnabled = iface.GetDhcpEnabled();
-            data.m_interface.m_strInterfaceAddress = iface.GetIPAddress();
-            data.m_interface.m_strInterfaceMask = iface.GetNetworkMask();
-            data.m_interface.m_fIpv6Supported = iface.GetIPV6Supported();
-            data.m_interface.m_strInterfaceAddress6 = iface.GetIPV6Address();
-            data.m_interface.m_strInterfaceMaskLength6 = QString::number(iface.GetIPV6NetworkMaskPrefixLength());
-            /* DHCP server settings: */
-            data.m_dhcpserver.m_fDhcpServerEnabled = dhcp.GetEnabled();
-            data.m_dhcpserver.m_strDhcpServerAddress = dhcp.GetIPAddress();
-            data.m_dhcpserver.m_strDhcpServerMask = dhcp.GetNetworkMask();
-            data.m_dhcpserver.m_strDhcpLowerAddress = dhcp.GetLowerIP();
-            data.m_dhcpserver.m_strDhcpUpperAddress = dhcp.GetUpperIP();
-            /* Cache: */
-            m_cache.m_items << data;
-        }
-    }
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-/* Load data to corresponding widgets from cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsNetwork::getFromCache()
-{
-    /* Fetch from cache: */
-    for (int iNetworkIndex = 0; iNetworkIndex < m_cache.m_items.size(); ++iNetworkIndex)
-    {
-        const UIHostNetworkData &data = m_cache.m_items[iNetworkIndex];
-        NetworkItem *pItem = new NetworkItem;
-        pItem->fetchNetworkData(data);
-        mTwInterfaces->addTopLevelItem(pItem);
-    }
-    mTwInterfaces->setCurrentItem(mTwInterfaces->topLevelItem(0));
-    updateCurrentItem();
-#ifdef Q_WS_MAC
-    int width = qMax(static_cast<QAbstractItemView*>(mTwInterfaces)->sizeHintForColumn(0) +
-                     2 * mTwInterfaces->frameWidth() + QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
-                     220);
-    mTwInterfaces->setFixedWidth(width);
-    mTwInterfaces->resizeColumnToContents(0);
-#endif /* Q_WS_MAC */
-}
-
-/* Save data from corresponding widgets to cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsNetwork::putToCache()
-{
-    /* Upload to cache: */
-    m_cache.m_items.clear();
-    for (int iNetworkIndex = 0; iNetworkIndex < mTwInterfaces->topLevelItemCount(); ++iNetworkIndex)
-    {
-        UIHostNetworkData data;
-        NetworkItem *pItem = static_cast<NetworkItem*>(mTwInterfaces->topLevelItem(iNetworkIndex));
-        pItem->uploadNetworkData(data);
-        m_cache.m_items << data;
-    }
-}
-
-/* Save data from cache to corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsNetwork::saveFromCacheTo(QVariant &data)
-{
-    /* Ensure settings were changed: */
-    if (!m_fChanged)
-        return;
-
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Save from cache: */
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-    CHost host = vbox.GetHost();
-    const CHostNetworkInterfaceVector &interfaces = host.GetNetworkInterfaces();
-    /* Remove all the old interfaces first: */
-    for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size(); ++iNetworkIndex)
-    {
-        /* Get iterated interface: */
-        const CHostNetworkInterface &iface = interfaces[iNetworkIndex];
-        if (iface.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
-        {
-            /* Search for this interface's dhcp sserver: */
-            CDHCPServer dhcp = vboxGlobal().virtualBox().FindDHCPServerByNetworkName(iface.GetNetworkName());
-            /* Delete it if its present: */
-            if (!dhcp.isNull())
-                vbox.RemoveDHCPServer(dhcp);
-            /* Delete interface finally: */
-            CProgress progress = host.RemoveHostOnlyNetworkInterface(iface.GetId());
-            if (host.isOk())
-            {
-                progress.WaitForCompletion(-1);
-                // TODO: Fix problem reporter!
-                //vboxProblem().showModalProgressDialog(progress, tr("Performing", "creating/removing host-only network"), this);
-                if (progress.GetResultCode() != 0)
-                    // TODO: Fix problem reporter!
-                    //vboxProblem().cannotRemoveHostInterface(progress, iface, this);
-                    AssertMsgFailed(("Failed to remove Host-only Network Adapter, result code is %d!\n", progress.GetResultCode()));
-            }
-            else
-                // TODO: Fix problem reporter!
-                //vboxProblem().cannotRemoveHostInterface(host, iface, this);
-                AssertMsgFailed(("Failed to remove Host-only Network Adapter!\n"));
-        }
-    }
-    /* Add all the new interfaces finally: */
-    for (int iNetworkIndex = 0; iNetworkIndex < m_cache.m_items.size(); ++iNetworkIndex)
-    {
-        /* Get iterated data: */
-        const UIHostNetworkData &data = m_cache.m_items[iNetworkIndex];
-        CHostNetworkInterface iface;
-        /* Create interface: */
-        CProgress progress = host.CreateHostOnlyNetworkInterface(iface);
-        if (host.isOk())
-        {
-            // TODO: Fix problem reporter!
-            //vboxProblem().showModalProgressDialog(progress, tr("Performing", "creating/removing host-only network"), this);
-            progress.WaitForCompletion(-1);
-            if (progress.GetResultCode() == 0)
-            {
-                /* Create DHCP server: */
-                CDHCPServer dhcp = vbox.FindDHCPServerByNetworkName(iface.GetNetworkName());
-                if (dhcp.isNull()) vbox.CreateDHCPServer(iface.GetNetworkName());
-                dhcp = vbox.FindDHCPServerByNetworkName(iface.GetNetworkName());
-                AssertMsg(!dhcp.isNull(), ("DHCP Server creation failed!\n"));
-                /* Host-only Interface configuring: */
-                if (data.m_interface.m_fDhcpClientEnabled)
-                {
-                    iface.EnableDynamicIpConfig();
-                }
-                else
-                {
-                    AssertMsg(data.m_interface.m_strInterfaceAddress.isEmpty() ||
-                              QHostAddress(data.m_interface.m_strInterfaceAddress).protocol() == QAbstractSocket::IPv4Protocol,
-                              ("Interface IPv4 address must be empty or IPv4-valid!\n"));
-                    AssertMsg(data.m_interface.m_strInterfaceMask.isEmpty() ||
-                              QHostAddress(data.m_interface.m_strInterfaceMask).protocol() == QAbstractSocket::IPv4Protocol,
-                              ("Interface IPv4 network mask must be empty or IPv4-valid!\n"));
-                    iface.EnableStaticIpConfig(data.m_interface.m_strInterfaceAddress, data.m_interface.m_strInterfaceMask);
-                    if (iface.GetIPV6Supported())
-                    {
-                        AssertMsg(data.m_interface.m_strInterfaceAddress6.isEmpty() ||
-                                  QHostAddress(data.m_interface.m_strInterfaceAddress6).protocol() == QAbstractSocket::IPv6Protocol,
-                                  ("Interface IPv6 address must be empty or IPv6-valid!\n"));
-                        iface.EnableStaticIpConfigV6(data.m_interface.m_strInterfaceAddress6, data.m_interface.m_strInterfaceMaskLength6.toULong());
-                    }
-                }
-                /* DHCP Server configuring: */
-                dhcp.SetEnabled(data.m_dhcpserver.m_fDhcpServerEnabled);
-//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpServerAddress).protocol() == QAbstractSocket::IPv4Protocol,
-//                          ("DHCP Server IPv4 address must be IPv4-valid!\n"));
-//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpServerMask).protocol() == QAbstractSocket::IPv4Protocol,
-//                          ("DHCP Server IPv4 network mask must be IPv4-valid!\n"));
-//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpLowerAddress).protocol() == QAbstractSocket::IPv4Protocol,
-//                          ("DHCP Server IPv4 lower bound must be IPv4-valid!\n"));
-//                AssertMsg(QHostAddress(data.m_dhcpserver.m_strDhcpUpperAddress).protocol() == QAbstractSocket::IPv4Protocol,
-//                          ("DHCP Server IPv4 upper bound must be IPv4-valid!\n"));
-                if (QHostAddress(data.m_dhcpserver.m_strDhcpServerAddress).protocol() == QAbstractSocket::IPv4Protocol &&
-                    QHostAddress(data.m_dhcpserver.m_strDhcpServerMask).protocol() == QAbstractSocket::IPv4Protocol &&
-                    QHostAddress(data.m_dhcpserver.m_strDhcpLowerAddress).protocol() == QAbstractSocket::IPv4Protocol &&
-                    QHostAddress(data.m_dhcpserver.m_strDhcpUpperAddress).protocol() == QAbstractSocket::IPv4Protocol)
-                    dhcp.SetConfiguration(data.m_dhcpserver.m_strDhcpServerAddress, data.m_dhcpserver.m_strDhcpServerMask,
-                                          data.m_dhcpserver.m_strDhcpLowerAddress, data.m_dhcpserver.m_strDhcpUpperAddress);
-            }
-            else
-                // TODO: Fix problem reporter!
-                //vboxProblem().cannotCreateHostInterface(progress, this);
-                AssertMsgFailed(("Failed to create Host-only Network Adapter, result code is %d!\n", progress.GetResultCode()));
-        }
-        else
-            // TODO: Fix problem reporter!
-            //vboxProblem().cannotCreateHostInterface(host, this);
-            AssertMsgFailed(("Failed to create Host-only Network Adapter!\n"));
-    }
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-void VBoxGLSettingsNetwork::setValidator (QIWidgetValidator *aValidator)
-{
-    mValidator = aValidator;
-}
-
-bool VBoxGLSettingsNetwork::revalidate (QString &aWarning, QString &aTitle)
-{
-    NetworkItem *item = static_cast <NetworkItem*> (mTwInterfaces->currentItem());
-    return item ? item->revalidate (aWarning, aTitle) : true;
-}
-
-void VBoxGLSettingsNetwork::setOrderAfter (QWidget *aWidget)
-{
-    setTabOrder (aWidget, mTwInterfaces);
-}
-
-void VBoxGLSettingsNetwork::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxGLSettingsNetwork::retranslateUi (this);
-
-    /* Translate action tool-tips */
-    mAddInterface->setText (tr ("&Add host-only network"));
-    mRemInterface->setText (tr ("&Remove host-only network"));
-    mEditInterface->setText (tr ("&Edit host-only network"));
-
-    mAddInterface->setToolTip (mAddInterface->text().remove ('&') +
-        QString (" (%1)").arg (mAddInterface->shortcut().toString()));
-    mRemInterface->setToolTip (mRemInterface->text().remove ('&') +
-        QString (" (%1)").arg (mRemInterface->shortcut().toString()));
-    mEditInterface->setToolTip (mEditInterface->text().remove ('&') +
-        QString (" (%1)").arg (mEditInterface->shortcut().toString()));
-}
-
-void VBoxGLSettingsNetwork::addInterface()
-{
-    /* Creating interface item: */
-    NetworkItem *pItem = new NetworkItem;
-    /* Fill item's data: */
-    UIHostNetworkData data;
-    /* Interface data: */
-    // TODO: Make unique name!
-    data.m_interface.m_strName = tr("New Host-Only Interface");
-    data.m_interface.m_fDhcpClientEnabled = true;
-    data.m_interface.m_fIpv6Supported = false;
-    /* DHCP data: */
-    data.m_dhcpserver.m_fDhcpServerEnabled = false;
-    /* Fetch item with data: */
-    pItem->fetchNetworkData(data);
-    /* Add new top-level item: */
-    mTwInterfaces->addTopLevelItem(pItem);
-    mTwInterfaces->sortItems(0, Qt::AscendingOrder);
-    mTwInterfaces->setCurrentItem(pItem);
-    /* Mark dialog as edited: */
-    m_fChanged = true;
-}
-
-void VBoxGLSettingsNetwork::remInterface()
-{
-    /* Get interface item: */
-    NetworkItem *pItem = static_cast<NetworkItem*>(mTwInterfaces->currentItem());
-    AssertMsg(pItem, ("Current item should present!\n"));
-    /* Get interface name: */
-    QString strInterfaceName(pItem->name());
-    /* Asking user about deleting selected network interface: */
-    if (vboxProblem().confirmDeletingHostInterface(strInterfaceName, this) == QIMessageBox::Cancel)
-        return;
-    /* Removing interface: */
-    delete pItem;
-    /* Mark dialog as edited: */
-    m_fChanged = true;
-}
-
-void VBoxGLSettingsNetwork::editInterface()
-{
-    /* Check interface presence */
-    NetworkItem *item = static_cast <NetworkItem*> (mTwInterfaces->currentItem());
-    AssertMsg (item, ("Current item should be selected!\n"));
-    /* Edit current item data */
-    VBoxGLSettingsNetworkDetails details (this);
-    details.getFromItem (item);
-    if (details.exec() == QDialog::Accepted)
-    {
-        details.putBackToItem();
-        item->updateInfo();
-    }
-    updateCurrentItem();
-    mValidator->revalidate();
-    /* Mark dialog as edited: */
-    m_fChanged = true;
-}
-
-void VBoxGLSettingsNetwork::updateCurrentItem()
-{
-    /* Get current item */
-    NetworkItem *item = static_cast <NetworkItem*> (mTwInterfaces->currentItem());
-    /* Set the final label text */
-    mLbInfo->setText (item ? item->updateInfo() : QString());
-    /* Update availability */
-    mRemInterface->setEnabled (item);
-    mEditInterface->setEnabled (item);
-}
-
-void VBoxGLSettingsNetwork::showContextMenu (const QPoint &aPos)
-{
-    QMenu menu;
-
-    if (mTwInterfaces->itemAt (aPos))
-    {
-        menu.addAction (mEditInterface);
-        menu.addAction (mRemInterface);
-    }
-    else
-    {
-        menu.addAction (mAddInterface);
-    }
-
-    menu.exec (mTwInterfaces->mapToGlobal (aPos));
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.h	(revision 33881)
+++ 	(revision )
@@ -1,166 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsNetwork class declaration
- */
-
-/*
- * Copyright (C) 2009-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxGLSettingsNetwork_h__
-#define __VBoxGLSettingsNetwork_h__
-
-#include "UISettingsPage.h"
-#include "VBoxGLSettingsNetwork.gen.h"
-
-/* Host interface data: */
-struct UIHostInterfaceData
-{
-    /* Host-only Interface: */
-    QString m_strName;
-    bool m_fDhcpClientEnabled;
-    QString m_strInterfaceAddress;
-    QString m_strInterfaceMask;
-    bool m_fIpv6Supported;
-    QString m_strInterfaceAddress6;
-    QString m_strInterfaceMaskLength6;
-};
-
-/* DHCP server data: */
-struct UIDHCPServerData
-{
-    /* DHCP Server */
-    bool m_fDhcpServerEnabled;
-    QString m_strDhcpServerAddress;
-    QString m_strDhcpServerMask;
-    QString m_strDhcpLowerAddress;
-    QString m_strDhcpUpperAddress;
-};
-
-/* Global network data: */
-struct UIHostNetworkData
-{
-    UIHostInterfaceData m_interface;
-    UIDHCPServerData m_dhcpserver;
-};
-
-/* Global settings / Network page / Cache: */
-struct UISettingsCacheGlobalNetwork
-{
-    QList<UIHostNetworkData> m_items;
-};
-
-class NetworkItem : public QTreeWidgetItem
-{
-public:
-
-    NetworkItem();
-
-    void fetchNetworkData(const UIHostNetworkData &data);
-    void uploadNetworkData(UIHostNetworkData &data);
-
-    bool revalidate (QString &aWarning, QString &aTitle);
-
-    QString updateInfo();
-
-    /* Page getters */
-    QString name() const { return m_data.m_interface.m_strName; }
-    bool isDhcpClientEnabled() const { return m_data.m_interface.m_fDhcpClientEnabled; }
-    QString interfaceAddress() const { return m_data.m_interface.m_strInterfaceAddress; }
-    QString interfaceMask() const { return m_data.m_interface.m_strInterfaceMask; }
-    bool isIpv6Supported() const { return m_data.m_interface.m_fIpv6Supported; }
-    QString interfaceAddress6() const { return m_data.m_interface.m_strInterfaceAddress6; }
-    QString interfaceMaskLength6() const { return m_data.m_interface.m_strInterfaceMaskLength6; }
-
-    bool isDhcpServerEnabled() const { return m_data.m_dhcpserver.m_fDhcpServerEnabled; }
-    QString dhcpServerAddress() const { return m_data.m_dhcpserver.m_strDhcpServerAddress; }
-    QString dhcpServerMask() const { return m_data.m_dhcpserver.m_strDhcpServerMask; }
-    QString dhcpLowerAddress() const { return m_data.m_dhcpserver.m_strDhcpLowerAddress; }
-    QString dhcpUpperAddress() const { return m_data.m_dhcpserver.m_strDhcpUpperAddress; }
-
-    /* Page setters */
-    void setDhcpClientEnabled (bool aEnabled) { m_data.m_interface.m_fDhcpClientEnabled = aEnabled; }
-    void setInterfaceAddress (const QString &aValue) { m_data.m_interface.m_strInterfaceAddress = aValue; }
-    void setInterfaceMask (const QString &aValue) { m_data.m_interface.m_strInterfaceMask = aValue; }
-    void setIp6Supported (bool aSupported) { m_data.m_interface.m_fIpv6Supported = aSupported; }
-    void setInterfaceAddress6 (const QString &aValue) { m_data.m_interface.m_strInterfaceAddress6 = aValue; }
-    void setInterfaceMaskLength6 (const QString &aValue) { m_data.m_interface.m_strInterfaceMaskLength6 = aValue; }
-
-    void setDhcpServerEnabled (bool aEnabled) { m_data.m_dhcpserver.m_fDhcpServerEnabled = aEnabled; }
-    void setDhcpServerAddress (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpServerAddress = aValue; }
-    void setDhcpServerMask (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpServerMask = aValue; }
-    void setDhcpLowerAddress (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpLowerAddress = aValue; }
-    void setDhcpUpperAddress (const QString &aValue) { m_data.m_dhcpserver.m_strDhcpUpperAddress = aValue; }
-
-private:
-
-    /* Network data: */
-    UIHostNetworkData m_data;
-};
-
-/* Global settings / Network page: */
-class VBoxGLSettingsNetwork : public UISettingsPageGlobal,
-                              public Ui::VBoxGLSettingsNetwork
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxGLSettingsNetwork();
-
-protected:
-
-    /* Load data to cashe from corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void loadToCacheFrom(QVariant &data);
-    /* Load data to corresponding widgets from cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void getFromCache();
-
-    /* Save data from corresponding widgets to cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void putToCache();
-    /* Save data from cache to corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void saveFromCacheTo(QVariant &data);
-
-    void setValidator (QIWidgetValidator *aVal);
-    bool revalidate (QString &aWarning, QString &aTitle);
-
-    void setOrderAfter (QWidget *aWidget);
-
-    void retranslateUi();
-
-private slots:
-
-    void addInterface();
-    void remInterface();
-    void editInterface();
-    void updateCurrentItem();
-    void showContextMenu (const QPoint &aPos);
-
-private:
-
-    QIWidgetValidator *mValidator;
-
-    QAction *mAddInterface;
-    QAction *mRemInterface;
-    QAction *mEditInterface;
-
-    bool m_fChanged;
-
-    /* Cache: */
-    UISettingsCacheGlobalNetwork m_cache;
-};
-
-#endif // __VBoxGLSettingsNetwork_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.ui	(revision 33881)
+++ 	(revision )
@@ -1,151 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
-
-     Copyright (C) 2009-2010 Oracle Corporation
-
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- </comment>
- <class>VBoxGLSettingsNetwork</class>
- <widget class="QWidget" name="VBoxGLSettingsNetwork">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>218</width>
-    <height>216</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" rowspan="4">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="1" colspan="3">
-    <widget class="QLabel" name="mLbPageName">
-     <property name="text">
-      <string>&amp;Host-only Networks:</string>
-     </property>
-     <property name="buddy">
-      <cstring>mTwInterfaces</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="2">
-    <widget class="QWidget" native="1" name="m_pWidNetwork" >
-     <layout class="QHBoxLayout" >
-      <property name="leftMargin" >
-       <number>0</number>
-      </property>
-      <property name="topMargin" >
-       <number>0</number>
-      </property>
-      <property name="rightMargin" >
-       <number>0</number>
-      </property>
-      <property name="bottomMargin" >
-       <number>0</number>
-      </property>
-      <property name="spacing" >
-       <number>1</number>
-      </property>
-      <item>
-       <widget class="QTreeWidget" name="mTwInterfaces">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>150</height>
-         </size>
-        </property>
-        <property name="whatsThis">
-         <string>Lists all available host-only networks.</string>
-        </property>
-        <property name="rootIsDecorated">
-         <bool>false</bool>
-        </property>
-        <column>
-         <property name="text">
-          <string>Name</string>
-         </property>
-        </column>
-       </widget>
-      </item>
-      <item>
-       <widget class="UIToolBar" name="mTbActions">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="1" column="1" rowspan="2">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="2" colspan="2">
-    <widget class="QLabel" name="mLbInfo">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>UIToolBar</class>
-   <extends>QToolBar</extends>
-   <header>UIToolBar.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetworkDetails.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetworkDetails.cpp	(revision 33881)
+++ 	(revision )
@@ -1,208 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsNetworkDetails class implementation
- */
-
-/*
- * Copyright (C) 2009 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-/* VBox Includes */
-#include "VBoxGLSettingsNetwork.h"
-#include "VBoxGLSettingsNetworkDetails.h"
-
-/* Qt Includes */
-#include <QHostAddress>
-#include <QRegExpValidator>
-
-VBoxGLSettingsNetworkDetails::VBoxGLSettingsNetworkDetails (QWidget *aParent)
-    : QIWithRetranslateUI2 <QIDialog> (aParent
-#ifdef Q_WS_MAC
-    ,Qt::Sheet
-#endif /* Q_WS_MAC */
-    )
-    , mItem(0)
-{
-    /* Apply UI decorations */
-    Ui::VBoxGLSettingsNetworkDetails::setupUi (this);
-
-    /* Setup dialog */
-    setWindowIcon (QIcon (":/guesttools_16px.png"));
-
-    /* Setup validators */
-    QString templateIPv4 ("([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
-                          "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
-                          "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\."
-                          "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])");
-    QString templateIPv6 ("[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
-                          "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
-                          "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}:{1,2}"
-                          "[0-9a-fA-Z]{1,4}:{1,2}[0-9a-fA-Z]{1,4}");
-
-    mLeIPv4->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
-    mLeNMv4->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
-    mLeIPv6->setValidator (new QRegExpValidator (QRegExp (templateIPv6), this));
-    mLeNMv6->setValidator (new QRegExpValidator (QRegExp ("[1-9][0-9]|1[0-1][0-9]|12[0-8]"), this));
-    mLeDhcpAddress->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
-    mLeDhcpMask->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
-    mLeDhcpLowerAddress->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
-    mLeDhcpUpperAddress->setValidator (new QRegExpValidator (QRegExp (templateIPv4), this));
-
-    /* Setup widgets */
-    mLeIPv6->setFixedWidthByText (QString().fill ('X', 32) + QString().fill (':', 7));
-
-#if 0 /* defined (Q_WS_WIN32) */
-    QStyleOption options1;
-    options1.initFrom (mCbManual);
-    QGridLayout *layout1 = qobject_cast <QGridLayout*> (mTwDetails->widget (0)->layout());
-    int wid1 = mCbManual->style()->pixelMetric (QStyle::PM_IndicatorWidth, &options1, mCbManual) +
-               mCbManual->style()->pixelMetric (QStyle::PM_CheckBoxLabelSpacing, &options1, mCbManual) -
-               layout1->spacing() - 1;
-    QSpacerItem *spacer1 = new QSpacerItem (wid1, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
-    layout1->addItem (spacer1, 1, 0, 4);
-#else
-    mCbManual->setVisible (false);
-#endif
-
-    QStyleOption options2;
-    options2.initFrom (mCbDhcpServerEnabled);
-    QGridLayout *layout2 = qobject_cast <QGridLayout*> (mTwDetails->widget (1)->layout());
-    int wid2 = mCbDhcpServerEnabled->style()->pixelMetric (QStyle::PM_IndicatorWidth, &options2, mCbDhcpServerEnabled) +
-               mCbDhcpServerEnabled->style()->pixelMetric (QStyle::PM_CheckBoxLabelSpacing, &options2, mCbDhcpServerEnabled) -
-               layout2->spacing() - 1;
-    QSpacerItem *spacer2 = new QSpacerItem (wid2, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
-    layout2->addItem (spacer2, 1, 0, 4);
-
-    /* Setup connections */
-    connect (mCbManual, SIGNAL (stateChanged (int)),
-             this, SLOT (dhcpClientStatusChanged()));
-    connect (mCbDhcpServerEnabled, SIGNAL (stateChanged (int)),
-             this, SLOT (dhcpServerStatusChanged()));
-
-    /* Applying language settings */
-    retranslateUi();
-
-    /* Fix minimum possible size */
-    resize (minimumSizeHint());
-    qApp->processEvents();
-    setFixedSize (minimumSizeHint());
-}
-
-void VBoxGLSettingsNetworkDetails::getFromItem (NetworkItem *aItem)
-{
-    mItem = aItem;
-
-    /* Host-only Interface */
-    mCbManual->setChecked (!mItem->isDhcpClientEnabled());
-#if !0 /* !defined (Q_WS_WIN32) */
-    /* Disable automatic for all hosts for now */
-    mCbManual->setChecked (true);
-    mCbManual->setEnabled (false);
-#endif
-    dhcpClientStatusChanged();
-
-    /* DHCP Server */
-    mCbDhcpServerEnabled->setChecked (mItem->isDhcpServerEnabled());
-    dhcpServerStatusChanged();
-}
-
-void VBoxGLSettingsNetworkDetails::putBackToItem()
-{
-    /* Host-only Interface */
-    mItem->setDhcpClientEnabled (!mCbManual->isChecked());
-    if (mCbManual->isChecked())
-    {
-        mItem->setInterfaceAddress (mLeIPv4->text());
-        mItem->setInterfaceMask (mLeNMv4->text());
-        if (mItem->isIpv6Supported())
-        {
-            mItem->setInterfaceAddress6 (mLeIPv6->text());
-            mItem->setInterfaceMaskLength6 (mLeNMv6->text());
-        }
-    }
-
-    /* DHCP Server */
-    mItem->setDhcpServerEnabled (mCbDhcpServerEnabled->isChecked());
-    if (mCbDhcpServerEnabled->isChecked())
-    {
-        mItem->setDhcpServerAddress (mLeDhcpAddress->text());
-        mItem->setDhcpServerMask (mLeDhcpMask->text());
-        mItem->setDhcpLowerAddress (mLeDhcpLowerAddress->text());
-        mItem->setDhcpUpperAddress (mLeDhcpUpperAddress->text());
-    }
-}
-
-void VBoxGLSettingsNetworkDetails::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxGLSettingsNetworkDetails::retranslateUi (this);
-}
-
-void VBoxGLSettingsNetworkDetails::dhcpClientStatusChanged()
-{
-    bool isManual = mCbManual->isChecked();
-    bool isIpv6Supported = isManual && mItem->isIpv6Supported();
-
-    mLeIPv4->clear();
-    mLeNMv4->clear();
-    mLeIPv6->clear();
-    mLeNMv6->clear();
-
-    mLbIPv4->setEnabled (isManual);
-    mLbNMv4->setEnabled (isManual);
-    mLeIPv4->setEnabled (isManual);
-    mLeNMv4->setEnabled (isManual);
-    mLbIPv6->setEnabled (isIpv6Supported);
-    mLbNMv6->setEnabled (isIpv6Supported);
-    mLeIPv6->setEnabled (isIpv6Supported);
-    mLeNMv6->setEnabled (isIpv6Supported);
-
-    if (isManual)
-    {
-        mLeIPv4->setText (mItem->interfaceAddress());
-        mLeNMv4->setText (mItem->interfaceMask());
-        if (isIpv6Supported)
-        {
-            mLeIPv6->setText (mItem->interfaceAddress6());
-            mLeNMv6->setText (mItem->interfaceMaskLength6());
-        }
-    }
-}
-
-void VBoxGLSettingsNetworkDetails::dhcpServerStatusChanged()
-{
-    bool isEnabled = mCbDhcpServerEnabled->isChecked();
-
-    mLeDhcpAddress->clear();
-    mLeDhcpMask->clear();
-    mLeDhcpLowerAddress->clear();
-    mLeDhcpUpperAddress->clear();
-
-    mLbDhcpAddress->setEnabled (isEnabled);
-    mLbDhcpMask->setEnabled (isEnabled);
-    mLbDhcpLowerAddress->setEnabled (isEnabled);
-    mLbDhcpUpperAddress->setEnabled (isEnabled);
-    mLeDhcpAddress->setEnabled (isEnabled);
-    mLeDhcpMask->setEnabled (isEnabled);
-    mLeDhcpLowerAddress->setEnabled (isEnabled);
-    mLeDhcpUpperAddress->setEnabled (isEnabled);
-
-    if (isEnabled)
-    {
-        mLeDhcpAddress->setText (mItem->dhcpServerAddress());
-        mLeDhcpMask->setText (mItem->dhcpServerMask());
-        mLeDhcpLowerAddress->setText (mItem->dhcpLowerAddress());
-        mLeDhcpUpperAddress->setText (mItem->dhcpUpperAddress());
-    }
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetworkDetails.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetworkDetails.h	(revision 33881)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsNetworkDetails class declaration
- */
-
-/*
- * Copyright (C) 2009 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxGLSettingsNetworkDetails_h__
-#define __VBoxGLSettingsNetworkDetails_h__
-
-/* VBox includes */
-#include "QIDialog.h"
-#include "QIWithRetranslateUI.h"
-#include "VBoxGLSettingsNetworkDetails.gen.h"
-
-/* VBox forwards */
-class NetworkItem;
-
-class VBoxGLSettingsNetworkDetails : public QIWithRetranslateUI2 <QIDialog>,
-                                     public Ui::VBoxGLSettingsNetworkDetails
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxGLSettingsNetworkDetails (QWidget *aParent);
-
-    void getFromItem (NetworkItem *aItem);
-    void putBackToItem();
-
-protected:
-
-    void retranslateUi();
-
-private slots:
-
-    void dhcpClientStatusChanged();
-    void dhcpServerStatusChanged();
-
-private:
-
-    NetworkItem *mItem;
-};
-
-#endif // __VBoxGLSettingsNetworkDetails_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetworkDetails.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetworkDetails.ui	(revision 33881)
+++ 	(revision )
@@ -1,375 +1,0 @@
-<ui version="4.0" >
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2009 Oracle Corporation
-
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- </comment>
- <class>VBoxGLSettingsNetworkDetails</class>
- <widget class="QWidget" name="VBoxGLSettingsNetworkDetails" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>402</width>
-    <height>255</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Host-only Network Details</string>
-  </property>
-  <layout class="QVBoxLayout" >
-   <item>
-    <widget class="QITabWidget" name="mTwDetails" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="currentIndex" >
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="mTabInterface" >
-      <attribute name="title" >
-       <string>&amp;Adapter</string>
-      </attribute>
-      <layout class="QGridLayout" >
-       <item row="0" column="0" colspan="3" >
-        <widget class="QCheckBox" name="mCbManual" >
-         <property name="text" >
-          <string>Manual &amp;Configuration</string>
-         </property>
-         <property name="checked" >
-          <bool>true</bool>
-         </property>
-         <property name="toolTip" >
-          <string>Use manual configuration for this host-only network adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1" >
-        <widget class="QLabel" name="mLbIPv4" >
-         <property name="text" >
-          <string>&amp;IPv4 Address:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeIPv4</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="2" >
-        <widget class="QILineEdit" name="mLeIPv4" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the host IPv4 address for this adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="1" >
-        <widget class="QLabel" name="mLbNMv4" >
-         <property name="text" >
-          <string>IPv4 Network &amp;Mask:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNMv4</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="2" >
-        <widget class="QILineEdit" name="mLeNMv4" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the host IPv4 network mask for this adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="1" >
-        <widget class="QLabel" name="mLbIPv6" >
-         <property name="text" >
-          <string>I&amp;Pv6 Address:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeIPv6</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="2" >
-        <widget class="QILineEdit" name="mLeIPv6" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the host IPv6 address for this adapter if IPv6 is supported.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="1" >
-        <widget class="QLabel" name="mLbNMv6" >
-         <property name="text" >
-          <string>IPv6 Network Mask &amp;Length:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNMv6</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="2" >
-        <widget class="QILineEdit" name="mLeNMv6" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the host IPv6 network mask prefix length for this adapter if IPv6 is supported.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="0" colspan="3" >
-        <spacer name="verticalSpacer1" >
-         <property name="orientation" >
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mTabDhcpServer" >
-      <attribute name="title" >
-       <string>&amp;DHCP Server</string>
-      </attribute>
-      <layout class="QGridLayout" >
-       <item row="0" column="0" colspan="3" >
-        <widget class="QCheckBox" name="mCbDhcpServerEnabled" >
-         <property name="text" >
-          <string>&amp;Enable Server</string>
-         </property>
-         <property name="toolTip" >
-          <string>Indicates whether the DHCP Server is enabled on machine startup or not.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1" >
-        <widget class="QLabel" name="mLbDhcpAddress" >
-         <property name="text" >
-          <string>Server Add&amp;ress:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeDhcpAddress</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="2" >
-        <widget class="QILineEdit" name="mLeDhcpAddress" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the address of the DHCP server servicing the network associated with this host-only adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="1" >
-        <widget class="QLabel" name="mLbDhcpMask" >
-         <property name="text" >
-          <string>Server &amp;Mask:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeDhcpMask</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="2" >
-        <widget class="QILineEdit" name="mLeDhcpMask" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the network mask of the DHCP server servicing the network associated with this host-only adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="1" >
-        <widget class="QLabel" name="mLbDhcpLowerAddress" >
-         <property name="text" >
-          <string>&amp;Lower Address Bound:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeDhcpLowerAddress</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="2" >
-        <widget class="QILineEdit" name="mLeDhcpLowerAddress" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the lower address bound offered by the DHCP server servicing the network associated with this host-only adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="1" >
-        <widget class="QLabel" name="mLbDhcpUpperAddress" >
-         <property name="text" >
-          <string>&amp;Upper Address Bound:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeDhcpUpperAddress</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="2" >
-        <widget class="QILineEdit" name="mLeDhcpUpperAddress" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="toolTip" >
-          <string>Displays the upper address bound offered by the DHCP server servicing the network associated with this host-only adapter.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="0" colspan="3" >
-        <spacer name="verticalSpacer2" >
-         <property name="orientation" >
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-   <item>
-    <widget class="QIDialogButtonBox" name="mButtonBox" >
-     <property name="standardButtons" >
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>QILineEdit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QIDialogButtonBox</class>
-   <extends>QDialogButtonBox</extends>
-   <header>QIDialogButtonBox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QITabWidget</class>
-   <extends>QTabWidget</extends>
-   <header>QITabWidget.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections>
-  <connection>
-   <sender>mButtonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>VBoxGLSettingsNetworkDetails</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>162</x>
-     <y>339</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>162</x>
-     <y>179</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>mButtonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>VBoxGLSettingsNetworkDetails</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>162</x>
-     <y>339</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>162</x>
-     <y>179</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsUpdate.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsUpdate.cpp	(revision 33881)
+++ 	(revision )
@@ -1,199 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsUpdate class implementation
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#include "VBoxGLSettingsUpdate.h"
-#include "VBoxGlobal.h"
-
-VBoxGLSettingsUpdate::VBoxGLSettingsUpdate()
-    : mSettingsChanged(false)
-    , mLastChosen(0)
-{
-    /* Apply UI decorations */
-    Ui::VBoxGLSettingsUpdate::setupUi (this);
-
-    /* Setup connections */
-    connect (mCbCheck, SIGNAL (toggled (bool)), this, SLOT (toggleUpdater (bool)));
-    connect (mCbOncePer, SIGNAL (activated (int)), this, SLOT (activatedPeriod (int)));
-    connect (mRbStable, SIGNAL (toggled (bool)), this, SLOT (toggledBranch()));
-    connect (mRbAllRelease, SIGNAL (toggled (bool)), this, SLOT (toggledBranch()));
-    connect (mRbWithBetas, SIGNAL (toggled (bool)), this, SLOT (toggledBranch()));
-
-    /* Applying language settings */
-    retranslateUi();
-}
-
-/* Load data to cashe from corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsUpdate::loadToCacheFrom(QVariant &data)
-{
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Fill internal variables with corresponding values: */
-    VBoxUpdateData updateData(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_UpdateDate));
-    m_cache.m_fCheckEnabled = !updateData.isNoNeedToCheck();
-    m_cache.m_periodIndex = updateData.periodIndex();
-    m_cache.m_branchIndex = updateData.branchIndex();
-    m_cache.m_strDate = updateData.date();
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-/* Load data to corresponding widgets from cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsUpdate::getFromCache()
-{
-    /* Apply internal variables data to QWidget(s): */
-    mCbCheck->setChecked(m_cache.m_fCheckEnabled);
-    if (mCbCheck->isChecked())
-    {
-        mCbOncePer->setCurrentIndex(m_cache.m_periodIndex);
-        if (m_cache.m_branchIndex == VBoxUpdateData::BranchWithBetas)
-            mRbWithBetas->setChecked(true);
-        else if (m_cache.m_branchIndex == VBoxUpdateData::BranchAllRelease)
-            mRbAllRelease->setChecked(true);
-        else
-            mRbStable->setChecked(true);
-    }
-    mTxDate->setText(m_cache.m_strDate);
-
-    /* Reset settings altering flag: */
-    mSettingsChanged = false;
-}
-
-/* Save data from corresponding widgets to cache,
- * this task SHOULD be performed in GUI thread only: */
-void VBoxGLSettingsUpdate::putToCache()
-{
-    /* Gather internal variables data from QWidget(s): */
-    m_cache.m_periodIndex = periodType();
-    m_cache.m_branchIndex = branchType();
-}
-
-/* Save data from cache to corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
-void VBoxGLSettingsUpdate::saveFromCacheTo(QVariant &data)
-{
-    /* Test settings altering flag: */
-    if (!mSettingsChanged)
-        return;
-
-    /* Fetch data to properties & settings: */
-    UISettingsPageGlobal::fetchData(data);
-
-    /* Gather corresponding values from internal variables: */
-    VBoxUpdateData newData(m_cache.m_periodIndex, m_cache.m_branchIndex);
-    vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_UpdateDate, newData.data());
-
-    /* Upload properties & settings to data: */
-    UISettingsPageGlobal::uploadData(data);
-}
-
-void VBoxGLSettingsUpdate::setOrderAfter (QWidget *aWidget)
-{
-    setTabOrder (aWidget, mCbCheck);
-    setTabOrder (mCbCheck, mCbOncePer);
-    setTabOrder (mCbOncePer, mRbStable);
-    setTabOrder (mRbStable, mRbAllRelease);
-    setTabOrder (mRbAllRelease, mRbWithBetas);
-}
-
-void VBoxGLSettingsUpdate::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxGLSettingsUpdate::retranslateUi (this);
-
-    /* Retranslate mCbOncePer combobox */
-    int ci = mCbOncePer->currentIndex();
-    mCbOncePer->clear();
-    VBoxUpdateData::populate();
-    mCbOncePer->insertItems (0, VBoxUpdateData::list());
-    mCbOncePer->setCurrentIndex (ci == -1 ? 0 : ci);
-}
-
-void VBoxGLSettingsUpdate::toggleUpdater (bool aOn)
-{
-    /* Enable/disable the sub widget */
-    mLbOncePer->setEnabled (aOn);
-    mCbOncePer->setEnabled (aOn);
-    mLbDate->setEnabled (aOn);
-    mTxDate->setEnabled (aOn);
-    mLbFilter->setEnabled (aOn);
-    mRbStable->setEnabled (aOn);
-    mRbAllRelease->setEnabled (aOn);
-    mRbWithBetas->setEnabled (aOn);
-    mRbStable->setAutoExclusive (aOn);
-    mRbAllRelease->setAutoExclusive (aOn);
-    mRbWithBetas->setAutoExclusive (aOn);
-
-    /* Update 'check for new version' time */
-    if (aOn)
-        activatedPeriod (mCbOncePer->currentIndex());
-    else
-    {
-        activatedPeriod (VBoxUpdateData::PeriodNever);
-        mLastChosen = mRbWithBetas->isChecked() ? mRbWithBetas :
-                      mRbAllRelease->isChecked() ? mRbAllRelease : mRbStable;
-    }
-
-    if (mLastChosen)
-        mLastChosen->setChecked (aOn);
-}
-
-void VBoxGLSettingsUpdate::activatedPeriod (int /*aIndex*/)
-{
-    VBoxUpdateData data (periodType(), branchType());
-    mTxDate->setText (data.date());
-    mSettingsChanged = true;
-}
-
-void VBoxGLSettingsUpdate::toggledBranch()
-{
-    mSettingsChanged = true;
-}
-
-void VBoxGLSettingsUpdate::showEvent (QShowEvent *aEvent)
-{
-    UISettingsPage::showEvent (aEvent);
-
-    /* That little hack allows avoid one of qt4 children focusing bug */
-    QWidget *current = QApplication::focusWidget();
-    mCbOncePer->setFocus (Qt::TabFocusReason);
-    if (current)
-        current->setFocus (Qt::TabFocusReason);
-}
-
-VBoxUpdateData::PeriodType VBoxGLSettingsUpdate::periodType() const
-{
-    VBoxUpdateData::PeriodType result = mCbCheck->isChecked() ?
-        (VBoxUpdateData::PeriodType) mCbOncePer->currentIndex() : VBoxUpdateData::PeriodNever;
-    return result == VBoxUpdateData::PeriodUndefined ? VBoxUpdateData::Period1Day : result;
-}
-
-VBoxUpdateData::BranchType VBoxGLSettingsUpdate::branchType() const
-{
-    if (mRbWithBetas->isChecked())
-        return VBoxUpdateData::BranchWithBetas;
-    else if (mRbAllRelease->isChecked())
-        return VBoxUpdateData::BranchAllRelease;
-    else
-        return VBoxUpdateData::BranchStable;
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsUpdate.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsUpdate.h	(revision 33881)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxGLSettingsUpdate class declaration
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxGLSettingsUpdate_h__
-#define __VBoxGLSettingsUpdate_h__
-
-#include "UISettingsPage.h"
-#include "VBoxGLSettingsUpdate.gen.h"
-#include "VBoxUpdateDlg.h"
-
-/* Global settings / Update page / Cache: */
-struct UISettingsCacheGlobalUpdate
-{
-    bool m_fCheckEnabled;
-    VBoxUpdateData::PeriodType m_periodIndex;
-    VBoxUpdateData::BranchType m_branchIndex;
-    QString m_strDate;
-};
-
-/* Global settings / Update page: */
-class VBoxGLSettingsUpdate : public UISettingsPageGlobal,
-                             public Ui::VBoxGLSettingsUpdate
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxGLSettingsUpdate();
-
-protected:
-
-    /* Load data to cashe from corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void loadToCacheFrom(QVariant &data);
-    /* Load data to corresponding widgets from cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void getFromCache();
-
-    /* Save data from corresponding widgets to cache,
-     * this task SHOULD be performed in GUI thread only: */
-    void putToCache();
-    /* Save data from cache to corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
-    void saveFromCacheTo(QVariant &data);
-
-    void setOrderAfter (QWidget *aWidget);
-
-    void retranslateUi();
-
-private slots:
-
-    void toggleUpdater (bool aOn);
-    void activatedPeriod (int aIndex);
-    void toggledBranch();
-
-private:
-
-    void showEvent (QShowEvent *aEvent);
-
-    VBoxUpdateData::PeriodType periodType() const;
-    VBoxUpdateData::BranchType branchType() const;
-
-    bool mSettingsChanged;
-    QRadioButton *mLastChosen;
-
-    /* Cache: */
-    UISettingsCacheGlobalUpdate m_cache;
-};
-
-#endif // __VBoxGLSettingsUpdate_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsUpdate.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsUpdate.ui	(revision 33881)
+++ 	(revision )
@@ -1,205 +1,0 @@
-<ui version="4.0" >
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2008 Oracle Corporation
-
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- </comment>
- <class>VBoxGLSettingsUpdate</class>
- <widget class="QWidget" name="VBoxGLSettingsUpdate" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>300</width>
-    <height>131</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" >
-   <property name="leftMargin" >
-    <number>0</number>
-   </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item row="0" column="1" colspan="4" >
-    <widget class="QCheckBox" name="mCbCheck" >
-     <property name="whatsThis" >
-      <string>When checked, the application will periodically connect to the VirtualBox website and check whether a new VirtualBox version is available.</string>
-     </property>
-     <property name="text" >
-      <string>&amp;Check for updates</string>
-     </property>
-     <property name="checked" >
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>40</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="1" rowspan="2" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>16</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="2" >
-    <widget class="QLabel" name="mLbOncePer" >
-     <property name="text" >
-      <string>&amp;Once per:</string>
-     </property>
-     <property name="alignment" >
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-     <property name="buddy" >
-      <cstring>mCbOncePer</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="3" >
-    <widget class="QComboBox" name="mCbOncePer" >
-     <property name="whatsThis" >
-      <string>Specifies how often the new version check should be performed. Note that if you want to completely disable this check, just clear the above check box.</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="4" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="2" >
-    <widget class="QLabel" name="mLbDate" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text" >
-      <string>Next Check:</string>
-     </property>
-     <property name="alignment" >
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="3" colspan="2" >
-    <widget class="QLabel" name="mTxDate" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="2" >
-    <widget class="QLabel" name="mLbFilter" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text" >
-      <string>Check for:</string>
-     </property>
-     <property name="alignment" >
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="3" colspan="2" >
-    <widget class="QRadioButton" name="mRbStable" >
-     <property name="whatsThis" >
-      <string>&lt;p>Choose this if you only wish to be notified about stable updates to VirtualBox.&lt;/p></string>
-     </property>
-     <property name="text" >
-      <string>&amp;Stable release versions</string>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="3" colspan="2" >
-    <widget class="QRadioButton" name="mRbAllRelease" >
-     <property name="whatsThis" >
-      <string>&lt;p>Choose this if you wish to be notified about all new VirtualBox releases.&lt;/p></string>
-     </property>
-     <property name="text" >
-      <string>&amp;All new releases</string>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="3" colspan="2" >
-    <widget class="QRadioButton" name="mRbWithBetas" >
-     <property name="whatsThis" >
-      <string>&lt;p>Choose this to be notified about all new VirtualBox releases and pre-release versions of VirtualBox.&lt;/p></string>
-     </property>
-     <property name="text" >
-      <string>All new releases and &amp;pre-releases</string>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="1" colspan="4" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp	(revision 33882)
@@ -0,0 +1,151 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsAudio class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIMachineSettingsAudio.h"
+#include "VBoxGlobal.h"
+
+UIMachineSettingsAudio::UIMachineSettingsAudio()
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsAudio::setupUi (this);
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsAudio::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    const CAudioAdapter &audio = m_machine.GetAudioAdapter();
+    m_cache.m_fAudioEnabled = audio.GetEnabled();
+    m_cache.m_audioDriverType = audio.GetAudioDriver();
+    m_cache.m_audioControllerType = audio.GetAudioController();
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsAudio::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    mGbAudio->setChecked(m_cache.m_fAudioEnabled);
+    mCbAudioDriver->setCurrentIndex(mCbAudioDriver->findText(vboxGlobal().toString(m_cache.m_audioDriverType)));
+    mCbAudioController->setCurrentIndex(mCbAudioController->findText(vboxGlobal().toString(m_cache.m_audioControllerType)));
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsAudio::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    m_cache.m_fAudioEnabled = mGbAudio->isChecked();
+    m_cache.m_audioDriverType = vboxGlobal().toAudioDriverType(mCbAudioDriver->currentText());
+    m_cache.m_audioControllerType = vboxGlobal().toAudioControllerType(mCbAudioController->currentText());
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsAudio::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    CAudioAdapter audio = m_machine.GetAudioAdapter();
+    audio.SetEnabled(m_cache.m_fAudioEnabled);
+    audio.SetAudioDriver(m_cache.m_audioDriverType);
+    audio.SetAudioController(m_cache.m_audioControllerType);
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsAudio::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mGbAudio);
+    setTabOrder (mGbAudio, mCbAudioDriver);
+    setTabOrder (mCbAudioDriver, mCbAudioController);
+}
+
+void UIMachineSettingsAudio::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsAudio::retranslateUi (this);
+    /* Fill the comboboxes */
+    prepareComboboxes();
+}
+
+void UIMachineSettingsAudio::prepareComboboxes()
+{
+    /* Save the current selected value */
+    int currentDriver = mCbAudioDriver->currentIndex();
+    /* Clear the driver box */
+    mCbAudioDriver->clear();
+    /* Refill them */
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_Null));
+#if defined Q_WS_WIN32
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_DirectSound));
+# ifdef VBOX_WITH_WINMM
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_WinMM));
+# endif
+#endif
+#if defined Q_OS_SOLARIS
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_SolAudio));
+# if defined VBOX_WITH_SOLARIS_OSS
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_OSS));
+#endif
+#endif
+#if defined Q_OS_LINUX || defined Q_OS_FREEBSD
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_OSS));
+# ifdef VBOX_WITH_PULSE
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_Pulse));
+# endif
+#endif
+#if defined Q_OS_LINUX
+# ifdef VBOX_WITH_ALSA
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_ALSA));
+# endif
+#endif
+#if defined Q_OS_MACX
+    mCbAudioDriver->addItem (vboxGlobal().toString (KAudioDriverType_CoreAudio));
+#endif
+    /* Set the old value */
+    mCbAudioDriver->setCurrentIndex (currentDriver);
+
+    /* Save the current selected value */
+    int currentController = mCbAudioController->currentIndex();
+    /* Clear the controller box */
+    mCbAudioController->clear();
+    /* Refill them */
+    mCbAudioController->insertItem (mCbAudioController->count(),
+        vboxGlobal().toString (KAudioControllerType_HDA));
+    mCbAudioController->insertItem (mCbAudioController->count(),
+        vboxGlobal().toString (KAudioControllerType_AC97));
+    mCbAudioController->insertItem (mCbAudioController->count(),
+        vboxGlobal().toString (KAudioControllerType_SB16));
+    /* Set the old value */
+    mCbAudioController->setCurrentIndex (currentController);
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.h	(revision 33882)
@@ -0,0 +1,73 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsAudio class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsAudio_h__
+#define __UIMachineSettingsAudio_h__
+
+#include "UISettingsPage.h"
+#include "UIMachineSettingsAudio.gen.h"
+#include "COMDefs.h"
+
+/* Machine settings / Audio page / Cache: */
+struct UISettingsCacheMachineAudio
+{
+    bool m_fAudioEnabled;
+    KAudioDriverType m_audioDriverType;
+    KAudioControllerType m_audioControllerType;
+};
+
+/* Machine settings / Audio page: */
+class UIMachineSettingsAudio : public UISettingsPageMachine,
+                            public Ui::UIMachineSettingsAudio
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsAudio();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private:
+
+    void prepareComboboxes();
+
+    /* Cache: */
+    UISettingsCacheMachineAudio m_cache;
+};
+
+#endif // __UIMachineSettingsAudio_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui	(revision 33882)
@@ -0,0 +1,160 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsAudio</class>
+ <widget class="QWidget" name="UIMachineSettingsAudio" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>250</width>
+    <height>122</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" colspan="2" >
+    <widget class="QCheckBox" name="mGbAudio" >
+     <property name="whatsThis" >
+      <string>When checked, a virtual PCI audio card will be plugged into the virtual machine and will communicate with the host audio system using the specified driver.</string>
+     </property>
+     <property name="text" >
+      <string>Enable &amp;Audio</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QWidget" native="1" name="mAudioChild" >
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="mLbAudioDriver" >
+        <property name="text" >
+         <string>Host Audio &amp;Driver:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbAudioDriver</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" >
+       <widget class="QComboBox" name="mCbAudioDriver" >
+        <property name="whatsThis" >
+         <string>Controls the audio output driver. The &lt;b>Null Audio Driver&lt;/b> makes the guest see an audio card, however every access to it will be ignored.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QLabel" name="mLbAudioController" >
+        <property name="text" >
+         <string>Audio &amp;Controller:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbAudioController</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <widget class="QComboBox" name="mCbAudioController" >
+        <property name="whatsThis" >
+         <string>Selects the type of the virtual sound card. Depending on this value, VirtualBox will provide different audio hardware to the virtual machine.</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mGbAudio</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mAudioChild</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>111</x>
+     <y>19</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>124</x>
+     <y>61</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp	(revision 33882)
@@ -0,0 +1,421 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsDisplay class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "QIWidgetValidator.h"
+#include "UIMachineSettingsDisplay.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+
+#include <QDesktopWidget>
+
+/**
+ *  Calculates a suitable page step size for the given max value. The returned
+ *  size is so that there will be no more than 32 pages. The minimum returned
+ *  page size is 4.
+ */
+static int calcPageStep (int aMax)
+{
+    /* reasonable max. number of page steps is 32 */
+    uint page = ((uint) aMax + 31) / 32;
+    /* make it a power of 2 */
+    uint p = page, p2 = 0x1;
+    while ((p >>= 1))
+        p2 <<= 1;
+    if (page != p2)
+        p2 <<= 1;
+    if (p2 < 4)
+        p2 = 4;
+    return (int) p2;
+}
+
+UIMachineSettingsDisplay::UIMachineSettingsDisplay()
+    : mValidator(0)
+    , m_minVRAM(0)
+    , m_maxVRAM(0)
+    , m_maxVRAMVisible(0)
+    , m_initialVRAM(0)
+#ifdef VBOX_WITH_CRHGSMI
+    , m_bWddmMode(false)
+#endif
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsDisplay::setupUi (this);
+
+    /* Setup constants */
+    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
+    m_minVRAM = sys.GetMinGuestVRAM();
+    m_maxVRAM = sys.GetMaxGuestVRAM();
+    m_maxVRAMVisible = m_maxVRAM;
+    const uint MinMonitors = 1;
+#if (QT_VERSION >= 0x040600)
+    const uint cHostScreens = QApplication::desktop()->screenCount();
+#else /* (QT_VERSION >= 0x040600) */
+    const uint cHostScreens = QApplication::desktop()->numScreens();
+#endif /* !(QT_VERSION >= 0x040600) */
+    const uint MaxMonitors = sys.GetMaxGuestMonitors();
+
+    /* Setup validators */
+    mLeMemory->setValidator (new QIntValidator (m_minVRAM, m_maxVRAMVisible, this));
+    mLeMonitors->setValidator (new QIntValidator (MinMonitors, MaxMonitors, this));
+    mLeVRDEPort->setValidator (new QRegExpValidator (QRegExp ("(([0-9]{1,5}(\\-[0-9]{1,5}){0,1}),)*([0-9]{1,5}(\\-[0-9]{1,5}){0,1})"), this));
+    mLeVRDETimeout->setValidator (new QIntValidator (this));
+
+    /* Setup connections */
+    connect (mSlMemory, SIGNAL (valueChanged (int)), this, SLOT (valueChangedVRAM (int)));
+    connect (mLeMemory, SIGNAL (textChanged (const QString&)), this, SLOT (textChangedVRAM (const QString&)));
+    connect (mSlMonitors, SIGNAL (valueChanged (int)), this, SLOT (valueChangedMonitors (int)));
+    connect (mLeMonitors, SIGNAL (textChanged (const QString&)), this, SLOT (textChangedMonitors (const QString&)));
+
+    /* Setup initial values */
+    mSlMemory->setPageStep (calcPageStep (m_maxVRAMVisible));
+    mSlMemory->setSingleStep (mSlMemory->pageStep() / 4);
+    mSlMemory->setTickInterval (mSlMemory->pageStep());
+    mSlMonitors->setPageStep (1);
+    mSlMonitors->setSingleStep (1);
+    mSlMonitors->setTickInterval (1);
+    /* Setup the scale so that ticks are at page step boundaries */
+    mSlMemory->setMinimum ((m_minVRAM / mSlMemory->pageStep()) * mSlMemory->pageStep());
+    mSlMemory->setMaximum (m_maxVRAMVisible);
+    mSlMemory->setSnappingEnabled (true);
+    quint64 needMBytes = VBoxGlobal::requiredVideoMemory (&m_machine) / _1M;
+    mSlMemory->setErrorHint (0, 1);
+    mSlMemory->setWarningHint (1, needMBytes);
+    mSlMemory->setOptimalHint (needMBytes, m_maxVRAMVisible);
+    mSlMonitors->setMinimum (MinMonitors);
+    mSlMonitors->setMaximum (MaxMonitors);
+    mSlMonitors->setErrorHint (0, MinMonitors);
+    mSlMonitors->setOptimalHint (MinMonitors, cHostScreens);
+    mSlMonitors->setWarningHint (cHostScreens, MaxMonitors);
+    /* Limit min/max. size of QLineEdit */
+    mLeMemory->setFixedWidthByText (QString().fill ('8', 4));
+    mLeMonitors->setFixedWidthByText (QString().fill ('8', 4));
+    /* Ensure value and validation is updated */
+    valueChangedVRAM (mSlMemory->value());
+    valueChangedMonitors (mSlMonitors->value());
+    /* Setup VRDE widget */
+    mCbVRDEMethod->insertItem (0, ""); /* KAuthType_Null */
+    mCbVRDEMethod->insertItem (1, ""); /* KAuthType_External */
+    mCbVRDEMethod->insertItem (2, ""); /* KAuthType_Guest */
+    /* Initially disabled */
+    mCbVRDE->setChecked (false);
+
+#ifndef VBOX_WITH_VIDEOHWACCEL
+    mCb2DVideo->setVisible (false);
+#endif
+
+#ifdef VBOX_WITH_CRHGSMI
+    m_bWddmMode = false;
+#endif
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+#ifdef VBOX_WITH_VIDEOHWACCEL
+bool UIMachineSettingsDisplay::isAcceleration2DVideoSelected() const
+{
+    return mCb2DVideo->isChecked();
+}
+#endif
+
+#ifdef VBOX_WITH_CRHGSMI
+void UIMachineSettingsDisplay::setWddmMode(bool bWddm)
+{
+    if (bWddm == m_bWddmMode)
+        return;
+
+    m_bWddmMode = bWddm;
+    checkVRAMRequirements();
+}
+#endif
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsDisplay::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    m_cache.m_iCurrentVRAM = m_machine.GetVRAMSize();
+    m_cache.m_cMonitorCount = m_machine.GetMonitorCount();
+    m_cache.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled();
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    m_cache.m_f2dAccelerationEnabled = m_machine.GetAccelerate2DVideoEnabled();
+#endif
+    CVRDEServer vrdeServer = m_machine.GetVRDEServer();
+    m_cache.m_fVRDEServerSupported = !vrdeServer.isNull();
+    m_cache.m_fVRDEServerEnabled = m_cache.m_fVRDEServerSupported && vrdeServer.GetEnabled();
+    m_cache.m_strVRDEPort = vrdeServer.GetVRDEProperty("TCP/Ports");
+    m_cache.m_iVRDEAuthType = vrdeServer.GetAuthType();
+    m_cache.m_uVRDETimeout = vrdeServer.GetAuthTimeout();
+    m_cache.m_fMultipleConnectionsAllowed = vrdeServer.GetAllowMultiConnection();
+
+    /* Other variables: */
+    m_initialVRAM = RT_MIN(m_cache.m_iCurrentVRAM, m_maxVRAM);
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsDisplay::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    mSlMonitors->setValue(m_cache.m_cMonitorCount);
+    mCb3D->setEnabled(vboxGlobal().virtualBox().GetHost().GetAcceleration3DAvailable());
+    mCb3D->setChecked(m_cache.m_f3dAccelerationEnabled);
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    mCb2DVideo->setEnabled(VBoxGlobal::isAcceleration2DVideoAvailable());
+    mCb2DVideo->setChecked(m_cache.m_f2dAccelerationEnabled);
+#endif
+    checkVRAMRequirements();
+    mSlMemory->setValue(m_cache.m_iCurrentVRAM);
+    if (m_cache.m_fVRDEServerSupported)
+    {
+        mCbVRDE->setChecked(m_cache.m_fVRDEServerEnabled);
+        mLeVRDEPort->setText(m_cache.m_strVRDEPort);
+        mCbVRDEMethod->setCurrentIndex(mCbVRDEMethod->findText(vboxGlobal().toString(m_cache.m_iVRDEAuthType)));
+        mLeVRDETimeout->setText(QString::number(m_cache.m_uVRDETimeout));
+        mCbMultipleConn->setChecked(m_cache.m_fMultipleConnectionsAllowed);
+    }
+    else
+        mTwDisplay->removeTab(1);
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsDisplay::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    m_cache.m_iCurrentVRAM = mSlMemory->value();
+    m_cache.m_cMonitorCount = mSlMonitors->value();
+    m_cache.m_f3dAccelerationEnabled = mCb3D->isChecked();
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    m_cache.m_f2dAccelerationEnabled = mCb2DVideo->isChecked();
+#endif
+    if (m_cache.m_fVRDEServerSupported)
+    {
+        m_cache.m_fVRDEServerEnabled = mCbVRDE->isChecked();
+        m_cache.m_strVRDEPort = mLeVRDEPort->text();
+        m_cache.m_iVRDEAuthType = vboxGlobal().toAuthType(mCbVRDEMethod->currentText());
+        m_cache.m_uVRDETimeout = mLeVRDETimeout->text().toULong();
+        m_cache.m_fMultipleConnectionsAllowed = mCbMultipleConn->isChecked();
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsDisplay::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    m_machine.SetVRAMSize(m_cache.m_iCurrentVRAM);
+    m_machine.SetMonitorCount(m_cache.m_cMonitorCount);
+    m_machine.SetAccelerate3DEnabled(m_cache.m_f3dAccelerationEnabled);
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    m_machine.SetAccelerate2DVideoEnabled(m_cache.m_f2dAccelerationEnabled);
+#endif
+    CVRDEServer vrdeServer = m_machine.GetVRDEServer();
+    if (!vrdeServer.isNull())
+    {
+        vrdeServer.SetEnabled(m_cache.m_fVRDEServerEnabled);
+        vrdeServer.SetVRDEProperty("TCP/Ports", m_cache.m_strVRDEPort);
+        vrdeServer.SetAuthType(m_cache.m_iVRDEAuthType);
+        vrdeServer.SetAuthTimeout(m_cache.m_uVRDETimeout);
+        vrdeServer.SetAllowMultiConnection(m_cache.m_fMultipleConnectionsAllowed);
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsDisplay::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+    connect (mCb3D, SIGNAL (stateChanged (int)),
+             mValidator, SLOT (revalidate()));
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    connect (mCb2DVideo, SIGNAL (stateChanged (int)),
+             mValidator, SLOT (revalidate()));
+#endif
+    connect (mCbVRDE, SIGNAL (toggled (bool)),
+             mValidator, SLOT (revalidate()));
+    connect (mLeVRDEPort, SIGNAL (textChanged (const QString&)),
+             mValidator, SLOT (revalidate()));
+    connect (mLeVRDETimeout, SIGNAL (textChanged (const QString&)),
+             mValidator, SLOT (revalidate()));
+}
+
+bool UIMachineSettingsDisplay::revalidate (QString &aWarning, QString & /* aTitle */)
+{
+    /* Video RAM amount test */
+    quint64 needBytes = VBoxGlobal::requiredVideoMemory (&m_machine, mSlMonitors->value());
+    if ((quint64) mSlMemory->value() * _1M < needBytes)
+    {
+        aWarning = tr (
+            "you have assigned less than <b>%1</b> of video memory which is "
+            "the minimum amount required to switch the virtual machine to "
+            "fullscreen or seamless mode.")
+            .arg (vboxGlobal().formatSize (needBytes, 0, VBoxDefs::FormatSize_RoundUp));
+    }
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    else if (mCb2DVideo->isChecked())
+    {
+        needBytes += VBoxGlobal::required2DOffscreenVideoMemory();
+        if ((quint64) mSlMemory->value() * _1M < needBytes)
+        {
+            aWarning = tr (
+                "you have assigned less than <b>%1</b> of video memory which is "
+                "the minimum amount required for HD Video to be played efficiently.")
+                .arg (vboxGlobal().formatSize (needBytes, 0, VBoxDefs::FormatSize_RoundUp));
+        }
+    }
+#endif
+#ifdef VBOX_WITH_CRHGSMI
+    else if (m_bWddmMode && mCb3D->isChecked())
+    {
+        int cVal = mSlMonitors->value();
+        needBytes += VBoxGlobal::required3DWddmOffscreenVideoMemory(&m_machine, cVal);
+        needBytes = RT_MAX(needBytes, 128 * _1M);
+        needBytes = RT_MIN(needBytes, 256 * _1M);
+        if ((quint64) mSlMemory->value() * _1M < needBytes)
+        {
+            aWarning = tr(
+                "You have 3D Acceleration enabled for a operation system which uses the WDDM video driver. "
+                "For maximal performance set the guest VRAM to at least <b>%1</b>."
+                ).arg (vboxGlobal().formatSize (needBytes, 0, VBoxDefs::FormatSize_RoundUp));
+        }
+    }
+#endif
+    checkVRAMRequirements();
+
+    /* 3D Acceleration support test */
+    // TODO : W8 for NaN //
+
+    return true;
+}
+
+void UIMachineSettingsDisplay::setOrderAfter (QWidget *aWidget)
+{
+    /* Video tab-order */
+    setTabOrder (aWidget, mTwDisplay->focusProxy());
+    setTabOrder (mTwDisplay->focusProxy(), mSlMemory);
+    setTabOrder (mSlMemory, mLeMemory);
+    setTabOrder (mLeMemory, mSlMonitors);
+    setTabOrder (mSlMonitors, mLeMonitors);
+    setTabOrder (mLeMonitors, mCb3D);
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    setTabOrder (mCb3D, mCb2DVideo);
+    setTabOrder (mCb2DVideo, mCbVRDE);
+#else
+    setTabOrder (mCb3D, mCbVRDE);
+#endif
+
+    /* Remote display tab-order */
+    setTabOrder (mCbVRDE, mLeVRDEPort);
+    setTabOrder (mLeVRDEPort, mCbVRDEMethod);
+    setTabOrder (mCbVRDEMethod, mLeVRDETimeout);
+    setTabOrder (mLeVRDETimeout, mCbMultipleConn);
+}
+
+void UIMachineSettingsDisplay::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsDisplay::retranslateUi (this);
+
+    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
+    mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (m_minVRAM));
+    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (m_maxVRAMVisible));
+    mLbMonitorsMin->setText (tr ("<qt>%1</qt>").arg (1));
+    mLbMonitorsMax->setText (tr ("<qt>%1</qt>").arg (sys.GetMaxGuestMonitors()));
+
+    mCbVRDEMethod->setItemText (0,
+        vboxGlobal().toString (KAuthType_Null));
+    mCbVRDEMethod->setItemText (1,
+        vboxGlobal().toString (KAuthType_External));
+    mCbVRDEMethod->setItemText (2,
+        vboxGlobal().toString (KAuthType_Guest));
+}
+
+void UIMachineSettingsDisplay::valueChangedVRAM (int aVal)
+{
+    mLeMemory->setText (QString().setNum (aVal));
+}
+
+void UIMachineSettingsDisplay::textChangedVRAM (const QString &aText)
+{
+    mSlMemory->setValue (aText.toInt());
+}
+
+void UIMachineSettingsDisplay::valueChangedMonitors (int aVal)
+{
+    mLeMonitors->setText (QString().setNum (aVal));
+    checkVRAMRequirements();
+}
+
+void UIMachineSettingsDisplay::textChangedMonitors (const QString &aText)
+{
+    mSlMonitors->setValue (aText.toInt());
+}
+
+void UIMachineSettingsDisplay::checkVRAMRequirements()
+{
+    int cVal = mSlMonitors->value();
+    /* The memory requirements have changed too. */
+    quint64 needMBytes = VBoxGlobal::requiredVideoMemory (&m_machine, cVal) / _1M;
+    /* Limit the maximum memory to save careless users from setting useless big values */
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    if (mCb2DVideo->isChecked())
+    {
+        needMBytes += VBoxGlobal::required2DOffscreenVideoMemory() / _1M;
+    }
+#endif
+#ifdef VBOX_WITH_CRHGSMI
+    if (m_bWddmMode && mCb3D->isChecked())
+    {
+        needMBytes += VBoxGlobal::required3DWddmOffscreenVideoMemory(&m_machine, cVal) / _1M;
+        needMBytes = RT_MAX(needMBytes, 128);
+        needMBytes = RT_MIN(needMBytes, 256);
+        m_maxVRAMVisible = 256;
+    }
+    else
+#endif
+    {
+        m_maxVRAMVisible = cVal * 32;
+        if (m_maxVRAMVisible < 128)
+            m_maxVRAMVisible = 128;
+        if (m_maxVRAMVisible < m_initialVRAM)
+            m_maxVRAMVisible = m_initialVRAM;
+    }
+    mSlMemory->setWarningHint (1, needMBytes);
+    mSlMemory->setPageStep (calcPageStep (m_maxVRAMVisible));
+    mSlMemory->setMaximum (m_maxVRAMVisible);
+    mSlMemory->setOptimalHint (needMBytes, m_maxVRAMVisible);
+    mLeMemory->setValidator (new QIntValidator (m_minVRAM, m_maxVRAMVisible, this));
+    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (m_maxVRAMVisible));
+    /* ... or just call retranslateUi()? */
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h	(revision 33882)
@@ -0,0 +1,114 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsDisplay class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsDisplay_h__
+#define __UIMachineSettingsDisplay_h__
+
+#include "COMDefs.h"
+#include "UISettingsPage.h"
+#include "UIMachineSettingsDisplay.gen.h"
+
+/* Machine settings / Display page / Cache: */
+struct UISettingsCacheMachineDisplay
+{
+    int m_iCurrentVRAM;
+    int m_cMonitorCount;
+    bool m_f3dAccelerationEnabled;
+    bool m_f2dAccelerationEnabled;
+    bool m_fVRDEServerSupported;
+    bool m_fVRDEServerEnabled;
+    QString m_strVRDEPort;
+    KAuthType m_iVRDEAuthType;
+    ulong m_uVRDETimeout;
+    bool m_fMultipleConnectionsAllowed;
+};
+
+/* Machine settings / Display page: */
+class UIMachineSettingsDisplay : public UISettingsPageMachine,
+                              public Ui::UIMachineSettingsDisplay
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsDisplay();
+
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    bool isAcceleration2DVideoSelected() const;
+#endif
+
+#ifdef VBOX_WITH_CRHGSMI
+    void setWddmMode(bool bWddm);
+#endif
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void valueChangedVRAM (int aVal);
+    void textChangedVRAM (const QString &aText);
+    void valueChangedMonitors (int aVal);
+    void textChangedMonitors (const QString &aText);
+
+private:
+
+    void checkVRAMRequirements();
+
+    QIWidgetValidator *mValidator;
+
+    /* System minimum lower limit of VRAM (MiB). */
+    int m_minVRAM;
+    /* System maximum limit of VRAM (MiB). */
+    int m_maxVRAM;
+    /* Upper limit of VRAM in MiB for this dialog. This value is lower than
+     * m_maxVRAM to save careless users from setting useless big values. */
+    int m_maxVRAMVisible;
+    /* Initial VRAM value when the dialog is opened. */
+    int m_initialVRAM;
+#ifdef VBOX_WITH_CRHGSMI
+    /* Specifies whether the guest os is wddm-capable: */
+    bool m_bWddmMode;
+#endif
+
+    /* Cache: */
+    UISettingsCacheMachineDisplay m_cache;
+};
+
+#endif // __UIMachineSettingsDisplay_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui	(revision 33882)
@@ -0,0 +1,519 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
+
+     Copyright (C) 2008-2010 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsDisplay</class>
+ <widget class="QWidget" name="UIMachineSettingsDisplay">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>350</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="mLtMain">
+   <item>
+    <widget class="QITabWidget" name="mTwDisplay">
+     <widget class="QWidget" name="mTabVideo">
+      <attribute name="title">
+       <string>&amp;Video</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="mLtVideoPage">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QWidget" name="mWtVideo" native="true">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <layout class="QGridLayout" name="mLtVideoItems">
+          <property name="margin">
+           <number>0</number>
+          </property>
+          <item row="0" column="0">
+           <widget class="QLabel" name="mLbMemory">
+            <property name="text">
+             <string>Video &amp;Memory:</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+            <property name="buddy">
+             <cstring>mLeMemory</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1" rowspan="2">
+           <layout class="QVBoxLayout" name="mLtMemorySlider">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QIAdvancedSlider" name="mSlMemory">
+              <property name="whatsThis">
+               <string>Controls the amount of video memory provided to the virtual machine.</string>
+              </property>
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="tickPosition">
+               <enum>QSlider::TicksBelow</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="mLtMemoryLegend">
+              <item>
+               <widget class="QLabel" name="mLbMemoryMin">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="mSpHor1">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>0</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="mLbMemoryMax">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="alignment">
+                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </item>
+          <item row="0" column="2">
+           <layout class="QHBoxLayout" name="mLtMemorySize">
+            <property name="spacing">
+             <number>4</number>
+            </property>
+            <item>
+             <widget class="QILineEdit" name="mLeMemory">
+              <property name="whatsThis">
+               <string>Controls the amount of video memory provided to the virtual machine.</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="mLbMemoryUnit">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>MB</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item row="2" column="0">
+           <widget class="QLabel" name="mLbMonitors">
+            <property name="text">
+             <string>Mo&amp;nitor Count:</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+            <property name="buddy">
+             <cstring>mLeMonitors</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="1" rowspan="2">
+           <layout class="QVBoxLayout" name="mLtMonitorsSlider">
+            <property name="spacing">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QIAdvancedSlider" name="mSlMonitors">
+              <property name="whatsThis">
+               <string>Controls the amount of virtual monitors provided to the virtual machine.</string>
+              </property>
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="tickPosition">
+               <enum>QSlider::TicksBelow</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <layout class="QHBoxLayout" name="mLtMonitorsLegend">
+              <item>
+               <widget class="QLabel" name="mLbMonitorsMin">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+               </widget>
+              </item>
+              <item>
+               <spacer name="mSpHor2">
+                <property name="orientation">
+                 <enum>Qt::Horizontal</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>0</width>
+                  <height>0</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+              <item>
+               <widget class="QLabel" name="mLbMonitorsMax">
+                <property name="sizePolicy">
+                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                  <horstretch>0</horstretch>
+                  <verstretch>0</verstretch>
+                 </sizepolicy>
+                </property>
+                <property name="alignment">
+                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                </property>
+               </widget>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </item>
+          <item row="2" column="2">
+           <layout class="QHBoxLayout" name="mLtMonitorsSize">
+            <property name="spacing">
+             <number>4</number>
+            </property>
+            <item>
+             <widget class="QILineEdit" name="mLeMonitors">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="whatsThis">
+               <string>Controls the amount of virtual monitors provided to the virtual machine.</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="mLbMonitorsUnit"/>
+            </item>
+           </layout>
+          </item>
+          <item row="4" column="0">
+           <widget class="QLabel" name="mLbOptions">
+            <property name="text">
+             <string>Extended Features:</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="1" colspan="2">
+           <widget class="QCheckBox" name="mCb3D">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="whatsThis">
+             <string>When checked, the virtual machine will be given access to the 3D graphics capabilities available on the host.</string>
+            </property>
+            <property name="text">
+             <string>Enable &amp;3D Acceleration</string>
+            </property>
+           </widget>
+          </item>
+          <item row="5" column="1" colspan="2">
+           <widget class="QCheckBox" name="mCb2DVideo">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="whatsThis">
+             <string>When checked, the virtual machine will be given access to the Video Acceleration capabilities available on the host.</string>
+            </property>
+            <property name="text">
+             <string>Enable &amp;2D Video Acceleration</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="mSpVer1">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mTabVRDP">
+      <attribute name="title">
+       <string>&amp;Remote Display</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="mLtVRDPPage">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QWidget" name="mWtVRDP" native="true">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <layout class="QVBoxLayout" name="mLtVRDPItems">
+          <property name="margin">
+           <number>0</number>
+          </property>
+          <item>
+           <widget class="QCheckBox" name="mCbVRDE">
+            <property name="whatsThis">
+             <string>When checked, the VM will act as a Remote Desktop Protocol (RDP) server, allowing remote clients to connect and operate the VM (when it is running) using a standard RDP client.</string>
+            </property>
+            <property name="text">
+             <string>&amp;Enable Server</string>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QWidget" name="mWtVRDPServer" native="true">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <layout class="QGridLayout" name="mLtVRDPServerItems">
+             <property name="margin">
+              <number>0</number>
+             </property>
+             <item row="1" column="0" rowspan="3">
+              <spacer name="mSpHor3">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeType">
+                <enum>QSizePolicy::Fixed</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>20</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item row="1" column="1">
+              <widget class="QLabel" name="mLbVRDPPort">
+               <property name="text">
+                <string>Server &amp;Port:</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
+               <property name="buddy">
+                <cstring>mLeVRDEPort</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="2">
+              <widget class="QLineEdit" name="mLeVRDEPort">
+               <property name="whatsThis">
+                <string>The VRDP Server port number. You may specify &lt;tt&gt;0&lt;/tt&gt; (zero), to select port 3389, the standard port for RDP.</string>
+               </property>
+              </widget>
+             </item>
+             <item row="2" column="1">
+              <widget class="QLabel" name="mLbVRDPMethod">
+               <property name="text">
+                <string>Authentication &amp;Method:</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
+               <property name="buddy">
+                <cstring>mCbVRDEMethod</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="2" column="2">
+              <widget class="QComboBox" name="mCbVRDEMethod">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="whatsThis">
+                <string>Defines the VRDP authentication method.</string>
+               </property>
+              </widget>
+             </item>
+             <item row="3" column="1">
+              <widget class="QLabel" name="mLbVRDPTimeout">
+               <property name="text">
+                <string>Authentication &amp;Timeout:</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
+               <property name="buddy">
+                <cstring>mLeVRDETimeout</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="3" column="2">
+              <widget class="QLineEdit" name="mLeVRDETimeout">
+               <property name="whatsThis">
+                <string>Specifies the timeout for guest authentication, in milliseconds.</string>
+               </property>
+              </widget>
+             </item>
+             <item row="4" column="1">
+              <widget class="QLabel" name="mLbOptions2">
+               <property name="text">
+                <string>Extended Features:</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
+              </widget>
+             </item>
+             <item row="4" column="2">
+              <widget class="QCheckBox" name="mCbMultipleConn">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="whatsThis">
+                <string>Specifies whether multiple simultaneous connections to the VM are permitted.</string>
+               </property>
+               <property name="text">
+                <string>&amp;Allow Multiple Connections</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="mSpVer2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>QILineEdit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIAdvancedSlider</class>
+   <extends>QSlider</extends>
+   <header>QIAdvancedSlider.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QITabWidget</class>
+   <extends>QTabWidget</extends>
+   <header>QITabWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mCbVRDE</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mWtVRDPServer</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>80</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>159</x>
+     <y>88</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 33882)
@@ -0,0 +1,199 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsGeneral class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIMachineSettingsGeneral.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "QIWidgetValidator.h"
+
+#include <QDir>
+
+UIMachineSettingsGeneral::UIMachineSettingsGeneral()
+    : mValidator(0)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsGeneral::setupUi (this);
+
+    /* Setup validators */
+    mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this));
+
+    /* Shared Clipboard mode */
+    mCbClipboard->addItem (""); /* KClipboardMode_Disabled */
+    mCbClipboard->addItem (""); /* KClipboardMode_HostToGuest */
+    mCbClipboard->addItem (""); /* KClipboardMode_GuestToHost */
+    mCbClipboard->addItem (""); /* KClipboardMode_Bidirectional */
+
+#ifdef Q_WS_MAC
+    mTeDescription->setMinimumHeight (150);
+#endif /* Q_WS_MAC */
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+bool UIMachineSettingsGeneral::is64BitOSTypeSelected() const
+{
+    return mOSTypeSelector->type().GetIs64Bit();
+}
+
+#ifdef VBOX_WITH_VIDEOHWACCEL
+bool UIMachineSettingsGeneral::isWindowsOSTypeSelected() const
+{
+    return mOSTypeSelector->type().GetFamilyId() == "Windows";
+}
+#endif
+
+#ifdef VBOX_WITH_CRHGSMI
+bool UIMachineSettingsGeneral::isWddmSupportedForOSType() const
+{
+    const QString &strOsId = mOSTypeSelector->type().GetId();
+    return strOsId == "WindowsVista" || strOsId == "Windows7";
+}
+#endif
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsGeneral::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    m_cache.m_strName = m_machine.GetName();
+    m_cache.m_strGuestOsTypeId = m_machine.GetOSTypeId();
+    QString strSaveMountedAtRuntime = m_machine.GetExtraData(VBoxDefs::GUI_SaveMountedAtRuntime);
+    m_cache.m_fSaveMountedAtRuntime = strSaveMountedAtRuntime != "no";
+    QString strShowMiniToolBar = m_machine.GetExtraData(VBoxDefs::GUI_ShowMiniToolBar);
+    m_cache.m_fShowMiniToolBar = strShowMiniToolBar != "no";
+    QString strMiniToolBarAlignment = m_machine.GetExtraData(VBoxDefs::GUI_MiniToolBarAlignment);
+    m_cache.m_fMiniToolBarAtTop = strMiniToolBarAlignment == "top";
+    m_cache.m_strSnapshotsFolder = m_machine.GetSnapshotFolder();
+    m_cache.m_strSnapshotsHomeDir = QFileInfo(m_machine.GetSettingsFilePath()).absolutePath();
+    m_cache.m_clipboardMode = m_machine.GetClipboardMode();
+    m_cache.m_strDescription = m_machine.GetDescription();
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsGeneral::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    mLeName->setText(m_cache.m_strName);
+    mOSTypeSelector->setType(vboxGlobal().vmGuestOSType(m_cache.m_strGuestOsTypeId));
+    mCbSaveMounted->setChecked(m_cache.m_fSaveMountedAtRuntime);
+    mCbShowToolBar->setChecked(m_cache.m_fShowMiniToolBar);
+    mCbToolBarAlignment->setChecked(m_cache.m_fMiniToolBarAtTop);
+    mCbToolBarAlignment->setEnabled(mCbShowToolBar->isChecked());
+    mPsSnapshot->setPath(m_cache.m_strSnapshotsFolder);
+    mPsSnapshot->setHomeDir(m_cache.m_strSnapshotsHomeDir);
+    mCbClipboard->setCurrentIndex(m_cache.m_clipboardMode);
+    mTeDescription->setPlainText(m_cache.m_strDescription);
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsGeneral::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    m_cache.m_strName = mLeName->text();
+    m_cache.m_strGuestOsTypeId = mOSTypeSelector->type().GetId();
+    m_cache.m_fSaveMountedAtRuntime = mCbSaveMounted->isChecked();
+    m_cache.m_fShowMiniToolBar = mCbShowToolBar->isChecked();
+    m_cache.m_fMiniToolBarAtTop = mCbToolBarAlignment->isChecked();
+    m_cache.m_strSnapshotsFolder = mPsSnapshot->path();
+    m_cache.m_clipboardMode = (KClipboardMode)mCbClipboard->currentIndex();
+    m_cache.m_strDescription = mTeDescription->toPlainText().isEmpty() ?
+                               QString::null : mTeDescription->toPlainText();
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsGeneral::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    m_machine.SetName(m_cache.m_strName);
+    m_machine.SetOSTypeId(m_cache.m_strGuestOsTypeId);
+    m_machine.SetExtraData(VBoxDefs::GUI_SaveMountedAtRuntime, m_cache.m_fSaveMountedAtRuntime ? "yes" : "no");
+    m_machine.SetExtraData(VBoxDefs::GUI_ShowMiniToolBar, m_cache.m_fShowMiniToolBar ? "yes" : "no");
+    m_machine.SetExtraData(VBoxDefs::GUI_MiniToolBarAlignment, m_cache.m_fMiniToolBarAtTop ? "top" : "bottom");
+    m_machine.SetSnapshotFolder(m_cache.m_strSnapshotsFolder);
+    m_machine.SetClipboardMode(m_cache.m_clipboardMode);
+    m_machine.SetDescription(m_cache.m_strDescription);
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsGeneral::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+    connect (mOSTypeSelector, SIGNAL (osTypeChanged()), mValidator, SLOT (revalidate()));
+}
+
+void UIMachineSettingsGeneral::setOrderAfter (QWidget *aWidget)
+{
+    /* Basic tab-order */
+    setTabOrder (aWidget, mTwGeneral->focusProxy());
+    setTabOrder (mTwGeneral->focusProxy(), mLeName);
+    setTabOrder (mLeName, mOSTypeSelector);
+
+    /* Advanced tab-order */
+    setTabOrder (mOSTypeSelector, mPsSnapshot);
+    setTabOrder (mPsSnapshot, mCbClipboard);
+    setTabOrder (mCbClipboard, mCbSaveMounted);
+    setTabOrder (mCbSaveMounted, mCbShowToolBar);
+    setTabOrder (mCbShowToolBar, mCbToolBarAlignment);
+
+    /* Description tab-order */
+    setTabOrder (mCbToolBarAlignment, mTeDescription);
+}
+
+void UIMachineSettingsGeneral::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsGeneral::retranslateUi (this);
+
+    /* Path selector */
+    mPsSnapshot->setWhatsThis (tr ("Displays the path where snapshots of this "
+                                   "virtual machine will be stored. Be aware that "
+                                   "snapshots can take quite a lot of disk "
+                                   "space."));
+
+    /* Shared Clipboard mode */
+    mCbClipboard->setItemText (0, vboxGlobal().toString (KClipboardMode_Disabled));
+    mCbClipboard->setItemText (1, vboxGlobal().toString (KClipboardMode_HostToGuest));
+    mCbClipboard->setItemText (2, vboxGlobal().toString (KClipboardMode_GuestToHost));
+    mCbClipboard->setItemText (3, vboxGlobal().toString (KClipboardMode_Bidirectional));
+}
+
+void UIMachineSettingsGeneral::showEvent (QShowEvent *aEvent)
+{
+    QCoreApplication::sendPostedEvents();
+    UISettingsPage::showEvent (aEvent);
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h	(revision 33882)
@@ -0,0 +1,93 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsGeneral class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsGeneral_h__
+#define __UIMachineSettingsGeneral_h__
+
+#include "UISettingsPage.h"
+#include "UIMachineSettingsGeneral.gen.h"
+#include "COMDefs.h"
+
+/* Machine settings / General page / Cache: */
+struct UISettingsCacheMachineGeneral
+{
+    QString m_strName;
+    QString m_strGuestOsTypeId;
+    bool m_fSaveMountedAtRuntime;
+    bool m_fShowMiniToolBar;
+    bool m_fMiniToolBarAtTop;
+    QString m_strSnapshotsFolder;
+    QString m_strSnapshotsHomeDir;
+    KClipboardMode m_clipboardMode;
+    QString m_strDescription;
+};
+
+/* Machine settings / General page: */
+class UIMachineSettingsGeneral : public UISettingsPageMachine,
+                              public Ui::UIMachineSettingsGeneral
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsGeneral();
+
+    bool is64BitOSTypeSelected() const;
+
+#ifdef VBOX_WITH_VIDEOHWACCEL
+    bool isWindowsOSTypeSelected() const;
+#endif
+
+#ifdef VBOX_WITH_CRHGSMI
+    bool isWddmSupportedForOSType() const;
+#endif
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private:
+
+    void showEvent (QShowEvent *aEvent);
+
+    QIWidgetValidator *mValidator;
+
+    /* Cache: */
+    UISettingsCacheMachineGeneral m_cache;
+};
+
+#endif // __UIMachineSettingsGeneral_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui	(revision 33882)
@@ -0,0 +1,318 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsGeneral</class>
+ <widget class="QWidget" name="UIMachineSettingsGeneral" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>350</width>
+    <height>250</height>
+   </rect>
+  </property>
+  <layout class="QHBoxLayout" name="mLtMain" >
+   <item>
+    <widget class="QITabWidget" name="mTwGeneral" >
+     <property name="currentIndex" >
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="mTabBasic" >
+      <attribute name="title" >
+       <string>&amp;Basic</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="mLtBasic" >
+       <property name="spacing" >
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="VBoxOSTypeSelectorWidget" native="1" name="mOSTypeSelector" >
+         <layout class="QGridLayout" name="mLtOSTypeSelector" >
+          <property name="margin" >
+           <number>0</number>
+          </property>
+          <item row="0" column="0" >
+           <widget class="QLabel" name="mLbName" >
+            <property name="text" >
+             <string>&amp;Name:</string>
+            </property>
+            <property name="alignment" >
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+            <property name="buddy" >
+             <cstring>mLeName</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1" colspan="2" >
+           <widget class="QLineEdit" name="mLeName" >
+            <property name="whatsThis" >
+             <string>Displays the name of the virtual machine.</string>
+            </property>
+            <property name="text" >
+             <string/>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="mSpVer1" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mTabAdvanced" >
+      <attribute name="title" >
+       <string>&amp;Advanced</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="mLtAdvanced" >
+       <property name="spacing" >
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QWidget" native="1" name="mWtAdvanced" >
+         <layout class="QGridLayout" name="mLtAdvancedItems" >
+          <property name="margin" >
+           <number>0</number>
+          </property>
+          <item row="0" column="0" >
+           <widget class="QLabel" name="mLbSnapshot" >
+            <property name="text" >
+             <string>S&amp;napshot Folder:</string>
+            </property>
+            <property name="alignment" >
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+            <property name="buddy" >
+             <cstring>mPsSnapshot</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1" colspan="2" >
+           <widget class="VBoxFilePathSelectorWidget" name="mPsSnapshot" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0" >
+           <widget class="QLabel" name="mLbClipboard" >
+            <property name="text" >
+             <string>&amp;Shared Clipboard:</string>
+            </property>
+            <property name="alignment" >
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+            <property name="buddy" >
+             <cstring>mCbClipboard</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1" >
+           <widget class="QComboBox" name="mCbClipboard" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="whatsThis" >
+             <string>Selects which clipboard data will be copied between the guest and the host OS. This feature requires Guest Additions to be installed in the guest OS.</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="2" >
+           <spacer name="mSpHor1" >
+            <property name="orientation" >
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0" >
+             <size>
+              <width>0</width>
+              <height>0</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item row="2" column="0" >
+           <widget class="QLabel" name="mLbMedia" >
+            <property name="text" >
+             <string>Removable Media:</string>
+            </property>
+            <property name="alignment" >
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="1" >
+           <widget class="QCheckBox" name="mCbSaveMounted" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="whatsThis" >
+             <string>If checked, any change to mounted CD/DVD or Floppy media performed during machine execution will be saved in the settings file in order to preserve the configuration of mounted media between runs.</string>
+            </property>
+            <property name="text" >
+             <string>&amp;Remember Runtime Changes</string>
+            </property>
+            <property name="checked" >
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="0" >
+           <widget class="QLabel" name="mLbToolBar" >
+            <property name="text" >
+             <string>Mini ToolBar:</string>
+            </property>
+            <property name="alignment" >
+             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="1" >
+           <widget class="QCheckBox" name="mCbShowToolBar" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="whatsThis" >
+             <string>If checked, show the Mini ToolBar in Fullscreen and Seamless modes.</string>
+            </property>
+            <property name="text" >
+             <string>Show In &amp;Fullscreen/Seamless</string>
+            </property>
+            <property name="checked" >
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="1" >
+           <widget class="QCheckBox" name="mCbToolBarAlignment" >
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="whatsThis" >
+             <string>If checked, show the Mini ToolBar at the top of the screen, rather than in its default position at the bottom of the screen.</string>
+            </property>
+            <property name="text" >
+             <string>Show At &amp;Top Of Screen</string>
+            </property>
+            <property name="checked" >
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="mSpVer2" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mTabDescription" >
+      <attribute name="title" >
+       <string>&amp;Description</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="mLtDescription" >
+       <property name="spacing" >
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QTextEdit" name="mTeDescription" >
+         <property name="whatsThis" >
+          <string>Displays the description of the virtual machine. The description field is useful for commenting on configuration details of the installed guest OS.</string>
+         </property>
+         <property name="acceptRichText" >
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>VBoxOSTypeSelectorWidget</class>
+   <extends>QWidget</extends>
+   <header>VBoxOSTypeSelectorWidget.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxFilePathSelectorWidget</class>
+   <extends>QComboBox</extends>
+   <header>VBoxFilePathSelectorWidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>QITabWidget</class>
+   <extends>QTabWidget</extends>
+   <header>QITabWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mCbShowToolBar</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mCbToolBarAlignment</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>195</x>
+     <y>50</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>196</x>
+     <y>72</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp	(revision 33882)
@@ -0,0 +1,987 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsNetwork class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* VBox Includes */
+#ifdef VBOX_WITH_VDE
+# include <iprt/ldr.h>
+# include <VBox/VDEPlug.h>
+#endif
+
+#include "QIWidgetValidator.h"
+#include "QIArrowButtonSwitch.h"
+#include "VBoxGlobal.h"
+#include "UIMachineSettingsNetwork.h"
+#include "QITabWidget.h"
+
+/* Qt Includes */
+#include <QTimer>
+#include <QCompleter>
+
+/* Empty item extra-code */
+const char *emptyItemCode = "#empty#";
+
+/* UIMachineSettingsNetwork Stuff */
+UIMachineSettingsNetwork::UIMachineSettingsNetwork (UIMachineSettingsNetworkPage *aParent, bool aDisableStaticControls)
+    : QIWithRetranslateUI <QWidget> (0)
+    , mParent (aParent)
+    , mValidator (0)
+    , m_iSlot(-1)
+    , mPolished (false)
+    , mDisableStaticControls (false)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsNetwork::setupUi (this);
+
+    /* Setup widgets */
+    mCbAdapterName->setInsertPolicy (QComboBox::NoInsert);
+    mLeMAC->setValidator (new QRegExpValidator (QRegExp (
+                          "[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"), this));
+    mLeMAC->setMinimumWidthByText (QString().fill ('0', 12));
+
+    /* Setup connections */
+    connect (mAbsAdvanced, SIGNAL (clicked()), this, SLOT (toggleAdvanced()));
+    connect (mTbMAC, SIGNAL (clicked()), this, SLOT (generateMac()));
+    connect (mPbPortForwarding, SIGNAL (clicked()), this, SLOT (sltOpenPortForwardingDlg()));
+
+#ifdef Q_WS_MAC
+    /* Prevent this widgets to go in the Small/Mini size state which is
+     * available on Mac OS X. Not sure why this happens but this seems to help
+     * against. */
+    QList <QWidget*> list = findChildren <QWidget*>();
+    foreach (QWidget *w, list)
+        if (w->parent() == this)
+            w->setFixedHeight (w->sizeHint().height());
+#endif /* Q_WS_MAC */
+
+    /* Applying language settings */
+    retranslateUi();
+
+    /* If some controls should be disabled or not when the
+     * same tab widgets are shown during runtime
+     */
+    mDisableStaticControls = aDisableStaticControls;
+}
+
+void UIMachineSettingsNetwork::fetchAdapterData(const UINetworkAdapterData &data)
+{
+    /* Load adapter & slot number: */
+    m_iSlot = data.m_iSlot;
+    m_adapter = data.m_adapter;
+
+    /* Load adapter activity state: */
+    mCbEnableAdapter->setChecked(data.m_fAdapterEnabled);
+
+    /* Load adapter type: */
+    int adapterPos = mCbAdapterType->findData(data.m_adapterType);
+    mCbAdapterType->setCurrentIndex(adapterPos == -1 ? 0 : adapterPos);
+
+    /* Load attachment type: */
+    int attachmentPos = mCbAttachmentType->findData(data.m_attachmentType);
+    mCbAttachmentType->setCurrentIndex(attachmentPos == -1 ? 0 : attachmentPos);
+
+    /* Load alternative name: */
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+            mBrgName = data.m_strBridgedAdapterName;
+            if (mBrgName.isEmpty()) mBrgName = QString();
+            break;
+        case KNetworkAttachmentType_Internal:
+            mIntName = data.m_strInternalNetworkName;
+            if (mIntName.isEmpty()) mIntName = QString();
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            mHoiName = data.m_strHostInterfaceName;
+            if (mHoiName.isEmpty()) mHoiName = QString();
+            break;
+#ifdef VBOX_WITH_VDE
+        case KNetworkAttachmentType_VDE:
+            mVDEName = data.m_strVDENetworkName;
+            if (mVDEName.isEmpty()) mVDEName = QString();
+            break;
+#endif
+        default:
+            break;
+    }
+    updateAttachmentAlternative();
+
+    /* Other options: */
+    mLeMAC->setText(data.m_strMACAddress);
+    mCbCableConnected->setChecked(data.m_fCableConnected);
+
+    /* Load port forwarding rules: */
+    mPortForwardingRules = data.m_redirects;
+}
+
+void UIMachineSettingsNetwork::uploadAdapterData(UINetworkAdapterData &data)
+{
+    /* Save adapter activity state: */
+    data.m_fAdapterEnabled = mCbEnableAdapter->isChecked();
+
+    /* Save adapter type: */
+    data.m_adapterType = (KNetworkAdapterType)mCbAdapterType->itemData(mCbAdapterType->currentIndex()).toInt();
+
+    /* Save attachment type & alternative name: */
+    data.m_attachmentType = attachmentType();
+    switch (data.m_attachmentType)
+    {
+        case KNetworkAttachmentType_Null:
+            break;
+        case KNetworkAttachmentType_NAT:
+            break;
+        case KNetworkAttachmentType_Bridged:
+            data.m_strBridgedAdapterName = alternativeName();
+            break;
+        case KNetworkAttachmentType_Internal:
+            data.m_strInternalNetworkName = alternativeName();
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            data.m_strHostInterfaceName = alternativeName();
+            break;
+#ifdef VBOX_WITH_VDE
+        case KNetworkAttachmentType_VDE:
+            data.m_strVDENetworkName = alternativeName();
+            break;
+#endif
+        default:
+            break;
+    }
+
+    /* Other options: */
+    data.m_strMACAddress = mLeMAC->text().isEmpty() ? QString() : mLeMAC->text();
+    data.m_fCableConnected = mCbCableConnected->isChecked();
+
+    /* Save port forwarding rules: */
+    data.m_redirects = mPortForwardingRules;
+}
+
+void UIMachineSettingsNetwork::setValidator (QIWidgetValidator *aValidator)
+{
+    mValidator = aValidator;
+
+    if (!mDisableStaticControls)
+        connect (mCbEnableAdapter, SIGNAL (toggled (bool)),
+                 mValidator, SLOT (revalidate()));
+    connect (mCbAttachmentType, SIGNAL (activated (const QString&)),
+             this, SLOT (updateAttachmentAlternative()));
+    connect (mCbAdapterName, SIGNAL (activated (const QString&)),
+             this, SLOT (updateAlternativeName()));
+    connect (mCbAdapterName, SIGNAL (editTextChanged (const QString&)),
+             this, SLOT (updateAlternativeName()));
+
+    if (!mDisableStaticControls)
+        mValidator->revalidate();
+}
+
+bool UIMachineSettingsNetwork::revalidate (QString &aWarning, QString &aTitle)
+{
+    /* 'True' for disabled adapter */
+    if (!mCbEnableAdapter->isChecked())
+        return true;
+
+    /* Validate alternatives */
+    bool valid = true;
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+            if (alternativeName().isNull())
+            {
+                aWarning = tr ("no bridged network adapter is selected");
+                valid = false;
+            }
+            break;
+        case KNetworkAttachmentType_Internal:
+            if (alternativeName().isNull())
+            {
+                aWarning = tr ("no internal network name is specified");
+                valid = false;
+            }
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            if (alternativeName().isNull())
+            {
+                aWarning = tr ("no host-only network adapter is selected");
+                valid = false;
+            }
+            break;
+        default:
+            break;
+    }
+
+    if (!valid)
+        aTitle += ": " + vboxGlobal().removeAccelMark (pageTitle());
+
+    return valid;
+}
+
+QWidget* UIMachineSettingsNetwork::setOrderAfter (QWidget *aAfter)
+{
+    setTabOrder (aAfter, mCbEnableAdapter);
+    setTabOrder (mCbEnableAdapter, mCbAttachmentType);
+    setTabOrder (mCbAttachmentType, mCbAdapterName);
+    setTabOrder (mCbAdapterName, mAbsAdvanced);
+    setTabOrder (mAbsAdvanced, mCbAdapterType);
+    setTabOrder (mCbAdapterType, mLeMAC);
+    setTabOrder (mLeMAC, mTbMAC);
+    setTabOrder (mTbMAC, mCbCableConnected);
+    setTabOrder (mCbCableConnected, mPbPortForwarding);
+    return mPbPortForwarding;
+}
+
+QString UIMachineSettingsNetwork::pageTitle() const
+{
+    return VBoxGlobal::tr("Adapter %1", "network").arg(QString("&%1").arg(m_iSlot + 1));;
+}
+
+KNetworkAttachmentType UIMachineSettingsNetwork::attachmentType() const
+{
+    return (KNetworkAttachmentType) mCbAttachmentType->itemData (
+           mCbAttachmentType->currentIndex()).toInt();
+}
+
+QString UIMachineSettingsNetwork::alternativeName (int aType) const
+{
+    if (aType == -1) aType = attachmentType();
+    QString result;
+    switch (aType)
+    {
+        case KNetworkAttachmentType_Bridged:
+            result = mBrgName;
+            break;
+        case KNetworkAttachmentType_Internal:
+            result = mIntName;
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            result = mHoiName;
+            break;
+#ifdef VBOX_WITH_VDE
+        case KNetworkAttachmentType_VDE:
+            result = mVDEName;
+            break;
+#endif
+        default:
+            break;
+    }
+    Assert (result.isNull() || !result.isEmpty());
+    return result;
+}
+
+void UIMachineSettingsNetwork::showEvent (QShowEvent *aEvent)
+{
+    if (!mPolished)
+    {
+        mPolished = true;
+
+        /* Give the minimum size hint to the first layout column */
+        mNetworkChildGridLayout->setColumnMinimumWidth (0, mLbAttachmentType->width());
+
+        if (mDisableStaticControls)
+        {
+            /* Disable controls for dynamically displayed page */
+            mCbEnableAdapter->setEnabled (false);
+            mCbAdapterType->setEnabled (false);
+            mLeMAC->setEnabled (false);
+            mTbMAC->setEnabled (false);
+            mLbAdapterType->setEnabled (false);
+            mLbMAC->setEnabled (false);
+            mAbsAdvanced->animateClick();
+        }
+        else
+        {
+            /* Hide advanced items initially */
+            toggleAdvanced();
+        }
+    }
+    QWidget::showEvent (aEvent);
+}
+
+void UIMachineSettingsNetwork::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsNetwork::retranslateUi (this);
+
+    /* Translate combo-boxes content */
+    populateComboboxes();
+
+    /* Translate attachment info */
+    updateAttachmentAlternative();
+}
+
+void UIMachineSettingsNetwork::updateAttachmentAlternative()
+{
+    /* Blocking signals to change content manually */
+    mCbAdapterName->blockSignals (true);
+
+    /* Update alternative-name combo-box availability */
+    mLbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
+                                attachmentType() != KNetworkAttachmentType_NAT);
+    mCbAdapterName->setEnabled (attachmentType() != KNetworkAttachmentType_Null &&
+                                attachmentType() != KNetworkAttachmentType_NAT);
+
+    /* Refresh list */
+    mCbAdapterName->clear();
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+            mCbAdapterName->insertItems (0, mParent->brgList());
+            mCbAdapterName->setEditable (false);
+            break;
+        case KNetworkAttachmentType_Internal:
+            mCbAdapterName->insertItems (0, mParent->fullIntList());
+            mCbAdapterName->setEditable (true);
+            mCbAdapterName->setCompleter (0);
+            break;
+        case KNetworkAttachmentType_HostOnly:
+            mCbAdapterName->insertItems (0, mParent->hoiList());
+            mCbAdapterName->setEditable (false);
+            break;
+#ifdef VBOX_WITH_VDE
+        case KNetworkAttachmentType_VDE:
+            mCbAdapterName->insertItem(0, alternativeName());
+            mCbAdapterName->setEditable (true);
+            mCbAdapterName->setCompleter (0);
+            break;
+#endif
+        default:
+            break;
+    }
+
+    /* Prepend 'empty' or 'default' item */
+    if (mCbAdapterName->count() == 0)
+    {
+        switch (attachmentType())
+        {
+            case KNetworkAttachmentType_Bridged:
+            case KNetworkAttachmentType_HostOnly:
+            {
+                /* Adapters list 'empty' */
+                int pos = mCbAdapterName->findData (emptyItemCode);
+                if (pos == -1)
+                    mCbAdapterName->insertItem (0, tr ("Not selected", "network adapter name"), emptyItemCode);
+                else
+                    mCbAdapterName->setItemText (pos, tr ("Not selected", "network adapter name"));
+                break;
+            }
+            case KNetworkAttachmentType_Internal:
+            {
+                /* Internal network 'default' name */
+                if (mCbAdapterName->findText ("intnet") == -1)
+                    mCbAdapterName->insertItem (0, "intnet");
+                break;
+            }
+            default:
+                break;
+        }
+    }
+
+    /* Select previous or default item */
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+        case KNetworkAttachmentType_HostOnly:
+        {
+            int pos = mCbAdapterName->findText (alternativeName());
+            mCbAdapterName->setCurrentIndex (pos == -1 ? 0 : pos);
+            break;
+        }
+        case KNetworkAttachmentType_Internal:
+        {
+            int pos = mCbAdapterName->findText (alternativeName());
+            mCbAdapterName->setCurrentIndex (pos == -1 ? 0 : pos);
+            break;
+        }
+        default:
+            break;
+    }
+
+    /* Remember selected item */
+    updateAlternativeName();
+
+    /* Update Forwarding rules button availability: */
+    mPbPortForwarding->setEnabled(attachmentType() == KNetworkAttachmentType_NAT);
+
+    /* Unblocking signals as content is changed already */
+    mCbAdapterName->blockSignals (false);
+}
+
+void UIMachineSettingsNetwork::updateAlternativeName()
+{
+    switch (attachmentType())
+    {
+        case KNetworkAttachmentType_Bridged:
+        {
+            QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
+                             QString (emptyItemCode) ||
+                             mCbAdapterName->currentText().isEmpty() ?
+                             QString::null : mCbAdapterName->currentText());
+            if (mBrgName != newName)
+                mBrgName = newName;
+            break;
+        }
+        case KNetworkAttachmentType_Internal:
+        {
+            QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
+                              QString (emptyItemCode) &&
+                              mCbAdapterName->currentText() ==
+                              mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||
+                              mCbAdapterName->currentText().isEmpty() ?
+                              QString::null : mCbAdapterName->currentText());
+            if (mIntName != newName)
+            {
+                mIntName = newName;
+                if (!mIntName.isNull())
+                    QTimer::singleShot (0, mParent, SLOT (updatePages()));
+            }
+            break;
+        }
+        case KNetworkAttachmentType_HostOnly:
+        {
+            QString newName (mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
+                             QString (emptyItemCode) ||
+                             mCbAdapterName->currentText().isEmpty() ?
+                             QString::null : mCbAdapterName->currentText());
+            if (mHoiName != newName)
+                mHoiName = newName;
+            break;
+        }
+#ifdef VBOX_WITH_VDE
+        case KNetworkAttachmentType_VDE:
+        {
+            QString newName ((mCbAdapterName->itemData (mCbAdapterName->currentIndex()).toString() ==
+                              QString (emptyItemCode) &&
+                              mCbAdapterName->currentText() ==
+                              mCbAdapterName->itemText (mCbAdapterName->currentIndex())) ||
+                              mCbAdapterName->currentText().isEmpty() ?
+                              QString::null : mCbAdapterName->currentText());
+            if (mVDEName != newName)
+                mVDEName = newName;
+            break;
+        }
+#endif
+        default:
+            break;
+    }
+
+    if (mValidator)
+        mValidator->revalidate();
+}
+
+void UIMachineSettingsNetwork::toggleAdvanced()
+{
+    mLbAdapterType->setVisible (mAbsAdvanced->isExpanded());
+    mCbAdapterType->setVisible (mAbsAdvanced->isExpanded());
+    mLbMAC->setVisible (mAbsAdvanced->isExpanded());
+    mLeMAC->setVisible (mAbsAdvanced->isExpanded());
+    mTbMAC->setVisible (mAbsAdvanced->isExpanded());
+    mCbCableConnected->setVisible (mAbsAdvanced->isExpanded());
+    mPbPortForwarding->setVisible (mAbsAdvanced->isExpanded());
+}
+
+void UIMachineSettingsNetwork::generateMac()
+{
+    m_adapter.SetMACAddress(QString::null);
+    mLeMAC->setText(m_adapter.GetMACAddress());
+}
+
+void UIMachineSettingsNetwork::sltOpenPortForwardingDlg()
+{
+    UIMachineSettingsPortForwardingDlg dlg(this, mPortForwardingRules);
+    if (dlg.exec() == QDialog::Accepted)
+        mPortForwardingRules = dlg.rules();
+}
+
+void UIMachineSettingsNetwork::populateComboboxes()
+{
+    /* Save the current selected adapter */
+    int currentAdapter = mCbAdapterType->currentIndex();
+
+    /* Clear the adapters combo-box */
+    mCbAdapterType->clear();
+
+    /* Populate adapters */
+    mCbAdapterType->insertItem (0,
+        vboxGlobal().toString (KNetworkAdapterType_Am79C970A));
+    mCbAdapterType->setItemData (0,
+        KNetworkAdapterType_Am79C970A);
+    mCbAdapterType->setItemData (0,
+        mCbAdapterType->itemText (0), Qt::ToolTipRole);
+    mCbAdapterType->insertItem (1,
+        vboxGlobal().toString (KNetworkAdapterType_Am79C973));
+    mCbAdapterType->setItemData (1,
+        KNetworkAdapterType_Am79C973);
+    mCbAdapterType->setItemData (1,
+        mCbAdapterType->itemText (1), Qt::ToolTipRole);
+#ifdef VBOX_WITH_E1000
+    mCbAdapterType->insertItem (2,
+        vboxGlobal().toString (KNetworkAdapterType_I82540EM));
+    mCbAdapterType->setItemData (2,
+        KNetworkAdapterType_I82540EM);
+    mCbAdapterType->setItemData (2,
+        mCbAdapterType->itemText (2), Qt::ToolTipRole);
+    mCbAdapterType->insertItem (3,
+        vboxGlobal().toString (KNetworkAdapterType_I82543GC));
+    mCbAdapterType->setItemData (3,
+        KNetworkAdapterType_I82543GC);
+    mCbAdapterType->setItemData (3,
+        mCbAdapterType->itemText (3), Qt::ToolTipRole);
+    mCbAdapterType->insertItem (4,
+        vboxGlobal().toString (KNetworkAdapterType_I82545EM));
+    mCbAdapterType->setItemData (4,
+        KNetworkAdapterType_I82545EM);
+    mCbAdapterType->setItemData (4,
+        mCbAdapterType->itemText (4), Qt::ToolTipRole);
+#endif /* VBOX_WITH_E1000 */
+#ifdef VBOX_WITH_VIRTIO
+    mCbAdapterType->insertItem (5,
+        vboxGlobal().toString (KNetworkAdapterType_Virtio));
+    mCbAdapterType->setItemData (5,
+        KNetworkAdapterType_Virtio);
+    mCbAdapterType->setItemData (5,
+        mCbAdapterType->itemText (5), Qt::ToolTipRole);
+#endif /* VBOX_WITH_VIRTIO */
+
+    /* Set the old value */
+    mCbAdapterType->setCurrentIndex (currentAdapter == -1 ?
+                                     0 : currentAdapter);
+
+
+    /* Save the current selected attachment type */
+    int currentAttachment = mCbAttachmentType->currentIndex();
+
+    /* Clear the attachments combo-box */
+    mCbAttachmentType->clear();
+
+    /* Populate attachments */
+    mCbAttachmentType->insertItem (0,
+        vboxGlobal().toString (KNetworkAttachmentType_Null));
+    mCbAttachmentType->setItemData (0,
+        KNetworkAttachmentType_Null);
+    mCbAttachmentType->setItemData (0,
+        mCbAttachmentType->itemText (0), Qt::ToolTipRole);
+    mCbAttachmentType->insertItem (1,
+        vboxGlobal().toString (KNetworkAttachmentType_NAT));
+    mCbAttachmentType->setItemData (1,
+        KNetworkAttachmentType_NAT);
+    mCbAttachmentType->setItemData (1,
+        mCbAttachmentType->itemText (1), Qt::ToolTipRole);
+    mCbAttachmentType->insertItem (2,
+        vboxGlobal().toString (KNetworkAttachmentType_Bridged));
+    mCbAttachmentType->setItemData (2,
+        KNetworkAttachmentType_Bridged);
+    mCbAttachmentType->setItemData (2,
+        mCbAttachmentType->itemText (2), Qt::ToolTipRole);
+    mCbAttachmentType->insertItem (3,
+        vboxGlobal().toString (KNetworkAttachmentType_Internal));
+    mCbAttachmentType->setItemData (3,
+        KNetworkAttachmentType_Internal);
+    mCbAttachmentType->setItemData (3,
+        mCbAttachmentType->itemText (3), Qt::ToolTipRole);
+    mCbAttachmentType->insertItem (4,
+        vboxGlobal().toString (KNetworkAttachmentType_HostOnly));
+    mCbAttachmentType->setItemData (4,
+        KNetworkAttachmentType_HostOnly);
+    mCbAttachmentType->setItemData (4,
+        mCbAttachmentType->itemText (4), Qt::ToolTipRole);
+#ifdef VBOX_WITH_VDE
+    RTLDRMOD hLdrDummy;
+    if (RT_SUCCESS(RTLdrLoad(VBOX_LIB_VDE_PLUG_NAME, &hLdrDummy)))
+    {
+        mCbAttachmentType->insertItem (5,
+            vboxGlobal().toString (KNetworkAttachmentType_VDE));
+        mCbAttachmentType->setItemData (5,
+            KNetworkAttachmentType_VDE);
+        mCbAttachmentType->setItemData (5,
+            mCbAttachmentType->itemText (5), Qt::ToolTipRole);
+    }
+#endif
+
+    /* Set the old value */
+    mCbAttachmentType->setCurrentIndex (currentAttachment);
+}
+
+/* UIMachineSettingsNetworkPage Stuff */
+UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage(bool aDisableStaticControls)
+    : mValidator(0)
+    , mTwAdapters(0)
+    , mDisableStaticControls(false)
+{
+    /* Setup Main Layout */
+    QVBoxLayout *mainLayout = new QVBoxLayout (this);
+    mainLayout->setContentsMargins (0, 5, 0, 5);
+
+    /* Creating Tab Widget */
+    mTwAdapters = new QITabWidget (this);
+    mainLayout->addWidget (mTwAdapters);
+
+    /* If some controls should be disabled or not when the
+     * same tab widgets are shown during runtime
+     */
+    mDisableStaticControls = aDisableStaticControls;
+}
+
+void UIMachineSettingsNetworkPage::loadDirectlyFrom(const CMachine &machine)
+{
+    qRegisterMetaType<UISettingsDataMachine>();
+    UISettingsDataMachine data(machine);
+    QVariant wrapper = QVariant::fromValue(data);
+    loadToCacheFrom(wrapper);
+    getFromCache();
+}
+
+void UIMachineSettingsNetworkPage::saveDirectlyTo(CMachine &machine)
+{
+    qRegisterMetaType<UISettingsDataMachine>();
+    UISettingsDataMachine data(machine);
+    QVariant wrapper = QVariant::fromValue(data);
+    putToCache();
+    saveFromCacheTo(wrapper);
+}
+
+QStringList UIMachineSettingsNetworkPage::brgList (bool aRefresh)
+{
+    if (aRefresh)
+    {
+        /* Load & filter interface list */
+        mBrgList.clear();
+        CHostNetworkInterfaceVector interfaces =
+            vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
+        for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin();
+             it != interfaces.end(); ++ it)
+        {
+            if (it->GetInterfaceType() == KHostNetworkInterfaceType_Bridged)
+                mBrgList << it->GetName();
+        }
+    }
+
+    return mBrgList;
+}
+
+QStringList UIMachineSettingsNetworkPage::intList (bool aRefresh)
+{
+    if (aRefresh)
+    {
+        /* Load total network list of all VMs */
+        mIntList.clear();
+        CVirtualBox vbox = vboxGlobal().virtualBox();
+        ulong count = qMin ((ULONG) 4, vbox.GetSystemProperties().GetNetworkAdapterCount());
+        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 name = m->GetNetworkAdapter (slot).GetInternalNetwork();
+                    if (!name.isEmpty() && !mIntList.contains (name))
+                        mIntList << name;
+                }
+            }
+        }
+    }
+
+    return mIntList;
+}
+
+QStringList UIMachineSettingsNetworkPage::fullIntList (bool aRefresh)
+{
+    QStringList list (intList (aRefresh));
+    /* Append network list with names from all the pages */
+    for (int index = 0; index < mTwAdapters->count(); ++ index)
+    {
+        UIMachineSettingsNetwork *page =
+            qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (index));
+        if (page)
+        {
+            QString name = page->alternativeName (KNetworkAttachmentType_Internal);
+            if (!name.isEmpty() && !list.contains (name))
+                list << name;
+        }
+    }
+    return list;
+}
+
+QStringList UIMachineSettingsNetworkPage::hoiList (bool aRefresh)
+{
+    if (aRefresh)
+    {
+        /* Load & filter interface list */
+        mHoiList.clear();
+        CHostNetworkInterfaceVector interfaces =
+            vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces();
+        for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin();
+             it != interfaces.end(); ++ it)
+        {
+            if (it->GetInterfaceType() == KHostNetworkInterfaceType_HostOnly)
+                mHoiList << it->GetName();
+        }
+    }
+
+    return mHoiList;
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsNetworkPage::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Cache names lists: */
+    brgList(true);
+    intList(true);
+    hoiList(true);
+
+    /* Load adapters data: */
+    ulong uCount = qMin((ULONG)4, vboxGlobal().virtualBox().GetSystemProperties().GetNetworkAdapterCount());
+    for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
+    {
+        /* Get adapter: */
+        const CNetworkAdapter &adapter = m_machine.GetNetworkAdapter(uSlot);
+
+        /* Prepare adapter's data container: */
+        UINetworkAdapterData data;
+
+        /* Load main options: */
+        data.m_iSlot = uSlot;
+        data.m_adapter = adapter;
+        data.m_fAdapterEnabled = adapter.GetEnabled();
+        data.m_adapterType = adapter.GetAdapterType();
+        data.m_attachmentType = adapter.GetAttachmentType();
+        switch (data.m_attachmentType)
+        {
+            case KNetworkAttachmentType_Bridged:
+                data.m_strBridgedAdapterName = adapter.GetHostInterface();
+                if (data.m_strBridgedAdapterName.isEmpty()) data.m_strBridgedAdapterName = QString();
+                break;
+            case KNetworkAttachmentType_Internal:
+                data.m_strInternalNetworkName = adapter.GetInternalNetwork();
+                if (data.m_strInternalNetworkName.isEmpty()) data.m_strInternalNetworkName = QString();
+                break;
+            case KNetworkAttachmentType_HostOnly:
+                data.m_strHostInterfaceName = adapter.GetHostInterface();
+                if (data.m_strHostInterfaceName.isEmpty()) data.m_strHostInterfaceName = QString();
+                break;
+#ifdef VBOX_WITH_VDE
+            case KNetworkAttachmentType_VDE:
+                data.m_strVDENetworkName = adapter.GetVDENetwork();
+                if (data.m_strVDENetworkName.isEmpty()) data.m_strVDENetworkName = QString();
+                break;
+#endif
+            default:
+                break;
+        }
+
+        /* Load advanced options: */
+        data.m_strMACAddress = adapter.GetMACAddress();
+        data.m_fCableConnected = adapter.GetCableConnected();
+
+        /* Load redirect options: */
+        QVector<QString> redirects = adapter.GetNatDriver().GetRedirects();
+        for (int i = 0; i < redirects.size(); ++i)
+        {
+            QStringList redirectData = redirects[i].split(',');
+            AssertMsg(redirectData.size() == 6, ("Redirect rule should be composed of 6 parts!\n"));
+            data.m_redirects << UIPortForwardingData(redirectData[0],
+                                                     (KNATProtocol)redirectData[1].toUInt(),
+                                                     redirectData[2],
+                                                     redirectData[3].toUInt(),
+                                                     redirectData[4],
+                                                     redirectData[5].toUInt());
+        }
+
+        /* Append adapter's data container: */
+        m_cache.m_items << data;
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsNetworkPage::getFromCache()
+{
+    /* Setup tab order: */
+    Assert(m_pFirstWidget);
+    setTabOrder(m_pFirstWidget, mTwAdapters->focusProxy());
+    QWidget *pLastFocusWidget = mTwAdapters->focusProxy();
+
+    /* Apply internal variables data to QWidget(s): */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Creating adapter's page: */
+        UIMachineSettingsNetwork *pPage = new UIMachineSettingsNetwork(this, mDisableStaticControls);
+
+        /* Loading adapter's data into page: */
+        pPage->fetchAdapterData(m_cache.m_items[iSlot]);
+
+        /* Attach adapter's page to Tab Widget: */
+        mTwAdapters->addTab(pPage, pPage->pageTitle());
+
+        /* Disable tab page of disabled adapter if it is being configured dynamically: */
+        if (mDisableStaticControls && !m_cache.m_items[iSlot].m_fAdapterEnabled)
+            mTwAdapters->setTabEnabled(iSlot, false);
+
+        /* Setup page validation: */
+        pPage->setValidator(mValidator);
+
+        /* Setup tab order: */
+        pLastFocusWidget = pPage->setOrderAfter(pLastFocusWidget);
+    }
+
+    /* Applying language settings: */
+    retranslateUi();
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsNetworkPage::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Getting adapter's page: */
+        UIMachineSettingsNetwork *pPage = qobject_cast<UIMachineSettingsNetwork*>(mTwAdapters->widget(iSlot));
+
+        /* Loading Adapter's data from page: */
+        pPage->uploadAdapterData(m_cache.m_items[iSlot]);
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsNetworkPage::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Get adapter: */
+        CNetworkAdapter adapter = m_machine.GetNetworkAdapter(iSlot);
+
+        /* Get cached data for this adapter: */
+        const UINetworkAdapterData &data = m_cache.m_items[iSlot];
+
+        /* Save main options: */
+        adapter.SetEnabled(data.m_fAdapterEnabled);
+        adapter.SetAdapterType(data.m_adapterType);
+        switch (data.m_attachmentType)
+        {
+            case KNetworkAttachmentType_Null:
+                adapter.Detach();
+                break;
+            case KNetworkAttachmentType_NAT:
+                adapter.AttachToNAT();
+                break;
+            case KNetworkAttachmentType_Bridged:
+                adapter.SetHostInterface(data.m_strBridgedAdapterName);
+                adapter.AttachToBridgedInterface();
+                break;
+            case KNetworkAttachmentType_Internal:
+                adapter.SetInternalNetwork(data.m_strInternalNetworkName);
+                adapter.AttachToInternalNetwork();
+                break;
+            case KNetworkAttachmentType_HostOnly:
+                adapter.SetHostInterface(data.m_strHostInterfaceName);
+                adapter.AttachToHostOnlyInterface();
+                break;
+    #ifdef VBOX_WITH_VDE
+            case KNetworkAttachmentType_VDE:
+                adapter.SetVDENetwork(data.m_strVDENetworkName);
+                adapter.AttachToVDE();
+                break;
+    #endif
+            default:
+                break;
+        }
+
+        /* Save advanced options: */
+        adapter.SetMACAddress(data.m_strMACAddress);
+        adapter.SetCableConnected(data.m_fCableConnected);
+
+        /* Save redirect options: */
+        QVector<QString> oldRedirects = adapter.GetNatDriver().GetRedirects();
+        for (int i = 0; i < oldRedirects.size(); ++i)
+            adapter.GetNatDriver().RemoveRedirect(oldRedirects[i].section(',', 0, 0));
+        UIPortForwardingDataList newRedirects = data.m_redirects;
+        for (int i = 0; i < newRedirects.size(); ++i)
+        {
+            UIPortForwardingData newRedirect = newRedirects[i];
+            adapter.GetNatDriver().AddRedirect(newRedirect.name, newRedirect.protocol,
+                                               newRedirect.hostIp, newRedirect.hostPort.value(),
+                                               newRedirect.guestIp, newRedirect.guestPort.value());
+        }
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsNetworkPage::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+}
+
+bool UIMachineSettingsNetworkPage::revalidate (QString &aWarning, QString &aTitle)
+{
+    bool valid = true;
+
+    for (int i = 0; i < mTwAdapters->count(); ++ i)
+    {
+        UIMachineSettingsNetwork *page =
+            qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));
+        Assert (page);
+        valid = page->revalidate (aWarning, aTitle);
+        if (!valid) break;
+    }
+
+    return valid;
+}
+
+void UIMachineSettingsNetworkPage::retranslateUi()
+{
+    for (int i = 0; i < mTwAdapters->count(); ++ i)
+    {
+        UIMachineSettingsNetwork *page =
+            qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));
+        Assert (page);
+        mTwAdapters->setTabText (i, page->pageTitle());
+    }
+}
+
+void UIMachineSettingsNetworkPage::updatePages()
+{
+    for (int i = 0; i < mTwAdapters->count(); ++ i)
+    {
+        /* Get the iterated page */
+        UIMachineSettingsNetwork *page =
+            qobject_cast <UIMachineSettingsNetwork*> (mTwAdapters->widget (i));
+        Assert (page);
+
+        /* Update the page if the attachment type is 'internal network' */
+        if (page->attachmentType() == KNetworkAttachmentType_Internal)
+            QTimer::singleShot (0, page, SLOT (updateAttachmentAlternative()));
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h	(revision 33882)
@@ -0,0 +1,172 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsNetwork class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsNetwork_h__
+#define __UIMachineSettingsNetwork_h__
+
+/* VBox Includes */
+#include "COMDefs.h"
+#include "UISettingsPage.h"
+#include "UIMachineSettingsNetwork.gen.h"
+#include "UIMachineSettingsPortForwardingDlg.h"
+
+/* VBox Forwards */
+class UIMachineSettingsNetworkPage;
+class QITabWidget;
+
+/* Machine settings / Network page / Adapter data: */
+struct UINetworkAdapterData
+{
+    int m_iSlot;
+    /* CNetworkAdapter used only for Generate MAC ability! */
+    CNetworkAdapter m_adapter;
+    bool m_fAdapterEnabled;
+    KNetworkAdapterType m_adapterType;
+    KNetworkAttachmentType m_attachmentType;
+    QString m_strBridgedAdapterName;
+    QString m_strInternalNetworkName;
+    QString m_strHostInterfaceName;
+#ifdef VBOX_WITH_VDE
+    QString m_strVDENetworkName;
+#endif /* VBOX_WITH_VDE */
+    QString m_strMACAddress;
+    bool m_fCableConnected;
+    UIPortForwardingDataList m_redirects;
+};
+
+/* Machine settings / Network page / Cache: */
+struct UISettingsCacheMachineNetwork
+{
+    QList<UINetworkAdapterData> m_items;
+};
+
+class UIMachineSettingsNetwork : public QIWithRetranslateUI <QWidget>,
+                              public Ui::UIMachineSettingsNetwork
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsNetwork (UIMachineSettingsNetworkPage *aParent, bool aDisableStaticControls = false);
+
+    void fetchAdapterData(const UINetworkAdapterData &data);
+    void uploadAdapterData(UINetworkAdapterData &data);
+
+    void setValidator (QIWidgetValidator *aValidator);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    QWidget* setOrderAfter (QWidget *aAfter);
+
+    QString pageTitle() const;
+    KNetworkAttachmentType attachmentType() const;
+    QString alternativeName (int aType = -1) const;
+
+protected:
+
+    void showEvent (QShowEvent *aEvent);
+
+    void retranslateUi();
+
+private slots:
+
+    void updateAttachmentAlternative();
+    void updateAlternativeName();
+    void toggleAdvanced();
+    void generateMac();
+    void sltOpenPortForwardingDlg();
+
+private:
+
+    void populateComboboxes();
+
+    UIMachineSettingsNetworkPage *mParent;
+    QIWidgetValidator *mValidator;
+    int m_iSlot;
+    CNetworkAdapter m_adapter;
+
+    QString mBrgName;
+    QString mIntName;
+    QString mHoiName;
+#ifdef VBOX_WITH_VDE
+    QString mVDEName;
+#endif
+
+    bool mPolished;
+    bool mDisableStaticControls;
+    UIPortForwardingDataList mPortForwardingRules;
+};
+
+/* Machine settings / Network page: */
+class UIMachineSettingsNetworkPage : public UISettingsPageMachine
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsNetworkPage (bool aDisableStaticControls = false);
+
+    void loadDirectlyFrom(const CMachine &machine);
+    void saveDirectlyTo(CMachine &machine);
+
+    QStringList brgList (bool aRefresh = false);
+    QStringList intList (bool aRefresh = false);
+    QStringList fullIntList (bool aRefresh = false);
+    QStringList hoiList (bool aRefresh = false);
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aValidator);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void retranslateUi();
+
+private slots:
+
+    void updatePages();
+
+private:
+
+    QIWidgetValidator *mValidator;
+    QITabWidget *mTwAdapters;
+
+    QStringList mBrgList;
+    QStringList mIntList;
+    QStringList mHoiList;
+
+    bool mDisableStaticControls;
+
+    /* Cache: */
+    UISettingsCacheMachineNetwork m_cache;
+};
+
+#endif // __UIMachineSettingsNetwork_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.ui	(revision 33882)
@@ -0,0 +1,286 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsNetwork</class>
+ <widget class="QWidget" name="UIMachineSettingsNetwork" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>431</width>
+    <height>248</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" name="VBoxVMSettingsNetworkGridLayout">
+   <item row="0" column="0" colspan="2">
+    <widget class="QCheckBox" name="mCbEnableAdapter" >
+     <property name="whatsThis" >
+      <string>When checked, plugs this virtual network adapter into the virtual machine.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Enable Network Adapter</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <spacer name="horizontalSpacer1">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QWidget" name="mNetworkChild" native="1">
+     <layout class="QGridLayout" name="mNetworkChildGridLayout">
+      <property name="margin">
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="mLbAttachmentType">
+        <property name="text" >
+         <string>&amp;Attached to:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbAttachmentType</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QComboBox" name="mCbAttachmentType">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis" >
+         <string>Controls how this virtual adapter is attached to the real network of the Host OS.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QLabel" name="mLbAdapterName">
+        <property name="text" >
+         <string>&amp;Name:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbAdapterName</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" colspan="3">
+       <widget class="QComboBox" name="mCbAdapterName">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+          <horstretch>1</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis" >
+         <string>Selects the name of the network adapter for &lt;b&gt;Bridged Adapter&lt;/b&gt; or &lt;b&gt;Host-only Adapter&lt;/b&gt; attachments and the name of the network &lt;b&gt;Internal Network&lt;/b&gt; attachments.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <layout class="QHBoxLayout" name="mLtAdvancedBtn">
+        <property name="margin">
+         <number>0</number>
+        </property>
+        <item>
+         <spacer name="horizontalSpacer2">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>0</width>
+            <height>0</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QIArrowButtonSwitch" native="1" name="mAbsAdvanced">
+          <property name="text">
+           <string>A&amp;dvanced</string>
+          </property>
+          <property name="whatsThis" >
+           <string>Shows or hides additional network adapter options.</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="3" column="0">
+       <widget class="QLabel" name="mLbAdapterType">
+        <property name="text">
+         <string>Adapter &amp;Type:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy">
+         <cstring>mCbAdapterType</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="1" colspan="3">
+       <widget class="QComboBox" name="mCbAdapterType">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+          <horstretch>1</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis">
+         <string>Selects the type of the virtual network adapter. Depending on this value, VirtualBox will provide different network hardware to the virtual machine.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="0">
+       <widget class="QLabel" name="mLbMAC">
+        <property name="text">
+         <string>&amp;Mac Address:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy">
+         <cstring>mLeMAC</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="1" colspan="2">
+       <widget class="QILineEdit" name="mLeMAC">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+          <horstretch>1</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis">
+         <string>Displays the MAC address of this adapter. It contains exactly 12 characters chosen from {0-9,A-F}. Note that the second character must be an even digit.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="3">
+       <widget class="QIToolButton" name="mTbMAC">
+        <property name="whatsThis">
+         <string>Generates a new random MAC address.</string>
+        </property>
+        <property name="icon">
+         <iconset resource="../VirtualBox1.qrc">
+          <normaloff>:/refresh_16px.png</normaloff>:/refresh_16px.png</iconset>
+        </property>
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="5" column="1" colspan="3">
+       <widget class="QCheckBox" name="mCbCableConnected">
+        <property name="whatsThis">
+         <string>Indicates whether the virtual network cable is plugged in on machine startup or not.</string>
+        </property>
+        <property name="text">
+         <string>&amp;Cable connected</string>
+        </property>
+       </widget>
+      </item>
+      <item row="6" column="1">
+       <widget class="QPushButton" name="mPbPortForwarding">
+        <property name="whatsThis">
+         <string>Opens dialog to manage port forwarding rules.</string>
+        </property>
+        <property name="text">
+         <string>&amp;Port Forwarding</string>
+        </property>
+       </widget>
+      </item>
+      <item row="7" column="0" colspan="4">
+       <spacer name="verticalSpacer">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>QILineEdit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIArrowButtonSwitch</class>
+   <extends>QWidget</extends>
+   <header>QIArrowButtonSwitch.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>QIToolButton</class>
+   <extends>QToolButton</extends>
+   <header>QIToolButton.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="../VirtualBox1.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>mCbEnableAdapter</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mNetworkChild</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>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp	(revision 33882)
@@ -0,0 +1,333 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsParallel class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIMachineSettingsParallel.h"
+#include "QIWidgetValidator.h"
+#include "VBoxGlobal.h"
+#include "QITabWidget.h"
+
+#include <QDir>
+
+/* UIMachineSettingsParallel stuff */
+UIMachineSettingsParallel::UIMachineSettingsParallel()
+    : QIWithRetranslateUI<QWidget> (0)
+    , mValidator(0)
+    , m_iSlot(-1)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsParallel::setupUi (this);
+
+    /* Setup validation */
+    mLeIRQ->setValidator (new QIULongValidator (0, 255, this));
+    mLeIOPort->setValidator (new QIULongValidator (0, 0xFFFF, this));
+    mLePath->setValidator (new QRegExpValidator (QRegExp (".+"), this));
+
+    /* Setup constraints */
+    mLeIRQ->setFixedWidth (mLeIRQ->fontMetrics().width ("8888"));
+    mLeIOPort->setFixedWidth (mLeIOPort->fontMetrics().width ("8888888"));
+
+    /* Set initial values */
+    /* Note: If you change one of the following don't forget retranslateUi. */
+    mCbNumber->insertItem (0, vboxGlobal().toCOMPortName (0, 0));
+    mCbNumber->insertItems (0, vboxGlobal().COMPortNames());
+
+    /* Setup connections */
+    connect (mGbParallel, SIGNAL (toggled (bool)),
+             this, SLOT (mGbParallelToggled (bool)));
+    connect (mCbNumber, SIGNAL (activated (const QString &)),
+             this, SLOT (mCbNumberActivated (const QString &)));
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+void UIMachineSettingsParallel::fetchPortData(const UIParallelPortData &data)
+{
+    /* Load port slot number: */
+    m_iSlot = data.m_iSlot;
+
+    /* Fetch port data: */
+    mGbParallel->setChecked(data.m_fPortEnabled);
+    mCbNumber->setCurrentIndex(mCbNumber->findText(vboxGlobal().toCOMPortName(data.m_uIRQ, data.m_uIOBase)));
+    mLeIRQ->setText(QString::number(data.m_uIRQ));
+    mLeIOPort->setText("0x" + QString::number(data.m_uIOBase, 16).toUpper());
+    mLePath->setText(data.m_strPath);
+
+    /* Ensure everything is up-to-date */
+    mGbParallelToggled(mGbParallel->isChecked());
+}
+
+void UIMachineSettingsParallel::uploadPortData(UIParallelPortData &data)
+{
+    /* Upload port data: */
+    data.m_fPortEnabled = mGbParallel->isChecked();
+    data.m_uIRQ = mLeIRQ->text().toULong(NULL, 0);
+    data.m_uIOBase = mLeIOPort->text().toULong(NULL, 0);
+    data.m_strPath = QDir::toNativeSeparators(mLePath->text());
+}
+
+void UIMachineSettingsParallel::setValidator (QIWidgetValidator *aVal)
+{
+    Assert (aVal);
+    mValidator = aVal;
+    connect (mLeIRQ, SIGNAL (textChanged (const QString &)),
+             mValidator, SLOT (revalidate()));
+    connect (mLeIOPort, SIGNAL (textChanged (const QString &)),
+             mValidator, SLOT (revalidate()));
+    connect (mLePath, SIGNAL (textChanged (const QString &)),
+             mValidator, SLOT (revalidate()));
+    mValidator->revalidate();
+}
+
+QWidget* UIMachineSettingsParallel::setOrderAfter (QWidget *aAfter)
+{
+    setTabOrder (aAfter, mGbParallel);
+    setTabOrder (mGbParallel, mCbNumber);
+    setTabOrder (mCbNumber, mLeIRQ);
+    setTabOrder (mLeIRQ, mLeIOPort);
+    setTabOrder (mLeIOPort, mLePath);
+    return mLePath;
+}
+
+QString UIMachineSettingsParallel::pageTitle() const
+{
+    return QString(tr("Port %1", "parallel ports")).arg(QString("&%1").arg(m_iSlot + 1));
+}
+
+bool UIMachineSettingsParallel::isUserDefined()
+{
+    ulong a, b;
+    return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b);
+}
+
+void UIMachineSettingsParallel::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsParallel::retranslateUi (this);
+
+    mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0));
+}
+
+void UIMachineSettingsParallel::mGbParallelToggled (bool aOn)
+{
+    if (aOn)
+        mCbNumberActivated (mCbNumber->currentText());
+    if (mValidator)
+        mValidator->revalidate();
+}
+
+void UIMachineSettingsParallel::mCbNumberActivated (const QString &aText)
+{
+    ulong IRQ, IOBase;
+    bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase);
+
+    mLeIRQ->setEnabled (!std);
+    mLeIOPort->setEnabled (!std);
+    if (std)
+    {
+        mLeIRQ->setText (QString::number (IRQ));
+        mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper());
+    }
+}
+
+
+/* UIMachineSettingsParallelPage stuff */
+UIMachineSettingsParallelPage::UIMachineSettingsParallelPage()
+    : mValidator(0)
+    , mTabWidget(0)
+{
+    /* TabWidget creation */
+    mTabWidget = new QITabWidget (this);
+    QVBoxLayout *layout = new QVBoxLayout (this);
+    layout->setContentsMargins (0, 5, 0, 5);
+    layout->addWidget (mTabWidget);
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsParallelPage::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Load port data: */
+    ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetParallelPortCount();
+    for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
+    {
+        /* Get port: */
+        const CParallelPort &port = m_machine.GetParallelPort(uSlot);
+
+        /* Prepare port's data container: */
+        UIParallelPortData data;
+
+        /* Load options: */
+        data.m_iSlot = uSlot;
+        data.m_fPortEnabled = port.GetEnabled();
+        data.m_uIRQ = port.GetIRQ();
+        data.m_uIOBase = port.GetIOBase();
+        data.m_strPath = port.GetPath();
+
+        /* Append adapter's data container: */
+        m_cache.m_items << data;
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsParallelPage::getFromCache()
+{
+    Assert(m_pFirstWidget);
+    setTabOrder(m_pFirstWidget, mTabWidget->focusProxy());
+    QWidget *pLastFocusWidget = mTabWidget->focusProxy();
+
+    /* Apply internal variables data to QWidget(s): */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Creating port's page: */
+        UIMachineSettingsParallel *pPage = new UIMachineSettingsParallel;
+
+        /* Loading port's data into page: */
+        pPage->fetchPortData(m_cache.m_items[iSlot]);
+
+        /* Attach port's page to Tab Widget: */
+        mTabWidget->addTab(pPage, pPage->pageTitle());
+
+        /* Setup page validation: */
+        pPage->setValidator(mValidator);
+
+        /* Setup tab order: */
+        pLastFocusWidget = pPage->setOrderAfter(pLastFocusWidget);
+    }
+
+    /* Applying language settings: */
+    retranslateUi();
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsParallelPage::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Getting adapter's page: */
+        UIMachineSettingsParallel *pPage = qobject_cast<UIMachineSettingsParallel*>(mTabWidget->widget(iSlot));
+
+        /* Loading Adapter's data from page: */
+        pPage->uploadPortData(m_cache.m_items[iSlot]);
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsParallelPage::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Get adapter: */
+        CParallelPort port = m_machine.GetParallelPort(iSlot);
+
+        /* Get cached data for this slot: */
+        const UIParallelPortData &data = m_cache.m_items[iSlot];
+
+        /* Save options: */
+        port.SetIRQ(data.m_uIRQ);
+        port.SetIOBase(data.m_uIOBase);
+        port.SetPath(data.m_strPath);
+        port.SetEnabled(data.m_fPortEnabled);
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsParallelPage::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+}
+
+bool UIMachineSettingsParallelPage::revalidate (QString &aWarning, QString &aTitle)
+{
+    bool valid = true;
+    QStringList ports;
+    QStringList paths;
+
+    int index = 0;
+    for (; index < mTabWidget->count(); ++ index)
+    {
+        QWidget *tab = mTabWidget->widget (index);
+        UIMachineSettingsParallel *page =
+            static_cast<UIMachineSettingsParallel*> (tab);
+
+        /* Check the predefined port number unicity */
+        if (page->mGbParallel->isChecked() && !page->isUserDefined())
+        {
+            QString port = page->mCbNumber->currentText();
+            valid = !ports.contains (port);
+            if (!valid)
+            {
+                aWarning = tr ("Duplicate port number selected ");
+                aTitle += ": " +
+                    vboxGlobal().removeAccelMark (mTabWidget->tabText (mTabWidget->indexOf (tab)));
+                break;
+            }
+            ports << port;
+        }
+
+        /* Check the port path emptiness & unicity */
+        if (page->mGbParallel->isChecked())
+        {
+            QString path = page->mLePath->text();
+            valid = !path.isEmpty() && !paths.contains (path);
+            if (!valid)
+            {
+                aWarning = path.isEmpty() ?
+                    tr ("Port path not specified ") :
+                    tr ("Duplicate port path entered ");
+                aTitle += ": " +
+                    vboxGlobal().removeAccelMark (mTabWidget->tabText (mTabWidget->indexOf (tab)));
+                break;
+            }
+            paths << path;
+        }
+    }
+
+    return valid;
+}
+
+void UIMachineSettingsParallelPage::retranslateUi()
+{
+    for (int i = 0; i < mTabWidget->count(); ++ i)
+    {
+        UIMachineSettingsParallel *page =
+            static_cast<UIMachineSettingsParallel*> (mTabWidget->widget (i));
+        mTabWidget->setTabText (i, page->pageTitle());
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.h	(revision 33882)
@@ -0,0 +1,117 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsParallel class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsParallel_h__
+#define __UIMachineSettingsParallel_h__
+
+#include "UISettingsPage.h"
+#include "UIMachineSettingsParallel.gen.h"
+#include "COMDefs.h"
+
+class QITabWidget;
+
+struct UIParallelPortData
+{
+    int m_iSlot;
+    bool m_fPortEnabled;
+    ulong m_uIRQ;
+    ulong m_uIOBase;
+    QString m_strPath;
+};
+
+/* Machine settings / Parallel page / Cache: */
+struct UISettingsCacheMachineParallel
+{
+    QList<UIParallelPortData> m_items;
+};
+
+class UIMachineSettingsParallel : public QIWithRetranslateUI<QWidget>,
+                               public Ui::UIMachineSettingsParallel
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsParallel();
+
+    void fetchPortData(const UIParallelPortData &data);
+    void uploadPortData(UIParallelPortData &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+
+    QWidget* setOrderAfter (QWidget *aAfter);
+
+    QString pageTitle() const;
+    bool isUserDefined();
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void mGbParallelToggled (bool aOn);
+    void mCbNumberActivated (const QString &aText);
+
+private:
+
+    QIWidgetValidator *mValidator;
+    int m_iSlot;
+};
+
+/* Machine settings / Parallel page: */
+class UIMachineSettingsParallelPage : public UISettingsPageMachine
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsParallelPage();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void retranslateUi();
+
+private:
+
+    QIWidgetValidator *mValidator;
+    QITabWidget *mTabWidget;
+
+    /* Internals: */
+    UISettingsCacheMachineParallel m_cache;
+};
+
+#endif // __UIMachineSettingsParallel_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.ui	(revision 33882)
@@ -0,0 +1,206 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsParallel</class>
+ <widget class="QWidget" name="UIMachineSettingsParallel" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>348</width>
+    <height>122</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" colspan="2" >
+    <widget class="QCheckBox" name="mGbParallel" >
+     <property name="whatsThis" >
+      <string>When checked, enables the given parallel port of the virtual machine.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Enable Parallel Port</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QWidget" native="1" name="mParallelChild" >
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="mLbNumber" >
+        <property name="text" >
+         <string>Port &amp;Number:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbNumber</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" >
+       <widget class="QComboBox" name="mCbNumber" >
+        <property name="whatsThis" >
+         <string>Displays the parallel port number. You can choose one of the standard parallel ports or select &lt;b>User-defined&lt;/b> and specify port parameters manually.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2" >
+       <widget class="QLabel" name="mLbIRQ" >
+        <property name="text" >
+         <string>&amp;IRQ:</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mLeIRQ</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="3" >
+       <widget class="QLineEdit" name="mLeIRQ" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis" >
+         <string>Displays the IRQ number of this parallel port. This should be a whole number between &lt;tt>0&lt;/tt> and &lt;tt>255&lt;/tt>. Values greater than &lt;tt>15&lt;/tt> may only be used if the &lt;b>IO APIC&lt;/b> setting is enabled for this virtual machine.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="4" >
+       <widget class="QLabel" name="mLbIOPort" >
+        <property name="text" >
+         <string>I/O Po&amp;rt:</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mLeIOPort</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="5" >
+       <widget class="QLineEdit" name="mLeIOPort" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis" >
+         <string>Displays the base I/O port address of this parallel port. Valid values are integer numbers in range from &lt;tt>0&lt;/tt> to &lt;tt>0xFFFF&lt;/tt>.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QLabel" name="mLbPath" >
+        <property name="text" >
+         <string>Port &amp;Path:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mLePath</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" colspan="5" >
+       <widget class="QLineEdit" name="mLePath" >
+        <property name="whatsThis" >
+         <string>Displays the host parallel device name.</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>16</width>
+       <height>21</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mGbParallel</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mParallelChild</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>76</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>285</x>
+     <y>120</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp	(revision 33882)
@@ -0,0 +1,713 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsPortForwardingDlg class implementation
+ */
+
+/*
+ * Copyright (C) 2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Global includes */
+#include <QAction>
+#include <QHeaderView>
+#include <QPushButton>
+#include <QStyledItemDelegate>
+#include <QItemEditorFactory>
+#include <QComboBox>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QTimer>
+
+/* Local includes */
+#include "UIMachineSettingsPortForwardingDlg.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "UIToolBar.h"
+#include "QITableView.h"
+#include "QIDialogButtonBox.h"
+#include "UIIconPool.h"
+#include <iprt/cidr.h>
+#include <math.h>
+
+/* IP validator: */
+class IPValidator : public QValidator
+{
+    Q_OBJECT;
+
+public:
+
+    IPValidator(QObject *pParent) : QValidator(pParent) {}
+    ~IPValidator() {}
+
+    QValidator::State validate(QString &strInput, int & /* iPos */) const
+    {
+        QString strStringToValidate(strInput);
+        strStringToValidate.remove(' ');
+        QString strDot("\\.");
+        QString strDigits("(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)");
+        QRegExp intRegExp(QString("^(%1?(%2(%1?(%2(%1?(%2%1?)?)?)?)?)?)?$").arg(strDigits).arg(strDot));
+        uint uNetwork, uMask;
+        if (strStringToValidate == "..." || RTCidrStrToIPv4(strStringToValidate.toLatin1().constData(), &uNetwork, &uMask) == VINF_SUCCESS)
+            return QValidator::Acceptable;
+        else if (intRegExp.indexIn(strStringToValidate) != -1)
+            return QValidator::Intermediate;
+        else
+            return QValidator::Invalid;
+    }
+};
+
+/* Name editor: */
+class NameEditor : public QLineEdit
+{
+    Q_OBJECT;
+    Q_PROPERTY(NameData name READ name WRITE setName USER true);
+
+public:
+
+    NameEditor(QWidget *pParent = 0) : QLineEdit(pParent)
+    {
+        setFrame(false);
+        setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+        setValidator(new QRegExpValidator(QRegExp("[^,]*"), this));
+    }
+
+private:
+
+    void setName(NameData name)
+    {
+        setText(name);
+    }
+
+    NameData name() const
+    {
+        return text();
+    }
+};
+
+/* Protocol editor: */
+class ProtocolEditor : public QComboBox
+{
+    Q_OBJECT;
+    Q_PROPERTY(KNATProtocol protocol READ protocol WRITE setProtocol USER true);
+
+public:
+
+    ProtocolEditor(QWidget *pParent = 0) : QComboBox(pParent)
+    {
+        addItem(vboxGlobal().toString(KNATProtocol_UDP), QVariant::fromValue(KNATProtocol_UDP));
+        addItem(vboxGlobal().toString(KNATProtocol_TCP), QVariant::fromValue(KNATProtocol_TCP));
+    }
+
+private:
+
+    void setProtocol(KNATProtocol p)
+    {
+        for (int i = 0; i < count(); ++i)
+        {
+            if (itemData(i).value<KNATProtocol>() == p)
+            {
+                setCurrentIndex(i);
+                break;
+            }
+        }
+    }
+
+    KNATProtocol protocol() const
+    {
+        return itemData(currentIndex()).value<KNATProtocol>();
+    }
+};
+
+/* IP editor: */
+class IPEditor : public QLineEdit
+{
+    Q_OBJECT;
+    Q_PROPERTY(IpData ip READ ip WRITE setIp USER true);
+
+public:
+
+    IPEditor(QWidget *pParent = 0) : QLineEdit(pParent)
+    {
+        setFrame(false);
+        setAlignment(Qt::AlignCenter);
+        setValidator(new IPValidator(this));
+        setInputMask("000.000.000.000");
+    }
+
+private:
+
+    void setIp(IpData ip)
+    {
+        setText(ip);
+    }
+
+    IpData ip() const
+    {
+        return text() == "..." ? QString() : text();
+    }
+};
+
+/* Port editor: */
+class PortEditor : public QSpinBox
+{
+    Q_OBJECT;
+    Q_PROPERTY(PortData port READ port WRITE setPort USER true);
+
+public:
+
+    PortEditor(QWidget *pParent = 0) : QSpinBox(pParent)
+    {
+        setFrame(false);
+        setRange(0, (1 << (8 * sizeof(ushort))) - 1);
+    }
+
+private:
+
+    void setPort(PortData port)
+    {
+        setValue(port.value());
+    }
+
+    PortData port() const
+    {
+        return value();
+    }
+};
+
+/* Port forwarding data model: */
+class UIPortForwardingModel : public QAbstractTableModel
+{
+    Q_OBJECT;
+
+public:
+
+    /* Column names: */
+    enum UIPortForwardingDataType
+    {
+        UIPortForwardingDataType_Name,
+        UIPortForwardingDataType_Protocol,
+        UIPortForwardingDataType_HostIp,
+        UIPortForwardingDataType_HostPort,
+        UIPortForwardingDataType_GuestIp,
+        UIPortForwardingDataType_GuestPort,
+        UIPortForwardingDataType_Max
+    };
+
+    /* Port forwarding model constructor: */
+    UIPortForwardingModel(QObject *pParent = 0, const UIPortForwardingDataList &rules = UIPortForwardingDataList())
+        : QAbstractTableModel(pParent), m_dataList(rules) {}
+    /* Port forwarding model destructor: */
+    ~UIPortForwardingModel() {}
+
+    /* The list of chosen rules: */
+    const UIPortForwardingDataList& rules() const
+    {
+        return m_dataList;
+    }
+
+    /* Flags for model indexes: */
+    Qt::ItemFlags flags(const QModelIndex &index) const
+    {
+        /* Check index validness: */
+        if (!index.isValid())
+            return Qt::NoItemFlags;
+        /* All columns have similar flags: */
+        return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
+    }
+
+    /* Row count getter: */
+    int rowCount(const QModelIndex & parent = QModelIndex()) const
+    {
+        Q_UNUSED(parent);
+        return m_dataList.size();
+    }
+
+    /* Column count getter: */
+    int columnCount(const QModelIndex & parent = QModelIndex()) const
+    {
+        Q_UNUSED(parent);
+        return UIPortForwardingDataType_Max;
+    }
+
+    /* Get header data: */
+    QVariant headerData(int iSection, Qt::Orientation orientation, int iRole) const
+    {
+        /* Display role for horizontal header: */
+        if (iRole == Qt::DisplayRole && orientation == Qt::Horizontal)
+        {
+            /* Switch for different columns: */
+            switch (iSection)
+            {
+                case UIPortForwardingDataType_Name: return tr("Name");
+                case UIPortForwardingDataType_Protocol: return tr("Protocol");
+                case UIPortForwardingDataType_HostIp: return tr("Host IP");
+                case UIPortForwardingDataType_HostPort: return tr("Host Port");
+                case UIPortForwardingDataType_GuestIp: return tr("Guest IP");
+                case UIPortForwardingDataType_GuestPort: return tr("Guest Port");
+                default: break;
+            }
+        }
+        /* Return wrong value: */
+        return QVariant();
+    }
+
+    /* Get index data: */
+    QVariant data(const QModelIndex &index, int iRole) const
+    {
+        /* Check index validness: */
+        if (!index.isValid())
+            return QVariant();
+        /* Switch for different roles: */
+        switch (iRole)
+        {
+            /* Display role: */
+            case Qt::DisplayRole:
+            {
+                /* Switch for different columns: */
+                switch (index.column())
+                {
+                    case UIPortForwardingDataType_Name: return m_dataList[index.row()].name;
+                    case UIPortForwardingDataType_Protocol: return vboxGlobal().toString(m_dataList[index.row()].protocol);
+                    case UIPortForwardingDataType_HostIp: return m_dataList[index.row()].hostIp;
+                    case UIPortForwardingDataType_HostPort: return m_dataList[index.row()].hostPort.value();
+                    case UIPortForwardingDataType_GuestIp: return m_dataList[index.row()].guestIp;
+                    case UIPortForwardingDataType_GuestPort: return m_dataList[index.row()].guestPort.value();
+                    default: return QVariant();
+                }
+            }
+            /* Edit role: */
+            case Qt::EditRole:
+            {
+                /* Switch for different columns: */
+                switch (index.column())
+                {
+                    case UIPortForwardingDataType_Name: return QVariant::fromValue(m_dataList[index.row()].name);
+                    case UIPortForwardingDataType_Protocol: return QVariant::fromValue(m_dataList[index.row()].protocol);
+                    case UIPortForwardingDataType_HostIp: return QVariant::fromValue(m_dataList[index.row()].hostIp);
+                    case UIPortForwardingDataType_HostPort: return QVariant::fromValue(m_dataList[index.row()].hostPort);
+                    case UIPortForwardingDataType_GuestIp: return QVariant::fromValue(m_dataList[index.row()].guestIp);
+                    case UIPortForwardingDataType_GuestPort: return QVariant::fromValue(m_dataList[index.row()].guestPort);
+                    default: return QVariant();
+                }
+            }
+            /* Alignment role: */
+            case Qt::TextAlignmentRole:
+            {
+                /* Switch for different columns: */
+                switch (index.column())
+                {
+                    case UIPortForwardingDataType_Name:
+                    case UIPortForwardingDataType_Protocol:
+                    case UIPortForwardingDataType_HostPort:
+                    case UIPortForwardingDataType_GuestPort:
+                        return (int)(Qt::AlignLeft | Qt::AlignVCenter);
+                    case UIPortForwardingDataType_HostIp:
+                    case UIPortForwardingDataType_GuestIp:
+                        return Qt::AlignCenter;
+                    default: return QVariant();
+                }
+            }
+            case Qt::SizeHintRole:
+            {
+                /* Switch for different columns: */
+                switch (index.column())
+                {
+                    case UIPortForwardingDataType_HostIp:
+                    case UIPortForwardingDataType_GuestIp:
+                        return QSize(QApplication::fontMetrics().width(" 888.888.888.888 "), QApplication::fontMetrics().height());
+                    default: return QVariant();
+                }
+            }
+            default: break;
+        }
+        /* Return wrong value: */
+        return QVariant();
+    }
+
+    /* Set index data: */
+    bool setData(const QModelIndex &index, const QVariant &value, int iRole = Qt::EditRole)
+    {
+        /* Check index validness: */
+        if (!index.isValid() || iRole != Qt::EditRole)
+            return false;
+        /* Switch for different columns: */
+        switch (index.column())
+        {
+            case UIPortForwardingDataType_Name:
+                m_dataList[index.row()].name = value.value<NameData>();
+                emit dataChanged(index, index);
+                return true;
+            case UIPortForwardingDataType_Protocol:
+                m_dataList[index.row()].protocol = value.value<KNATProtocol>();
+                emit dataChanged(index, index);
+                return true;
+            case UIPortForwardingDataType_HostIp:
+                m_dataList[index.row()].hostIp = value.value<IpData>();
+                emit dataChanged(index, index);
+                return true;
+            case UIPortForwardingDataType_HostPort:
+                m_dataList[index.row()].hostPort = value.value<PortData>();
+                emit dataChanged(index, index);
+                return true;
+            case UIPortForwardingDataType_GuestIp:
+                m_dataList[index.row()].guestIp = value.value<IpData>();
+                emit dataChanged(index, index);
+                return true;
+            case UIPortForwardingDataType_GuestPort:
+                m_dataList[index.row()].guestPort = value.value<PortData>();
+                emit dataChanged(index, index);
+                return true;
+            default: return false;
+        }
+        /* Return false value: */
+        return false;
+    }
+
+    /* Add/Copy rule: */
+    void addRule(const QModelIndex &index)
+    {
+        beginInsertRows(QModelIndex(), m_dataList.size(), m_dataList.size());
+        /* Search for existing "Rule [NUMBER]" record: */
+        uint uMaxIndex = 0;
+        QString strTemplate("Rule %1");
+        QRegExp regExp(strTemplate.arg("(\\d+)"));
+        for (int i = 0; i < m_dataList.size(); ++i)
+            if (regExp.indexIn(m_dataList[i].name) > -1)
+                uMaxIndex = regExp.cap(1).toUInt() > uMaxIndex ? regExp.cap(1).toUInt() : uMaxIndex;
+        /* If index is valid => copy data: */
+        if (index.isValid())
+            m_dataList << UIPortForwardingData(strTemplate.arg(++uMaxIndex), m_dataList[index.row()].protocol,
+                                               m_dataList[index.row()].hostIp, m_dataList[index.row()].hostPort,
+                                               m_dataList[index.row()].guestIp, m_dataList[index.row()].guestPort);
+        /* If index is NOT valid => use default values: */
+        else
+            m_dataList << UIPortForwardingData(strTemplate.arg(++uMaxIndex), KNATProtocol_TCP,
+                                               QString(""), 0, QString(""), 0);
+        endInsertRows();
+    }
+
+    /* Delete rule: */
+    void delRule(const QModelIndex &index)
+    {
+        if (!index.isValid())
+            return;
+        beginRemoveRows(QModelIndex(), index.row(), index.row());
+        m_dataList.removeAt(index.row());
+        endRemoveRows();
+    }
+
+private:
+
+    /* Data container: */
+    UIPortForwardingDataList m_dataList;
+};
+
+/* Port forwarding dialog constructor: */
+UIMachineSettingsPortForwardingDlg::UIMachineSettingsPortForwardingDlg(QWidget *pParent,
+                                                                 const UIPortForwardingDataList &rules)
+    : QIWithRetranslateUI<QIDialog>(pParent)
+    , fIsTableDataChanged(false)
+    , m_pTableView(0)
+    , m_pToolBar(0)
+    , m_pButtonBox(0)
+    , m_pModel(0)
+    , m_pAddAction(0)
+    , m_pCopyAction(0)
+    , m_pDelAction(0)
+{
+#ifdef Q_WS_MAC
+    setWindowFlags(Qt::Sheet);
+#endif /* Q_WS_MAC */
+
+    /* Set dialog icon: */
+    setWindowIcon(UIIconPool::iconSetFull(QSize(32, 32), QSize(16, 16), ":/nw_32px.png", ":/nw_16px.png"));
+
+    /* Create table: */
+    m_pTableView = new QITableView(this);
+    m_pTableView->setTabKeyNavigation(false);
+    m_pTableView->verticalHeader()->hide();
+    m_pTableView->verticalHeader()->setDefaultSectionSize((int)m_pTableView->verticalHeader()->minimumSectionSize() * 1.33);
+    m_pTableView->setSelectionMode(QAbstractItemView::SingleSelection);
+    m_pTableView->setContextMenuPolicy(Qt::CustomContextMenu);
+    m_pTableView->installEventFilter(this);
+    connect(m_pTableView, SIGNAL(sigCurrentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(sltCurrentChanged()));
+    connect(m_pTableView, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(sltShowTableContexMenu(const QPoint &)));
+
+    /* Create actions: */
+    m_pAddAction = new QAction(this);
+    m_pCopyAction = new QAction(this);
+    m_pDelAction = new QAction(this);
+    m_pAddAction->setShortcut(QKeySequence("Ins"));
+    m_pDelAction->setShortcut(QKeySequence("Del"));
+    m_pAddAction->setIcon(UIIconPool::iconSet(":/controller_add_16px.png", ":/controller_add_disabled_16px.png"));
+    m_pCopyAction->setIcon(UIIconPool::iconSet(":/controller_add_16px.png", ":/controller_add_disabled_16px.png"));
+    m_pDelAction->setIcon(UIIconPool::iconSet(":/controller_remove_16px.png", ":/controller_remove_disabled_16px.png"));
+    connect(m_pAddAction, SIGNAL(triggered(bool)), this, SLOT(sltAddRule()));
+    connect(m_pCopyAction, SIGNAL(triggered(bool)), this, SLOT(sltCopyRule()));
+    connect(m_pDelAction, SIGNAL(triggered(bool)), this, SLOT(sltDelRule()));
+
+    /* Create toolbar: */
+    m_pToolBar = new UIToolBar(this);
+    m_pToolBar->setIconSize(QSize(16, 16));
+    m_pToolBar->setOrientation(Qt::Vertical);
+    m_pToolBar->addAction(m_pAddAction);
+    m_pToolBar->addAction(m_pDelAction);
+
+    /* Create table & toolbar layout: */
+    QHBoxLayout *pTableAndToolbarLayout = new QHBoxLayout;
+    pTableAndToolbarLayout->setSpacing(1);
+    pTableAndToolbarLayout->addWidget(m_pTableView);
+    pTableAndToolbarLayout->addWidget(m_pToolBar);
+
+    /* Create buttonbox: */
+    m_pButtonBox = new QIDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
+    connect(m_pButtonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
+    connect(m_pButtonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
+
+    /* Create main layout: */
+    QVBoxLayout *pMainLayout = new QVBoxLayout;
+    this->setLayout(pMainLayout);
+    pMainLayout->addLayout(pTableAndToolbarLayout);
+    pMainLayout->addWidget(m_pButtonBox);
+
+    /* Create model: */
+    m_pModel = new UIPortForwardingModel(this, rules);
+    connect(m_pModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(sltTableDataChanged()));
+    connect(m_pModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(sltTableDataChanged()));
+    connect(m_pModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(sltTableDataChanged()));
+    m_pTableView->setModel(m_pModel);
+
+    /* Register delegates editors: */
+    if (QAbstractItemDelegate *pAbstractItemDelegate = m_pTableView->itemDelegate())
+    {
+        if (QStyledItemDelegate *pStyledItemDelegate = qobject_cast<QStyledItemDelegate*>(pAbstractItemDelegate))
+        {
+            /* Create new item editor factory: */
+            QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;
+
+            /* Register name type: */
+            int iNameId = qRegisterMetaType<NameData>();
+            /* Register name editor: */
+            QStandardItemEditorCreator<NameEditor> *pNameEditorItemCreator = new QStandardItemEditorCreator<NameEditor>();
+            /* Link name type & editor: */
+            pNewItemEditorFactory->registerEditor((QVariant::Type)iNameId, pNameEditorItemCreator);
+
+            /* Register protocol type: */
+            int iProtocolId = qRegisterMetaType<KNATProtocol>();
+            /* Register protocol editor: */
+            QStandardItemEditorCreator<ProtocolEditor> *pProtocolEditorItemCreator = new QStandardItemEditorCreator<ProtocolEditor>();
+            /* Link protocol type & editor: */
+            pNewItemEditorFactory->registerEditor((QVariant::Type)iProtocolId, pProtocolEditorItemCreator);
+
+            /* Register ip type: */
+            int iIpId = qRegisterMetaType<IpData>();
+            /* Register ip editor: */
+            QStandardItemEditorCreator<IPEditor> *pIpEditorItemCreator = new QStandardItemEditorCreator<IPEditor>();
+            /* Link ip type & editor: */
+            pNewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIpEditorItemCreator);
+
+            /* Register port type: */
+            int iPortId = qRegisterMetaType<PortData>();
+            /* Register port editor: */
+            QStandardItemEditorCreator<PortEditor> *pPortEditorItemCreator = new QStandardItemEditorCreator<PortEditor>();
+            /* Link port type & editor: */
+            pNewItemEditorFactory->registerEditor((QVariant::Type)iPortId, pPortEditorItemCreator);
+
+            /* Set newly created item editor factory for table delegate: */
+            pStyledItemDelegate->setItemEditorFactory(pNewItemEditorFactory);
+        }
+    }
+
+    /* Retranslate dialog: */
+    retranslateUi();
+
+    /* Minimum Size: */
+    setMinimumSize(600, 300);
+}
+
+/* Port forwarding dialog destructor: */
+UIMachineSettingsPortForwardingDlg::~UIMachineSettingsPortForwardingDlg()
+{
+}
+
+const UIPortForwardingDataList& UIMachineSettingsPortForwardingDlg::rules() const
+{
+    return m_pModel->rules();
+}
+
+/* Add rule slot: */
+void UIMachineSettingsPortForwardingDlg::sltAddRule()
+{
+    m_pModel->addRule(QModelIndex());
+    m_pTableView->setFocus();
+    m_pTableView->setCurrentIndex(m_pModel->index(m_pModel->rowCount() - 1, 0));
+    sltCurrentChanged();
+    sltAdjustTable();
+}
+
+/* Copy rule slot: */
+void UIMachineSettingsPortForwardingDlg::sltCopyRule()
+{
+    m_pModel->addRule(m_pTableView->currentIndex());
+    m_pTableView->setFocus();
+    m_pTableView->setCurrentIndex(m_pModel->index(m_pModel->rowCount() - 1, 0));
+    sltCurrentChanged();
+    sltAdjustTable();
+}
+
+/* Del rule slot: */
+void UIMachineSettingsPortForwardingDlg::sltDelRule()
+{
+    m_pModel->delRule(m_pTableView->currentIndex());
+    m_pTableView->setFocus();
+    sltCurrentChanged();
+    sltAdjustTable();
+}
+
+/* Table data change handler: */
+void UIMachineSettingsPortForwardingDlg::sltTableDataChanged()
+{
+    fIsTableDataChanged = true;
+}
+
+/* Table index-change handler: */
+void UIMachineSettingsPortForwardingDlg::sltCurrentChanged()
+{
+    bool fTableFocused = m_pTableView->hasFocus();
+    bool fTableChildrenFocused = m_pTableView->findChildren<QWidget*>().contains(QApplication::focusWidget());
+    bool fTableOrChildrenFocused = fTableFocused || fTableChildrenFocused;
+    m_pCopyAction->setEnabled(m_pTableView->currentIndex().isValid() && fTableOrChildrenFocused);
+    m_pDelAction->setEnabled(m_pTableView->currentIndex().isValid() && fTableOrChildrenFocused);
+}
+
+/* Table context-menu handler: */
+void UIMachineSettingsPortForwardingDlg::sltShowTableContexMenu(const QPoint &pos)
+{
+    /* Prepare context menu: */
+    QMenu menu(m_pTableView);
+    /* If some index is currently selected: */
+    if (m_pTableView->indexAt(pos).isValid())
+    {
+        menu.addAction(m_pCopyAction);
+        menu.addAction(m_pDelAction);
+    }
+    /* If no valid index selected: */
+    else
+    {
+        menu.addAction(m_pAddAction);
+    }
+    menu.exec(m_pTableView->viewport()->mapToGlobal(pos));
+}
+
+/* Adjusts table column's sizes: */
+void UIMachineSettingsPortForwardingDlg::sltAdjustTable()
+{
+    m_pTableView->horizontalHeader()->setStretchLastSection(false);
+    /* If table is NOT empty: */
+    if (m_pModel->rowCount())
+    {
+        /* Resize table to contents size-hint and emit a spare place for first column: */
+        m_pTableView->resizeColumnsToContents();
+        uint uFullWidth = m_pTableView->viewport()->width();
+        for (uint u = 1; u < UIPortForwardingModel::UIPortForwardingDataType_Max; ++u)
+            uFullWidth -= m_pTableView->horizontalHeader()->sectionSize(u);
+        m_pTableView->horizontalHeader()->resizeSection(UIPortForwardingModel::UIPortForwardingDataType_Name, uFullWidth);
+    }
+    /* If table is empty: */
+    else
+    {
+        /* Resize table columns to be equal in size: */
+        uint uFullWidth = m_pTableView->viewport()->width();
+        for (uint u = 0; u < UIPortForwardingModel::UIPortForwardingDataType_Max; ++u)
+            m_pTableView->horizontalHeader()->resizeSection(u, uFullWidth / UIPortForwardingModel::UIPortForwardingDataType_Max);
+    }
+    m_pTableView->horizontalHeader()->setStretchLastSection(true);
+}
+
+void UIMachineSettingsPortForwardingDlg::accept()
+{
+    /* Validate table: */
+    for (int i = 0; i < m_pModel->rowCount(); ++i)
+    {
+        if (m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostPort), Qt::EditRole).value<PortData>().value() == 0 ||
+            m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_GuestPort), Qt::EditRole).value<PortData>().value() == 0)
+        {
+            vboxProblem().warnAboutIncorrectPort(this);
+            return;
+        }
+    }
+    /* Base class accept() slot: */
+    QIWithRetranslateUI<QIDialog>::accept();
+}
+
+void UIMachineSettingsPortForwardingDlg::reject()
+{
+    /* Check if table data was changed: */
+    if (fIsTableDataChanged && !vboxProblem().confirmCancelingPortForwardingDialog(this))
+        return;
+    /* Base class reject() slot: */
+    QIWithRetranslateUI<QIDialog>::reject();
+}
+
+/* UI Retranslation slot: */
+void UIMachineSettingsPortForwardingDlg::retranslateUi()
+{
+    /* Set window title: */
+    setWindowTitle(tr("Port Forwarding Rules"));
+
+    /* Table translations: */
+    m_pTableView->setWhatsThis(tr("This table contains a list of port forwarding rules."));
+
+    /* Set action's text: */
+    m_pAddAction->setText(tr("Insert new rule"));
+    m_pCopyAction->setText(tr("Copy selected rule"));
+    m_pDelAction->setText(tr("Delete selected rule"));
+    m_pAddAction->setWhatsThis(tr("This button adds new port forwarding rule."));
+    m_pDelAction->setWhatsThis(tr("This button deletes selected port forwarding rule."));
+    m_pAddAction->setToolTip(QString("%1 (%2)").arg(m_pAddAction->text()).arg(m_pAddAction->shortcut().toString()));
+    m_pDelAction->setToolTip(QString("%1 (%2)").arg(m_pDelAction->text()).arg(m_pDelAction->shortcut().toString()));
+}
+
+/* Extended event-handler: */
+bool UIMachineSettingsPortForwardingDlg::eventFilter(QObject *pObj, QEvent *pEvent)
+{
+    /* Process table: */
+    if (pObj == m_pTableView)
+    {
+        /* Switch for different event-types: */
+        switch (pEvent->type())
+        {
+            case QEvent::FocusIn:
+            case QEvent::FocusOut:
+                /* Update actions: */
+                sltCurrentChanged();
+                break;
+            case QEvent::Show:
+            case QEvent::Resize:
+            {
+                /* Instant table adjusting: */
+                sltAdjustTable();
+                /* Delayed table adjusting: */
+                QTimer::singleShot(0, this, SLOT(sltAdjustTable()));
+                break;
+            }
+            default:
+                break;
+        }
+    }
+    /* Continue with base-class processing: */
+    return QIWithRetranslateUI<QIDialog>::eventFilter(pObj, pEvent);
+}
+
+#include "UIMachineSettingsPortForwardingDlg.moc"
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.h	(revision 33882)
@@ -0,0 +1,148 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsPortForwardingDlg class declaration
+ */
+
+/*
+ * Copyright (C) 2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsPortForwardingDlg_h__
+#define __UIMachineSettingsPortForwardingDlg_h__
+
+/* Local includes */
+#include "QIWithRetranslateUI.h"
+#include "QIDialog.h"
+#include "COMDefs.h"
+
+/* Forward declarations: */
+class QITableView;
+class UIToolBar;
+class QIDialogButtonBox;
+class UIPortForwardingModel;
+
+/* Name data: */
+class NameData : public QString
+{
+public:
+
+    NameData() : QString() {}
+    NameData(const QString &ruleName) : QString(ruleName) {}
+};
+Q_DECLARE_METATYPE(NameData);
+
+/* Ip data: */
+class IpData : public QString
+{
+public:
+
+    IpData() : QString() {}
+    IpData(const QString &ipAddress) : QString(ipAddress) {}
+};
+Q_DECLARE_METATYPE(IpData);
+
+/* Port data: */
+class PortData
+{
+public:
+
+    PortData() : m_uValue(0) {}
+    PortData(ushort uValue) : m_uValue(uValue) {}
+    PortData(const PortData &other) : m_uValue(other.value()) {}
+    ushort value() const { return m_uValue; }
+
+private:
+
+    ushort m_uValue;
+};
+Q_DECLARE_METATYPE(PortData);
+
+/* Port forwarding data: */
+struct UIPortForwardingData
+{
+    UIPortForwardingData(const NameData &strName, KNATProtocol eProtocol,
+                         const IpData &strHostIp, PortData uHostPort,
+                         const IpData &strGuestIp, PortData uGuestPort)
+        : name(strName), protocol(eProtocol)
+        , hostIp(strHostIp), hostPort(uHostPort)
+        , guestIp(strGuestIp), guestPort(uGuestPort) {}
+    NameData name;
+    KNATProtocol protocol;
+    IpData hostIp;
+    PortData hostPort;
+    IpData guestIp;
+    PortData guestPort;
+};
+
+/* Port forwarding data list: */
+typedef QList<UIPortForwardingData> UIPortForwardingDataList;
+
+/* Port forwarding dialog: */
+class UIMachineSettingsPortForwardingDlg : public QIWithRetranslateUI<QIDialog>
+{
+    Q_OBJECT;
+
+public:
+
+    /* Port forwarding dialog constructor: */
+    UIMachineSettingsPortForwardingDlg(QWidget *pParent = 0,
+                                    const UIPortForwardingDataList &rules = UIPortForwardingDataList());
+    /* Port forwarding dialog destructor: */
+    ~UIMachineSettingsPortForwardingDlg();
+
+    /* The list of chosen rules: */
+    const UIPortForwardingDataList& rules() const;
+
+private slots:
+
+    /* Action's slots: */
+    void sltAddRule();
+    void sltCopyRule();
+    void sltDelRule();
+
+    /* Table slots: */
+    void sltTableDataChanged();
+    void sltCurrentChanged();
+    void sltShowTableContexMenu(const QPoint &position);
+    void sltAdjustTable();
+
+    /* Dialog slots: */
+    void accept();
+    void reject();
+
+private:
+
+    /* UI Translator: */
+    void retranslateUi();
+
+    /* Event filter: */
+    bool eventFilter(QObject *pObj, QEvent *pEvent);
+
+    /* Flags: */
+    bool fIsTableDataChanged;
+
+    /* Widgets: */
+    QITableView *m_pTableView;
+    UIToolBar *m_pToolBar;
+    QIDialogButtonBox *m_pButtonBox;
+
+    /* Model: */
+    UIPortForwardingModel *m_pModel;
+
+    /* Actions: */
+    QAction *m_pAddAction;
+    QAction *m_pCopyAction;
+    QAction *m_pDelAction;
+};
+
+#endif // __UIMachineSettingsPortForwardingDlg_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp	(revision 33882)
@@ -0,0 +1,712 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSF class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Local includes */
+#include "UIIconPool.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "VBoxUtils.h"
+#include "UIMachineSettingsSF.h"
+#include "UIMachineSettingsSFDetails.h"
+
+/* Global includes */
+#include <QHeaderView>
+#include <QTimer>
+
+class SFTreeViewItem : public QTreeWidgetItem
+{
+public:
+
+    enum { SFTreeViewItemType = QTreeWidgetItem::UserType + 1 };
+
+    enum FormatType
+    {
+        IncorrectFormat = 0,
+        EllipsisStart   = 1,
+        EllipsisMiddle  = 2,
+        EllipsisEnd     = 3,
+        EllipsisFile    = 4
+    };
+
+    /* Root Item */
+    SFTreeViewItem (QTreeWidget *aParent, const QStringList &aFields, FormatType aFormat)
+        : QTreeWidgetItem (aParent, aFields, SFTreeViewItemType), mFormat (aFormat)
+    {
+        setFirstColumnSpanned (true);
+        setFlags (flags() ^ Qt::ItemIsSelectable);
+    }
+
+    /* Child Item */
+    SFTreeViewItem (SFTreeViewItem *aParent, const QStringList &aFields, FormatType aFormat)
+        : QTreeWidgetItem (aParent, aFields, SFTreeViewItemType), mFormat (aFormat)
+    {
+        updateText (aFields);
+    }
+
+    bool operator< (const QTreeWidgetItem &aOther) const
+    {
+        /* Root items should always been sorted by id-field. */
+        return parent() ? text (0).toLower() < aOther.text (0).toLower() :
+                          text (1).toLower() < aOther.text (1).toLower();
+    }
+
+    SFTreeViewItem* child (int aIndex) const
+    {
+        QTreeWidgetItem *item = QTreeWidgetItem::child (aIndex);
+        return item && item->type() == SFTreeViewItemType ? static_cast <SFTreeViewItem*> (item) : 0;
+    }
+
+    QString getText (int aIndex) const
+    {
+        return aIndex >= 0 && aIndex < (int)mTextList.size() ? mTextList [aIndex] : QString::null;
+    }
+
+    void updateText (const QStringList &aFields)
+    {
+        mTextList.clear();
+        mTextList << aFields;
+        adjustText();
+    }
+
+    void adjustText()
+    {
+        for (int i = 0; i < treeWidget()->columnCount(); ++ i)
+            processColumn (i);
+    }
+
+private:
+
+    void processColumn (int aColumn)
+    {
+        QString oneString = getText (aColumn);
+        if (oneString.isNull())
+            return;
+        QFontMetrics fm = treeWidget()->fontMetrics();
+        int oldSize = fm.width (oneString);
+        int indentSize = fm.width (" ... ");
+        int itemIndent = parent() ? treeWidget()->indentation() * 2 : treeWidget()->indentation();
+        if (aColumn == 0)
+            indentSize += itemIndent;
+        int cWidth = treeWidget()->columnWidth (aColumn);
+
+        /* Compress text */
+        int start = 0;
+        int finish = 0;
+        int position = 0;
+        int textWidth = 0;
+        do
+        {
+            textWidth = fm.width (oneString);
+            if (textWidth + indentSize > cWidth)
+            {
+                start  = 0;
+                finish = oneString.length();
+
+                /* Selecting remove position */
+                switch (mFormat)
+                {
+                    case EllipsisStart:
+                        position = start;
+                        break;
+                    case EllipsisMiddle:
+                        position = (finish - start) / 2;
+                        break;
+                    case EllipsisEnd:
+                        position = finish - 1;
+                        break;
+                    case EllipsisFile:
+                    {
+                        QRegExp regExp ("([\\\\/][^\\\\^/]+[\\\\/]?$)");
+                        int newFinish = regExp.indexIn (oneString);
+                        if (newFinish != -1)
+                            finish = newFinish;
+                        position = (finish - start) / 2;
+                        break;
+                    }
+                    default:
+                        AssertMsgFailed (("Invalid format type\n"));
+                }
+
+                if (position == finish)
+                   break;
+
+                oneString.remove (position, 1);
+            }
+        }
+        while (textWidth + indentSize > cWidth);
+
+        if (position || mFormat == EllipsisFile) oneString.insert (position, "...");
+        int newSize = fm.width (oneString);
+        setText (aColumn, newSize < oldSize ? oneString : mTextList [aColumn]);
+        setToolTip (aColumn, text (aColumn) == getText (aColumn) ? QString::null : getText (aColumn));
+
+        /* Calculate item's size-hint */
+        setSizeHint (aColumn, QSize (fm.width (QString ("  %1  ").arg (getText (aColumn))), 100));
+    }
+
+    FormatType  mFormat;
+    QStringList mTextList;
+};
+
+UIMachineSettingsSF::UIMachineSettingsSF()
+    : m_type(WrongType)
+    , mNewAction(0), mEdtAction(0), mDelAction(0)
+    , mIsListViewChanged(false)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsSF::setupUi (this);
+
+    /* Prepare actions */
+    mNewAction = new QAction (this);
+    mEdtAction = new QAction (this);
+    mDelAction = new QAction (this);
+
+    mNewAction->setShortcut (QKeySequence ("Ins"));
+    mEdtAction->setShortcut (QKeySequence ("Ctrl+Space"));
+    mDelAction->setShortcut (QKeySequence ("Del"));
+
+    mNewAction->setIcon(UIIconPool::iconSet(":/add_shared_folder_16px.png",
+                                            ":/add_shared_folder_disabled_16px.png"));
+    mEdtAction->setIcon(UIIconPool::iconSet(":/edit_shared_folder_16px.png",
+                                            ":/edit_shared_folder_disabled_16px.png"));
+    mDelAction->setIcon(UIIconPool::iconSet(":/remove_shared_folder_16px.png",
+                                            ":/remove_shared_folder_disabled_16px.png"));
+
+    /* Prepare toolbar */
+    mTbFolders->setUsesTextLabel (false);
+    mTbFolders->setIconSize (QSize (16, 16));
+    mTbFolders->setOrientation (Qt::Vertical);
+    mTbFolders->addAction (mNewAction);
+    mTbFolders->addAction (mEdtAction);
+    mTbFolders->addAction (mDelAction);
+
+    /* Setup connections */
+    mTwFolders->header()->setMovable (false);
+    connect (mNewAction, SIGNAL (triggered (bool)), this, SLOT (addTriggered()));
+    connect (mEdtAction, SIGNAL (triggered (bool)), this, SLOT (edtTriggered()));
+    connect (mDelAction, SIGNAL (triggered (bool)), this, SLOT (delTriggered()));
+    connect (mTwFolders, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
+             this, SLOT (processCurrentChanged (QTreeWidgetItem *)));
+    connect (mTwFolders, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)),
+             this, SLOT (processDoubleClick (QTreeWidgetItem *)));
+    connect (mTwFolders, SIGNAL (customContextMenuRequested (const QPoint &)),
+             this, SLOT (showContextMenu (const QPoint &)));
+
+    retranslateUi();
+}
+
+void UIMachineSettingsSF::loadDirectlyFrom(const CConsole &console)
+{
+    loadToCacheFromMachine(console.GetMachine());
+    loadToCacheFromConsole(console);
+    getFromCache();
+}
+
+void UIMachineSettingsSF::saveDirectlyTo(CConsole &console)
+{
+    putToCache();
+    saveFromCacheToConsole(console);
+    CMachine machine = console.GetMachine();
+    saveFromCacheToMachine(machine);
+}
+
+void UIMachineSettingsSF::resizeEvent (QResizeEvent *aEvent)
+{
+    NOREF(aEvent);
+    adjustList();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsSF::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    loadToCacheFromMachine(m_machine);
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsSF::loadToCacheFromMachine(const CMachine &machine)
+{
+    /* Update dialog type: */
+    if (m_type == WrongType)
+        m_type = MachineType;
+    /* Load machine items into internal cache: */
+    loadToCacheFromVector(machine.GetSharedFolders(), MachineType);
+}
+
+void UIMachineSettingsSF::loadToCacheFromConsole(const CConsole &console)
+{
+    /* Update dialog type: */
+    if (m_type == WrongType || m_type == MachineType)
+        m_type = ConsoleType;
+    /* Load console items into internal cache: */
+    loadToCacheFromVector(console.GetSharedFolders(), ConsoleType);
+}
+
+void UIMachineSettingsSF::loadToCacheFromVector(const CSharedFolderVector &vector, UISharedFolderType type)
+{
+    /* Cache shared folders in internal variables: */
+    for (int iFolderIndex = 0; iFolderIndex < vector.size(); ++iFolderIndex)
+    {
+        const CSharedFolder &folder = vector[iFolderIndex];
+        UISharedFolderData data;
+        data.m_type = type;
+        data.m_strName = folder.GetName();
+        data.m_strHostPath = folder.GetHostPath();
+        data.m_fAutoMount = folder.GetAutoMount();
+        data.m_fWritable = folder.GetWritable();
+        m_cache.m_items << data;
+    }
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsSF::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    if (m_type == MachineType || m_type == ConsoleType)
+        root(MachineType);
+    if (m_type == ConsoleType)
+        root(ConsoleType);
+    for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size(); ++iFolderIndex)
+    {
+        /* Get iterated folder's data: */
+        const UISharedFolderData &data = m_cache.m_items[iFolderIndex];
+        /* Prepare list item's fields: */
+        QStringList fields;
+        fields << data.m_strName << data.m_strHostPath
+               << (data.m_fAutoMount ? mTrYes : "")
+               << (data.m_fWritable ? mTrFull : mTrReadOnly);
+        /* Searching for item's root: */
+        SFTreeViewItem *pItemsRoot = root(data.m_type);
+        /* Create new folder list item: */
+        new SFTreeViewItem(pItemsRoot, fields, SFTreeViewItem::EllipsisFile);
+    }
+    /* Sort populated item's list: */
+    mTwFolders->sortItems(0, Qt::AscendingOrder);
+    /* Ensure current item fetched: */
+    mTwFolders->setCurrentItem(mTwFolders->topLevelItem(0));
+    processCurrentChanged(mTwFolders->currentItem());
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsSF::putToCache()
+{
+    /* Reset cache: */
+    m_cache.m_items.clear();
+    /* Gather internal variables data from QWidget(s): */
+    QTreeWidgetItem *pMainRootItem = mTwFolders->invisibleRootItem();
+    /* Iterate other all the list top-level items: */
+    for (int iFodlersTypeIndex = 0; iFodlersTypeIndex < pMainRootItem->childCount(); ++iFodlersTypeIndex)
+    {
+        SFTreeViewItem *pFolderTypeRoot = static_cast<SFTreeViewItem*>(pMainRootItem->child(iFodlersTypeIndex));
+        UISharedFolderType type = (UISharedFolderType)pFolderTypeRoot->text(1).toInt();
+        AssertMsg(type != WrongType, ("Incorrent folders type!"));
+        /* Iterate other all the folder items: */
+        for (int iFoldersIndex = 0; iFoldersIndex < pFolderTypeRoot->childCount(); ++iFoldersIndex)
+        {
+            SFTreeViewItem *pFolderItem = static_cast<SFTreeViewItem*>(pFolderTypeRoot->child(iFoldersIndex));
+            UISharedFolderData data;
+            data.m_type = type;
+            data.m_strName = pFolderItem->getText(0);
+            data.m_strHostPath = pFolderItem->getText(1);
+            data.m_fAutoMount = pFolderItem->getText(2) == mTrYes ? true : false;
+            data.m_fWritable = pFolderItem->getText(3) == mTrFull ? true : false;
+            m_cache.m_items << data;
+        }
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsSF::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    saveFromCacheToMachine(m_machine);
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsSF::saveFromCacheToMachine(CMachine &machine)
+{
+    /* Save machine items from internal cache: */
+    /* Check if items were changed: */
+    if (!mIsListViewChanged)
+        return;
+
+    /* Delete all machine folders first: */
+    const CSharedFolderVector &folders = machine.GetSharedFolders();
+    for (int iFolderIndex = 0; iFolderIndex < folders.size(); ++iFolderIndex)
+    {
+        const CSharedFolder &folder = folders[iFolderIndex];
+        QString strFolderName = folder.GetName();
+        QString strFolderPath = folder.GetHostPath();
+        machine.RemoveSharedFolder(strFolderName);
+        if (!machine.isOk())
+        {
+            // TODO: Fix problem reporter!
+            //vboxProblem().cannotRemoveSharedFolder(this, machine, strFolderName, strFolderPath);
+        }
+    }
+
+    /* Save all new machine folders: */
+    for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size(); ++iFolderIndex)
+    {
+        const UISharedFolderData &data = m_cache.m_items[iFolderIndex];
+        if (data.m_type == MachineType)
+        {
+            machine.CreateSharedFolder(data.m_strName, data.m_strHostPath, data.m_fWritable, data.m_fAutoMount);
+            if (!machine.isOk())
+            {
+                // TODO: Fix problem reporter!
+                //vboxProblem().cannotCreateSharedFolder(this, machine, data.m_strName, data.m_strHostPath);
+            }
+        }
+    }
+}
+
+void UIMachineSettingsSF::saveFromCacheToConsole(CConsole &console)
+{
+    /* Save console items from internal cache: */
+    /* Check if items were changed: */
+    if (!mIsListViewChanged)
+        return;
+
+    /* Delete all console folders first: */
+    const CSharedFolderVector &folders = console.GetSharedFolders();
+    for (int iFolderIndex = 0; iFolderIndex < folders.size(); ++iFolderIndex)
+    {
+        const CSharedFolder &folder = folders[iFolderIndex];
+        QString strFolderName = folder.GetName();
+        QString strFolderPath = folder.GetHostPath();
+        console.RemoveSharedFolder(strFolderName);
+        if (!console.isOk())
+        {
+            // TODO: Fix problem reporter!
+            //vboxProblem().cannotRemoveSharedFolder(this, console, strFolderName, strFolderPath);
+        }
+    }
+
+    /* Save all new console folders: */
+    for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size(); ++iFolderIndex)
+    {
+        const UISharedFolderData &data = m_cache.m_items[iFolderIndex];
+        if (data.m_type == ConsoleType)
+        {
+            console.CreateSharedFolder(data.m_strName, data.m_strHostPath, data.m_fWritable, data.m_fAutoMount);
+            if (!console.isOk())
+            {
+                // TODO: Fix problem reporter!
+                //vboxProblem().cannotCreateSharedFolder(this, console, data.m_strName, data.m_strHostPath);
+            }
+        }
+    }
+}
+
+void UIMachineSettingsSF::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mTwFolders);
+}
+
+void UIMachineSettingsSF::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsSF::retranslateUi (this);
+
+    mNewAction->setText (tr ("&Add Shared Folder"));
+    mEdtAction->setText (tr ("&Edit Shared Folder"));
+    mDelAction->setText (tr ("&Remove Shared Folder"));
+
+    mNewAction->setToolTip (mNewAction->text().remove ('&') +
+        QString (" (%1)").arg (mNewAction->shortcut().toString()));
+    mEdtAction->setToolTip (mEdtAction->text().remove ('&') +
+        QString (" (%1)").arg (mEdtAction->shortcut().toString()));
+    mDelAction->setToolTip (mDelAction->text().remove ('&') +
+        QString (" (%1)").arg (mDelAction->shortcut().toString()));
+
+    mNewAction->setWhatsThis (tr ("Adds a new shared folder definition."));
+    mEdtAction->setWhatsThis (tr ("Edits the selected shared folder definition."));
+    mDelAction->setWhatsThis (tr ("Removes the selected shared folder definition."));
+
+    mTrFull = tr ("Full");
+    mTrReadOnly = tr ("Read-only");
+    mTrYes = tr ("Yes"); /** @todo Need to figure out if this string is necessary at all! */
+}
+
+void UIMachineSettingsSF::addTriggered()
+{
+    /* Invoke Add-Box Dialog */
+    UIMachineSettingsSFDetails dlg (UIMachineSettingsSFDetails::AddType, m_type == ConsoleType, usedList (true), this);
+    if (dlg.exec() == QDialog::Accepted)
+    {
+        QString name = dlg.name();
+        QString path = dlg.path();
+        bool isPermanent = dlg.isPermanent();
+        /* Shared folder's name & path could not be empty */
+        Assert (!name.isEmpty() && !path.isEmpty());
+        /* Searching root for the new listview item */
+        SFTreeViewItem *pRoot = root(isPermanent ? MachineType : ConsoleType);
+        Assert (pRoot);
+        /* Appending a new listview item to the root */
+        QStringList fields;
+        fields << name /* name */ << path /* path */
+               << (dlg.isAutoMounted() ? mTrYes : "" /* auto mount? */)
+               << (dlg.isWriteable() ? mTrFull : mTrReadOnly /* writable? */);
+        SFTreeViewItem *item = new SFTreeViewItem (pRoot, fields, SFTreeViewItem::EllipsisFile);
+        mTwFolders->sortItems (0, Qt::AscendingOrder);
+        mTwFolders->scrollToItem (item);
+        mTwFolders->setCurrentItem (item);
+        processCurrentChanged (item);
+        mTwFolders->setFocus();
+        adjustList();
+
+        mIsListViewChanged = true;
+    }
+}
+
+void UIMachineSettingsSF::edtTriggered()
+{
+    /* Check selected item */
+    QTreeWidgetItem *selectedItem = mTwFolders->selectedItems().size() == 1 ? mTwFolders->selectedItems() [0] : 0;
+    SFTreeViewItem *item = selectedItem && selectedItem->type() == SFTreeViewItem::SFTreeViewItemType ?
+                           static_cast <SFTreeViewItem*> (selectedItem) : 0;
+    Assert (item);
+    Assert (item->parent());
+
+    /* Invoke Edit-Box Dialog */
+    UIMachineSettingsSFDetails dlg (UIMachineSettingsSFDetails::EditType, m_type == ConsoleType, usedList (false), this);
+    dlg.setPath (item->getText (1));
+    dlg.setName (item->getText (0));
+    dlg.setPermanent ((UISharedFolderType)item->parent()->text (1).toInt() != ConsoleType);
+    dlg.setAutoMount (item->getText (2) == mTrYes);
+    dlg.setWriteable (item->getText (3) == mTrFull);
+    if (dlg.exec() == QDialog::Accepted)
+    {
+        QString name = dlg.name();
+        QString path = dlg.path();
+        bool isPermanent = dlg.isPermanent();
+        /* Shared folder's name & path could not be empty */
+        Assert (!name.isEmpty() && !path.isEmpty());
+        /* Searching new root for the selected listview item */
+        SFTreeViewItem *pRoot = root(isPermanent ? MachineType : ConsoleType);
+        Assert (pRoot);
+        /* Updating an edited listview item */
+        QStringList fields;
+        fields << name /* name */ << path /* path */
+               << (dlg.isAutoMounted() ? mTrYes : "" /* auto mount? */)
+               << (dlg.isWriteable() ? mTrFull : mTrReadOnly /* writable? */);
+        item->updateText (fields);
+        mTwFolders->sortItems (0, Qt::AscendingOrder);
+        if (item->parent() != pRoot)
+        {
+            /* Move the selected item into new location */
+            item->parent()->takeChild (item->parent()->indexOfChild (item));
+            pRoot->insertChild (pRoot->childCount(), item);
+            mTwFolders->scrollToItem (item);
+            mTwFolders->setCurrentItem (item);
+            processCurrentChanged (item);
+            mTwFolders->setFocus();
+        }
+        adjustList();
+
+        mIsListViewChanged = true;
+    }
+}
+
+void UIMachineSettingsSF::delTriggered()
+{
+    QTreeWidgetItem *selectedItem = mTwFolders->selectedItems().size() == 1 ? mTwFolders->selectedItems() [0] : 0;
+    Assert (selectedItem);
+    delete selectedItem;
+    adjustList();
+    mIsListViewChanged = true;
+}
+
+void UIMachineSettingsSF::processCurrentChanged (QTreeWidgetItem *aCurrentItem)
+{
+    if (aCurrentItem && aCurrentItem->parent() && !aCurrentItem->isSelected())
+        aCurrentItem->setSelected (true);
+    QString key = !aCurrentItem ? QString::null : aCurrentItem->parent() ?
+                  aCurrentItem->parent()->text (1) : aCurrentItem->text (1);
+    bool addEnabled = aCurrentItem;
+    bool removeEnabled = addEnabled && aCurrentItem->parent();
+    mNewAction->setEnabled (addEnabled);
+    mEdtAction->setEnabled (removeEnabled);
+    mDelAction->setEnabled (removeEnabled);
+}
+
+void UIMachineSettingsSF::processDoubleClick (QTreeWidgetItem *aItem)
+{
+    bool editEnabled = aItem && aItem->parent();
+    if (editEnabled)
+        edtTriggered();
+}
+
+void UIMachineSettingsSF::showContextMenu (const QPoint &aPos)
+{
+    QMenu menu;
+    QTreeWidgetItem *item = mTwFolders->itemAt (aPos);
+    if (item && item->flags() & Qt::ItemIsSelectable)
+    {
+        menu.addAction (mEdtAction);
+        menu.addAction (mDelAction);
+    }
+    else
+    {
+        menu.addAction (mNewAction);
+    }
+    menu.exec (mTwFolders->viewport()->mapToGlobal (aPos));
+}
+
+void UIMachineSettingsSF::adjustList()
+{
+    /*
+     * Calculates required columns sizes to max out column 2
+     * and let all other columns stay at their minimum sizes.
+     *
+     * Columns
+     * 0 = Tree view
+     * 1 = Shared Folder name
+     * 2 = Auto-mount flag
+     * 3 = Writable flag
+     */
+    QAbstractItemView *itemView = mTwFolders;
+    QHeaderView *itemHeader = mTwFolders->header();
+    int total = mTwFolders->viewport()->width();
+
+    int mw0 = qMax (itemView->sizeHintForColumn (0), itemHeader->sectionSizeHint (0));
+    int mw2 = qMax (itemView->sizeHintForColumn (2), itemHeader->sectionSizeHint (2));
+    int mw3 = qMax (itemView->sizeHintForColumn (3), itemHeader->sectionSizeHint (3));
+
+    int w0 = mw0 < total / 4 ? mw0 : total / 4;
+    int w2 = mw2 < total / 4 ? mw2 : total / 4;
+    int w3 = mw3 < total / 4 ? mw3 : total / 4;
+
+    /* Giving 1st column all the available space. */
+    mTwFolders->setColumnWidth (0, w0);
+    mTwFolders->setColumnWidth (1, total - w0 - w2 - w3);
+    mTwFolders->setColumnWidth (2, w2);
+    mTwFolders->setColumnWidth (3, w3);
+}
+
+void UIMachineSettingsSF::adjustFields()
+{
+    QTreeWidgetItem *mainRoot = mTwFolders->invisibleRootItem();
+    for (int i = 0; i < mainRoot->childCount(); ++ i)
+    {
+        QTreeWidgetItem *subRoot = mainRoot->child (i);
+        for (int j = 0; j < subRoot->childCount(); ++ j)
+        {
+            SFTreeViewItem *item = subRoot->child (j) &&
+                                   subRoot->child (j)->type() == SFTreeViewItem::SFTreeViewItemType ?
+                                   static_cast <SFTreeViewItem*> (subRoot->child (j)) : 0;
+            if (item)
+                item->adjustText();
+        }
+    }
+}
+
+void UIMachineSettingsSF::showEvent (QShowEvent *aEvent)
+{
+    QWidget::showEvent (aEvent);
+
+    /* Connect header-resize signal just before widget is shown after all the items properly loaded and initialized. */
+    connect (mTwFolders->header(), SIGNAL (sectionResized (int, int, int)), this, SLOT (adjustFields()));
+
+    /* Adjusting size after all pending show events are processed. */
+    QTimer::singleShot (0, this, SLOT (adjustList()));
+}
+
+SFTreeViewItem* UIMachineSettingsSF::root(UISharedFolderType type)
+{
+    /* Prepare empty item: */
+    SFTreeViewItem *pRootItem = 0;
+    /* Get top-level root item: */
+    QTreeWidgetItem *pMainRootItem = mTwFolders->invisibleRootItem();
+    /* Iterate other the all root items: */
+    for (int iFolderTypeIndex = 0; iFolderTypeIndex < pMainRootItem->childCount(); ++iFolderTypeIndex)
+    {
+        /* Get iterated item: */
+        QTreeWidgetItem *pIteratedItem = pMainRootItem->child(iFolderTypeIndex);
+        /* If iterated item's type is what we are looking for: */
+        if (pIteratedItem->text(1).toInt() == type)
+        {
+            /* Remember the item: */
+            pRootItem = static_cast<SFTreeViewItem*>(pIteratedItem);
+            /* And break further search: */
+            break;
+        }
+    }
+    /* If root item we are looking for still not found: */
+    if (!pRootItem)
+    {
+        /* Preparing fields: */
+        QStringList fields;
+        /* Depending on folder type: */
+        switch (type)
+        {
+            case MachineType:
+                fields << tr(" Machine Folders") << QString::number(MachineType);
+                break;
+            case ConsoleType:
+                fields << tr(" Transient Folders") << QString::number(ConsoleType);
+                break;
+            default:
+                break;
+        }
+        /* Creating root: */
+        pRootItem = new SFTreeViewItem(mTwFolders, fields, SFTreeViewItem::EllipsisEnd);
+        /* We should show it (its not?): */
+        pRootItem->setHidden(false);
+        /* Expand it: */
+        pRootItem->setExpanded(true);
+    }
+    /* Return root item: */
+    return pRootItem;
+}
+
+SFoldersNameList UIMachineSettingsSF::usedList (bool aIncludeSelected)
+{
+    /* Make the used names list: */
+    SFoldersNameList list;
+    QTreeWidgetItemIterator it (mTwFolders);
+    while (*it)
+    {
+        if ((*it)->parent() && (aIncludeSelected || !(*it)->isSelected()) &&
+            (*it)->type() == SFTreeViewItem::SFTreeViewItemType)
+        {
+            SFTreeViewItem *item = static_cast <SFTreeViewItem*> (*it);
+            UISharedFolderType type = (UISharedFolderType) item->parent()->text (1).toInt();
+            list << qMakePair (item->getText (0), type);
+        }
+        ++ it;
+    }
+    return list;
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h	(revision 33882)
@@ -0,0 +1,129 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSF class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsSF_h__
+#define __UIMachineSettingsSF_h__
+
+/* Local includes */
+#include "UISettingsPage.h"
+#include "UIMachineSettingsSF.gen.h"
+
+/* Local forwards */
+class SFTreeViewItem;
+
+enum UISharedFolderType
+{
+    WrongType   = 0x00,
+    MachineType = 0x01,
+    ConsoleType = 0x02
+};
+typedef QPair <QString, UISharedFolderType> SFolderName;
+typedef QList <SFolderName> SFoldersNameList;
+
+/* Machine settings / Shared Folders page / Folder data: */
+struct UISharedFolderData
+{
+    UISharedFolderType m_type;
+    QString m_strName;
+    QString m_strHostPath;
+    bool m_fAutoMount;
+    bool m_fWritable;
+    bool m_fEdited;
+};
+
+/* Machine settings / Shared Folders page / Cache: */
+struct UISettingsCacheMachineSFolders
+{
+    QList<UISharedFolderData> m_items;
+};
+
+class UIMachineSettingsSF : public UISettingsPageMachine,
+                         public Ui::UIMachineSettingsSF
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsSF();
+
+    void loadDirectlyFrom(const CConsole &console);
+    void saveDirectlyTo(CConsole &console);
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    void loadToCacheFromMachine(const CMachine &machine);
+    void loadToCacheFromConsole(const CConsole &console);
+    void loadToCacheFromVector(const CSharedFolderVector &vector, UISharedFolderType type);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+    void saveFromCacheToMachine(CMachine &machine);
+    void saveFromCacheToConsole(CConsole &console);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void addTriggered();
+    void edtTriggered();
+    void delTriggered();
+
+    void processCurrentChanged (QTreeWidgetItem *aCurrentItem);
+    void processDoubleClick (QTreeWidgetItem *aItem);
+    void showContextMenu (const QPoint &aPos);
+
+    void adjustList();
+    void adjustFields();
+
+private:
+
+    void resizeEvent (QResizeEvent *aEvent);
+
+    void showEvent (QShowEvent *aEvent);
+
+    SFTreeViewItem* root(UISharedFolderType type);
+    SFoldersNameList usedList (bool aIncludeSelected);
+
+    UISharedFolderType m_type;
+
+    QAction  *mNewAction;
+    QAction  *mEdtAction;
+    QAction  *mDelAction;
+    bool      mIsListViewChanged;
+    QString   mTrFull;
+    QString   mTrReadOnly;
+    QString   mTrYes;
+
+    /* Cache: */
+    UISettingsCacheMachineSFolders m_cache;
+};
+
+#endif // __UIMachineSettingsSF_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.ui	(revision 33882)
@@ -0,0 +1,112 @@
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008-2009 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsSF</class>
+ <widget class="QWidget" name="UIMachineSettingsSF">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>300</width>
+    <height>220</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QILabelSeparator" native="1" name="mNameSeparator">
+     <property name="text">
+      <string>&amp;Folders List</string>
+     </property>
+     <property name="buddy">
+      <cstring>mTwFolders</cstring>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="mLtFolders">
+     <property name="margin">
+      <number>0</number>
+     </property>
+     <property name="spacing">
+      <number>1</number>
+     </property>
+     <item>
+      <widget class="QTreeWidget" name="mTwFolders">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>200</height>
+        </size>
+       </property>
+       <property name="contextMenuPolicy">
+        <enum>Qt::CustomContextMenu</enum>
+       </property>
+       <property name="whatsThis">
+        <string>Lists all shared folders accessible to this machine. Use 'net use x: \\vboxsvr\share' to access a shared folder named &lt;i>share&lt;/i> from a DOS-like OS, or 'mount -t vboxsf share mount_point' to access it from a Linux OS. This feature requires Guest Additions.</string>
+       </property>
+       <property name="uniformRowHeights">
+        <bool>true</bool>
+       </property>
+       <property name="allColumnsShowFocus">
+        <bool>true</bool>
+       </property>
+       <column>
+        <property name="text">
+         <string>Name</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Path</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Auto-Mount</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Access</string>
+        </property>
+       </column>
+      </widget>
+     </item>
+     <item>
+      <widget class="UIToolBar" native="1" name="mTbFolders"/>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabelSeparator</class>
+   <extends>QLabel</extends>
+   <header>QILabelSeparator.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>UIToolBar</class>
+   <extends>QWidget</extends>
+   <header>UIToolBar.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp	(revision 33882)
@@ -0,0 +1,185 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSFDetails class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIMachineSettingsSFDetails.h"
+#include "VBoxGlobal.h"
+
+/* Qt includes */
+#include <QDir>
+#include <QPushButton>
+
+UIMachineSettingsSFDetails::UIMachineSettingsSFDetails (DialogType aType,
+                                                  bool aEnableSelector, /* for "permanent" checkbox */
+                                                  const SFoldersNameList &aUsedNames,
+                                                  QWidget *aParent /* = NULL */)
+   : QIWithRetranslateUI2<QIDialog> (aParent)
+   , mType (aType)
+   , mUsePermanent (aEnableSelector)
+   , mUsedNames (aUsedNames)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsSFDetails::setupUi (this);
+
+    mCbPermanent->setHidden (!aEnableSelector);
+
+    /* No reset button */
+    mPsPath->setResetEnabled (false);
+
+    /* Setup connections: */
+    connect (mPsPath, SIGNAL (currentIndexChanged (int)),
+             this, SLOT (onSelectPath()));
+    connect (mPsPath, SIGNAL (pathChanged (const QString &)),
+             this, SLOT (onSelectPath()));
+    connect (mLeName, SIGNAL (textChanged (const QString &)),
+             this, SLOT (validate()));
+
+    if (aEnableSelector)
+    {
+        connect (mCbPermanent, SIGNAL (toggled (bool)),
+                 this, SLOT (validate()));
+    }
+
+     /* Applying language settings */
+    retranslateUi();
+
+    /* Validate the initial fields */
+    validate();
+
+    adjustSize();
+
+#ifdef Q_WS_MAC
+    setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
+    setFixedSize (minimumSize());
+#endif /* Q_WS_MAC */
+}
+
+void UIMachineSettingsSFDetails::setPath (const QString &aPath)
+{
+    mPsPath->setPath (aPath);
+}
+
+QString UIMachineSettingsSFDetails::path() const
+{
+    return mPsPath->path();
+}
+
+void UIMachineSettingsSFDetails::setName (const QString &aName)
+{
+    mLeName->setText (aName);
+}
+
+QString UIMachineSettingsSFDetails::name() const
+{
+    return mLeName->text();
+}
+
+void UIMachineSettingsSFDetails::setWriteable (bool aWritable)
+{
+    mCbReadonly->setChecked (!aWritable);
+}
+
+bool UIMachineSettingsSFDetails::isWriteable() const
+{
+    return !mCbReadonly->isChecked();
+}
+
+void UIMachineSettingsSFDetails::setAutoMount (bool aAutoMount)
+{
+    mCbAutoMount->setChecked (aAutoMount);
+}
+
+bool UIMachineSettingsSFDetails::isAutoMounted() const
+{
+    return mCbAutoMount->isChecked();
+}
+
+void UIMachineSettingsSFDetails::setPermanent (bool aPermanent)
+{
+    mCbPermanent->setChecked (aPermanent);
+}
+
+bool UIMachineSettingsSFDetails::isPermanent() const
+{
+    return mUsePermanent ? mCbPermanent->isChecked() : true;
+}
+
+void UIMachineSettingsSFDetails::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsSFDetails::retranslateUi (this);
+
+    switch (mType)
+    {
+        case AddType:
+            setWindowTitle (tr ("Add Share"));
+            break;
+        case EditType:
+            setWindowTitle (tr ("Edit Share"));
+            break;
+        default:
+            AssertMsgFailed (("Incorrect SF Dialog type\n"));
+    }
+}
+
+void UIMachineSettingsSFDetails::validate()
+{
+    UISharedFolderType resultType =
+        mUsePermanent && !mCbPermanent->isChecked() ? ConsoleType : MachineType;
+    SFolderName pair = qMakePair (mLeName->text(), resultType);
+
+    mButtonBox->button (QDialogButtonBox::Ok)->setEnabled (!mPsPath->path().isEmpty() &&
+                                                           QDir(mPsPath->path()).exists() &&
+                                                           !mLeName->text().trimmed().isEmpty() &&
+                                                           !mLeName->text().contains(" ") &&
+                                                           !mUsedNames.contains (pair));
+}
+
+void UIMachineSettingsSFDetails::onSelectPath()
+{
+    if (!mPsPath->isPathSelected())
+        return;
+
+    QString folderName (mPsPath->path());
+#if defined (Q_OS_WIN) || defined (Q_OS_OS2)
+    if (folderName[0].isLetter() && folderName[1] == ':' && folderName[2] == 0)
+    {
+        /* VBoxFilePathSelectorWidget returns root path as 'X:', which is invalid path.
+         * Append the trailing backslash to get a valid root path 'X:\'.
+         */
+        folderName += "\\";
+        mPsPath->setPath(folderName);
+    }
+#endif
+    QDir folder (folderName);
+    if (!folder.isRoot())
+        /* Processing non-root folder */
+        mLeName->setText (folder.dirName().replace(' ', '_'));
+    else
+    {
+        /* Processing root folder */
+#if defined (Q_OS_WIN) || defined (Q_OS_OS2)
+        mLeName->setText (folderName.toUpper()[0] + "_DRIVE");
+#elif defined (Q_OS_UNIX)
+        mLeName->setText ("ROOT");
+#endif
+    }
+    /* Validate the fields */
+    validate();
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.h	(revision 33882)
@@ -0,0 +1,78 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSFDetails class declaration
+ */
+
+/*
+ * Copyright (C) 2008 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsSFDetails_h__
+#define __UIMachineSettingsSFDetails_h__
+
+#include "UIMachineSettingsSFDetails.gen.h"
+#include "QIDialog.h"
+#include "QIWithRetranslateUI.h"
+#include "UIMachineSettingsSF.h"
+
+class UIMachineSettingsSFDetails : public QIWithRetranslateUI2<QIDialog>,
+                                public Ui::UIMachineSettingsSFDetails
+{
+    Q_OBJECT;
+
+public:
+
+    enum DialogType
+    {
+        AddType,
+        EditType
+    };
+
+    UIMachineSettingsSFDetails (DialogType aType,
+                             bool aEnableSelector, /* for "permanent" checkbox */
+                             const SFoldersNameList &aUsedNames,
+                             QWidget *aParent = NULL);
+
+    void setPath (const QString &aPath);
+    QString path() const;
+
+    void setName (const QString &aName);
+    QString name() const;
+
+    void setWriteable (bool aWriteable);
+    bool isWriteable() const;
+
+    void setAutoMount (bool aAutoMount);
+    bool isAutoMounted() const;
+
+    void setPermanent (bool aPermanent);
+    bool isPermanent() const;
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void onSelectPath();
+    void validate();
+
+private:
+
+    /* Private member vars */
+    DialogType       mType;
+    bool             mUsePermanent;
+    SFoldersNameList mUsedNames;
+};
+
+#endif // __UIMachineSettingsSFDetails_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.ui	(revision 33882)
@@ -0,0 +1,159 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008-2010 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsSFDetails</class>
+ <widget class="QDialog" name="UIMachineSettingsSFDetails" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>218</width>
+    <height>196</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" >
+    <widget class="QLabel" name="mLbPath" >
+     <property name="text" >
+      <string>Folder Path:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" >
+    <widget class="VBoxFilePathSelectorWidget" name="mPsPath" />
+   </item>
+   <item row="1" column="0" >
+    <widget class="QLabel" name="mLbName" >
+     <property name="text" >
+      <string>Folder Name:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QLineEdit" name="mLeName" >
+     <property name="toolTip" >
+      <string>Displays the name of the shared folder (as it will be seen by the guest OS).</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1" >
+    <widget class="QCheckBox" name="mCbReadonly" >
+     <property name="toolTip" >
+      <string>When checked, the guest OS will not be able to write to the specified shared folder.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Read-only</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1" >
+    <widget class="QCheckBox" name="mCbAutoMount" >
+     <property name="toolTip" >
+      <string>When checked, the guest OS will try to automatically mount the shared folder on startup.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Auto-mount</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1" >
+    <widget class="QCheckBox" name="mCbPermanent" >
+     <property name="toolTip" >
+      <string>If checked, this shared folder will be permanent.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Make Permanent</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="6" column="0" colspan="2" >
+    <widget class="QIDialogButtonBox" name="mButtonBox" >
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>VBoxFilePathSelectorWidget</class>
+   <extends>QComboBox</extends>
+   <header>VBoxFilePathSelectorWidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>QIDialogButtonBox</class>
+   <extends>QDialogButtonBox</extends>
+   <header>QIDialogButtonBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mButtonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>UIMachineSettingsSFDetails</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>108</x>
+     <y>158</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>108</x>
+     <y>90</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>mButtonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>UIMachineSettingsSFDetails</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>108</x>
+     <y>158</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>108</x>
+     <y>90</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp	(revision 33882)
@@ -0,0 +1,384 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSerial class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2008 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIMachineSettingsSerial.h"
+#include "QIWidgetValidator.h"
+#include "VBoxGlobal.h"
+#include "QITabWidget.h"
+
+#include <QDir>
+
+/* UIMachineSettingsSerial stuff */
+UIMachineSettingsSerial::UIMachineSettingsSerial()
+    : QIWithRetranslateUI<QWidget> (0)
+    , mValidator(0)
+    , m_iSlot(-1)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsSerial::setupUi (this);
+
+    /* Setup validation */
+    mLeIRQ->setValidator (new QIULongValidator (0, 255, this));
+    mLeIOPort->setValidator (new QIULongValidator (0, 0xFFFF, this));
+    mLePath->setValidator (new QRegExpValidator (QRegExp (".+"), this));
+
+    /* Setup constraints */
+    mLeIRQ->setFixedWidth (mLeIRQ->fontMetrics().width ("8888"));
+    mLeIOPort->setFixedWidth (mLeIOPort->fontMetrics().width ("8888888"));
+
+    /* Set initial values */
+    /* Note: If you change one of the following don't forget retranslateUi. */
+    mCbNumber->insertItem (0, vboxGlobal().toCOMPortName (0, 0));
+    mCbNumber->insertItems (0, vboxGlobal().COMPortNames());
+
+    mCbMode->addItem (""); /* KPortMode_Disconnected */
+    mCbMode->addItem (""); /* KPortMode_HostPipe */
+    mCbMode->addItem (""); /* KPortMode_HostDevice */
+    mCbMode->addItem (""); /* KPortMode_RawFile */
+
+    /* Setup connections */
+    connect (mGbSerial, SIGNAL (toggled (bool)),
+             this, SLOT (mGbSerialToggled (bool)));
+    connect (mCbNumber, SIGNAL (activated (const QString &)),
+             this, SLOT (mCbNumberActivated (const QString &)));
+    connect (mCbMode, SIGNAL (activated (const QString &)),
+             this, SLOT (mCbModeActivated (const QString &)));
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+void UIMachineSettingsSerial::fetchPortData(const UISerialPortData &data)
+{
+    /* Load port slot number: */
+    m_iSlot = data.m_iSlot;
+
+    /* Fetch port data: */
+    mGbSerial->setChecked(data.m_fPortEnabled);
+    mCbNumber->setCurrentIndex(mCbNumber->findText(vboxGlobal().toCOMPortName(data.m_uIRQ, data.m_uIOBase)));
+    mLeIRQ->setText(QString::number(data.m_uIRQ));
+    mLeIOPort->setText("0x" + QString::number(data.m_uIOBase, 16).toUpper());
+    mCbMode->setCurrentIndex(mCbMode->findText(vboxGlobal().toString(data.m_hostMode)));
+    mCbPipe->setChecked(data.m_fServer);
+    mLePath->setText(data.m_strPath);
+
+    /* Ensure everything is up-to-date */
+    mGbSerialToggled(mGbSerial->isChecked());
+}
+
+void UIMachineSettingsSerial::uploadPortData(UISerialPortData &data)
+{
+    /* Upload port data: */
+    data.m_fPortEnabled = mGbSerial->isChecked();
+    data.m_uIRQ = mLeIRQ->text().toULong(NULL, 0);
+    data.m_uIOBase = mLeIOPort->text().toULong (NULL, 0);
+    data.m_fServer = mCbPipe->isChecked();
+    data.m_hostMode = vboxGlobal().toPortMode(mCbMode->currentText());
+    data.m_strPath = QDir::toNativeSeparators(mLePath->text());
+}
+
+void UIMachineSettingsSerial::setValidator (QIWidgetValidator *aVal)
+{
+    Assert (aVal);
+    mValidator = aVal;
+    connect (mLeIRQ, SIGNAL (textChanged (const QString &)),
+             mValidator, SLOT (revalidate()));
+    connect (mLeIOPort, SIGNAL (textChanged (const QString &)),
+             mValidator, SLOT (revalidate()));
+    connect (mLePath, SIGNAL (textChanged (const QString &)),
+             mValidator, SLOT (revalidate()));
+    mValidator->revalidate();
+}
+
+QWidget* UIMachineSettingsSerial::setOrderAfter (QWidget *aAfter)
+{
+    setTabOrder (aAfter, mGbSerial);
+    setTabOrder (mGbSerial, mCbNumber);
+    setTabOrder (mCbNumber, mLeIRQ);
+    setTabOrder (mLeIRQ, mLeIOPort);
+    setTabOrder (mLeIOPort, mCbMode);
+    setTabOrder (mCbMode, mCbPipe);
+    setTabOrder (mCbPipe, mLePath);
+    return mLePath;
+}
+
+QString UIMachineSettingsSerial::pageTitle() const
+{
+    return QString(tr("Port %1", "serial ports")).arg(QString("&%1").arg(m_iSlot + 1));
+}
+
+bool UIMachineSettingsSerial::isUserDefined()
+{
+    ulong a, b;
+    return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b);
+}
+
+void UIMachineSettingsSerial::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsSerial::retranslateUi (this);
+
+    mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0));
+
+    mCbMode->setItemText (3, vboxGlobal().toString (KPortMode_RawFile));
+    mCbMode->setItemText (2, vboxGlobal().toString (KPortMode_HostDevice));
+    mCbMode->setItemText (1, vboxGlobal().toString (KPortMode_HostPipe));
+    mCbMode->setItemText (0, vboxGlobal().toString (KPortMode_Disconnected));
+}
+
+void UIMachineSettingsSerial::mGbSerialToggled (bool aOn)
+{
+    if (aOn)
+    {
+        mCbNumberActivated (mCbNumber->currentText());
+        mCbModeActivated (mCbMode->currentText());
+    }
+    if (mValidator)
+        mValidator->revalidate();
+}
+
+void UIMachineSettingsSerial::mCbNumberActivated (const QString &aText)
+{
+    ulong IRQ, IOBase;
+    bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase);
+
+    mLeIRQ->setEnabled (!std);
+    mLeIOPort->setEnabled (!std);
+    if (std)
+    {
+        mLeIRQ->setText (QString::number (IRQ));
+        mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper());
+    }
+}
+
+void UIMachineSettingsSerial::mCbModeActivated (const QString &aText)
+{
+    KPortMode mode = vboxGlobal().toPortMode (aText);
+    mCbPipe->setEnabled (mode == KPortMode_HostPipe);
+    mLbPath->setEnabled (mode != KPortMode_Disconnected);
+    mLePath->setEnabled (mode != KPortMode_Disconnected);
+    if (mValidator)
+        mValidator->revalidate();
+}
+
+
+/* UIMachineSettingsSerialPage stuff */
+UIMachineSettingsSerialPage::UIMachineSettingsSerialPage()
+    : mValidator(0)
+    , mTabWidget(0)
+{
+    /* TabWidget creation */
+    mTabWidget = new QITabWidget (this);
+    QVBoxLayout *layout = new QVBoxLayout (this);
+    layout->setContentsMargins (0, 5, 0, 5);
+    layout->addWidget (mTabWidget);
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsSerialPage::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Load port data: */
+    ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetSerialPortCount();
+    for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
+    {
+        /* Get port: */
+        const CSerialPort &port = m_machine.GetSerialPort(uSlot);
+
+        /* Prepare port's data container: */
+        UISerialPortData data;
+
+        /* Load options: */
+        data.m_iSlot = uSlot;
+        data.m_fPortEnabled = port.GetEnabled();
+        data.m_uIRQ = port.GetIRQ();
+        data.m_uIOBase = port.GetIOBase();
+        data.m_hostMode = port.GetHostMode();
+        data.m_fServer = port.GetServer();
+        data.m_strPath = port.GetPath();
+
+        /* Append adapter's data container: */
+        m_cache.m_items << data;
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsSerialPage::getFromCache()
+{
+    Assert(m_pFirstWidget);
+    setTabOrder(m_pFirstWidget, mTabWidget->focusProxy());
+    QWidget *pLastFocusWidget = mTabWidget->focusProxy();
+
+    /* Apply internal variables data to QWidget(s): */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Creating port's page: */
+        UIMachineSettingsSerial *pPage = new UIMachineSettingsSerial;
+
+        /* Loading port's data into page: */
+        pPage->fetchPortData(m_cache.m_items[iSlot]);
+
+        /* Attach port's page to Tab Widget: */
+        mTabWidget->addTab(pPage, pPage->pageTitle());
+
+        /* Setup page validation: */
+        pPage->setValidator(mValidator);
+
+        /* Setup tab order: */
+        pLastFocusWidget = pPage->setOrderAfter(pLastFocusWidget);
+    }
+
+    /* Applying language settings: */
+    retranslateUi();
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsSerialPage::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Getting adapter's page: */
+        UIMachineSettingsSerial *pPage = qobject_cast<UIMachineSettingsSerial*>(mTabWidget->widget(iSlot));
+
+        /* Loading Adapter's data from page: */
+        pPage->uploadPortData(m_cache.m_items[iSlot]);
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsSerialPage::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    for (int iSlot = 0; iSlot < m_cache.m_items.size(); ++iSlot)
+    {
+        /* Get adapter: */
+        CSerialPort port = m_machine.GetSerialPort(iSlot);
+
+        /* Get cached data for this slot: */
+        const UISerialPortData &data = m_cache.m_items[iSlot];
+
+        /* Save options: */
+        port.SetEnabled(data.m_fPortEnabled);
+        port.SetIRQ(data.m_uIRQ);
+        port.SetIOBase(data.m_uIOBase);
+        port.SetServer(data.m_fServer);
+        port.SetPath(data.m_strPath);
+        /* This *must* be last. The host mode will be changed to disconnected if
+         * some of the necessary settings above will not meet the requirements for
+         * the selected mode. */
+        port.SetHostMode(data.m_hostMode);
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsSerialPage::setValidator (QIWidgetValidator * aVal)
+{
+    mValidator = aVal;
+}
+
+bool UIMachineSettingsSerialPage::revalidate (QString &aWarning, QString &aTitle)
+{
+    bool valid = true;
+    QStringList ports;
+    QStringList paths;
+
+    int index = 0;
+    for (; index < mTabWidget->count(); ++ index)
+    {
+        QWidget *tab = mTabWidget->widget (index);
+        UIMachineSettingsSerial *page =
+            static_cast<UIMachineSettingsSerial*> (tab);
+
+        if (!page->mGbSerial->isChecked())
+            continue;
+
+        /* Check the predefined port number unicity */
+        if (!page->isUserDefined())
+        {
+            QString port = page->mCbNumber->currentText();
+            valid = !ports.contains (port);
+            if (!valid)
+            {
+                aWarning = tr ("Duplicate port number selected ");
+                aTitle += ": " +
+                    vboxGlobal().removeAccelMark (mTabWidget->tabText (mTabWidget->indexOf (tab)));
+                break;
+            }
+            ports << port;
+        }
+
+        /* Check the port path emptiness & unicity */
+        KPortMode mode =
+            vboxGlobal().toPortMode (page->mCbMode->currentText());
+        if (mode != KPortMode_Disconnected)
+        {
+            QString path = page->mLePath->text();
+            valid = !path.isEmpty() && !paths.contains (path);
+            if (!valid)
+            {
+                if (!page->mGbSerial->isChecked())
+                    page->mCbMode->setCurrentIndex (KPortMode_Disconnected);
+                else
+                {
+                    aWarning = path.isEmpty() ?
+                        tr ("Port path not specified ") :
+                        tr ("Duplicate port path entered ");
+                    aTitle += ": " +
+                        vboxGlobal().removeAccelMark (mTabWidget->tabText (mTabWidget->indexOf (tab)));
+                    break;
+                }
+            }
+            paths << path;
+        }
+    }
+
+    return valid;
+}
+
+void UIMachineSettingsSerialPage::retranslateUi()
+{
+    for (int i = 0; i < mTabWidget->count(); ++ i)
+    {
+        UIMachineSettingsSerial *page =
+            static_cast<UIMachineSettingsSerial*> (mTabWidget->widget (i));
+        mTabWidget->setTabText (i, page->pageTitle());
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.h	(revision 33882)
@@ -0,0 +1,121 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSerial class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsSerial_h__
+#define __UIMachineSettingsSerial_h__
+
+#include "UISettingsPage.h"
+#include "UIMachineSettingsSerial.gen.h"
+#include "COMDefs.h"
+
+class QITabWidget;
+
+/* Machine settings / Network page / Port data: */
+struct UISerialPortData
+{
+    int m_iSlot;
+    bool m_fPortEnabled;
+    ulong m_uIRQ;
+    ulong m_uIOBase;
+    KPortMode m_hostMode;
+    bool m_fServer;
+    QString m_strPath;
+};
+
+/* Machine settings / Serial page / Cache: */
+struct UISettingsCacheMachineSerial
+{
+    QList<UISerialPortData> m_items;
+};
+
+class UIMachineSettingsSerial : public QIWithRetranslateUI<QWidget>,
+                             public Ui::UIMachineSettingsSerial
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsSerial();
+
+    void fetchPortData(const UISerialPortData &data);
+    void uploadPortData(UISerialPortData &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+
+    QWidget* setOrderAfter (QWidget *aAfter);
+
+    QString pageTitle() const;
+    bool isUserDefined();
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void mGbSerialToggled (bool aOn);
+    void mCbNumberActivated (const QString &aText);
+    void mCbModeActivated (const QString &aText);
+
+private:
+
+    QIWidgetValidator *mValidator;
+    int m_iSlot;
+};
+
+/* Machine settings / Serial page: */
+class UIMachineSettingsSerialPage : public UISettingsPageMachine
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsSerialPage();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void retranslateUi();
+
+private:
+
+    QIWidgetValidator *mValidator;
+    QITabWidget *mTabWidget;
+
+    /* Cache: */
+    UISettingsCacheMachineSerial m_cache;
+};
+
+#endif // __UIMachineSettingsSerial_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.ui	(revision 33882)
@@ -0,0 +1,249 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsSerial</class>
+ <widget class="QWidget" name="UIMachineSettingsSerial" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>357</width>
+    <height>179</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" colspan="2" >
+    <widget class="QCheckBox" name="mGbSerial" >
+     <property name="whatsThis" >
+      <string>When checked, enables the given serial port of the virtual machine.</string>
+     </property>
+     <property name="text" >
+      <string>&amp;Enable Serial Port</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QWidget" native="1" name="mSerialChild" >
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="mLbNumber" >
+        <property name="text" >
+         <string>Port &amp;Number:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbNumber</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" >
+       <widget class="QComboBox" name="mCbNumber" >
+        <property name="whatsThis" >
+         <string>Displays the serial port number. You can choose one of the standard serial ports or select &lt;b>User-defined&lt;/b> and specify port parameters manually.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2" >
+       <widget class="QLabel" name="mLbIRQ" >
+        <property name="text" >
+         <string>&amp;IRQ:</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mLeIRQ</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="3" >
+       <widget class="QLineEdit" name="mLeIRQ" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis" >
+         <string>Displays the IRQ number of this serial port. This should be a whole number between &lt;tt>0&lt;/tt> and &lt;tt>255&lt;/tt>. Values greater than &lt;tt>15&lt;/tt> may only be used if the &lt;b>IO APIC&lt;/b> setting is enabled for this virtual machine.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="4" >
+       <widget class="QLabel" name="mLbIOPort" >
+        <property name="text" >
+         <string>I/O Po&amp;rt:</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mLeIOPort</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="5" >
+       <widget class="QLineEdit" name="mLeIOPort" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="whatsThis" >
+         <string>Displays the base I/O port address of this serial port. Valid values are integer numbers in range from &lt;tt>0&lt;/tt> to &lt;tt>0xFFFF&lt;/tt>.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QLabel" name="mLbMode" >
+        <property name="text" >
+         <string>Port &amp;Mode:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mCbMode</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <widget class="QComboBox" name="mCbMode" >
+        <property name="whatsThis" >
+         <string>Controls the working mode of this serial port. If you select &lt;b>Disconnected&lt;/b>, the guest OS will detect the serial port but will not be able to operate it.</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2" colspan="4" >
+       <spacer>
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" >
+         <size>
+          <width>131</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="2" column="1" colspan="2" >
+       <widget class="QCheckBox" name="mCbPipe" >
+        <property name="whatsThis" >
+         <string>If checked, the pipe specified in the &lt;b>Port Path&lt;/b> field will be created by the virtual machine when it starts. Otherwise, the virtual machine will assume that the pipe exists and try to use it.</string>
+        </property>
+        <property name="text" >
+         <string>&amp;Create Pipe</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0" >
+       <widget class="QLabel" name="mLbPath" >
+        <property name="text" >
+         <string>Port/File &amp;Path:</string>
+        </property>
+        <property name="alignment" >
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+        <property name="buddy" >
+         <cstring>mLePath</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="1" colspan="5" >
+       <widget class="QLineEdit" name="mLePath" >
+        <property name="whatsThis" >
+         <string>Displays the path to the serial port's pipe on the host when the port is working in &lt;b>Host Pipe&lt;/b> mode, or the host serial device name when the port is working in &lt;b>Host Device&lt;/b> mode.</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mGbSerial</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mSerialChild</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>71</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>255</x>
+     <y>125</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 33882)
@@ -0,0 +1,2829 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsStorage class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Local Includes */
+#include "QIWidgetValidator.h"
+#include "UIIconPool.h"
+#include "UINewHDWzd.h"
+#include "VBoxGlobal.h"
+#include "QIFileDialog.h"
+#include "VBoxProblemReporter.h"
+#include "UIMachineSettingsStorage.h"
+
+/* Global Includes */
+#include <QHeaderView>
+#include <QItemEditorFactory>
+#include <QMetaProperty>
+#include <QMouseEvent>
+#include <QScrollBar>
+#include <QStylePainter>
+#include <QTimer>
+#include <QCommonStyle>
+
+/* String Tags */
+const char *firstAvailableId = "first available";
+
+/* Type converters */
+VBoxDefs::MediumType typeToLocal (KDeviceType aType)
+{
+    VBoxDefs::MediumType result = VBoxDefs::MediumType_Invalid;
+    switch (aType)
+    {
+        case KDeviceType_HardDisk:
+            result = VBoxDefs::MediumType_HardDisk;
+            break;
+        case KDeviceType_DVD:
+            result = VBoxDefs::MediumType_DVD;
+            break;
+        case KDeviceType_Floppy:
+            result = VBoxDefs::MediumType_Floppy;
+            break;
+        default:
+            AssertMsgFailed (("Incorrect medium type!\n"));
+            break;
+    }
+    return result;
+}
+
+
+QString compressText (const QString &aText)
+{
+    return QString ("<nobr><compact elipsis=\"end\">%1</compact></nobr>").arg (aText);
+}
+
+
+/* Pixmap Storage */
+QPointer <PixmapPool> PixmapPool::mThis = 0;
+
+PixmapPool* PixmapPool::pool (QObject *aParent)
+{
+    if (!mThis)
+    {
+        AssertMsg (aParent, ("This object must have parent!\n"));
+        mThis = new PixmapPool (aParent);
+    }
+    else
+    {
+        AssertMsg (!aParent, ("Parent already set!\n"));
+    }
+    return mThis;
+}
+
+PixmapPool::PixmapPool (QObject *aParent)
+    : QObject (aParent)
+    , mPool(MaxIndex)
+{
+    mPool [ControllerAddEn]          = QPixmap (":/controller_add_16px.png");
+    mPool [ControllerAddDis]         = QPixmap (":/controller_add_disabled_16px.png");
+    mPool [ControllerDelEn]          = QPixmap (":/controller_remove_16px.png");
+    mPool [ControllerDelDis]         = QPixmap (":/controller_remove_disabled_16px.png");
+
+    mPool [AttachmentAddEn]          = QPixmap (":/attachment_add_16px.png");
+    mPool [AttachmentAddDis]         = QPixmap (":/attachment_add_disabled_16px.png");
+    mPool [AttachmentDelEn]          = QPixmap (":/attachment_remove_16px.png");
+    mPool [AttachmentDelDis]         = QPixmap (":/attachment_remove_disabled_16px.png");
+
+    mPool [IDEControllerNormal]      = QPixmap (":/ide_16px.png");
+    mPool [IDEControllerExpand]      = QPixmap (":/ide_expand_16px.png");
+    mPool [IDEControllerCollapse]    = QPixmap (":/ide_collapse_16px.png");
+    mPool [SATAControllerNormal]     = QPixmap (":/sata_16px.png");
+    mPool [SATAControllerExpand]     = QPixmap (":/sata_expand_16px.png");
+    mPool [SATAControllerCollapse]   = QPixmap (":/sata_collapse_16px.png");
+    mPool [SCSIControllerNormal]     = QPixmap (":/scsi_16px.png");
+    mPool [SCSIControllerExpand]     = QPixmap (":/scsi_expand_16px.png");
+    mPool [SCSIControllerCollapse]   = QPixmap (":/scsi_collapse_16px.png");
+    mPool [FloppyControllerNormal]   = QPixmap (":/floppy_16px.png");
+    mPool [FloppyControllerExpand]   = QPixmap (":/floppy_expand_16px.png");
+    mPool [FloppyControllerCollapse] = QPixmap (":/floppy_collapse_16px.png");
+
+    mPool [IDEControllerAddEn]       = QPixmap (":/ide_add_16px.png");
+    mPool [IDEControllerAddDis]      = QPixmap (":/ide_add_disabled_16px.png");
+    mPool [SATAControllerAddEn]      = QPixmap (":/sata_add_16px.png");
+    mPool [SATAControllerAddDis]     = QPixmap (":/sata_add_disabled_16px.png");
+    mPool [SCSIControllerAddEn]      = QPixmap (":/scsi_add_16px.png");
+    mPool [SCSIControllerAddDis]     = QPixmap (":/scsi_add_disabled_16px.png");
+    mPool [FloppyControllerAddEn]    = QPixmap (":/floppy_add_16px.png");
+    mPool [FloppyControllerAddDis]   = QPixmap (":/floppy_add_disabled_16px.png");
+
+    mPool [HDAttachmentNormal]       = QPixmap (":/hd_16px.png");
+    mPool [CDAttachmentNormal]       = QPixmap (":/cd_16px.png");
+    mPool [FDAttachmentNormal]       = QPixmap (":/fd_16px.png");
+
+    mPool [HDAttachmentAddEn]        = QPixmap (":/hd_add_16px.png");
+    mPool [HDAttachmentAddDis]       = QPixmap (":/hd_add_disabled_16px.png");
+    mPool [CDAttachmentAddEn]        = QPixmap (":/cd_add_16px.png");
+    mPool [CDAttachmentAddDis]       = QPixmap (":/cd_add_disabled_16px.png");
+    mPool [FDAttachmentAddEn]        = QPixmap (":/fd_add_16px.png");
+    mPool [FDAttachmentAddDis]       = QPixmap (":/fd_add_disabled_16px.png");
+
+    mPool [VMMEn]                    = QPixmap (":/select_file_16px.png");
+    mPool [VMMDis]                   = QPixmap (":/select_file_dis_16px.png");
+}
+
+QPixmap PixmapPool::pixmap (PixmapType aType) const
+{
+    return aType > InvalidPixmap && aType < MaxIndex ? mPool [aType] : 0;
+}
+
+/* Abstract Controller Type */
+AbstractControllerType::AbstractControllerType (KStorageBus aBusType, KStorageControllerType aCtrType)
+    : mBusType (aBusType)
+    , mCtrType (aCtrType)
+{
+    AssertMsg (mBusType != KStorageBus_Null, ("Wrong Bus Type {%d}!\n", mBusType));
+    AssertMsg (mCtrType != KStorageControllerType_Null, ("Wrong Controller Type {%d}!\n", mCtrType));
+
+    for (int i = 0; i < State_MAX; ++ i)
+    {
+        mPixmaps << PixmapPool::InvalidPixmap;
+        switch (mBusType)
+        {
+            case KStorageBus_IDE:
+                mPixmaps [i] = (PixmapPool::PixmapType) (PixmapPool::IDEControllerNormal + i);
+                break;
+            case KStorageBus_SATA:
+                mPixmaps [i] = (PixmapPool::PixmapType) (PixmapPool::SATAControllerNormal + i);
+                break;
+            case KStorageBus_SCSI:
+                mPixmaps [i] = (PixmapPool::PixmapType) (PixmapPool::SCSIControllerNormal + i);
+                break;
+            case KStorageBus_Floppy:
+                mPixmaps [i] = (PixmapPool::PixmapType) (PixmapPool::FloppyControllerNormal + i);
+                break;
+            case KStorageBus_SAS:
+                mPixmaps [i] = (PixmapPool::PixmapType) (PixmapPool::SATAControllerNormal + i);
+                break;
+            default:
+                break;
+        }
+        AssertMsg (mPixmaps [i] != PixmapPool::InvalidPixmap, ("Item state pixmap was not set!\n"));
+    }
+}
+
+KStorageBus AbstractControllerType::busType() const
+{
+    return mBusType;
+}
+
+KStorageControllerType AbstractControllerType::ctrType() const
+{
+    return mCtrType;
+}
+
+ControllerTypeList AbstractControllerType::ctrTypes() const
+{
+    ControllerTypeList result;
+    for (uint i = first(); i < first() + size(); ++ i)
+        result << (KStorageControllerType) i;
+    return result;
+}
+
+PixmapPool::PixmapType AbstractControllerType::pixmap (ItemState aState) const
+{
+    return mPixmaps [aState];
+}
+
+void AbstractControllerType::setCtrType (KStorageControllerType aCtrType)
+{
+    mCtrType = aCtrType;
+}
+
+DeviceTypeList AbstractControllerType::deviceTypeList() const
+{
+    return vboxGlobal().virtualBox().GetSystemProperties().GetDeviceTypesForStorageBus (mBusType).toList();
+}
+
+/* IDE Controller Type */
+IDEControllerType::IDEControllerType (KStorageControllerType aSubType)
+    : AbstractControllerType (KStorageBus_IDE, aSubType)
+{
+}
+
+KStorageControllerType IDEControllerType::first() const
+{
+    return KStorageControllerType_PIIX3;
+}
+
+uint IDEControllerType::size() const
+{
+    return 3;
+}
+
+/* SATA Controller Type */
+SATAControllerType::SATAControllerType (KStorageControllerType aSubType)
+    : AbstractControllerType (KStorageBus_SATA, aSubType)
+{
+}
+
+KStorageControllerType SATAControllerType::first() const
+{
+    return KStorageControllerType_IntelAhci;
+}
+
+uint SATAControllerType::size() const
+{
+    return 1;
+}
+
+/* SCSI Controller Type */
+SCSIControllerType::SCSIControllerType (KStorageControllerType aSubType)
+    : AbstractControllerType (KStorageBus_SCSI, aSubType)
+{
+}
+
+KStorageControllerType SCSIControllerType::first() const
+{
+    return KStorageControllerType_LsiLogic;
+}
+
+uint SCSIControllerType::size() const
+{
+    return 2;
+}
+
+/* Floppy Controller Type */
+FloppyControllerType::FloppyControllerType (KStorageControllerType aSubType)
+    : AbstractControllerType (KStorageBus_Floppy, aSubType)
+{
+}
+
+KStorageControllerType FloppyControllerType::first() const
+{
+    return KStorageControllerType_I82078;
+}
+
+uint FloppyControllerType::size() const
+{
+    return 1;
+}
+
+/* SAS Controller Type */
+SASControllerType::SASControllerType (KStorageControllerType aSubType)
+    : AbstractControllerType (KStorageBus_SAS, aSubType)
+{
+}
+
+KStorageControllerType SASControllerType::first() const
+{
+    return KStorageControllerType_LsiLogicSas;
+}
+
+uint SASControllerType::size() const
+{
+    return 1;
+}
+
+/* Abstract Item */
+AbstractItem::AbstractItem (AbstractItem *aParent)
+    : mParent (aParent)
+    , mId (QUuid::createUuid())
+{
+    if (mParent) mParent->addChild (this);
+}
+
+AbstractItem::~AbstractItem()
+{
+    if (mParent) mParent->delChild (this);
+}
+
+AbstractItem* AbstractItem::parent() const
+{
+    return mParent;
+}
+
+QUuid AbstractItem::id() const
+{
+    return mId;
+}
+
+QString AbstractItem::machineId() const
+{
+    return mMachineId;
+}
+
+void AbstractItem::setMachineId (const QString &aMachineId)
+{
+    mMachineId = aMachineId;
+}
+
+/* Root Item */
+RootItem::RootItem()
+    : AbstractItem (0)
+{
+}
+
+RootItem::~RootItem()
+{
+    while (!mControllers.isEmpty())
+        delete mControllers.first();
+}
+
+ULONG RootItem::childCount (KStorageBus aBus) const
+{
+    ULONG result = 0;
+    foreach (AbstractItem *item, mControllers)
+    {
+        ControllerItem *ctrItem = static_cast <ControllerItem*> (item);
+        if (ctrItem->ctrBusType() == aBus)
+            ++ result;
+    }
+    return result;
+}
+
+AbstractItem::ItemType RootItem::rtti() const
+{
+    return Type_RootItem;
+}
+
+AbstractItem* RootItem::childByPos (int aIndex)
+{
+    return mControllers [aIndex];
+}
+
+AbstractItem* RootItem::childById (const QUuid &aId)
+{
+    for (int i = 0; i < childCount(); ++ i)
+        if (mControllers [i]->id() == aId)
+            return mControllers [i];
+    return 0;
+}
+
+int RootItem::posOfChild (AbstractItem *aItem) const
+{
+    return mControllers.indexOf (aItem);
+}
+
+int RootItem::childCount() const
+{
+    return mControllers.size();
+}
+
+QString RootItem::text() const
+{
+    return QString();
+}
+
+QString RootItem::tip() const
+{
+    return QString();
+}
+
+QPixmap RootItem::pixmap (ItemState /* aState */)
+{
+    return QPixmap();
+}
+
+void RootItem::addChild (AbstractItem *aItem)
+{
+    mControllers << aItem;
+}
+
+void RootItem::delChild (AbstractItem *aItem)
+{
+    mControllers.removeAll (aItem);
+}
+
+/* Controller Item */
+ControllerItem::ControllerItem (AbstractItem *aParent, const QString &aName,
+                                KStorageBus aBusType, KStorageControllerType aControllerType)
+    : AbstractItem (aParent)
+    , mCtrName (aName)
+    , mCtrType (0)
+{
+    /* Check for proper parent type */
+    AssertMsg (mParent->rtti() == AbstractItem::Type_RootItem, ("Incorrect parent type!\n"));
+
+    /* Select default type */
+    switch (aBusType)
+    {
+        case KStorageBus_IDE:
+            mCtrType = new IDEControllerType (aControllerType);
+            break;
+        case KStorageBus_SATA:
+            mCtrType = new SATAControllerType (aControllerType);
+            break;
+        case KStorageBus_SCSI:
+            mCtrType = new SCSIControllerType (aControllerType);
+            break;
+        case KStorageBus_Floppy:
+            mCtrType = new FloppyControllerType (aControllerType);
+            break;
+        case KStorageBus_SAS:
+            mCtrType = new SASControllerType (aControllerType);
+            break;
+        default:
+            AssertMsgFailed (("Wrong Controller Type {%d}!\n", aBusType));
+            break;
+    }
+
+    mUseIoCache = vboxGlobal().virtualBox().GetSystemProperties().GetDefaultIoCacheSettingForStorageController (aControllerType);
+}
+
+ControllerItem::~ControllerItem()
+{
+    delete mCtrType;
+    while (!mAttachments.isEmpty())
+        delete mAttachments.first();
+}
+
+KStorageBus ControllerItem::ctrBusType() const
+{
+    return mCtrType->busType();
+}
+
+QString ControllerItem::ctrName() const
+{
+    return mCtrName;
+}
+
+KStorageControllerType ControllerItem::ctrType() const
+{
+    return mCtrType->ctrType();
+}
+
+ControllerTypeList ControllerItem::ctrTypes() const
+{
+    return mCtrType->ctrTypes();
+}
+
+bool ControllerItem::ctrUseIoCache() const
+{
+    return mUseIoCache;
+}
+
+void ControllerItem::setCtrName (const QString &aCtrName)
+{
+    mCtrName = aCtrName;
+}
+
+void ControllerItem::setCtrType (KStorageControllerType aCtrType)
+{
+    mCtrType->setCtrType (aCtrType);
+}
+
+void ControllerItem::setCtrUseIoCache (bool aUseIoCache)
+{
+    mUseIoCache = aUseIoCache;
+}
+
+SlotsList ControllerItem::ctrAllSlots() const
+{
+    SlotsList allSlots;
+    CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties();
+    for (ULONG i = 0; i < sp.GetMaxPortCountForStorageBus (mCtrType->busType()); ++ i)
+        for (ULONG j = 0; j < sp.GetMaxDevicesPerPortForStorageBus (mCtrType->busType()); ++ j)
+            allSlots << StorageSlot (mCtrType->busType(), i, j);
+    return allSlots;
+}
+
+SlotsList ControllerItem::ctrUsedSlots() const
+{
+    SlotsList usedSlots;
+    for (int i = 0; i < mAttachments.size(); ++ i)
+        usedSlots << static_cast <AttachmentItem*> (mAttachments [i])->attSlot();
+    return usedSlots;
+}
+
+DeviceTypeList ControllerItem::ctrDeviceTypeList() const
+{
+     return mCtrType->deviceTypeList();
+}
+
+QStringList ControllerItem::ctrAllMediumIds (bool aShowDiffs) const
+{
+    QStringList allMediums;
+    foreach (const VBoxMedium &medium, vboxGlobal().currentMediaList())
+    {
+         foreach (const KDeviceType &deviceType, mCtrType->deviceTypeList())
+         {
+             if (medium.isNull() || medium.medium().GetDeviceType() == deviceType)
+             {
+                 /* In 'don't show diffs' mode we should only show hard-disks which are:
+                  * 1. Attached to 'current state' of this VM even if these are differencing disks.
+                  * 2. Not attached to this VM at all only if they are not differencing disks. */
+                 if (!aShowDiffs && medium.type() == VBoxDefs::MediumType_HardDisk)
+                 {
+                     if (medium.isAttachedInCurStateTo (parent()->machineId()) ||
+                         (!medium.medium().GetMachineIds().contains (parent()->machineId()) && !medium.parent()))
+                         allMediums << medium.id();
+                 }
+                 else allMediums << medium.id();
+                 break;
+             }
+         }
+    }
+    return allMediums;
+}
+
+QStringList ControllerItem::ctrUsedMediumIds() const
+{
+    QStringList usedImages;
+    for (int i = 0; i < mAttachments.size(); ++ i)
+    {
+        QString usedMediumId = static_cast <AttachmentItem*> (mAttachments [i])->attMediumId();
+        if (!vboxGlobal().findMedium (usedMediumId).isNull())
+            usedImages << usedMediumId;
+    }
+    return usedImages;
+}
+
+AbstractItem::ItemType ControllerItem::rtti() const
+{
+    return Type_ControllerItem;
+}
+
+AbstractItem* ControllerItem::childByPos (int aIndex)
+{
+    return mAttachments [aIndex];
+}
+
+AbstractItem* ControllerItem::childById (const QUuid &aId)
+{
+    for (int i = 0; i < childCount(); ++ i)
+        if (mAttachments [i]->id() == aId)
+            return mAttachments [i];
+    return 0;
+}
+
+int ControllerItem::posOfChild (AbstractItem *aItem) const
+{
+    return mAttachments.indexOf (aItem);
+}
+
+int ControllerItem::childCount() const
+{
+    return mAttachments.size();
+}
+
+QString ControllerItem::text() const
+{
+    return ctrName();
+}
+
+QString ControllerItem::tip() const
+{
+    return UIMachineSettingsStorage::tr ("<nobr><b>%1</b></nobr><br>"
+                                 "<nobr>Bus:&nbsp;&nbsp;%2</nobr><br>"
+                                 "<nobr>Type:&nbsp;&nbsp;%3</nobr>")
+                                 .arg (mCtrName)
+                                 .arg (vboxGlobal().toString (mCtrType->busType()))
+                                 .arg (vboxGlobal().toString (mCtrType->ctrType()));
+}
+
+QPixmap ControllerItem::pixmap (ItemState aState)
+{
+    return PixmapPool::pool()->pixmap (mCtrType->pixmap (aState));
+}
+
+void ControllerItem::addChild (AbstractItem *aItem)
+{
+    mAttachments << aItem;
+}
+
+void ControllerItem::delChild (AbstractItem *aItem)
+{
+    mAttachments.removeAll (aItem);
+}
+
+/* Attachment Item */
+AttachmentItem::AttachmentItem (AbstractItem *aParent, KDeviceType aDeviceType)
+    : AbstractItem (aParent)
+    , mAttDeviceType (aDeviceType)
+    , mAttIsShowDiffs (false)
+    , mAttIsHostDrive (false)
+    , mAttIsPassthrough (false)
+{
+    /* Check for proper parent type */
+    AssertMsg (mParent->rtti() == AbstractItem::Type_ControllerItem, ("Incorrect parent type!\n"));
+
+    /* Select default slot */
+    AssertMsg (!attSlots().isEmpty(), ("There should be at least one available slot!\n"));
+    mAttSlot = attSlots() [0];
+
+    /* Try to select unique medium for HD and empty medium for CD/FD device */
+    QStringList freeMediumIds (attMediumIds());
+    if (freeMediumIds.size() > 0)
+        setAttMediumId (freeMediumIds [0]);
+}
+
+StorageSlot AttachmentItem::attSlot() const
+{
+    return mAttSlot;
+}
+
+SlotsList AttachmentItem::attSlots() const
+{
+    ControllerItem *ctr = static_cast <ControllerItem*> (mParent);
+
+    /* Filter list from used slots */
+    SlotsList allSlots (ctr->ctrAllSlots());
+    SlotsList usedSlots (ctr->ctrUsedSlots());
+    foreach (StorageSlot usedSlot, usedSlots)
+        if (usedSlot != mAttSlot)
+            allSlots.removeAll (usedSlot);
+
+    return allSlots;
+}
+
+KDeviceType AttachmentItem::attDeviceType() const
+{
+    return mAttDeviceType;
+}
+
+DeviceTypeList AttachmentItem::attDeviceTypes() const
+{
+    return static_cast <ControllerItem*> (mParent)->ctrDeviceTypeList();
+}
+
+QString AttachmentItem::attMediumId() const
+{
+    return mAttMediumId;
+}
+
+QStringList AttachmentItem::attMediumIds (bool aFilter) const
+{
+    ControllerItem *ctr = static_cast <ControllerItem*> (mParent);
+    QStringList allMediumIds;
+
+    /* Populate list of suitable medium ids */
+    foreach (QString mediumId, ctr->ctrAllMediumIds (mAttIsShowDiffs))
+    {
+        VBoxMedium medium = vboxGlobal().findMedium (mediumId);
+        if ((medium.isNull() && mAttDeviceType != KDeviceType_HardDisk) ||
+            (!medium.isNull() && medium.medium().GetDeviceType() == mAttDeviceType))
+            allMediumIds << mediumId;
+    }
+
+    if (aFilter)
+    {
+        /* Filter list from used medium ids */
+        QStringList usedMediumIds (ctr->ctrUsedMediumIds());
+        foreach (QString usedMediumId, usedMediumIds)
+            if (usedMediumId != mAttMediumId)
+                allMediumIds.removeAll (usedMediumId);
+    }
+
+    return allMediumIds;
+}
+
+bool AttachmentItem::attIsShowDiffs() const
+{
+    return mAttIsShowDiffs;
+}
+
+bool AttachmentItem::attIsHostDrive() const
+{
+    return mAttIsHostDrive;
+}
+
+bool AttachmentItem::attIsPassthrough() const
+{
+    return mAttIsPassthrough;
+}
+
+void AttachmentItem::setAttSlot (const StorageSlot &aAttSlot)
+{
+    mAttSlot = aAttSlot;
+}
+
+void AttachmentItem::setAttDevice (KDeviceType aAttDeviceType)
+{
+    mAttDeviceType = aAttDeviceType;
+}
+
+void AttachmentItem::setAttMediumId (const QString &aAttMediumId)
+{
+    VBoxMedium medium;
+
+    /* Caching first available medium */
+    if (aAttMediumId == firstAvailableId && !attMediumIds (false).isEmpty())
+        medium = vboxGlobal().findMedium (attMediumIds (false) [0]);
+    /* Caching passed medium */
+    else if (!aAttMediumId.isEmpty())
+        medium = vboxGlobal().findMedium (aAttMediumId);
+
+    mAttMediumId = medium.id();
+    cache();
+}
+
+void AttachmentItem::setAttIsShowDiffs (bool aAttIsShowDiffs)
+{
+    mAttIsShowDiffs = aAttIsShowDiffs;
+    cache();
+}
+
+void AttachmentItem::setAttIsPassthrough (bool aIsAttPassthrough)
+{
+    mAttIsPassthrough = aIsAttPassthrough;
+}
+
+QString AttachmentItem::attSize() const
+{
+    return mAttSize;
+}
+
+QString AttachmentItem::attLogicalSize() const
+{
+    return mAttLogicalSize;
+}
+
+QString AttachmentItem::attLocation() const
+{
+    return mAttLocation;
+}
+
+QString AttachmentItem::attFormat() const
+{
+    return mAttFormat;
+}
+
+QString AttachmentItem::attUsage() const
+{
+    return mAttUsage;
+}
+
+void AttachmentItem::cache()
+{
+    VBoxMedium medium = vboxGlobal().findMedium (mAttMediumId);
+
+    /* Cache medium information */
+    mAttName = medium.name (!mAttIsShowDiffs);
+    mAttTip = medium.toolTipCheckRO (!mAttIsShowDiffs, mAttDeviceType != KDeviceType_HardDisk);
+    mAttPixmap = medium.iconCheckRO (!mAttIsShowDiffs);
+    mAttIsHostDrive = medium.isHostDrive();
+
+    /* Cache additional information */
+    mAttSize = medium.size (!mAttIsShowDiffs);
+    mAttLogicalSize = medium.logicalSize (!mAttIsShowDiffs);
+    mAttLocation = medium.location (!mAttIsShowDiffs);
+    mAttFormat = medium.isNull() ? QString ("--") :
+        QString ("%1 (%2)").arg (medium.hardDiskType (!mAttIsShowDiffs))
+                           .arg (medium.hardDiskFormat (!mAttIsShowDiffs));
+    mAttUsage = medium.usage (!mAttIsShowDiffs);
+
+    /* Fill empty attributes */
+    if (mAttUsage.isEmpty())
+        mAttUsage = QString ("--");
+}
+
+AbstractItem::ItemType AttachmentItem::rtti() const
+{
+    return Type_AttachmentItem;
+}
+
+AbstractItem* AttachmentItem::childByPos (int /* aIndex */)
+{
+    return 0;
+}
+
+AbstractItem* AttachmentItem::childById (const QUuid& /* aId */)
+{
+    return 0;
+}
+
+int AttachmentItem::posOfChild (AbstractItem* /* aItem */) const
+{
+    return 0;
+}
+
+int AttachmentItem::childCount() const
+{
+    return 0;
+}
+
+QString AttachmentItem::text() const
+{
+    return mAttName;
+}
+
+QString AttachmentItem::tip() const
+{
+    return mAttTip;
+}
+
+QPixmap AttachmentItem::pixmap (ItemState /* aState */)
+{
+    if (mAttPixmap.isNull())
+    {
+        switch (mAttDeviceType)
+        {
+            case KDeviceType_HardDisk:
+                mAttPixmap = PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentNormal);
+                break;
+            case KDeviceType_DVD:
+                mAttPixmap = PixmapPool::pool()->pixmap (PixmapPool::CDAttachmentNormal);
+                break;
+            case KDeviceType_Floppy:
+                mAttPixmap = PixmapPool::pool()->pixmap (PixmapPool::FDAttachmentNormal);
+                break;
+            default:
+                break;
+        }
+    }
+    return mAttPixmap;
+}
+
+void AttachmentItem::addChild (AbstractItem* /* aItem */)
+{
+}
+
+void AttachmentItem::delChild (AbstractItem* /* aItem */)
+{
+}
+
+/* Storage model */
+StorageModel::StorageModel (QObject *aParent)
+    : QAbstractItemModel (aParent)
+    , mRootItem (new RootItem)
+    , mToolTipType (DefaultToolTip)
+{
+}
+
+StorageModel::~StorageModel()
+{
+    delete mRootItem;
+}
+
+int StorageModel::rowCount (const QModelIndex &aParent) const
+{
+    return !aParent.isValid() ? 1 /* only root item has invalid parent */ :
+           static_cast <AbstractItem*> (aParent.internalPointer())->childCount();
+}
+
+int StorageModel::columnCount (const QModelIndex & /* aParent */) const
+{
+    return 1;
+}
+
+QModelIndex StorageModel::root() const
+{
+    return index (0, 0);
+}
+
+QModelIndex StorageModel::index (int aRow, int aColumn, const QModelIndex &aParent) const
+{
+    if (!hasIndex (aRow, aColumn, aParent))
+        return QModelIndex();
+
+    AbstractItem *item = !aParent.isValid() ? mRootItem :
+                         static_cast <AbstractItem*> (aParent.internalPointer())->childByPos (aRow);
+
+    return item ? createIndex (aRow, aColumn, item) : QModelIndex();
+}
+
+QModelIndex StorageModel::parent (const QModelIndex &aIndex) const
+{
+    if (!aIndex.isValid())
+        return QModelIndex();
+
+    AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer());
+    AbstractItem *parentOfItem = item->parent();
+    AbstractItem *parentOfParent = parentOfItem ? parentOfItem->parent() : 0;
+    int position = parentOfParent ? parentOfParent->posOfChild (parentOfItem) : 0;
+
+    if (parentOfItem)
+        return createIndex (position, 0, parentOfItem);
+    else
+        return QModelIndex();
+}
+
+QVariant StorageModel::data (const QModelIndex &aIndex, int aRole) const
+{
+    if (!aIndex.isValid())
+        return QVariant();
+
+    switch (aRole)
+    {
+        /* Basic Attributes: */
+        case Qt::FontRole:
+        {
+            return QVariant (qApp->font());
+        }
+        case Qt::SizeHintRole:
+        {
+            QFontMetrics fm (data (aIndex, Qt::FontRole).value <QFont>());
+            int minimumHeight = qMax (fm.height(), data (aIndex, R_IconSize).toInt());
+            int margin = data (aIndex, R_Margin).toInt();
+            return QSize (1 /* ignoring width */, 2 * margin + minimumHeight);
+        }
+        case Qt::ToolTipRole:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+            {
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                {
+                    QString tip (item->tip());
+                    switch (mToolTipType)
+                    {
+                        case ExpanderToolTip:
+                            if (aIndex.child (0, 0).isValid())
+                                tip = UIMachineSettingsStorage::tr ("<nobr>Expand/Collapse&nbsp;Item</nobr>");
+                            break;
+                        case HDAdderToolTip:
+                            tip = UIMachineSettingsStorage::tr ("<nobr>Add&nbsp;Hard&nbsp;Disk</nobr>");
+                            break;
+                        case CDAdderToolTip:
+                            tip = UIMachineSettingsStorage::tr ("<nobr>Add&nbsp;CD/DVD&nbsp;Device</nobr>");
+                            break;
+                        case FDAdderToolTip:
+                            tip = UIMachineSettingsStorage::tr ("<nobr>Add&nbsp;Floppy&nbsp;Device</nobr>");
+                            break;
+                        default:
+                            break;
+                    }
+                    return tip;
+                }
+                return item->tip();
+            }
+            return QString();
+        }
+
+        /* Advanced Attributes: */
+        case R_ItemId:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                return item->id().toString();
+            return QUuid().toString();
+        }
+        case R_ItemPixmap:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+            {
+                ItemState state = State_DefaultItem;
+                if (hasChildren (aIndex))
+                    if (QTreeView *view = qobject_cast <QTreeView*> (QObject::parent()))
+                        state = view->isExpanded (aIndex) ? State_ExpandedItem : State_CollapsedItem;
+                return item->pixmap (state);
+            }
+            return QPixmap();
+        }
+        case R_ItemPixmapRect:
+        {
+            int margin = data (aIndex, R_Margin).toInt();
+            int width = data (aIndex, R_IconSize).toInt();
+            return QRect (margin, margin, width, width);
+        }
+        case R_ItemName:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                return item->text();
+            return QString();
+        }
+        case R_ItemNamePoint:
+        {
+            int margin = data (aIndex, R_Margin).toInt();
+            int spacing = data (aIndex, R_Spacing).toInt();
+            int width = data (aIndex, R_IconSize).toInt();
+            QFontMetrics fm (data (aIndex, Qt::FontRole).value <QFont>());
+            QSize sizeHint = data (aIndex, Qt::SizeHintRole).toSize();
+            return QPoint (margin + width + 2 * spacing,
+                           sizeHint.height() / 2 + fm.ascent() / 2 - 1 /* base line */);
+        }
+        case R_ItemType:
+        {
+            QVariant result (QVariant::fromValue (AbstractItem::Type_InvalidItem));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                result.setValue (item->rtti());
+            return result;
+        }
+        case R_IsController:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                return item->rtti() == AbstractItem::Type_ControllerItem;
+            return false;
+        }
+        case R_IsAttachment:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                return item->rtti() == AbstractItem::Type_AttachmentItem;
+            return false;
+        }
+
+        case R_ToolTipType:
+        {
+            return QVariant::fromValue (mToolTipType);
+        }
+        case R_IsMoreIDEControllersPossible:
+        {
+            return static_cast <RootItem*> (mRootItem)->childCount (KStorageBus_IDE) <
+                   vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus (KStorageBus_IDE);
+        }
+        case R_IsMoreSATAControllersPossible:
+        {
+            return static_cast <RootItem*> (mRootItem)->childCount (KStorageBus_SATA) <
+                   vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus (KStorageBus_SATA);
+        }
+        case R_IsMoreSCSIControllersPossible:
+        {
+            return static_cast <RootItem*> (mRootItem)->childCount (KStorageBus_SCSI) <
+                   vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus (KStorageBus_SCSI);
+        }
+        case R_IsMoreFloppyControllersPossible:
+        {
+            return static_cast <RootItem*> (mRootItem)->childCount (KStorageBus_Floppy) <
+                   vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus (KStorageBus_Floppy);
+        }
+        case R_IsMoreSASControllersPossible:
+        {
+            return static_cast <RootItem*> (mRootItem)->childCount (KStorageBus_SAS) <
+                   vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus (KStorageBus_SAS);
+        }
+        case R_IsMoreAttachmentsPossible:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+            {
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                {
+                    ControllerItem *ctr = static_cast <ControllerItem*> (item);
+                    CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties();
+                    return (uint) rowCount (aIndex) < sp.GetMaxPortCountForStorageBus (ctr->ctrBusType()) *
+                                                      sp.GetMaxDevicesPerPortForStorageBus (ctr->ctrBusType());
+                }
+            }
+            return false;
+        }
+
+        case R_CtrName:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                    return static_cast <ControllerItem*> (item)->ctrName();
+            return QString();
+        }
+        case R_CtrType:
+        {
+            QVariant result (QVariant::fromValue (KStorageControllerType_Null));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                    result.setValue (static_cast <ControllerItem*> (item)->ctrType());
+            return result;
+        }
+        case R_CtrTypes:
+        {
+            QVariant result (QVariant::fromValue (ControllerTypeList()));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                    result.setValue (static_cast <ControllerItem*> (item)->ctrTypes());
+            return result;
+        }
+        case R_CtrDevices:
+        {
+            QVariant result (QVariant::fromValue (DeviceTypeList()));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                    result.setValue (static_cast <ControllerItem*> (item)->ctrDeviceTypeList());
+            return result;
+        }
+        case R_CtrBusType:
+        {
+            QVariant result (QVariant::fromValue (KStorageBus_Null));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                    result.setValue (static_cast <ControllerItem*> (item)->ctrBusType());
+            return result;
+        }
+        case R_CtrIoCache:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                    return static_cast <ControllerItem*> (item)->ctrUseIoCache();
+            return false;
+        }
+
+        case R_AttSlot:
+        {
+            QVariant result (QVariant::fromValue (StorageSlot()));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    result.setValue (static_cast <AttachmentItem*> (item)->attSlot());
+            return result;
+        }
+        case R_AttSlots:
+        {
+            QVariant result (QVariant::fromValue (SlotsList()));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    result.setValue (static_cast <AttachmentItem*> (item)->attSlots());
+            return result;
+        }
+        case R_AttDevice:
+        {
+            QVariant result (QVariant::fromValue (KDeviceType_Null));
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    result.setValue (static_cast <AttachmentItem*> (item)->attDeviceType());
+            return result;
+        }
+        case R_AttMediumId:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attMediumId();
+            return QString();
+        }
+        case R_AttIsShowDiffs:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attIsShowDiffs();
+            return false;
+        }
+        case R_AttIsHostDrive:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attIsHostDrive();
+            return false;
+        }
+        case R_AttIsPassthrough:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attIsPassthrough();
+            return false;
+        }
+        case R_AttSize:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attSize();
+            return QString();
+        }
+        case R_AttLogicalSize:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attLogicalSize();
+            return QString();
+        }
+        case R_AttLocation:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attLocation();
+            return QString();
+        }
+        case R_AttFormat:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attFormat();
+            return QString();
+        }
+        case R_AttUsage:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                    return static_cast <AttachmentItem*> (item)->attUsage();
+            return QString();
+        }
+        case R_Margin:
+        {
+            return 4;
+        }
+        case R_Spacing:
+        {
+            return 4;
+        }
+        case R_IconSize:
+        {
+            return 16;
+        }
+
+        case R_HDPixmapEn:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentNormal);
+        }
+        case R_CDPixmapEn:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::CDAttachmentNormal);
+        }
+        case R_FDPixmapEn:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::FDAttachmentNormal);
+        }
+
+        case R_HDPixmapAddEn:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddEn);
+        }
+        case R_HDPixmapAddDis:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddDis);
+        }
+        case R_CDPixmapAddEn:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::CDAttachmentAddEn);
+        }
+        case R_CDPixmapAddDis:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::CDAttachmentAddDis);
+        }
+        case R_FDPixmapAddEn:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::FDAttachmentAddEn);
+        }
+        case R_FDPixmapAddDis:
+        {
+            return PixmapPool::pool()->pixmap (PixmapPool::FDAttachmentAddDis);
+        }
+        case R_HDPixmapRect:
+        {
+            int margin = data (aIndex, R_Margin).toInt();
+            int width = data (aIndex, R_IconSize).toInt();
+            return QRect (0 - width - margin, margin, width, width);
+        }
+        case R_CDPixmapRect:
+        {
+            int margin = data (aIndex, R_Margin).toInt();
+            int spacing = data (aIndex, R_Spacing).toInt();
+            int width = data (aIndex, R_IconSize).toInt();
+            return QRect (0 - width - spacing - width - margin, margin, width, width);
+        }
+        case R_FDPixmapRect:
+        {
+            int margin = data (aIndex, R_Margin).toInt();
+            int width = data (aIndex, R_IconSize).toInt();
+            return QRect (0 - width - margin, margin, width, width);
+        }
+
+        default:
+            break;
+    }
+    return QVariant();
+}
+
+bool StorageModel::setData (const QModelIndex &aIndex, const QVariant &aValue, int aRole)
+{
+    if (!aIndex.isValid())
+        return QAbstractItemModel::setData (aIndex, aValue, aRole);
+
+    switch (aRole)
+    {
+        case R_ToolTipType:
+        {
+            mToolTipType = aValue.value <ToolTipType>();
+            emit dataChanged (aIndex, aIndex);
+            return true;
+        }
+        case R_CtrName:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                {
+                    static_cast <ControllerItem*> (item)->setCtrName (aValue.toString());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        case R_CtrType:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                {
+                    static_cast <ControllerItem*> (item)->setCtrType (aValue.value <KStorageControllerType>());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        case R_CtrIoCache:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_ControllerItem)
+                {
+                    static_cast <ControllerItem*> (item)->setCtrUseIoCache (aValue.toBool());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        case R_AttSlot:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                {
+                    static_cast <AttachmentItem*> (item)->setAttSlot (aValue.value <StorageSlot>());
+                    emit dataChanged (aIndex, aIndex);
+                    sort();
+                    return true;
+                }
+            return false;
+        }
+        case R_AttDevice:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                {
+                    static_cast <AttachmentItem*> (item)->setAttDevice (aValue.value <KDeviceType>());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        case R_AttMediumId:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                {
+                    static_cast <AttachmentItem*> (item)->setAttMediumId (aValue.toString());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        case R_AttIsShowDiffs:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                {
+                    static_cast <AttachmentItem*> (item)->setAttIsShowDiffs (aValue.toBool());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        case R_AttIsPassthrough:
+        {
+            if (AbstractItem *item = static_cast <AbstractItem*> (aIndex.internalPointer()))
+                if (item->rtti() == AbstractItem::Type_AttachmentItem)
+                {
+                    static_cast <AttachmentItem*> (item)->setAttIsPassthrough (aValue.toBool());
+                    emit dataChanged (aIndex, aIndex);
+                    return true;
+                }
+            return false;
+        }
+        default:
+            break;
+    }
+
+    return false;
+}
+
+QModelIndex StorageModel::addController (const QString &aCtrName, KStorageBus aBusType, KStorageControllerType aCtrType)
+{
+    beginInsertRows (root(), mRootItem->childCount(), mRootItem->childCount());
+    new ControllerItem (mRootItem, aCtrName, aBusType, aCtrType);
+    endInsertRows();
+    return index (mRootItem->childCount() - 1, 0, root());
+}
+
+void StorageModel::delController (const QUuid &aCtrId)
+{
+    if (AbstractItem *item = mRootItem->childById (aCtrId))
+    {
+        int itemPosition = mRootItem->posOfChild (item);
+        beginRemoveRows (root(), itemPosition, itemPosition);
+        delete item;
+        endRemoveRows();
+    }
+}
+
+QModelIndex StorageModel::addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType)
+{
+    if (AbstractItem *parent = mRootItem->childById (aCtrId))
+    {
+        int parentPosition = mRootItem->posOfChild (parent);
+        QModelIndex parentIndex = index (parentPosition, 0, root());
+        beginInsertRows (parentIndex, parent->childCount(), parent->childCount());
+        new AttachmentItem (parent, aDeviceType);
+        endInsertRows();
+        return index (parent->childCount() - 1, 0, parentIndex);
+    }
+    return QModelIndex();
+}
+
+void StorageModel::delAttachment (const QUuid &aCtrId, const QUuid &aAttId)
+{
+    if (AbstractItem *parent = mRootItem->childById (aCtrId))
+    {
+        int parentPosition = mRootItem->posOfChild (parent);
+        if (AbstractItem *item = parent->childById (aAttId))
+        {
+            int itemPosition = parent->posOfChild (item);
+            beginRemoveRows (index (parentPosition, 0, root()), itemPosition, itemPosition);
+            delete item;
+            endRemoveRows();
+        }
+    }
+}
+
+void StorageModel::setMachineId (const QString &aMachineId)
+{
+    mRootItem->setMachineId (aMachineId);
+}
+
+void StorageModel::sort(int /* iColumn */, Qt::SortOrder order)
+{
+    /* Count of controller items: */
+    int iItemLevel1Count = mRootItem->childCount();
+    /* For each of controller items: */
+    for (int iItemLevel1Pos = 0; iItemLevel1Pos < iItemLevel1Count; ++iItemLevel1Pos)
+    {
+        /* Get iterated controller item: */
+        AbstractItem *pItemLevel1 = mRootItem->childByPos(iItemLevel1Pos);
+        ControllerItem *pControllerItem = static_cast<ControllerItem*>(pItemLevel1);
+        /* Count of attachment items: */
+        int iItemLevel2Count = pItemLevel1->childCount();
+        /* Prepare empty list for sorted attachments: */
+        QList<AbstractItem*> newAttachments;
+        /* For each of attachment items: */
+        for (int iItemLevel2Pos = 0; iItemLevel2Pos < iItemLevel2Count; ++iItemLevel2Pos)
+        {
+            /* Get iterated attachment item: */
+            AbstractItem *pItemLevel2 = pItemLevel1->childByPos(iItemLevel2Pos);
+            AttachmentItem *pAttachmentItem = static_cast<AttachmentItem*>(pItemLevel2);
+            /* Get iterated attachment storage slot: */
+            StorageSlot attachmentSlot = pAttachmentItem->attSlot();
+            int iInsertPosition = 0;
+            for (; iInsertPosition < newAttachments.size(); ++iInsertPosition)
+            {
+                /* Get sorted attachment item: */
+                AbstractItem *pNewItemLevel2 = newAttachments[iInsertPosition];
+                AttachmentItem *pNewAttachmentItem = static_cast<AttachmentItem*>(pNewItemLevel2);
+                /* Get sorted attachment storage slot: */
+                StorageSlot newAttachmentSlot = pNewAttachmentItem->attSlot();
+                /* Apply sorting rule: */
+                if (((order == Qt::AscendingOrder) && (attachmentSlot < newAttachmentSlot)) ||
+                    ((order == Qt::DescendingOrder) && (attachmentSlot > newAttachmentSlot)))
+                    break;
+            }
+            /* Insert iterated attachment into sorted position: */
+            newAttachments.insert(iInsertPosition, pItemLevel2);
+        }
+
+        /* If that controller has attachments: */
+        if (iItemLevel2Count)
+        {
+            /* We should update corresponding model-indexes: */
+            QModelIndex controllerIndex = index(iItemLevel1Pos, 0, root());
+            pControllerItem->setAttachments(newAttachments);
+            /* That is actually beginMoveRows() + endMoveRows() which
+             * unfortunately become available only in Qt 4.6 version. */
+            beginRemoveRows(controllerIndex, 0, iItemLevel2Count - 1);
+            endRemoveRows();
+            beginInsertRows(controllerIndex, 0, iItemLevel2Count - 1);
+            endInsertRows();
+        }
+    }
+}
+
+QModelIndex StorageModel::attachmentBySlot(QModelIndex controllerIndex, StorageSlot attachmentStorageSlot)
+{
+    /* Check what parent model index is valid, set and of 'controller' type: */
+    AssertMsg(controllerIndex.isValid(), ("Controller index should be valid!\n"));
+    AbstractItem *pParentItem = static_cast<AbstractItem*>(controllerIndex.internalPointer());
+    AssertMsg(pParentItem, ("Parent item should be set!\n"));
+    AssertMsg(pParentItem->rtti() == AbstractItem::Type_ControllerItem, ("Parent item should be of 'controller' type!\n"));
+    NOREF(pParentItem);
+
+    /* Search for suitable attachment one by one: */
+    for (int i = 0; i < rowCount(controllerIndex); ++i)
+    {
+        QModelIndex curAttachmentIndex = index(i, 0, controllerIndex);
+        StorageSlot curAttachmentStorageSlot = data(curAttachmentIndex, R_AttSlot).value<StorageSlot>();
+        if (curAttachmentStorageSlot ==  attachmentStorageSlot)
+            return curAttachmentIndex;
+    }
+    return QModelIndex();
+}
+
+Qt::ItemFlags StorageModel::flags (const QModelIndex &aIndex) const
+{
+    return !aIndex.isValid() ? QAbstractItemModel::flags (aIndex) :
+           Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+}
+
+/* Storage Delegate */
+StorageDelegate::StorageDelegate (QObject *aParent)
+    : QItemDelegate (aParent)
+{
+}
+
+void StorageDelegate::paint (QPainter *aPainter, const QStyleOptionViewItem &aOption, const QModelIndex &aIndex) const
+{
+    if (!aIndex.isValid()) return;
+
+    /* Initialize variables */
+    QStyle::State state = aOption.state;
+    QRect rect = aOption.rect;
+    const StorageModel *model = qobject_cast <const StorageModel*> (aIndex.model());
+    Assert (model);
+
+    aPainter->save();
+
+    /* Draw item background */
+    QItemDelegate::drawBackground (aPainter, aOption, aIndex);
+
+    /* Setup foreground settings */
+    QPalette::ColorGroup cg = state & QStyle::State_Active ? QPalette::Active : QPalette::Inactive;
+    bool isSelected = state & QStyle::State_Selected;
+    bool isFocused = state & QStyle::State_HasFocus;
+    bool isGrayOnLoosingFocus = QApplication::style()->styleHint (QStyle::SH_ItemView_ChangeHighlightOnFocus, &aOption) != 0;
+    aPainter->setPen (aOption.palette.color (cg, isSelected && (isFocused || !isGrayOnLoosingFocus) ?
+                                             QPalette::HighlightedText : QPalette::Text));
+
+    aPainter->translate (rect.x(), rect.y());
+
+    /* Draw Item Pixmap */
+    aPainter->drawPixmap (model->data (aIndex, StorageModel::R_ItemPixmapRect).toRect().topLeft(),
+                          model->data (aIndex, StorageModel::R_ItemPixmap).value <QPixmap>());
+
+    /* Draw compressed item name */
+    int margin = model->data (aIndex, StorageModel::R_Margin).toInt();
+    int iconWidth = model->data (aIndex, StorageModel::R_IconSize).toInt();
+    int spacing = model->data (aIndex, StorageModel::R_Spacing).toInt();
+    QPoint textPosition = model->data (aIndex, StorageModel::R_ItemNamePoint).toPoint();
+    int textWidth = rect.width() - textPosition.x();
+    if (model->data (aIndex, StorageModel::R_IsController).toBool() && state & QStyle::State_Selected)
+    {
+        textWidth -= (2 * spacing + iconWidth + margin);
+        if (model->data (aIndex, StorageModel::R_CtrBusType).value <KStorageBus>() != KStorageBus_Floppy)
+            textWidth -= (spacing + iconWidth);
+    }
+    QString text (model->data (aIndex, StorageModel::R_ItemName).toString());
+    QString shortText (text);
+    QFont font = model->data (aIndex, Qt::FontRole).value <QFont>();
+    QFontMetrics fm (font);
+    while ((shortText.size() > 1) && (fm.width (shortText) + fm.width ("...") > textWidth))
+        shortText.truncate (shortText.size() - 1);
+    if (shortText != text)
+        shortText += "...";
+    aPainter->setFont (font);
+    aPainter->drawText (textPosition, shortText);
+
+    /* Draw Controller Additions */
+    if (model->data (aIndex, StorageModel::R_IsController).toBool() && state & QStyle::State_Selected)
+    {
+        DeviceTypeList devicesList (model->data (aIndex, StorageModel::R_CtrDevices).value <DeviceTypeList>());
+        for (int i = 0; i < devicesList.size(); ++ i)
+        {
+            KDeviceType deviceType = devicesList [i];
+
+            QRect deviceRect;
+            QPixmap devicePixmap;
+            switch (deviceType)
+            {
+                case KDeviceType_HardDisk:
+                {
+                    deviceRect = model->data (aIndex, StorageModel::R_HDPixmapRect).value <QRect>();
+                    devicePixmap = model->data (aIndex, StorageModel::R_IsMoreAttachmentsPossible).toBool() ?
+                                   model->data (aIndex, StorageModel::R_HDPixmapAddEn).value <QPixmap>() :
+                                   model->data (aIndex, StorageModel::R_HDPixmapAddDis).value <QPixmap>();
+                    break;
+                }
+                case KDeviceType_DVD:
+                {
+                    deviceRect = model->data (aIndex, StorageModel::R_CDPixmapRect).value <QRect>();
+                    devicePixmap = model->data (aIndex, StorageModel::R_IsMoreAttachmentsPossible).toBool() ?
+                                   model->data (aIndex, StorageModel::R_CDPixmapAddEn).value <QPixmap>() :
+                                   model->data (aIndex, StorageModel::R_CDPixmapAddDis).value <QPixmap>();
+                    break;
+                }
+                case KDeviceType_Floppy:
+                {
+                    deviceRect = model->data (aIndex, StorageModel::R_FDPixmapRect).value <QRect>();
+                    devicePixmap = model->data (aIndex, StorageModel::R_IsMoreAttachmentsPossible).toBool() ?
+                                   model->data (aIndex, StorageModel::R_FDPixmapAddEn).value <QPixmap>() :
+                                   model->data (aIndex, StorageModel::R_FDPixmapAddDis).value <QPixmap>();
+                    break;
+                }
+                default:
+                    break;
+            }
+
+            aPainter->drawPixmap (QPoint (rect.width() + deviceRect.x(), deviceRect.y()), devicePixmap);
+        }
+    }
+
+    aPainter->restore();
+
+    drawFocus (aPainter, aOption, rect);
+}
+
+/**
+ * QWidget class reimplementation.
+ * Used as HD Settings widget.
+ */
+UIMachineSettingsStorage::UIMachineSettingsStorage()
+    : mValidator(0)
+    , mStorageModel(0)
+    , mAddCtrAction(0), mDelCtrAction(0)
+    , mAddIDECtrAction(0), mAddSATACtrAction(0), mAddSCSICtrAction(0), mAddSASCtrAction(0), mAddFloppyCtrAction(0)
+    , mAddAttAction(0), mDelAttAction(0)
+    , mAddHDAttAction(0), mAddCDAttAction(0), mAddFDAttAction(0)
+    , mIsLoadingInProgress(0)
+    , mIsPolished(false)
+    , mDisableStaticControls(0)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsStorage::setupUi (this);
+
+    /* Initialize pixmap pool */
+    PixmapPool::pool (this);
+
+    /* Controller Actions */
+    mAddCtrAction = new QAction (this);
+    mAddCtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::ControllerAddEn),
+                                               PixmapPool::pool()->pixmap (PixmapPool::ControllerAddDis)));
+
+    mAddIDECtrAction = new QAction (this);
+    mAddIDECtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::IDEControllerAddEn),
+                                                  PixmapPool::pool()->pixmap (PixmapPool::IDEControllerAddDis)));
+
+    mAddSATACtrAction = new QAction (this);
+    mAddSATACtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::SATAControllerAddEn),
+                                                   PixmapPool::pool()->pixmap (PixmapPool::SATAControllerAddDis)));
+
+    mAddSCSICtrAction = new QAction (this);
+    mAddSCSICtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::SCSIControllerAddEn),
+                                                   PixmapPool::pool()->pixmap (PixmapPool::SCSIControllerAddDis)));
+
+    mAddFloppyCtrAction = new QAction (this);
+    mAddFloppyCtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::FloppyControllerAddEn),
+                                                     PixmapPool::pool()->pixmap (PixmapPool::FloppyControllerAddDis)));
+
+    mAddSASCtrAction = new QAction (this);
+    mAddSASCtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::SATAControllerAddEn),
+                                                  PixmapPool::pool()->pixmap (PixmapPool::SATAControllerAddDis)));
+
+    mDelCtrAction = new QAction (this);
+    mDelCtrAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::ControllerDelEn),
+                                               PixmapPool::pool()->pixmap (PixmapPool::ControllerDelDis)));
+
+    /* Attachment Actions */
+    mAddAttAction = new QAction (this);
+    mAddAttAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::AttachmentAddEn),
+                                               PixmapPool::pool()->pixmap (PixmapPool::AttachmentAddDis)));
+
+    mAddHDAttAction = new QAction (this);
+    mAddHDAttAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddEn),
+                                                 PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddDis)));
+
+    mAddCDAttAction = new QAction (this);
+    mAddCDAttAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::CDAttachmentAddEn),
+                                                 PixmapPool::pool()->pixmap (PixmapPool::CDAttachmentAddDis)));
+
+    mAddFDAttAction = new QAction (this);
+    mAddFDAttAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::FDAttachmentAddEn),
+                                                 PixmapPool::pool()->pixmap (PixmapPool::FDAttachmentAddDis)));
+
+    mDelAttAction = new QAction (this);
+    mDelAttAction->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::AttachmentDelEn),
+                                               PixmapPool::pool()->pixmap (PixmapPool::AttachmentDelDis)));
+
+    /* Storage Model/View */
+    mStorageModel = new StorageModel (mTwStorageTree);
+    StorageDelegate *storageDelegate = new StorageDelegate (mTwStorageTree);
+    mTwStorageTree->setMouseTracking (true);
+    mTwStorageTree->setContextMenuPolicy (Qt::CustomContextMenu);
+    mTwStorageTree->setModel (mStorageModel);
+    mTwStorageTree->setItemDelegate (storageDelegate);
+    mTwStorageTree->setRootIndex (mStorageModel->root());
+    mTwStorageTree->setCurrentIndex (mStorageModel->root());
+
+    /* Storage ToolBar */
+    mTbStorageBar->setIconSize (QSize (16, 16));
+    mTbStorageBar->addAction (mAddAttAction);
+    mTbStorageBar->addAction (mDelAttAction);
+    mTbStorageBar->addAction (mAddCtrAction);
+    mTbStorageBar->addAction (mDelCtrAction);
+
+#ifdef Q_WS_MAC
+    /* We need a little more space for the focus rect. */
+    mLtStorage->setContentsMargins (3, 0, 3, 0);
+    mLtStorage->setSpacing (3);
+#endif /* Q_WS_MAC */
+
+    /* Vdi Combo */
+    mCbVdi->setNullItemPresent (true);
+    mCbVdi->refresh();
+
+    /* Vmm Button */
+    mTbOpen->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::VMMEn),
+                                        PixmapPool::pool()->pixmap (PixmapPool::VMMDis)));
+    mTbNew->setIcon(UIIconPool::iconSet(PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddEn),
+                                        PixmapPool::pool()->pixmap (PixmapPool::HDAttachmentAddDis)));
+
+    /* Info Pane initialization */
+    mLbHDVirtualSizeValue->setFullSizeSelection (true);
+    mLbHDActualSizeValue->setFullSizeSelection (true);
+    mLbSizeValue->setFullSizeSelection (true);
+    mLbLocationValue->setFullSizeSelection (true);
+    mLbHDFormatValue->setFullSizeSelection (true);
+    mLbUsageValue->setFullSizeSelection (true);
+
+    /* Setup connections */
+    connect (&vboxGlobal(), SIGNAL (mediumEnumerated (const VBoxMedium &)),
+             this, SLOT (mediumUpdated (const VBoxMedium &)));
+    connect (&vboxGlobal(), SIGNAL (mediumUpdated (const VBoxMedium &)),
+             this, SLOT (mediumUpdated (const VBoxMedium &)));
+    connect (&vboxGlobal(), SIGNAL (mediumRemoved (VBoxDefs::MediumType, const QString &)),
+             this, SLOT (mediumRemoved (VBoxDefs::MediumType, const QString &)));
+    connect (mAddCtrAction, SIGNAL (triggered (bool)), this, SLOT (addController()));
+    connect (mAddIDECtrAction, SIGNAL (triggered (bool)), this, SLOT (addIDEController()));
+    connect (mAddSATACtrAction, SIGNAL (triggered (bool)), this, SLOT (addSATAController()));
+    connect (mAddSCSICtrAction, SIGNAL (triggered (bool)), this, SLOT (addSCSIController()));
+    connect (mAddSASCtrAction, SIGNAL (triggered (bool)), this, SLOT (addSASController()));
+    connect (mAddFloppyCtrAction, SIGNAL (triggered (bool)), this, SLOT (addFloppyController()));
+    connect (mDelCtrAction, SIGNAL (triggered (bool)), this, SLOT (delController()));
+    connect (mAddAttAction, SIGNAL (triggered (bool)), this, SLOT (addAttachment()));
+    connect (mAddHDAttAction, SIGNAL (triggered (bool)), this, SLOT (addHDAttachment()));
+    connect (mAddCDAttAction, SIGNAL (triggered (bool)), this, SLOT (addCDAttachment()));
+    connect (mAddFDAttAction, SIGNAL (triggered (bool)), this, SLOT (addFDAttachment()));
+    connect (mDelAttAction, SIGNAL (triggered (bool)), this, SLOT (delAttachment()));
+    connect (mStorageModel, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
+             this, SLOT (onRowInserted (const QModelIndex&, int)));
+    connect (mStorageModel, SIGNAL (rowsRemoved (const QModelIndex&, int, int)),
+             this, SLOT (onRowRemoved()));
+    connect (mTwStorageTree, SIGNAL (currentItemChanged (const QModelIndex&, const QModelIndex&)),
+             this, SLOT (onCurrentItemChanged()));
+    connect (mTwStorageTree, SIGNAL (customContextMenuRequested (const QPoint&)),
+             this, SLOT (onContextMenuRequested (const QPoint&)));
+    connect (mTwStorageTree, SIGNAL (drawItemBranches (QPainter*, const QRect&, const QModelIndex&)),
+             this, SLOT (onDrawItemBranches (QPainter *, const QRect &, const QModelIndex &)));
+    connect (mTwStorageTree, SIGNAL (mouseMoved (QMouseEvent*)),
+             this, SLOT (onMouseMoved (QMouseEvent*)));
+    connect (mTwStorageTree, SIGNAL (mousePressed (QMouseEvent*)),
+             this, SLOT (onMouseClicked (QMouseEvent*)));
+    connect (mTwStorageTree, SIGNAL (mouseDoubleClicked (QMouseEvent*)),
+             this, SLOT (onMouseClicked (QMouseEvent*)));
+    connect (mLeName, SIGNAL (textEdited (const QString&)), this, SLOT (setInformation()));
+    connect (mCbType, SIGNAL (activated (int)), this, SLOT (setInformation()));
+    connect (mCbSlot, SIGNAL (activated (int)), this, SLOT (setInformation()));
+    connect (mCbIoCache, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
+    connect (mCbVdi, SIGNAL (activated (int)), this, SLOT (setInformation()));
+    connect (mTbOpen, SIGNAL (clicked (bool)), this, SLOT (sltOpenMedium()));
+    connect (mTbNew, SIGNAL (clicked (bool)), this, SLOT (sltNewMedium()));
+    connect (mCbShowDiffs, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
+    connect (mCbPassthrough, SIGNAL (stateChanged (int)), this, SLOT (setInformation()));
+
+    /* Update actions */
+    updateActionsState();
+
+    /* Applying language settings */
+    retranslateUi();
+
+    /* Initial setup */
+    setMinimumWidth (500);
+    mSplitter->setSizes (QList<int>() << (int) (0.45 * minimumWidth()) << (int) (0.55 * minimumWidth()));
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsStorage::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    m_cache.m_strMachineId = m_machine.GetId();
+    /* Load controllers list: */
+    const CStorageControllerVector &controllers = m_machine.GetStorageControllers();
+    for (int iControllerIndex = 0; iControllerIndex < controllers.size(); ++iControllerIndex)
+    {
+        /* Prepare controller item: */
+        const CStorageController &controller = controllers[iControllerIndex];
+        UIStorageControllerData controllerData;
+        controllerData.m_strControllerName = controller.GetName();
+        controllerData.m_controllerBus = controller.GetBus();
+        controllerData.m_controllerType = controller.GetControllerType();
+        controllerData.m_fUseHostIOCache = controller.GetUseHostIOCache();
+        /* Load attachments list: */
+        const CMediumAttachmentVector &attachments = m_machine.GetMediumAttachmentsOfController(controllerData.m_strControllerName);
+        for (int iAttachmentIndex = 0; iAttachmentIndex < attachments.size(); ++iAttachmentIndex)
+        {
+            /* Prepare attachment item: */
+            const CMediumAttachment &attachment = attachments[iAttachmentIndex];
+            UIStorageAttachmentData attachmentData;
+            attachmentData.m_attachmentType = attachment.GetType();
+            attachmentData.m_iAttachmentPort = attachment.GetPort();
+            attachmentData.m_iAttachmentDevice = attachment.GetDevice();
+            attachmentData.m_fAttachmentPassthrough = attachment.GetPassthrough();
+            CMedium comMedium(attachment.GetMedium());
+            VBoxMedium vboxMedium;
+            vboxGlobal().findMedium(comMedium, vboxMedium);
+            attachmentData.m_strAttachmentMediumId = vboxMedium.id();
+            controllerData.m_items << attachmentData;
+        }
+        m_cache.m_items << controllerData;
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsStorage::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    mCbVdi->setMachineId(m_cache.m_strMachineId);
+    mStorageModel->setMachineId(m_cache.m_strMachineId);
+    for (int iControllerIndex = 0; iControllerIndex < m_cache.m_items.size(); ++iControllerIndex)
+    {
+        /* Get iterated controller: */
+        const UIStorageControllerData &controllerData = m_cache.m_items[iControllerIndex];
+        QModelIndex controllerIndex = mStorageModel->addController(controllerData.m_strControllerName,
+                                                                   controllerData.m_controllerBus,
+                                                                   controllerData.m_controllerType);
+        QUuid controllerId = QUuid(mStorageModel->data(controllerIndex, StorageModel::R_ItemId).toString());
+        mStorageModel->setData(controllerIndex, controllerData.m_fUseHostIOCache, StorageModel::R_CtrIoCache);
+        for (int iAttachmentIndex = 0; iAttachmentIndex < controllerData.m_items.size(); ++iAttachmentIndex)
+        {
+            /* Get iterated attachment: */
+            const UIStorageAttachmentData &attachmentData = controllerData.m_items[iAttachmentIndex];
+            QModelIndex attachmentIndex = mStorageModel->addAttachment(controllerId, attachmentData.m_attachmentType);
+            StorageSlot attachmentStorageSlot(controllerData.m_controllerBus,
+                                              attachmentData.m_iAttachmentPort,
+                                              attachmentData.m_iAttachmentDevice);
+            mStorageModel->setData(attachmentIndex, QVariant::fromValue(attachmentStorageSlot), StorageModel::R_AttSlot);
+            mStorageModel->setData(attachmentIndex, attachmentData.m_fAttachmentPassthrough, StorageModel::R_AttIsPassthrough);
+            mStorageModel->setData(attachmentIndex, attachmentData.m_strAttachmentMediumId, StorageModel::R_AttMediumId);
+        }
+    }
+    /* Set the first controller as current if present */
+    if (mStorageModel->rowCount(mStorageModel->root()) > 0)
+        mTwStorageTree->setCurrentIndex(mStorageModel->index(0, 0, mStorageModel->root()));
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsStorage::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    m_cache.m_items.clear();
+    QModelIndex rootIndex = mStorageModel->root();
+    for (int iControllerIndex = 0; iControllerIndex < mStorageModel->rowCount(rootIndex); ++iControllerIndex)
+    {
+        QModelIndex controllerIndex = mStorageModel->index(iControllerIndex, 0, rootIndex);
+        UIStorageControllerData controllerData;
+        controllerData.m_strControllerName = mStorageModel->data(controllerIndex, StorageModel::R_CtrName).toString();
+        controllerData.m_controllerBus = mStorageModel->data(controllerIndex, StorageModel::R_CtrBusType).value<KStorageBus>();
+        controllerData.m_controllerType = mStorageModel->data(controllerIndex, StorageModel::R_CtrType).value<KStorageControllerType>();
+        controllerData.m_fUseHostIOCache = mStorageModel->data(controllerIndex, StorageModel::R_CtrIoCache).toBool();
+        for (int iAttachmentIndex = 0; iAttachmentIndex < mStorageModel->rowCount(controllerIndex); ++iAttachmentIndex)
+        {
+            QModelIndex attachmentIndex = mStorageModel->index(iAttachmentIndex, 0, controllerIndex);
+            UIStorageAttachmentData attachmentData;
+            attachmentData.m_attachmentType = mStorageModel->data(attachmentIndex, StorageModel::R_AttDevice).value<KDeviceType>();
+            StorageSlot attachmentSlot = mStorageModel->data(attachmentIndex, StorageModel::R_AttSlot).value<StorageSlot>();
+            attachmentData.m_iAttachmentPort = attachmentSlot.port;
+            attachmentData.m_iAttachmentDevice = attachmentSlot.device;
+            attachmentData.m_fAttachmentPassthrough = mStorageModel->data(attachmentIndex, StorageModel::R_AttIsPassthrough).toBool();
+            attachmentData.m_strAttachmentMediumId = mStorageModel->data(attachmentIndex, StorageModel::R_AttMediumId).toString();
+            controllerData.m_items << attachmentData;
+        }
+        m_cache.m_items << controllerData;
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsStorage::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Remove currently present controllers & attachments */
+    const CStorageControllerVector &controllers = m_machine.GetStorageControllers();
+    for (int iControllerIndex = 0; iControllerIndex < controllers.size(); ++iControllerIndex)
+    {
+        const CStorageController &controller = controllers[iControllerIndex];
+        QString strControllerName(controller.GetName());
+        const CMediumAttachmentVector &attachments = m_machine.GetMediumAttachmentsOfController(strControllerName);
+        for (int iAttachmentIndex = 0; iAttachmentIndex < attachments.size(); ++iAttachmentIndex)
+        {
+            const CMediumAttachment &attachment = attachments[iAttachmentIndex];
+            m_machine.DetachDevice(strControllerName, attachment.GetPort(), attachment.GetDevice());
+        }
+        m_machine.RemoveStorageController(strControllerName);
+    }
+    /* Save created controllers: */
+    for (int iControllerIndex = 0; iControllerIndex < m_cache.m_items.size(); ++iControllerIndex)
+    {
+        const UIStorageControllerData &controllerData = m_cache.m_items[iControllerIndex];
+        CStorageController controller = m_machine.AddStorageController(controllerData.m_strControllerName, controllerData.m_controllerBus);
+        controller.SetControllerType(controllerData.m_controllerType);
+        controller.SetUseHostIOCache(controllerData.m_fUseHostIOCache);
+        int cMaxUsedPort = -1;
+        /* Save created attachments: */
+        for (int iAttachmentIndex = 0; iAttachmentIndex < controllerData.m_items.size(); ++iAttachmentIndex)
+        {
+            const UIStorageAttachmentData &attachmentData = controllerData.m_items[iAttachmentIndex];
+            VBoxMedium vboxMedium = vboxGlobal().findMedium(attachmentData.m_strAttachmentMediumId);
+            CMedium comMedium = vboxMedium.medium();
+            m_machine.AttachDevice(controllerData.m_strControllerName,
+                                   attachmentData.m_iAttachmentPort, attachmentData.m_iAttachmentDevice,
+                                   attachmentData.m_attachmentType, comMedium);
+            if (m_machine.isOk())
+            {
+                if (attachmentData.m_attachmentType == KDeviceType_DVD)
+                    m_machine.PassthroughDevice(controllerData.m_strControllerName,
+                                                attachmentData.m_iAttachmentPort, attachmentData.m_iAttachmentDevice,
+                                                attachmentData.m_fAttachmentPassthrough);
+                cMaxUsedPort = attachmentData.m_iAttachmentPort > cMaxUsedPort ? attachmentData.m_iAttachmentPort : cMaxUsedPort;
+            }
+            else
+            {
+                // TODO: Fix problem reporter!
+                //vboxProblem().cannotAttachDevice(this, m_machine, VBoxDefs::MediumType_HardDisk, vboxMedium.location(),
+                //                                 controllerData.m_controllerBus, attachmentData.m_iAttachmentPort, attachmentData.m_iAttachmentDevice);
+            }
+        }
+        if (controllerData.m_controllerBus == KStorageBus_SATA)
+        {
+            ULONG uSataPortsCount = cMaxUsedPort + 1;
+            uSataPortsCount = qMax(uSataPortsCount, controller.GetMinPortCount());
+            uSataPortsCount = qMin(uSataPortsCount, controller.GetMaxPortCount());
+            controller.SetPortCount(uSataPortsCount);
+        }
+    }
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsStorage::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+}
+
+bool UIMachineSettingsStorage::revalidate (QString &aWarning, QString &)
+{
+    QModelIndex rootIndex = mStorageModel->root();
+    QMap <QString, QString> config;
+    for (int i = 0; i < mStorageModel->rowCount (rootIndex); ++ i)
+    {
+        QModelIndex ctrIndex = rootIndex.child (i, 0);
+        QString ctrName = mStorageModel->data (ctrIndex, StorageModel::R_CtrName).toString();
+        for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j)
+        {
+            QModelIndex attIndex = ctrIndex.child (j, 0);
+            StorageSlot attSlot = mStorageModel->data (attIndex, StorageModel::R_AttSlot).value <StorageSlot>();
+            KDeviceType attDevice = mStorageModel->data (attIndex, StorageModel::R_AttDevice).value <KDeviceType>();
+            QString key (mStorageModel->data (attIndex, StorageModel::R_AttMediumId).toString());
+            QString value (QString ("%1 (%2)").arg (ctrName, vboxGlobal().toString (attSlot)));
+            /* Check for emptiness */
+            if (vboxGlobal().findMedium (key).isNull() && attDevice == KDeviceType_HardDisk)
+            {
+                aWarning = tr ("No hard disk is selected for <i>%1</i>.").arg (value);
+                return aWarning.isNull();
+            }
+            /* Check for coincidence */
+            if (!vboxGlobal().findMedium (key).isNull() && config.contains (key))
+            {
+                aWarning = tr ("<i>%1</i> uses a medium that is already attached to <i>%2</i>.")
+                              .arg (value).arg (config [key]);
+                return aWarning.isNull();
+            }
+            else config.insert (key, value);
+        }
+    }
+    return aWarning.isNull();
+}
+
+void UIMachineSettingsStorage::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsStorage::retranslateUi (this);
+
+    mAddCtrAction->setShortcut (QKeySequence ("Ins"));
+    mDelCtrAction->setShortcut (QKeySequence ("Del"));
+    mAddAttAction->setShortcut (QKeySequence ("+"));
+    mDelAttAction->setShortcut (QKeySequence ("-"));
+
+    mAddCtrAction->setText (tr ("Add Controller"));
+    mAddIDECtrAction->setText (tr ("Add IDE Controller"));
+    mAddSATACtrAction->setText (tr ("Add SATA Controller"));
+    mAddSCSICtrAction->setText (tr ("Add SCSI Controller"));
+    mAddSASCtrAction->setText (tr ("Add SAS Controller"));
+    mAddFloppyCtrAction->setText (tr ("Add Floppy Controller"));
+    mDelCtrAction->setText (tr ("Remove Controller"));
+    mAddAttAction->setText (tr ("Add Attachment"));
+    mAddHDAttAction->setText (tr ("Add Hard Disk"));
+    mAddCDAttAction->setText (tr ("Add CD/DVD Device"));
+    mAddFDAttAction->setText (tr ("Add Floppy Device"));
+    mDelAttAction->setText (tr ("Remove Attachment"));
+
+    mAddCtrAction->setWhatsThis (tr ("Adds a new controller to the end of the Storage Tree."));
+    mDelCtrAction->setWhatsThis (tr ("Removes the controller highlighted in the Storage Tree."));
+    mAddAttAction->setWhatsThis (tr ("Adds a new attachment to the Storage Tree using "
+                                     "currently selected controller as parent."));
+    mDelAttAction->setWhatsThis (tr ("Removes the attachment highlighted in the Storage Tree."));
+
+    mAddCtrAction->setToolTip (QString ("<nobr>%1&nbsp;(%2)")
+                               .arg (mAddCtrAction->text().remove ('&'))
+                               .arg (mAddCtrAction->shortcut().toString()));
+    mDelCtrAction->setToolTip (QString ("<nobr>%1&nbsp;(%2)")
+                               .arg (mDelCtrAction->text().remove ('&'))
+                               .arg (mDelCtrAction->shortcut().toString()));
+    mAddAttAction->setToolTip (QString ("<nobr>%1&nbsp;(%2)")
+                               .arg (mAddAttAction->text().remove ('&'))
+                               .arg (mAddAttAction->shortcut().toString()));
+    mDelAttAction->setToolTip (QString ("<nobr>%1&nbsp;(%2)")
+                               .arg (mDelAttAction->text().remove ('&'))
+                               .arg (mDelAttAction->shortcut().toString()));
+}
+
+void UIMachineSettingsStorage::showEvent (QShowEvent *aEvent)
+{
+    if (!mIsPolished)
+    {
+        /* Enumerate Mediums */
+        vboxGlobal().startEnumeratingMedia();
+
+        mIsPolished = true;
+
+        /* First column indent */
+        mLtEmpty->setColumnMinimumWidth (0, 10);
+        mLtController->setColumnMinimumWidth (0, 10);
+        mLtAttachment->setColumnMinimumWidth (0, 10);
+#if 0
+        /* Second column indent minimum width */
+        QList <QLabel*> labelsList;
+        labelsList << mLbSlot << mLbVdi
+                   << mLbHDVirtualSize << mLbHDActualSize << mLbSize
+                   << mLbLocation << mLbHDFormat << mLbUsage;
+        int maxWidth = 0;
+        QFontMetrics metrics (font());
+        foreach (QLabel *label, labelsList)
+        {
+            int width = metrics.width (label->text());
+            maxWidth = width > maxWidth ? width : maxWidth;
+        }
+        mLtAttachment->setColumnMinimumWidth (1, maxWidth);
+#endif
+    }
+    UISettingsPage::showEvent (aEvent);
+}
+
+void UIMachineSettingsStorage::mediumUpdated (const VBoxMedium &aMedium)
+{
+    QModelIndex rootIndex = mStorageModel->root();
+    for (int i = 0; i < mStorageModel->rowCount (rootIndex); ++ i)
+    {
+        QModelIndex ctrIndex = rootIndex.child (i, 0);
+        for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j)
+        {
+            QModelIndex attIndex = ctrIndex.child (j, 0);
+            QString attMediumId = mStorageModel->data (attIndex, StorageModel::R_AttMediumId).toString();
+            if (attMediumId == aMedium.id())
+            {
+                mStorageModel->setData (attIndex, attMediumId, StorageModel::R_AttMediumId);
+                if (mValidator) mValidator->revalidate();
+            }
+        }
+    }
+}
+
+void UIMachineSettingsStorage::mediumRemoved (VBoxDefs::MediumType /* aType */, const QString &aMediumId)
+{
+    QModelIndex rootIndex = mStorageModel->root();
+    for (int i = 0; i < mStorageModel->rowCount (rootIndex); ++ i)
+    {
+        QModelIndex ctrIndex = rootIndex.child (i, 0);
+        for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j)
+        {
+            QModelIndex attIndex = ctrIndex.child (j, 0);
+            QString attMediumId = mStorageModel->data (attIndex, StorageModel::R_AttMediumId).toString();
+            if (attMediumId == aMediumId)
+            {
+                mStorageModel->setData (attIndex, firstAvailableId, StorageModel::R_AttMediumId);
+                if (mValidator) mValidator->revalidate();
+            }
+        }
+    }
+}
+
+void UIMachineSettingsStorage::addController()
+{
+    QMenu menu;
+    menu.addAction (mAddIDECtrAction);
+    menu.addAction (mAddSATACtrAction);
+    menu.addAction (mAddSCSICtrAction);
+    menu.addAction (mAddSASCtrAction);
+    menu.addAction (mAddFloppyCtrAction);
+    menu.exec (QCursor::pos());
+}
+
+void UIMachineSettingsStorage::addIDEController()
+{
+    addControllerWrapper (generateUniqueName (tr ("IDE Controller")), KStorageBus_IDE, KStorageControllerType_PIIX4);
+}
+
+void UIMachineSettingsStorage::addSATAController()
+{
+    addControllerWrapper (generateUniqueName (tr ("SATA Controller")), KStorageBus_SATA, KStorageControllerType_IntelAhci);
+}
+
+void UIMachineSettingsStorage::addSCSIController()
+{
+    addControllerWrapper (generateUniqueName (tr ("SCSI Controller")), KStorageBus_SCSI, KStorageControllerType_LsiLogic);
+}
+
+void UIMachineSettingsStorage::addFloppyController()
+{
+    addControllerWrapper (generateUniqueName (tr ("Floppy Controller")), KStorageBus_Floppy, KStorageControllerType_I82078);
+}
+
+void UIMachineSettingsStorage::addSASController()
+{
+    addControllerWrapper (generateUniqueName (tr ("SAS Controller")), KStorageBus_SAS, KStorageControllerType_LsiLogicSas);
+}
+
+void UIMachineSettingsStorage::delController()
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+    if (!mStorageModel->data (index, StorageModel::R_IsController).toBool()) return;
+
+    mStorageModel->delController (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()));
+    emit storageChanged();
+    if (mValidator) mValidator->revalidate();
+}
+
+void UIMachineSettingsStorage::addAttachment()
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+    Assert (mStorageModel->data (index, StorageModel::R_IsController).toBool());
+
+    DeviceTypeList deviceTypeList (mStorageModel->data (index, StorageModel::R_CtrDevices).value <DeviceTypeList>());
+    bool justTrigger = deviceTypeList.size() == 1;
+    bool showMenu = deviceTypeList.size() > 1;
+    QMenu menu;
+    foreach (const KDeviceType &deviceType, deviceTypeList)
+    {
+        switch (deviceType)
+        {
+            case KDeviceType_HardDisk:
+                if (justTrigger)
+                    mAddHDAttAction->trigger();
+                if (showMenu)
+                    menu.addAction (mAddHDAttAction);
+                break;
+            case KDeviceType_DVD:
+                if (justTrigger)
+                    mAddCDAttAction->trigger();
+                if (showMenu)
+                    menu.addAction (mAddCDAttAction);
+                break;
+            case KDeviceType_Floppy:
+                if (justTrigger)
+                    mAddFDAttAction->trigger();
+                if (showMenu)
+                    menu.addAction (mAddFDAttAction);
+                break;
+            default:
+                break;
+        }
+    }
+    if (showMenu)
+        menu.exec (QCursor::pos());
+}
+
+void UIMachineSettingsStorage::addHDAttachment()
+{
+    addAttachmentWrapper (KDeviceType_HardDisk);
+}
+
+void UIMachineSettingsStorage::addCDAttachment()
+{
+    addAttachmentWrapper (KDeviceType_DVD);
+}
+
+void UIMachineSettingsStorage::addFDAttachment()
+{
+    addAttachmentWrapper (KDeviceType_Floppy);
+}
+
+void UIMachineSettingsStorage::delAttachment()
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+
+    KDeviceType device = mStorageModel->data (index, StorageModel::R_AttDevice).value <KDeviceType>();
+    /* Check if this would be the last DVD. If so let the user confirm this again. */
+    if (   device == KDeviceType_DVD
+        && deviceCount (KDeviceType_DVD) == 1)
+    {
+        if (vboxProblem().confirmRemovingOfLastDVDDevice() != QIMessageBox::Ok)
+            return;
+    }
+
+    QModelIndex parent = index.parent();
+    if (!index.isValid() || !parent.isValid() ||
+        !mStorageModel->data (index, StorageModel::R_IsAttachment).toBool() ||
+        !mStorageModel->data (parent, StorageModel::R_IsController).toBool())
+        return;
+
+    mStorageModel->delAttachment (QUuid (mStorageModel->data (parent, StorageModel::R_ItemId).toString()),
+                                  QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()));
+    emit storageChanged();
+    if (mValidator) mValidator->revalidate();
+}
+
+void UIMachineSettingsStorage::getInformation()
+{
+    mIsLoadingInProgress = true;
+
+    QModelIndex index = mTwStorageTree->currentIndex();
+    if (!index.isValid() || index == mStorageModel->root())
+    {
+        /* Showing Initial Page */
+        mSwRightPane->setCurrentIndex (0);
+    }
+    else
+    {
+        switch (mStorageModel->data (index, StorageModel::R_ItemType).value <AbstractItem::ItemType>())
+        {
+            case AbstractItem::Type_ControllerItem:
+            {
+                /* Getting Controller Name */
+                mLeName->setText (mStorageModel->data (index, StorageModel::R_CtrName).toString());
+
+                /* Getting Controller Sub type */
+                mCbType->clear();
+                ControllerTypeList controllerTypeList (mStorageModel->data (index, StorageModel::R_CtrTypes).value <ControllerTypeList>());
+                for (int i = 0; i < controllerTypeList.size(); ++ i)
+                    mCbType->insertItem (mCbType->count(), vboxGlobal().toString (controllerTypeList [i]));
+                KStorageControllerType type = mStorageModel->data (index, StorageModel::R_CtrType).value <KStorageControllerType>();
+                int ctrPos = mCbType->findText (vboxGlobal().toString (type));
+                mCbType->setCurrentIndex (ctrPos == -1 ? 0 : ctrPos);
+
+                bool isUseIoCache = mStorageModel->data (index, StorageModel::R_CtrIoCache).toBool();
+                mCbIoCache->setChecked(isUseIoCache);
+
+                /* Showing Controller Page */
+                mSwRightPane->setCurrentIndex (1);
+                break;
+            }
+            case AbstractItem::Type_AttachmentItem:
+            {
+                /* Getting Attachment Slot */
+                mCbSlot->clear();
+                SlotsList slotsList (mStorageModel->data (index, StorageModel::R_AttSlots).value <SlotsList>());
+                for (int i = 0; i < slotsList.size(); ++ i)
+                    mCbSlot->insertItem (mCbSlot->count(), vboxGlobal().toString (slotsList [i]));
+                StorageSlot slt = mStorageModel->data (index, StorageModel::R_AttSlot).value <StorageSlot>();
+                int attSlotPos = mCbSlot->findText (vboxGlobal().toString (slt));
+                mCbSlot->setCurrentIndex (attSlotPos == -1 ? 0 : attSlotPos);
+                mCbSlot->setToolTip (mCbSlot->itemText (mCbSlot->currentIndex()));
+
+                /* Getting Show Diffs state */
+                bool isShowDiffs = mStorageModel->data (index, StorageModel::R_AttIsShowDiffs).toBool();
+                mCbShowDiffs->setChecked (isShowDiffs);
+
+                /* Getting Attachment Medium */
+                KDeviceType device = mStorageModel->data (index, StorageModel::R_AttDevice).value <KDeviceType>();
+                switch (device)
+                {
+                    case KDeviceType_HardDisk:
+                        mLbVdi->setText(tr("Hard &Disk:"));
+                        mTbOpen->setWhatsThis(tr("Open hard disk image file using file-open dialog."));
+                        mTbOpen->setToolTip(tr("Open hard disk image file"));
+                        mTbNew->setVisible(true);
+                        break;
+                    case KDeviceType_DVD:
+                        mLbVdi->setText(tr("&CD/DVD Device:"));
+                        mTbOpen->setWhatsThis(tr("Open CD/DVD image file using file-open dialog."));
+                        mTbOpen->setToolTip(tr("Open CD/DVD image file"));
+                        mTbNew->setVisible(false);
+                        break;
+                    case KDeviceType_Floppy:
+                        mLbVdi->setText(tr("&Floppy Device:"));
+                        mTbOpen->setWhatsThis(tr("Open floppy image file using file-open dialog."));
+                        mTbOpen->setToolTip(tr("Open floppy image file"));
+                        mTbNew->setVisible(false);
+                        break;
+                    default:
+                        break;
+                }
+                mCbVdi->setType (typeToLocal (device));
+                mCbVdi->setShowDiffs (isShowDiffs);
+                mCbVdi->setCurrentItem (mStorageModel->data (index, StorageModel::R_AttMediumId).toString());
+                mCbVdi->refresh();
+
+                /* Getting Passthrough state */
+                bool isHostDrive = mStorageModel->data (index, StorageModel::R_AttIsHostDrive).toBool();
+                mCbPassthrough->setEnabled (isHostDrive);
+                mCbPassthrough->setChecked (isHostDrive && mStorageModel->data (index, StorageModel::R_AttIsPassthrough).toBool());
+
+                /* Update optional widgets visibility */
+                updateAdditionalObjects (device);
+
+                /* Getting Other Information */
+                mLbHDVirtualSizeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttLogicalSize).toString()));
+                mLbHDActualSizeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttSize).toString()));
+                mLbSizeValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttSize).toString()));
+                mLbLocationValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttLocation).toString()));
+                mLbHDFormatValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttFormat).toString()));
+                mLbUsageValue->setText (compressText (mStorageModel->data (index, StorageModel::R_AttUsage).toString()));
+
+                /* Showing Attachment Page */
+                mSwRightPane->setCurrentIndex (2);
+                break;
+            }
+            default:
+                break;
+        }
+    }
+
+    if (mValidator) mValidator->revalidate();
+
+    mIsLoadingInProgress = false;
+}
+
+void UIMachineSettingsStorage::setInformation()
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+    if (mIsLoadingInProgress || !index.isValid() || index == mStorageModel->root()) return;
+
+    QObject *sdr = sender();
+    switch (mStorageModel->data (index, StorageModel::R_ItemType).value <AbstractItem::ItemType>())
+    {
+        case AbstractItem::Type_ControllerItem:
+        {
+            /* Setting Controller Name */
+            if (sdr == mLeName)
+                mStorageModel->setData (index, mLeName->text(), StorageModel::R_CtrName);
+            /* Setting Controller Sub-Type */
+            else if (sdr == mCbType)
+                mStorageModel->setData (index, QVariant::fromValue (vboxGlobal().toControllerType (mCbType->currentText())),
+                                        StorageModel::R_CtrType);
+            else if (sdr == mCbIoCache)
+                mStorageModel->setData (index, mCbIoCache->isChecked(), StorageModel::R_CtrIoCache);
+            break;
+        }
+        case AbstractItem::Type_AttachmentItem:
+        {
+            /* Setting Attachment Slot */
+            if (sdr == mCbSlot)
+            {
+                QModelIndex controllerIndex = mStorageModel->parent(index);
+                StorageSlot attachmentStorageSlot = vboxGlobal().toStorageSlot(mCbSlot->currentText());
+                mStorageModel->setData(index, QVariant::fromValue(attachmentStorageSlot), StorageModel::R_AttSlot);
+                QModelIndex theSameIndexAtNewPosition = mStorageModel->attachmentBySlot(controllerIndex, attachmentStorageSlot);
+                AssertMsg(theSameIndexAtNewPosition.isValid(), ("Current attachment disappears!\n"));
+                mTwStorageTree->setCurrentIndex(theSameIndexAtNewPosition);
+            }
+            /* Setting Attachment Medium */
+            else if (sdr == mCbVdi)
+                mStorageModel->setData (index, mCbVdi->id(), StorageModel::R_AttMediumId);
+            else if (sdr == mCbShowDiffs)
+                mStorageModel->setData (index, mCbShowDiffs->isChecked(), StorageModel::R_AttIsShowDiffs);
+            else if (sdr == mCbPassthrough)
+            {
+                if (mStorageModel->data (index, StorageModel::R_AttIsHostDrive).toBool())
+                    mStorageModel->setData (index, mCbPassthrough->isChecked(), StorageModel::R_AttIsPassthrough);
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    emit storageChanged();
+    getInformation();
+}
+
+void UIMachineSettingsStorage::sltOpenMedium()
+{
+    QString id = vboxGlobal().openMediumWithFileOpenDialog(mCbVdi->type(), this);
+    if (!id.isNull())
+        mCbVdi->setCurrentItem(id);
+}
+
+void UIMachineSettingsStorage::sltNewMedium()
+{
+    QString id = getWithNewHDWizard();
+    if (!id.isNull())
+        mCbVdi->setCurrentItem (id);
+}
+
+void UIMachineSettingsStorage::updateActionsState()
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+
+    bool isIDEPossible = mStorageModel->data (index, StorageModel::R_IsMoreIDEControllersPossible).toBool();
+    bool isSATAPossible = mStorageModel->data (index, StorageModel::R_IsMoreSATAControllersPossible).toBool();
+    bool isSCSIPossible = mStorageModel->data (index, StorageModel::R_IsMoreSCSIControllersPossible).toBool();
+    bool isFloppyPossible = mStorageModel->data (index, StorageModel::R_IsMoreFloppyControllersPossible).toBool();
+    bool isSASPossible = mStorageModel->data (index, StorageModel::R_IsMoreSASControllersPossible).toBool();
+
+    bool isController = mStorageModel->data (index, StorageModel::R_IsController).toBool();
+    bool isAttachment = mStorageModel->data (index, StorageModel::R_IsAttachment).toBool();
+    bool isAttachmentsPossible = mStorageModel->data (index, StorageModel::R_IsMoreAttachmentsPossible).toBool();
+
+    mAddCtrAction->setEnabled (isIDEPossible || isSATAPossible || isSCSIPossible || isFloppyPossible || isSASPossible);
+    mAddIDECtrAction->setEnabled (isIDEPossible);
+    mAddSATACtrAction->setEnabled (isSATAPossible);
+    mAddSCSICtrAction->setEnabled (isSCSIPossible);
+    mAddFloppyCtrAction->setEnabled (isFloppyPossible);
+    mAddSASCtrAction->setEnabled (isSASPossible);
+
+    mAddAttAction->setEnabled (isController && isAttachmentsPossible);
+    mAddHDAttAction->setEnabled (isController && isAttachmentsPossible);
+    mAddCDAttAction->setEnabled (isController && isAttachmentsPossible);
+    mAddFDAttAction->setEnabled (isController && isAttachmentsPossible);
+
+    mDelCtrAction->setEnabled (isController);
+    mDelAttAction->setEnabled (isAttachment);
+}
+
+void UIMachineSettingsStorage::onRowInserted (const QModelIndex &aParent, int aPosition)
+{
+    QModelIndex index = mStorageModel->index (aPosition, 0, aParent);
+
+    switch (mStorageModel->data (index, StorageModel::R_ItemType).value <AbstractItem::ItemType>())
+    {
+        case AbstractItem::Type_ControllerItem:
+        {
+            /* Select the newly created Controller Item */
+            mTwStorageTree->setCurrentIndex (index);
+            break;
+        }
+        case AbstractItem::Type_AttachmentItem:
+        {
+            /* Expand parent if it is not expanded yet */
+            if (!mTwStorageTree->isExpanded (aParent))
+                mTwStorageTree->setExpanded (aParent, true);
+
+            /* Check if no medium was selected for this attachment */
+            if (mStorageModel->data (index, StorageModel::R_AttMediumId).toString().isEmpty())
+            {
+                /* Ask the user for the method to select medium */
+                KDeviceType deviceType = mStorageModel->data (index, StorageModel::R_AttDevice).value <KDeviceType>();
+                int askResult = vboxProblem().confirmRunNewHDWzdOrOFD (deviceType);
+                QString mediumId = askResult == QIMessageBox::Yes ? getWithNewHDWizard() :
+                                   askResult == QIMessageBox::No ? vboxGlobal().openMediumWithFileOpenDialog(typeToLocal (deviceType), this) : QString();
+                if (mediumId.isNull())
+                    mediumId = firstAvailableId;
+                mStorageModel->setData (index, mediumId, StorageModel::R_AttMediumId);
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    updateActionsState();
+    getInformation();
+}
+
+void UIMachineSettingsStorage::onRowRemoved()
+{
+    if (mStorageModel->rowCount (mStorageModel->root()) == 0)
+        mTwStorageTree->setCurrentIndex (mStorageModel->root());
+
+    updateActionsState();
+    getInformation();
+}
+
+void UIMachineSettingsStorage::onCurrentItemChanged()
+{
+    updateActionsState();
+    getInformation();
+}
+
+void UIMachineSettingsStorage::onContextMenuRequested (const QPoint &aPosition)
+{
+    QModelIndex index = mTwStorageTree->indexAt (aPosition);
+    if (!index.isValid()) return addController();
+
+    QMenu menu;
+    switch (mStorageModel->data (index, StorageModel::R_ItemType).value <AbstractItem::ItemType>())
+    {
+        case AbstractItem::Type_ControllerItem:
+        {
+            DeviceTypeList deviceTypeList (mStorageModel->data (index, StorageModel::R_CtrDevices).value <DeviceTypeList>());
+            foreach (KDeviceType deviceType, deviceTypeList)
+            {
+                switch (deviceType)
+                {
+                    case KDeviceType_HardDisk:
+                        menu.addAction (mAddHDAttAction);
+                        break;
+                    case KDeviceType_DVD:
+                        menu.addAction (mAddCDAttAction);
+                        break;
+                    case KDeviceType_Floppy:
+                        menu.addAction (mAddFDAttAction);
+                        break;
+                    default:
+                        break;
+                }
+            }
+            menu.addAction (mDelCtrAction);
+            break;
+        }
+        case AbstractItem::Type_AttachmentItem:
+        {
+            menu.addAction (mDelAttAction);
+            break;
+        }
+        default:
+            break;
+    }
+    if (!menu.isEmpty())
+        menu.exec (mTwStorageTree->viewport()->mapToGlobal (aPosition));
+}
+
+void UIMachineSettingsStorage::onDrawItemBranches (QPainter *aPainter, const QRect &aRect, const QModelIndex &aIndex)
+{
+    if (!aIndex.parent().isValid() || !aIndex.parent().parent().isValid()) return;
+
+    aPainter->save();
+    QStyleOption options;
+    options.initFrom (mTwStorageTree);
+    options.rect = aRect;
+    options.state |= QStyle::State_Item;
+    if (aIndex.row() < mStorageModel->rowCount (aIndex.parent()) - 1)
+        options.state |= QStyle::State_Sibling;
+    /* This pen is commonly used by different
+     * look and feel styles to paint tree-view branches. */
+    QPen pen (QBrush (options.palette.dark().color(), Qt::Dense4Pattern), 0);
+    aPainter->setPen (pen);
+    /* If we want tree-view branches to be always painted we have to use QCommonStyle::drawPrimitive()
+     * because QCommonStyle performs branch painting as opposed to particular inherited sub-classing styles. */
+    qobject_cast <QCommonStyle*> (style())->QCommonStyle::drawPrimitive (QStyle::PE_IndicatorBranch, &options, aPainter);
+    aPainter->restore();
+}
+
+void UIMachineSettingsStorage::onMouseMoved (QMouseEvent *aEvent)
+{
+    QModelIndex index = mTwStorageTree->indexAt (aEvent->pos());
+    QRect indexRect = mTwStorageTree->visualRect (index);
+
+    /* Expander tool-tip */
+    if (mStorageModel->data (index, StorageModel::R_IsController).toBool())
+    {
+        QRect expanderRect = mStorageModel->data (index, StorageModel::R_ItemPixmapRect).toRect();
+        expanderRect.translate (indexRect.x(), indexRect.y());
+        if (expanderRect.contains (aEvent->pos()))
+        {
+            aEvent->setAccepted (true);
+            if (mStorageModel->data (index, StorageModel::R_ToolTipType).value <StorageModel::ToolTipType>() != StorageModel::ExpanderToolTip)
+                mStorageModel->setData (index, QVariant::fromValue (StorageModel::ExpanderToolTip), StorageModel::R_ToolTipType);
+            return;
+        }
+    }
+
+    /* Adder tool-tip */
+    if (mStorageModel->data (index, StorageModel::R_IsController).toBool() &&
+        mTwStorageTree->currentIndex() == index)
+    {
+        DeviceTypeList devicesList (mStorageModel->data (index, StorageModel::R_CtrDevices).value <DeviceTypeList>());
+        for (int i = 0; i < devicesList.size(); ++ i)
+        {
+            KDeviceType deviceType = devicesList [i];
+
+            QRect deviceRect;
+            switch (deviceType)
+            {
+                case KDeviceType_HardDisk:
+                {
+                    deviceRect = mStorageModel->data (index, StorageModel::R_HDPixmapRect).toRect();
+                    break;
+                }
+                case KDeviceType_DVD:
+                {
+                    deviceRect = mStorageModel->data (index, StorageModel::R_CDPixmapRect).toRect();
+                    break;
+                }
+                case KDeviceType_Floppy:
+                {
+                    deviceRect = mStorageModel->data (index, StorageModel::R_FDPixmapRect).toRect();
+                    break;
+                }
+                default:
+                    break;
+            }
+            deviceRect.translate (indexRect.x() + indexRect.width(), indexRect.y());
+
+            if (deviceRect.contains (aEvent->pos()))
+            {
+                aEvent->setAccepted (true);
+                switch (deviceType)
+                {
+                    case KDeviceType_HardDisk:
+                    {
+                        if (mStorageModel->data (index, StorageModel::R_ToolTipType).value <StorageModel::ToolTipType>() != StorageModel::HDAdderToolTip)
+                            mStorageModel->setData (index, QVariant::fromValue (StorageModel::HDAdderToolTip), StorageModel::R_ToolTipType);
+                        break;
+                    }
+                    case KDeviceType_DVD:
+                    {
+                        if (mStorageModel->data (index, StorageModel::R_ToolTipType).value <StorageModel::ToolTipType>() != StorageModel::CDAdderToolTip)
+                            mStorageModel->setData (index, QVariant::fromValue (StorageModel::CDAdderToolTip), StorageModel::R_ToolTipType);
+                        break;
+                    }
+                    case KDeviceType_Floppy:
+                    {
+                        if (mStorageModel->data (index, StorageModel::R_ToolTipType).value <StorageModel::ToolTipType>() != StorageModel::FDAdderToolTip)
+                            mStorageModel->setData (index, QVariant::fromValue (StorageModel::FDAdderToolTip), StorageModel::R_ToolTipType);
+                        break;
+                    }
+                    default:
+                        break;
+                }
+                return;
+            }
+        }
+    }
+
+    /* Default tool-tip */
+    if (mStorageModel->data (index, StorageModel::R_ToolTipType).value <StorageModel::ToolTipType>() != StorageModel::DefaultToolTip)
+        mStorageModel->setData (index, StorageModel::DefaultToolTip, StorageModel::R_ToolTipType);
+}
+
+void UIMachineSettingsStorage::onMouseClicked (QMouseEvent *aEvent)
+{
+    QModelIndex index = mTwStorageTree->indexAt (aEvent->pos());
+    QRect indexRect = mTwStorageTree->visualRect (index);
+
+    /* Expander icon */
+    if (mStorageModel->data (index, StorageModel::R_IsController).toBool())
+    {
+        QRect expanderRect = mStorageModel->data (index, StorageModel::R_ItemPixmapRect).toRect();
+        expanderRect.translate (indexRect.x(), indexRect.y());
+        if (expanderRect.contains (aEvent->pos()))
+        {
+            aEvent->setAccepted (true);
+            mTwStorageTree->setExpanded (index, !mTwStorageTree->isExpanded (index));
+            return;
+        }
+    }
+
+    /* Adder icons */
+    if (mStorageModel->data (index, StorageModel::R_IsController).toBool() &&
+        mTwStorageTree->currentIndex() == index)
+    {
+        DeviceTypeList devicesList (mStorageModel->data (index, StorageModel::R_CtrDevices).value <DeviceTypeList>());
+        for (int i = 0; i < devicesList.size(); ++ i)
+        {
+            KDeviceType deviceType = devicesList [i];
+
+            QRect deviceRect;
+            switch (deviceType)
+            {
+                case KDeviceType_HardDisk:
+                {
+                    deviceRect = mStorageModel->data (index, StorageModel::R_HDPixmapRect).toRect();
+                    break;
+                }
+                case KDeviceType_DVD:
+                {
+                    deviceRect = mStorageModel->data (index, StorageModel::R_CDPixmapRect).toRect();
+                    break;
+                }
+                case KDeviceType_Floppy:
+                {
+                    deviceRect = mStorageModel->data (index, StorageModel::R_FDPixmapRect).toRect();
+                    break;
+                }
+                default:
+                    break;
+            }
+            deviceRect.translate (indexRect.x() + indexRect.width(), indexRect.y());
+
+            if (deviceRect.contains (aEvent->pos()))
+            {
+                aEvent->setAccepted (true);
+                if (mAddAttAction->isEnabled())
+                    addAttachmentWrapper (deviceType);
+                return;
+            }
+        }
+    }
+}
+
+void UIMachineSettingsStorage::addControllerWrapper (const QString &aName, KStorageBus aBus, KStorageControllerType aType)
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+    switch (aBus)
+    {
+        case KStorageBus_IDE:
+            Assert (mStorageModel->data (index, StorageModel::R_IsMoreIDEControllersPossible).toBool());
+            break;
+        case KStorageBus_SATA:
+            Assert (mStorageModel->data (index, StorageModel::R_IsMoreSATAControllersPossible).toBool());
+            break;
+        case KStorageBus_SCSI:
+            Assert (mStorageModel->data (index, StorageModel::R_IsMoreSCSIControllersPossible).toBool());
+            break;
+        case KStorageBus_SAS:
+            Assert (mStorageModel->data (index, StorageModel::R_IsMoreSASControllersPossible).toBool());
+            break;
+        case KStorageBus_Floppy:
+            Assert (mStorageModel->data (index, StorageModel::R_IsMoreFloppyControllersPossible).toBool());
+            break;
+        default:
+            break;
+    }
+
+    mStorageModel->addController (aName, aBus, aType);
+    emit storageChanged();
+}
+
+void UIMachineSettingsStorage::addAttachmentWrapper (KDeviceType aDevice)
+{
+    QModelIndex index = mTwStorageTree->currentIndex();
+    Assert (mStorageModel->data (index, StorageModel::R_IsController).toBool());
+    Assert (mStorageModel->data (index, StorageModel::R_IsMoreAttachmentsPossible).toBool());
+
+    mStorageModel->addAttachment (QUuid (mStorageModel->data (index, StorageModel::R_ItemId).toString()), aDevice);
+    mStorageModel->sort();
+    emit storageChanged();
+    if (mValidator) mValidator->revalidate();
+}
+
+QString UIMachineSettingsStorage::getWithNewHDWizard()
+{
+    /* Run New HD Wizard */
+    UINewHDWzd dlg(this);
+    /* Initialize variables: */
+    CGuestOSType guestOSType = vboxGlobal().virtualBox().GetGuestOSType(m_machine.GetOSTypeId());
+    dlg.setRecommendedSize(guestOSType.GetRecommendedHDD());
+    QString strMachineSettingsFilepath = m_machine.GetSettingsFilePath();
+    QFileInfo fileInfo(strMachineSettingsFilepath);
+    dlg.setDefaultPath(fileInfo.absolutePath());
+
+    return dlg.exec() == QDialog::Accepted ? dlg.hardDisk().GetId() : QString();
+}
+
+void UIMachineSettingsStorage::updateAdditionalObjects (KDeviceType aType)
+{
+    mCbShowDiffs->setVisible (aType == KDeviceType_HardDisk);
+    mCbPassthrough->setVisible (aType == KDeviceType_DVD);
+
+    mLbHDVirtualSize->setVisible (aType == KDeviceType_HardDisk);
+    mLbHDVirtualSizeValue->setVisible (aType == KDeviceType_HardDisk);
+
+    mLbHDActualSize->setVisible (aType == KDeviceType_HardDisk);
+    mLbHDActualSizeValue->setVisible (aType == KDeviceType_HardDisk);
+
+    mLbSize->setVisible (aType != KDeviceType_HardDisk);
+    mLbSizeValue->setVisible (aType != KDeviceType_HardDisk);
+
+    mLbHDFormat->setVisible (aType == KDeviceType_HardDisk);
+    mLbHDFormatValue->setVisible (aType == KDeviceType_HardDisk);
+}
+
+QString UIMachineSettingsStorage::generateUniqueName (const QString &aTemplate) const
+{
+    int maxNumber = 0;
+    QModelIndex rootIndex = mStorageModel->root();
+    for (int i = 0; i < mStorageModel->rowCount (rootIndex); ++ i)
+    {
+        QModelIndex ctrIndex = rootIndex.child (i, 0);
+        QString ctrName = mStorageModel->data (ctrIndex, StorageModel::R_CtrName).toString();
+        if (ctrName.startsWith (aTemplate))
+        {
+            QString stringNumber (ctrName.right (ctrName.size() - aTemplate.size()));
+            bool isConverted = false;
+            int number = stringNumber.toInt (&isConverted);
+            maxNumber = isConverted && (number > maxNumber) ? number : 1;
+        }
+    }
+    return maxNumber ? QString ("%1 %2").arg (aTemplate).arg (++ maxNumber) : aTemplate;
+}
+
+uint32_t UIMachineSettingsStorage::deviceCount (KDeviceType aType) const
+{
+    uint32_t cDevices = 0;
+    QModelIndex rootIndex = mStorageModel->root();
+    for (int i = 0; i < mStorageModel->rowCount (rootIndex); ++ i)
+    {
+        QModelIndex ctrIndex = rootIndex.child (i, 0);
+        for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j)
+        {
+            QModelIndex attIndex = ctrIndex.child (j, 0);
+            KDeviceType attDevice = mStorageModel->data (attIndex, StorageModel::R_AttDevice).value <KDeviceType>();
+            if (attDevice == aType)
+                ++cDevices;
+        }
+    }
+
+    return cDevices;
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h	(revision 33882)
@@ -0,0 +1,674 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsStorage class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsStorage_h__
+#define __UIMachineSettingsStorage_h__
+
+/* Global includes */
+#include <QtGlobal> /* for Q_WS_MAC */
+#ifdef Q_WS_MAC
+/* Somewhere Carbon.h includes AssertMacros.h which defines the macro "check".
+ * In QItemDelegate a class method is called "check" also. As we not used the
+ * macro undefine it here. */
+# undef check
+#endif /* Q_WS_MAC */
+#include <QItemDelegate>
+#include <QPointer>
+
+/* Local includes */
+#include "UISettingsPage.h"
+#include "UIMachineSettingsStorage.gen.h"
+#include "COMDefs.h"
+
+/* Local forwards */
+class AttachmentItem;
+class ControllerItem;
+
+/* Internal Types */
+typedef QList <StorageSlot> SlotsList;
+typedef QList <KDeviceType> DeviceTypeList;
+typedef QList <KStorageControllerType> ControllerTypeList;
+Q_DECLARE_METATYPE (SlotsList);
+Q_DECLARE_METATYPE (DeviceTypeList);
+Q_DECLARE_METATYPE (ControllerTypeList);
+
+enum ItemState
+{
+    State_DefaultItem   = 0,
+    State_CollapsedItem = 1,
+    State_ExpandedItem  = 2,
+    State_MAX
+};
+
+/* Pixmap Storage Pool */
+class PixmapPool : public QObject
+{
+    Q_OBJECT;
+
+public:
+
+    enum PixmapType
+    {
+        InvalidPixmap            = -1,
+
+        ControllerAddEn          =  0,
+        ControllerAddDis         =  1,
+        ControllerDelEn          =  2,
+        ControllerDelDis         =  3,
+
+        AttachmentAddEn          =  4,
+        AttachmentAddDis         =  5,
+        AttachmentDelEn          =  6,
+        AttachmentDelDis         =  7,
+
+        IDEControllerNormal      =  8,
+        IDEControllerExpand      =  9,
+        IDEControllerCollapse    = 10,
+        SATAControllerNormal     = 11,
+        SATAControllerExpand     = 12,
+        SATAControllerCollapse   = 13,
+        SCSIControllerNormal     = 14,
+        SCSIControllerExpand     = 15,
+        SCSIControllerCollapse   = 16,
+        FloppyControllerNormal   = 17,
+        FloppyControllerExpand   = 18,
+        FloppyControllerCollapse = 19,
+
+        IDEControllerAddEn       = 20,
+        IDEControllerAddDis      = 21,
+        SATAControllerAddEn      = 22,
+        SATAControllerAddDis     = 23,
+        SCSIControllerAddEn      = 24,
+        SCSIControllerAddDis     = 25,
+        FloppyControllerAddEn    = 26,
+        FloppyControllerAddDis   = 27,
+
+        HDAttachmentNormal       = 28,
+        CDAttachmentNormal       = 29,
+        FDAttachmentNormal       = 30,
+
+        HDAttachmentAddEn        = 31,
+        HDAttachmentAddDis       = 32,
+        CDAttachmentAddEn        = 33,
+        CDAttachmentAddDis       = 34,
+        FDAttachmentAddEn        = 35,
+        FDAttachmentAddDis       = 36,
+
+        VMMEn                    = 37,
+        VMMDis                   = 38,
+
+        MaxIndex
+    };
+
+    static PixmapPool* pool (QObject *aParent = 0);
+
+    QPixmap pixmap (PixmapType aType) const;
+
+protected:
+
+    PixmapPool (QObject *aParent);
+
+    static QPointer <PixmapPool> mThis;
+
+private:
+
+    QVector <QPixmap> mPool;
+};
+
+/* Abstract Controller Type */
+class AbstractControllerType
+{
+public:
+
+    AbstractControllerType (KStorageBus aBusType, KStorageControllerType aCtrType);
+    virtual ~AbstractControllerType() {}
+
+    KStorageBus busType() const;
+    KStorageControllerType ctrType() const;
+    ControllerTypeList ctrTypes() const;
+    PixmapPool::PixmapType pixmap (ItemState aState) const;
+
+    void setCtrType (KStorageControllerType aCtrType);
+
+    DeviceTypeList deviceTypeList() const;
+
+protected:
+
+    virtual KStorageControllerType first() const = 0;
+    virtual uint size() const = 0;
+
+    KStorageBus mBusType;
+    KStorageControllerType mCtrType;
+    QList <PixmapPool::PixmapType> mPixmaps;
+};
+
+/* IDE Controller Type */
+class IDEControllerType : public AbstractControllerType
+{
+public:
+
+    IDEControllerType (KStorageControllerType aSubType);
+
+private:
+
+    KStorageControllerType first() const;
+    uint size() const;
+};
+
+/* SATA Controller Type */
+class SATAControllerType : public AbstractControllerType
+{
+public:
+
+    SATAControllerType (KStorageControllerType aSubType);
+
+private:
+
+    KStorageControllerType first() const;
+    uint size() const;
+};
+
+/* SCSI Controller Type */
+class SCSIControllerType : public AbstractControllerType
+{
+public:
+
+    SCSIControllerType (KStorageControllerType aSubType);
+
+private:
+
+    KStorageControllerType first() const;
+    uint size() const;
+};
+
+/* Floppy Controller Type */
+class FloppyControllerType : public AbstractControllerType
+{
+public:
+
+    FloppyControllerType (KStorageControllerType aSubType);
+
+private:
+
+    KStorageControllerType first() const;
+    uint size() const;
+};
+
+/* SAS Controller Type */
+class SASControllerType : public AbstractControllerType
+{
+public:
+
+    SASControllerType (KStorageControllerType aSubType);
+
+private:
+
+    KStorageControllerType first() const;
+    uint size() const;
+};
+
+/* Abstract Item */
+class AbstractItem
+{
+public:
+
+    enum ItemType
+    {
+        Type_InvalidItem    = 0,
+        Type_RootItem       = 1,
+        Type_ControllerItem = 2,
+        Type_AttachmentItem = 3
+    };
+
+    AbstractItem (AbstractItem *aParent = 0);
+    virtual ~AbstractItem();
+
+    AbstractItem* parent() const;
+    QUuid id() const;
+    QString machineId() const;
+
+    void setMachineId (const QString &aMchineId);
+
+    virtual ItemType rtti() const = 0;
+    virtual AbstractItem* childByPos (int aIndex) = 0;
+    virtual AbstractItem* childById (const QUuid &aId) = 0;
+    virtual int posOfChild (AbstractItem *aItem) const = 0;
+    virtual int childCount() const = 0;
+    virtual QString text() const = 0;
+    virtual QString tip() const = 0;
+    virtual QPixmap pixmap (ItemState aState = State_DefaultItem) = 0;
+
+protected:
+
+    virtual void addChild (AbstractItem *aItem) = 0;
+    virtual void delChild (AbstractItem *aItem) = 0;
+
+    AbstractItem *mParent;
+    QUuid         mId;
+    QString       mMachineId;
+};
+Q_DECLARE_METATYPE (AbstractItem::ItemType);
+
+/* Root Item */
+class RootItem : public AbstractItem
+{
+public:
+
+    RootItem();
+   ~RootItem();
+
+    ULONG childCount (KStorageBus aBus) const;
+
+private:
+
+    ItemType rtti() const;
+    AbstractItem* childByPos (int aIndex);
+    AbstractItem* childById (const QUuid &aId);
+    int posOfChild (AbstractItem *aItem) const;
+    int childCount() const;
+    QString text() const;
+    QString tip() const;
+    QPixmap pixmap (ItemState aState);
+    void addChild (AbstractItem *aItem);
+    void delChild (AbstractItem *aItem);
+
+    QList <AbstractItem*> mControllers;
+};
+
+/* Controller Item */
+class ControllerItem : public AbstractItem
+{
+public:
+
+    ControllerItem (AbstractItem *aParent, const QString &aName, KStorageBus aBusType,
+                    KStorageControllerType aControllerType);
+   ~ControllerItem();
+
+    KStorageBus ctrBusType() const;
+    QString ctrName() const;
+    KStorageControllerType ctrType() const;
+    ControllerTypeList ctrTypes() const;
+    bool ctrUseIoCache() const;
+
+    void setCtrName (const QString &aCtrName);
+    void setCtrType (KStorageControllerType aCtrType);
+    void setCtrUseIoCache (bool aUseIoCache);
+
+    SlotsList ctrAllSlots() const;
+    SlotsList ctrUsedSlots() const;
+    DeviceTypeList ctrDeviceTypeList() const;
+    QStringList ctrAllMediumIds (bool aShowDiffs) const;
+    QStringList ctrUsedMediumIds() const;
+
+    void setAttachments(const QList<AbstractItem*> &attachments) { mAttachments = attachments; }
+
+private:
+
+    ItemType rtti() const;
+    AbstractItem* childByPos (int aIndex);
+    AbstractItem* childById (const QUuid &aId);
+    int posOfChild (AbstractItem *aItem) const;
+    int childCount() const;
+    QString text() const;
+    QString tip() const;
+    QPixmap pixmap (ItemState aState);
+    void addChild (AbstractItem *aItem);
+    void delChild (AbstractItem *aItem);
+
+    QString mCtrName;
+    AbstractControllerType *mCtrType;
+    bool mUseIoCache;
+    QList <AbstractItem*> mAttachments;
+};
+
+/* Attachment Item */
+class AttachmentItem : public AbstractItem
+{
+public:
+
+    AttachmentItem (AbstractItem *aParent, KDeviceType aDeviceType);
+
+    StorageSlot attSlot() const;
+    SlotsList attSlots() const;
+    KDeviceType attDeviceType() const;
+    DeviceTypeList attDeviceTypes() const;
+    QString attMediumId() const;
+    QStringList attMediumIds (bool aFilter = true) const;
+    bool attIsShowDiffs() const;
+    bool attIsHostDrive() const;
+    bool attIsPassthrough() const;
+
+    void setAttSlot (const StorageSlot &aAttSlot);
+    void setAttDevice (KDeviceType aAttDeviceType);
+    void setAttMediumId (const QString &aAttMediumId);
+    void setAttIsShowDiffs (bool aAttIsShowDiffs);
+    void setAttIsPassthrough (bool aPassthrough);
+
+    QString attSize() const;
+    QString attLogicalSize() const;
+    QString attLocation() const;
+    QString attFormat() const;
+    QString attUsage() const;
+
+private:
+
+    void cache();
+
+    ItemType rtti() const;
+    AbstractItem* childByPos (int aIndex);
+    AbstractItem* childById (const QUuid &aId);
+    int posOfChild (AbstractItem *aItem) const;
+    int childCount() const;
+    QString text() const;
+    QString tip() const;
+    QPixmap pixmap (ItemState aState);
+    void addChild (AbstractItem *aItem);
+    void delChild (AbstractItem *aItem);
+
+    KDeviceType mAttDeviceType;
+
+    StorageSlot mAttSlot;
+    QString mAttMediumId;
+    bool mAttIsShowDiffs;
+    bool mAttIsHostDrive;
+    bool mAttIsPassthrough;
+
+    QString mAttName;
+    QString mAttTip;
+    QPixmap mAttPixmap;
+
+    QString mAttSize;
+    QString mAttLogicalSize;
+    QString mAttLocation;
+    QString mAttFormat;
+    QString mAttUsage;
+};
+
+/* Storage Model */
+class StorageModel : public QAbstractItemModel
+{
+    Q_OBJECT;
+
+public:
+
+    enum DataRole
+    {
+        R_ItemId = Qt::UserRole + 1,
+        R_ItemPixmap,
+        R_ItemPixmapRect,
+        R_ItemName,
+        R_ItemNamePoint,
+        R_ItemType,
+        R_IsController,
+        R_IsAttachment,
+
+        R_ToolTipType,
+        R_IsMoreIDEControllersPossible,
+        R_IsMoreSATAControllersPossible,
+        R_IsMoreSCSIControllersPossible,
+        R_IsMoreFloppyControllersPossible,
+        R_IsMoreSASControllersPossible,
+        R_IsMoreAttachmentsPossible,
+
+        R_CtrName,
+        R_CtrType,
+        R_CtrTypes,
+        R_CtrDevices,
+        R_CtrBusType,
+        R_CtrIoCache,
+
+        R_AttSlot,
+        R_AttSlots,
+        R_AttDevice,
+        R_AttMediumId,
+        R_AttIsShowDiffs,
+        R_AttIsHostDrive,
+        R_AttIsPassthrough,
+        R_AttSize,
+        R_AttLogicalSize,
+        R_AttLocation,
+        R_AttFormat,
+        R_AttUsage,
+
+        R_Margin,
+        R_Spacing,
+        R_IconSize,
+
+        R_HDPixmapEn,
+        R_CDPixmapEn,
+        R_FDPixmapEn,
+
+        R_HDPixmapAddEn,
+        R_HDPixmapAddDis,
+        R_CDPixmapAddEn,
+        R_CDPixmapAddDis,
+        R_FDPixmapAddEn,
+        R_FDPixmapAddDis,
+        R_HDPixmapRect,
+        R_CDPixmapRect,
+        R_FDPixmapRect
+    };
+
+    enum ToolTipType
+    {
+        DefaultToolTip  = 0,
+        ExpanderToolTip = 1,
+        HDAdderToolTip  = 2,
+        CDAdderToolTip  = 3,
+        FDAdderToolTip  = 4
+    };
+
+    StorageModel (QObject *aParent);
+   ~StorageModel();
+
+    int rowCount (const QModelIndex &aParent = QModelIndex()) const;
+    int columnCount (const QModelIndex &aParent = QModelIndex()) const;
+
+    QModelIndex root() const;
+    QModelIndex index (int aRow, int aColumn, const QModelIndex &aParent = QModelIndex()) const;
+    QModelIndex parent (const QModelIndex &aIndex) const;
+
+    QVariant data (const QModelIndex &aIndex, int aRole) const;
+    bool setData (const QModelIndex &aIndex, const QVariant &aValue, int aRole);
+
+    QModelIndex addController (const QString &aCtrName, KStorageBus aBusType, KStorageControllerType aCtrType);
+    void delController (const QUuid &aCtrId);
+
+    QModelIndex addAttachment (const QUuid &aCtrId, KDeviceType aDeviceType);
+    void delAttachment (const QUuid &aCtrId, const QUuid &aAttId);
+
+    void setMachineId (const QString &aMachineId);
+
+    void sort(int iColumn = 0, Qt::SortOrder order = Qt::AscendingOrder);
+    QModelIndex attachmentBySlot(QModelIndex controllerIndex, StorageSlot attachmentStorageSlot);
+
+private:
+
+    Qt::ItemFlags flags (const QModelIndex &aIndex) const;
+
+    AbstractItem *mRootItem;
+
+    QPixmap mPlusPixmapEn;
+    QPixmap mPlusPixmapDis;
+
+    QPixmap mMinusPixmapEn;
+    QPixmap mMinusPixmapDis;
+
+    ToolTipType mToolTipType;
+};
+Q_DECLARE_METATYPE (StorageModel::ToolTipType);
+
+/* Storage Delegate */
+class StorageDelegate : public QItemDelegate
+{
+    Q_OBJECT;
+
+public:
+
+    StorageDelegate (QObject *aParent);
+
+private:
+
+    void paint (QPainter *aPainter, const QStyleOptionViewItem &aOption, const QModelIndex &aIndex) const;
+
+    bool mDisableStaticControls;
+};
+
+/* Machine settings / Storage page / Attachment data: */
+struct UIStorageAttachmentData
+{
+    KDeviceType m_attachmentType;
+    LONG m_iAttachmentPort;
+    LONG m_iAttachmentDevice;
+    QString m_strAttachmentMediumId;
+    bool m_fAttachmentPassthrough;
+};
+
+/* Machine settings / Storage page / Controller data: */
+struct UIStorageControllerData
+{
+    QString m_strControllerName;
+    KStorageBus m_controllerBus;
+    KStorageControllerType m_controllerType;
+    bool m_fUseHostIOCache;
+    QList<UIStorageAttachmentData> m_items;
+};
+
+/* Machine settings / Storage page / Cache: */
+struct UISettingsCacheMachineStorage
+{
+    QString m_strMachineId;
+    QList<UIStorageControllerData> m_items;
+};
+
+/* Machine settings / Storage page: */
+class UIMachineSettingsStorage : public UISettingsPageMachine,
+                         public Ui::UIMachineSettingsStorage
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsStorage();
+
+signals:
+
+    void storageChanged();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void retranslateUi();
+
+    void showEvent (QShowEvent *aEvent);
+
+private slots:
+
+    void mediumUpdated (const VBoxMedium &aMedium);
+    void mediumRemoved (VBoxDefs::MediumType aType, const QString &aMediumId);
+
+    void addController();
+    void addIDEController();
+    void addSATAController();
+    void addSCSIController();
+    void addFloppyController();
+    void addSASController();
+    void delController();
+
+    void addAttachment();
+    void addHDAttachment();
+    void addCDAttachment();
+    void addFDAttachment();
+    void delAttachment();
+
+    void getInformation();
+    void setInformation();
+
+    void sltOpenMedium();
+    void sltNewMedium();
+
+    void updateActionsState();
+
+    void onRowInserted (const QModelIndex &aParent, int aIndex);
+    void onRowRemoved();
+
+    void onCurrentItemChanged();
+
+    void onContextMenuRequested (const QPoint &aPosition);
+
+    void onDrawItemBranches (QPainter *aPainter, const QRect &aRect, const QModelIndex &aIndex);
+
+    void onMouseMoved (QMouseEvent *aEvent);
+    void onMouseClicked (QMouseEvent *aEvent);
+
+private:
+
+    void addControllerWrapper (const QString &aName, KStorageBus aBus, KStorageControllerType aType);
+    void addAttachmentWrapper (KDeviceType aDevice);
+
+    QString getWithNewHDWizard();
+
+    void updateAdditionalObjects (KDeviceType aType);
+
+    QString generateUniqueName (const QString &aTemplate) const;
+
+    uint32_t deviceCount (KDeviceType aType) const;
+
+    QIWidgetValidator *mValidator;
+
+    StorageModel *mStorageModel;
+
+    QAction *mAddCtrAction;
+    QAction *mDelCtrAction;
+    QAction *mAddIDECtrAction;
+    QAction *mAddSATACtrAction;
+    QAction *mAddSCSICtrAction;
+    QAction *mAddSASCtrAction;
+    QAction *mAddFloppyCtrAction;
+    QAction *mAddAttAction;
+    QAction *mDelAttAction;
+    QAction *mAddHDAttAction;
+    QAction *mAddCDAttAction;
+    QAction *mAddFDAttAction;
+
+    bool mIsLoadingInProgress;
+    bool mIsPolished;
+    bool mDisableStaticControls;
+
+    /* Cache: */
+    UISettingsCacheMachineStorage m_cache;
+};
+
+#endif // __UIMachineSettingsStorage_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.ui	(revision 33882)
@@ -0,0 +1,577 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsStorage</class>
+ <widget class="QWidget" name="UIMachineSettingsStorage" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>700</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="mLtMain" >
+   <item>
+    <widget class="QISplitter" native="1" name="mSplitter" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="handleWidth" >
+      <number>4</number>
+     </property>
+     <widget class="QWidget" native="1" name="mWtLeftPane" >
+      <layout class="QVBoxLayout" name="mLtLeftPane" >
+       <property name="leftMargin" >
+        <number>0</number>
+       </property>
+       <property name="topMargin" >
+        <number>0</number>
+       </property>
+       <property name="rightMargin" >
+        <number>10</number>
+       </property>
+       <property name="bottomMargin" >
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QILabelSeparator" native="1" name="mLsLeftPane" >
+         <property name="text" >
+          <string>&amp;Storage Tree</string>
+         </property>
+         <property name="buddy" >
+          <cstring>mTwStorageTree</cstring>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="mLtStorage" >
+         <property name="spacing" >
+          <number>0</number>
+         </property>
+         <property name="margin" >
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QITreeView" native="1" name="mTwStorageTree" >
+           <property name="whatsThis" >
+            <string>Contains all storage controllers for this machine and the virtual images and host drives attached to them.</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="mLtStorageBar" >
+           <item>
+            <spacer name="mSp1" >
+             <property name="orientation" >
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0" >
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="UIToolBar" native="1" name="mTbStorageBar" />
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QStackedWidget" name="mSwRightPane" >
+      <widget class="QWidget" name="mWtEmpty">
+       <layout class="QGridLayout" name="mLtEmpty" >
+        <property name="leftMargin" >
+         <number>10</number>
+        </property>
+        <property name="topMargin" >
+         <number>0</number>
+        </property>
+        <property name="rightMargin" >
+         <number>0</number>
+        </property>
+        <property name="bottomMargin" >
+         <number>0</number>
+        </property>
+        <item row="0" column="0" colspan="2" >
+         <widget class="QILabelSeparator" native="1" name="mLsEmpty" >
+          <property name="text" >
+           <string>Information</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1" >
+         <widget class="QLabel" name="mLbInfo" >
+          <property name="text" >
+           <string>The Storage Tree can contain several controllers of different types. This machine currently has no controllers.</string>
+          </property>
+          <property name="wordWrap">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="0" colspan="2" >
+         <spacer name="mSp2" >
+          <property name="orientation" >
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>0</width>
+            <height>0</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="mWtController" >
+       <layout class="QGridLayout" name="mLtController" >
+        <property name="leftMargin" >
+         <number>10</number>
+        </property>
+        <property name="topMargin" >
+         <number>0</number>
+        </property>
+        <property name="rightMargin" >
+         <number>0</number>
+        </property>
+        <property name="bottomMargin" >
+         <number>0</number>
+        </property>
+        <item row="0" column="0" colspan="3" >
+         <widget class="QILabelSeparator" native="1" name="mLsParameters" >
+          <property name="text" >
+           <string>Attributes</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1" >
+         <widget class="QLabel" name="mLbName" >
+          <property name="text" >
+           <string>&amp;Name:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>mLeName</cstring>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="2" >
+         <widget class="QLineEdit" name="mLeName" >
+          <property name="whatsThis" >
+           <string>Changes the name of the storage controller currently selected in the Storage Tree.</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="1" >
+         <widget class="QLabel" name="mLbType" >
+          <property name="text" >
+           <string>&amp;Type:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>mCbType</cstring>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="2" >
+         <widget class="QComboBox" name="mCbType" >
+          <property name="whatsThis" >
+           <string>Selects the sub-type of the storage controller currently selected in the Storage Tree.</string>
+          </property>
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="2" >
+         <widget class="QCheckBox" name="mCbIoCache" >
+          <property name="whatsThis" >
+           <string>Allows to use host I/O caching capabilities.</string>
+          </property>
+          <property name="text" >
+           <string>Use host I/O cache</string>
+          </property>
+         </widget>
+        </item>
+        <item row="4" column="0" colspan="3" >
+         <spacer name="mSp3" >
+          <property name="orientation" >
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>0</width>
+            <height>0</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="mWtAttachment" >
+       <layout class="QGridLayout" name="mLtAttachment" >
+        <property name="leftMargin" >
+         <number>10</number>
+        </property>
+        <property name="topMargin" >
+         <number>0</number>
+        </property>
+        <property name="rightMargin" >
+         <number>0</number>
+        </property>
+        <property name="bottomMargin" >
+         <number>0</number>
+        </property>
+        <item row="0" column="0" colspan="3" >
+         <widget class="QILabelSeparator" native="1" name="mLsAttributes" >
+          <property name="text" >
+           <string>Attributes</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1" >
+         <widget class="QLabel" name="mLbSlot" >
+          <property name="text" >
+           <string>S&amp;lot:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>mCbSlot</cstring>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="2" >
+         <widget class="QComboBox" name="mCbSlot" >
+          <property name="whatsThis" >
+           <string>Selects the slot on the storage controller used by this attachment. The available slots depend on the type of the controller and other attachments on it.</string>
+          </property>
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="1" >
+         <widget class="QLabel" name="mLbVdi" >
+          <property name="buddy" >
+           <cstring>mCbVdi</cstring>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="2" >
+         <widget class="QWidget" name="mWtContainer" >
+          <layout class="QHBoxLayout" name="mLtContainer" >
+           <property name="leftMargin" >
+            <number>0</number>
+           </property>
+           <property name="topMargin" >
+            <number>0</number>
+            </property>
+           <property name="rightMargin" >
+            <number>0</number>
+           </property>
+           <property name="bottomMargin" >
+            <number>0</number>
+           </property>
+           <property name="spacing" >
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="VBoxMediaComboBox" native="1" name="mCbVdi" >
+             <property name="whatsThis" >
+              <string>Selects the virtual disk image or the host drive used by this attachment.</string>
+             </property>
+             <property name="sizePolicy" >
+              <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QIToolButton" name="mTbOpen" >
+             <property name="text" >
+              <string/>
+             </property>
+             <property name="autoRaise" >
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QIToolButton" name="mTbNew" >
+             <property name="whatsThis" >
+              <string>Create hard disk image file using New Hard Disk wizard.</string>
+             </property>
+             <property name="toolTip" >
+              <string>Create hard disk image file</string>
+             </property>
+             <property name="text" >
+              <string/>
+             </property>
+             <property name="autoRaise" >
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item row="3" column="2" >
+         <widget class="QCheckBox" name="mCbShowDiffs">
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="whatsThis">
+           <string>If checked, shows the differencing hard disks that are attached to slots rather than their base hard disks (shown for indirect attachments) and allows explicit attaching of differencing hard disks. Check this only if you need a complex hard disk setup.</string>
+          </property>
+          <property name="text">
+           <string>D&amp;ifferencing Disks</string>
+          </property>
+         </widget>
+        </item>
+        <item row="4" column="2" >
+         <widget class="QCheckBox" name="mCbPassthrough" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="whatsThis" >
+           <string>When checked, allows the guest to send ATAPI commands directly to the host-drive which makes it possible to use CD/DVD writers connected to the host inside the VM. Note that writing audio CD inside the VM is not yet supported.</string>
+          </property>
+          <property name="text" >
+           <string>&amp;Passthrough</string>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="0" colspan="3" >
+         <widget class="QILabelSeparator" native="1" name="mLsInformation" >
+          <property name="text" >
+           <string>Information</string>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="1" >
+         <widget class="QLabel" name="mLbHDVirtualSize" >
+          <property name="text" >
+           <string>Virtual Size:</string>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="2" >
+         <widget class="QILabel" name="mLbHDVirtualSizeValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="7" column="1" >
+         <widget class="QLabel" name="mLbHDActualSize" >
+          <property name="text" >
+           <string>Actual Size:</string>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="7" column="2" >
+         <widget class="QILabel" name="mLbHDActualSizeValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="8" column="1" >
+         <widget class="QLabel" name="mLbSize" >
+          <property name="text" >
+           <string>Size:</string>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="8" column="2" >
+         <widget class="QILabel" name="mLbSizeValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="9" column="1" >
+         <widget class="QLabel" name="mLbLocation" >
+          <property name="text" >
+           <string>Location:</string>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="9" column="2" >
+         <widget class="QILabel" name="mLbLocationValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="10" column="1" >
+         <widget class="QLabel" name="mLbHDFormat" >
+          <property name="text" >
+           <string>Type (Format):</string>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="10" column="2" >
+         <widget class="QILabel" name="mLbHDFormatValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="11" column="1" >
+         <widget class="QLabel" name="mLbUsage" >
+          <property name="text" >
+           <string>Attached To:</string>
+          </property>
+          <property name="alignment" >
+           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="11" column="2" >
+         <widget class="QILabel" name="mLbUsageValue" >
+          <property name="sizePolicy" >
+           <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item row="12" column="0" colspan="3" >
+         <spacer name="mSp6" >
+          <property name="orientation" >
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>0</width>
+            <height>0</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </widget>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QISplitter</class>
+   <extends>QSplitter</extends>
+   <header>QISplitter.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>QILabelSeparator</class>
+   <extends>QLabel</extends>
+   <header>QILabelSeparator.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>QITreeView</class>
+   <extends>QTreeView</extends>
+   <header>QITreeView.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>UIToolBar</class>
+   <extends>QWidget</extends>
+   <header>UIToolBar.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>VBoxMediaComboBox</class>
+   <extends>QComboBox</extends>
+   <header>VBoxMediaComboBox.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIToolButton</class>
+   <extends>QToolButton</extends>
+   <header>QIToolButton.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp	(revision 33882)
@@ -0,0 +1,595 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSystem class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Local includes */
+#include "QIWidgetValidator.h"
+#include "UIIconPool.h"
+#include "VBoxGlobal.h"
+#include "UIMachineSettingsSystem.h"
+
+/* Global includes */
+#include <iprt/cdefs.h>
+#include <QHeaderView>
+
+#define ITEM_TYPE_ROLE Qt::UserRole + 1
+
+UIMachineSettingsSystem::UIMachineSettingsSystem()
+    : mValidator(0)
+    , mMinGuestCPU(0), mMaxGuestCPU(0)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsSystem::setupUi (this);
+
+    /* Setup constants */
+    CSystemProperties properties = vboxGlobal().virtualBox().GetSystemProperties();
+    uint hostCPUs = vboxGlobal().virtualBox().GetHost().GetProcessorCount();
+    mMinGuestCPU = properties.GetMinGuestCPUCount();
+    mMaxGuestCPU = RT_MIN (2 * hostCPUs, properties.GetMaxGuestCPUCount());
+
+    /* Populate possible boot items list.
+     * Currently, it seems, we are supporting only 4 possible boot device types:
+     * 1. Floppy, 2. DVD-ROM, 3. Hard Disk, 4. Network.
+     * But maximum boot devices count supported by machine
+     * should be retreived through the ISystemProperties getter.
+     * Moreover, possible boot device types are not listed in some separate Main vector,
+     * so we should get them (randomely?) from the list of all device types.
+     * Until there will be separate Main getter for list of supported boot device types,
+     * this list will be hard-coded here... */
+    int iPossibleBootListSize = qMin((ULONG)4, properties.GetMaxBootPosition());
+    for (int iBootPosition = 1; iBootPosition <= iPossibleBootListSize; ++iBootPosition)
+    {
+        switch (iBootPosition)
+        {
+            case 1:
+                m_possibleBootItems << KDeviceType_Floppy;
+                break;
+            case 2:
+                m_possibleBootItems << KDeviceType_DVD;
+                break;
+            case 3:
+                m_possibleBootItems << KDeviceType_HardDisk;
+                break;
+            case 4:
+                m_possibleBootItems << KDeviceType_Network;
+                break;
+            default:
+                break;
+        }
+    }
+
+    /* Setup validators */
+    mLeMemory->setValidator (new QIntValidator (mSlMemory->minRAM(), mSlMemory->maxRAM(), this));
+    mLeCPU->setValidator (new QIntValidator (mMinGuestCPU, mMaxGuestCPU, this));
+
+    /* Setup connections */
+    connect (mSlMemory, SIGNAL (valueChanged (int)),
+             this, SLOT (valueChangedRAM (int)));
+    connect (mLeMemory, SIGNAL (textChanged (const QString&)),
+             this, SLOT (textChangedRAM (const QString&)));
+
+    connect (mTbBootItemUp, SIGNAL (clicked()),
+             this, SLOT (moveBootItemUp()));
+    connect (mTbBootItemDown, SIGNAL (clicked()),
+             this, SLOT (moveBootItemDown()));
+    connect (mTwBootOrder, SIGNAL (moveItemUp()),
+             this, SLOT (moveBootItemUp()));
+    connect (mTwBootOrder, SIGNAL (moveItemDown()),
+             this, SLOT (moveBootItemDown()));
+    connect (mTwBootOrder, SIGNAL (itemToggled()),
+             this, SIGNAL (tableChanged()));
+    connect (mTwBootOrder, SIGNAL (currentItemChanged (QTreeWidgetItem*,
+                                                       QTreeWidgetItem*)),
+             this, SLOT (onCurrentBootItemChanged (QTreeWidgetItem*,
+                                                   QTreeWidgetItem*)));
+
+    connect (mSlCPU, SIGNAL (valueChanged (int)),
+             this, SLOT (valueChangedCPU (int)));
+    connect (mLeCPU, SIGNAL (textChanged (const QString&)),
+             this, SLOT (textChangedCPU (const QString&)));
+
+    /* Setup iconsets */
+    mTbBootItemUp->setIcon(UIIconPool::iconSet(":/list_moveup_16px.png",
+                                               ":/list_moveup_disabled_16px.png"));
+    mTbBootItemDown->setIcon(UIIconPool::iconSet(":/list_movedown_16px.png",
+                                                 ":/list_movedown_disabled_16px.png"));
+
+#ifdef Q_WS_MAC
+    /* We need a little space for the focus rect. */
+    mLtBootOrder->setContentsMargins (3, 3, 3, 3);
+    mLtBootOrder->setSpacing (3);
+#endif /* Q_WS_MAC */
+
+    /* Limit min/max. size of QLineEdit */
+    mLeMemory->setFixedWidthByText (QString().fill ('8', 5));
+    /* Ensure mLeMemory value and validation is updated */
+    valueChangedRAM (mSlMemory->value());
+
+    /* Setup cpu slider */
+    mSlCPU->setPageStep (1);
+    mSlCPU->setSingleStep (1);
+    mSlCPU->setTickInterval (1);
+    /* Setup the scale so that ticks are at page step boundaries */
+    mSlCPU->setMinimum (mMinGuestCPU);
+    mSlCPU->setMaximum (mMaxGuestCPU);
+    mSlCPU->setOptimalHint (1, hostCPUs);
+    mSlCPU->setWarningHint (hostCPUs, mMaxGuestCPU);
+    /* Limit min/max. size of QLineEdit */
+    mLeCPU->setFixedWidthByText (QString().fill ('8', 3));
+    /* Ensure mLeMemory value and validation is updated */
+    valueChangedCPU (mSlCPU->value());
+    /* Populate chipset combo: */
+    mCbChipset->insertItem(0, vboxGlobal().toString(KChipsetType_PIIX3), QVariant(KChipsetType_PIIX3));
+    mCbChipset->insertItem(1, vboxGlobal().toString(KChipsetType_ICH9), QVariant(KChipsetType_ICH9));
+
+    /* Install global event filter */
+    qApp->installEventFilter (this);
+
+    /* Applying language settings */
+    retranslateUi();
+}
+
+bool UIMachineSettingsSystem::isHWVirtExEnabled() const
+{
+    return mCbVirt->isChecked();
+}
+
+int UIMachineSettingsSystem::cpuCount() const
+{
+    return mSlCPU->value();
+}
+
+bool UIMachineSettingsSystem::isHIDEnabled() const
+{
+    return mCbUseAbsHID->isChecked();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsSystem::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Fill internal variables with corresponding values: */
+    /* Load boot-items of current VM: */
+    QList<KDeviceType> usedBootItems;
+    for (int i = 1; i <= m_possibleBootItems.size(); ++i)
+    {
+        KDeviceType type = m_machine.GetBootOrder(i);
+        if (type != KDeviceType_Null)
+        {
+            usedBootItems << type;
+            UIBootItemData data;
+            data.m_type = type;
+            data.m_fEnabled = true;
+            m_cache.m_bootItems << data;
+        }
+    }
+    /* Load other unique boot-items: */
+    for (int i = 0; i < m_possibleBootItems.size(); ++i)
+    {
+        KDeviceType type = m_possibleBootItems[i];
+        if (!usedBootItems.contains(type))
+        {
+            UIBootItemData data;
+            data.m_type = type;
+            data.m_fEnabled = false;
+            m_cache.m_bootItems << data;
+        }
+    }
+    m_cache.m_fPFHwVirtExSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
+    m_cache.m_fPFPAESupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_PAE);
+    m_cache.m_fIoApicEnabled = m_machine.GetBIOSSettings().GetIOAPICEnabled();
+    m_cache.m_fEFIEnabled = m_machine.GetFirmwareType() >= KFirmwareType_EFI && m_machine.GetFirmwareType() <= KFirmwareType_EFIDUAL;
+    m_cache.m_fUTCEnabled = m_machine.GetRTCUseUTC();
+    m_cache.m_fUseAbsHID = m_machine.GetPointingHidType() == KPointingHidType_USBTablet;
+    m_cache.m_fPAEEnabled = m_machine.GetCPUProperty(KCPUPropertyType_PAE);
+    m_cache.m_fHwVirtExEnabled = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled);
+    m_cache.m_fNestedPagingEnabled = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging);
+    m_cache.m_iRAMSize = m_machine.GetMemorySize();
+    m_cache.m_cCPUCount = m_cache.m_fPFHwVirtExSupported ? m_machine.GetCPUCount() : 1;
+    m_cache.m_chipsetType = m_machine.GetChipsetType();
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsSystem::getFromCache()
+{
+    /* Apply internal variables data to QWidget(s): */
+    for (int i = 0; i < m_cache.m_bootItems.size(); ++i)
+    {
+        UIBootItemData data = m_cache.m_bootItems[i];
+        QString name = vboxGlobal().toString(data.m_type);
+        QTreeWidgetItem *pItem = new QTreeWidgetItem(QStringList(name));
+        pItem->setData(0, ITEM_TYPE_ROLE, QVariant(data.m_type));
+        pItem->setCheckState(0, data.m_fEnabled ? Qt::Checked : Qt::Unchecked);
+        mTwBootOrder->addTopLevelItem(pItem);
+    }
+    mCbApic->setChecked(m_cache.m_fIoApicEnabled);
+    mCbEFI->setChecked(m_cache.m_fEFIEnabled);
+    mCbTCUseUTC->setChecked(m_cache.m_fUTCEnabled);
+    mCbUseAbsHID->setChecked(m_cache.m_fUseAbsHID);
+    mSlCPU->setEnabled(m_cache.m_fPFHwVirtExSupported);
+    mLeCPU->setEnabled(m_cache.m_fPFHwVirtExSupported);
+    mCbPae->setEnabled(m_cache.m_fPFPAESupported);
+    mCbPae->setChecked(m_cache.m_fPAEEnabled);
+    mCbVirt->setEnabled(m_cache.m_fPFHwVirtExSupported);
+    mCbVirt->setChecked(m_cache.m_fHwVirtExEnabled);
+    mCbNestedPaging->setEnabled(m_cache.m_fPFHwVirtExSupported && m_cache.m_fHwVirtExEnabled);
+    mCbNestedPaging->setChecked(m_cache.m_fNestedPagingEnabled);
+    mSlMemory->setValue(m_cache.m_iRAMSize);
+    mSlCPU->setValue(m_cache.m_cCPUCount);
+    int iChipsetPositionPos = mCbChipset->findData(m_cache.m_chipsetType);
+    mCbChipset->setCurrentIndex(iChipsetPositionPos == -1 ? 0 : iChipsetPositionPos);
+    adjustBootOrderTWSize();
+    if (!m_cache.m_fPFHwVirtExSupported)
+        mTwSystem->removeTab(2);
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsSystem::putToCache()
+{
+    /* Gather internal variables data from QWidget(s): */
+    m_cache.m_bootItems.clear();
+    for (int i = 0; i < mTwBootOrder->topLevelItemCount(); ++i)
+    {
+        QTreeWidgetItem *pItem = mTwBootOrder->topLevelItem(i);
+        UIBootItemData data;
+        data.m_type = (KDeviceType)pItem->data(0, ITEM_TYPE_ROLE).toInt();
+        data.m_fEnabled = pItem->checkState(0) == Qt::Checked;
+        m_cache.m_bootItems << data;
+    }
+    m_cache.m_fIoApicEnabled = mCbApic->isChecked() || mSlCPU->value() > 1 ||
+                               (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9;
+    m_cache.m_fEFIEnabled = mCbEFI->isChecked();
+    m_cache.m_fUTCEnabled = mCbTCUseUTC->isChecked();
+    m_cache.m_fUseAbsHID = mCbUseAbsHID->isChecked();
+    m_cache.m_fPAEEnabled = mCbPae->isChecked();
+    m_cache.m_fHwVirtExEnabled = mCbVirt->checkState() == Qt::Checked || mSlCPU->value() > 1;
+    m_cache.m_fNestedPagingEnabled = mCbNestedPaging->isChecked();
+    m_cache.m_iRAMSize = mSlMemory->value();
+    m_cache.m_cCPUCount = mSlCPU->value();
+    m_cache.m_chipsetType = (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt();
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsSystem::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to machine: */
+    UISettingsPageMachine::fetchData(data);
+
+    /* Gather corresponding values from internal variables: */
+    int iBootIndex = 0;
+    /* Save boot-items of current VM: */
+    for (int i = 0; i < m_cache.m_bootItems.size(); ++i)
+    {
+        if (m_cache.m_bootItems[i].m_fEnabled)
+            m_machine.SetBootOrder(++iBootIndex, m_cache.m_bootItems[i].m_type);
+    }
+    /* Save other unique boot-items: */
+    for (int i = 0; i < m_cache.m_bootItems.size(); ++i)
+    {
+        if (!m_cache.m_bootItems[i].m_fEnabled)
+            m_machine.SetBootOrder(++iBootIndex, KDeviceType_Null);
+    }
+    m_machine.GetBIOSSettings().SetIOAPICEnabled(m_cache.m_fIoApicEnabled);
+    m_machine.SetFirmwareType(m_cache.m_fEFIEnabled ? KFirmwareType_EFI : KFirmwareType_BIOS);
+    m_machine.SetRTCUseUTC(m_cache.m_fUTCEnabled);
+    m_machine.SetPointingHidType(m_cache.m_fUseAbsHID ? KPointingHidType_USBTablet : KPointingHidType_PS2Mouse);
+    m_machine.SetCPUProperty(KCPUPropertyType_PAE, m_cache.m_fPAEEnabled);
+    m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, m_cache.m_fHwVirtExEnabled);
+    m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, m_cache.m_fNestedPagingEnabled);
+    m_machine.SetMemorySize(m_cache.m_iRAMSize);
+    m_machine.SetCPUCount(m_cache.m_cCPUCount);
+    m_machine.SetChipsetType(m_cache.m_chipsetType);
+
+    /* Upload machine to data: */
+    UISettingsPageMachine::uploadData(data);
+}
+
+void UIMachineSettingsSystem::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+    connect (mCbApic, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
+    connect (mCbVirt, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
+    connect (mCbUseAbsHID, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
+    connect(mCbChipset, SIGNAL(currentIndexChanged(int)), mValidator, SLOT(revalidate()));
+}
+
+bool UIMachineSettingsSystem::revalidate (QString &aWarning, QString & /* aTitle */)
+{
+    ulong fullSize = vboxGlobal().virtualBox().GetHost().GetMemorySize();
+    if (mSlMemory->value() > (int)mSlMemory->maxRAMAlw())
+    {
+        aWarning = tr (
+            "you have assigned more than <b>%1%</b> of your computer's memory "
+            "(<b>%2</b>) to the virtual machine. Not enough memory is left "
+            "for your host operating system. Please select a smaller amount.")
+            .arg ((unsigned)qRound ((double)mSlMemory->maxRAMAlw() / fullSize * 100.0))
+            .arg (vboxGlobal().formatSize ((uint64_t)fullSize * _1M));
+        return false;
+    }
+    if (mSlMemory->value() > (int)mSlMemory->maxRAMOpt())
+    {
+        aWarning = tr (
+            "you have assigned more than <b>%1%</b> of your computer's memory "
+            "(<b>%2</b>) to the virtual machine. There might not be enough memory "
+            "left for your host operating system. Continue at your own risk.")
+            .arg ((unsigned)qRound ((double)mSlMemory->maxRAMOpt() / fullSize * 100.0))
+            .arg (vboxGlobal().formatSize ((uint64_t)fullSize * _1M));
+        return true;
+    }
+
+    /* VCPU amount test */
+    int totalCPUs = vboxGlobal().virtualBox().GetHost().GetProcessorOnlineCount();
+    if (mSlCPU->value() > 2 * totalCPUs)
+    {
+        aWarning = tr (
+            "for performance reasons, the number of virtual CPUs attached to the "
+            "virtual machine may not be more than twice the number of physical "
+            "CPUs on the host (<b>%1</b>). Please reduce the number of virtual CPUs.")
+            .arg (totalCPUs);
+        return false;
+    }
+    if (mSlCPU->value() > totalCPUs)
+    {
+        aWarning = tr (
+            "you have assigned more virtual CPUs to the virtual machine than "
+            "the number of physical CPUs on your host system (<b>%1</b>). "
+            "This is likely to degrade the performance of your virtual machine. "
+            "Please consider reducing the number of virtual CPUs.")
+            .arg (totalCPUs);
+        return true;
+    }
+
+    /* VCPU IO-APIC test */
+    if (mSlCPU->value() > 1 && !mCbApic->isChecked())
+    {
+        aWarning = tr (
+            "you have assigned more than one virtual CPU to this VM. "
+            "This will not work unless the IO-APIC feature is also enabled. "
+            "This will be done automatically when you accept the VM Settings "
+            "by pressing the OK button.");
+        return true;
+    }
+
+    /* VCPU VT-x/AMD-V test */
+    if (mSlCPU->value() > 1 && !mCbVirt->isChecked())
+    {
+        aWarning = tr (
+            "you have assigned more than one virtual CPU to this VM. "
+            "This will not work unless hardware virtualization (VT-x/AMD-V) is also enabled. "
+            "This will be done automatically when you accept the VM Settings "
+            "by pressing the OK button.");
+        return true;
+    }
+
+    /* Chipset type & IO-APIC test */
+    if ((KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9 && !mCbApic->isChecked())
+    {
+        aWarning = tr (
+            "you have assigned ICH9 chipset type to this VM. "
+            "It will not work properly unless the IO-APIC feature is also enabled. "
+            "This will be done automatically when you accept the VM Settings "
+            "by pressing the OK button.");
+        return true;
+    }
+
+    return true;
+}
+
+void UIMachineSettingsSystem::setOrderAfter (QWidget *aWidget)
+{
+    /* Motherboard tab-order */
+    setTabOrder (aWidget, mTwSystem->focusProxy());
+    setTabOrder (mTwSystem->focusProxy(), mSlMemory);
+    setTabOrder (mSlMemory, mLeMemory);
+    setTabOrder (mLeMemory, mTwBootOrder);
+    setTabOrder (mTwBootOrder, mTbBootItemUp);
+    setTabOrder (mTbBootItemUp, mTbBootItemDown);
+    setTabOrder (mTbBootItemDown, mCbApic);
+    setTabOrder (mCbApic, mCbEFI);
+    setTabOrder (mCbEFI, mCbTCUseUTC);
+    setTabOrder (mCbTCUseUTC, mCbUseAbsHID);
+
+    /* Processor tab-order */
+    setTabOrder (mCbUseAbsHID, mSlCPU);
+    setTabOrder (mSlCPU, mLeCPU);
+    setTabOrder (mLeCPU, mCbPae);
+
+    /* Acceleration tab-order */
+    setTabOrder (mCbPae, mCbVirt);
+    setTabOrder (mCbVirt, mCbNestedPaging);
+}
+
+void UIMachineSettingsSystem::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsSystem::retranslateUi (this);
+
+    /* Adjust the boot order tree widget */
+    mTwBootOrder->header()->setResizeMode (QHeaderView::ResizeToContents);
+    mTwBootOrder->resizeColumnToContents (0);
+    mTwBootOrder->updateGeometry();
+    /* Retranslate the boot order items */
+    QTreeWidgetItemIterator it (mTwBootOrder);
+    while (*it)
+    {
+        QTreeWidgetItem *item = (*it);
+        item->setText (0, vboxGlobal().toString (
+             static_cast <KDeviceType> (item->data (0, ITEM_TYPE_ROLE).toInt())));
+        ++ it;
+    }
+    /* Readjust the tree widget items size */
+    adjustBootOrderTWSize();
+
+    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
+
+    /* Retranslate the memory slider legend */
+    mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (mSlMemory->minRAM()));
+    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (mSlMemory->maxRAM()));
+
+    /* Retranslate the cpu slider legend */
+    mLbCPUMin->setText (tr ("<qt>%1&nbsp;CPU</qt>", "%1 is 1 for now").arg (mMinGuestCPU));
+    mLbCPUMax->setText (tr ("<qt>%1&nbsp;CPUs</qt>", "%1 is host cpu count * 2 for now").arg (mMaxGuestCPU));
+}
+
+void UIMachineSettingsSystem::valueChangedRAM (int aVal)
+{
+    mLeMemory->setText (QString().setNum (aVal));
+}
+
+void UIMachineSettingsSystem::textChangedRAM (const QString &aText)
+{
+    mSlMemory->setValue (aText.toInt());
+}
+
+void UIMachineSettingsSystem::moveBootItemUp()
+{
+    QTreeWidgetItem *item = mTwBootOrder->currentItem();
+    Assert (item);
+    if (!mTwBootOrder->itemAbove (item))
+        return;
+
+    int index = mTwBootOrder->indexOfTopLevelItem (item);
+    QTreeWidgetItem *takenItem = mTwBootOrder->takeTopLevelItem (index);
+    Assert (takenItem == item);
+
+    mTwBootOrder->insertTopLevelItem (index - 1, takenItem);
+    mTwBootOrder->setCurrentItem (item);
+
+    emit tableChanged();
+}
+
+void UIMachineSettingsSystem::moveBootItemDown()
+{
+    QTreeWidgetItem *item = mTwBootOrder->currentItem();
+    Assert (item);
+    if (!mTwBootOrder->itemBelow (item))
+        return;
+
+    int index = mTwBootOrder->indexOfTopLevelItem (item);
+    QTreeWidgetItem *takenItem = mTwBootOrder->takeTopLevelItem (index);
+    Assert (takenItem == item);
+
+    mTwBootOrder->insertTopLevelItem (index + 1, takenItem);
+    mTwBootOrder->setCurrentItem (item);
+
+    emit tableChanged();
+}
+
+void UIMachineSettingsSystem::onCurrentBootItemChanged (QTreeWidgetItem *aItem,
+                                                     QTreeWidgetItem *)
+{
+    bool upEnabled   = aItem && mTwBootOrder->itemAbove (aItem);
+    bool downEnabled = aItem && mTwBootOrder->itemBelow (aItem);
+    if ((mTbBootItemUp->hasFocus() && !upEnabled) ||
+        (mTbBootItemDown->hasFocus() && !downEnabled))
+        mTwBootOrder->setFocus();
+    mTbBootItemUp->setEnabled (upEnabled);
+    mTbBootItemDown->setEnabled (downEnabled);
+}
+
+void UIMachineSettingsSystem::adjustBootOrderTWSize()
+{
+    /* Calculate the optimal size of the tree widget & set it as fixed
+     * size. */
+
+    QAbstractItemView *iv = qobject_cast <QAbstractItemView*> (mTwBootOrder);
+
+    int h = 2 * mTwBootOrder->frameWidth();
+    int w = h;
+#ifdef Q_WS_MAC
+    int left, top, right, bottom;
+    mTwBootOrder->getContentsMargins (&left, &top, &right, &bottom);
+    h += top + bottom;
+    w += left + right;
+#else /* Q_WS_MAC */
+    w += 4;
+#endif /* Q_WS_MAC */
+    mTwBootOrder->setFixedSize (
+        iv->sizeHintForColumn (0) + w,
+        iv->sizeHintForRow (0) * mTwBootOrder->topLevelItemCount() + h);
+
+    /* Update the layout system */
+    if (mTabMotherboard->layout())
+    {
+        mTabMotherboard->layout()->activate();
+        mTabMotherboard->layout()->update();
+    }
+}
+
+void UIMachineSettingsSystem::valueChangedCPU (int aVal)
+{
+    mLeCPU->setText (QString().setNum (aVal));
+}
+
+void UIMachineSettingsSystem::textChangedCPU (const QString &aText)
+{
+    mSlCPU->setValue (aText.toInt());
+}
+
+bool UIMachineSettingsSystem::eventFilter (QObject *aObject, QEvent *aEvent)
+{
+    if (!aObject->isWidgetType())
+        return QWidget::eventFilter (aObject, aEvent);
+
+    QWidget *widget = static_cast<QWidget*> (aObject);
+    if (widget->window() != window())
+        return QWidget::eventFilter (aObject, aEvent);
+
+    switch (aEvent->type())
+    {
+        case QEvent::FocusIn:
+        {
+            /* Boot Table */
+            if (widget == mTwBootOrder)
+            {
+                if (!mTwBootOrder->currentItem())
+                    mTwBootOrder->setCurrentItem (mTwBootOrder->topLevelItem (0));
+                else
+                    onCurrentBootItemChanged (mTwBootOrder->currentItem());
+                mTwBootOrder->currentItem()->setSelected (true);
+            }
+            else if (widget != mTbBootItemUp && widget != mTbBootItemDown)
+            {
+                if (mTwBootOrder->currentItem())
+                {
+                    mTwBootOrder->currentItem()->setSelected (false);
+                    mTbBootItemUp->setEnabled (false);
+                    mTbBootItemDown->setEnabled (false);
+                }
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    return QWidget::eventFilter (aObject, aEvent);
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h	(revision 33882)
@@ -0,0 +1,123 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsSystem class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsSystem_h__
+#define __UIMachineSettingsSystem_h__
+
+#include "COMDefs.h"
+#include "UISettingsPage.h"
+#include "UIMachineSettingsSystem.gen.h"
+
+/* Machine settings / System page / Boot item: */
+struct UIBootItemData
+{
+    KDeviceType m_type;
+    bool m_fEnabled;
+};
+
+/* Machine settings / System page / Cache: */
+struct UISettingsCacheMachineSystem
+{
+    QList<UIBootItemData> m_bootItems;
+    KChipsetType m_chipsetType;
+    bool m_fPFHwVirtExSupported;
+    bool m_fPFPAESupported;
+    bool m_fIoApicEnabled;
+    bool m_fEFIEnabled;
+    bool m_fUTCEnabled;
+    bool m_fUseAbsHID;
+    bool m_fPAEEnabled;
+    bool m_fHwVirtExEnabled;
+    bool m_fNestedPagingEnabled;
+    int m_iRAMSize;
+    int m_cCPUCount;
+};
+
+/* Machine settings / System page: */
+class UIMachineSettingsSystem : public UISettingsPageMachine,
+                             public Ui::UIMachineSettingsSystem
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsSystem();
+
+    bool isHWVirtExEnabled() const;
+    int cpuCount() const;
+    bool isHIDEnabled() const;
+
+signals:
+
+    void tableChanged();
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+    bool revalidate (QString &aWarning, QString &aTitle);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void valueChangedRAM (int aVal);
+    void textChangedRAM (const QString &aText);
+
+    void moveBootItemUp();
+    void moveBootItemDown();
+    void onCurrentBootItemChanged (QTreeWidgetItem *aItem,
+                                   QTreeWidgetItem *aPrev = 0);
+
+    void valueChangedCPU (int aVal);
+    void textChangedCPU (const QString &aText);
+
+private:
+
+    bool eventFilter (QObject *aObject, QEvent *aEvent);
+
+    void adjustBootOrderTWSize();
+
+    QIWidgetValidator *mValidator;
+
+    uint mMinGuestCPU;
+    uint mMaxGuestCPU;
+
+    QList<KDeviceType> m_possibleBootItems;
+
+    /* Cache: */
+    UISettingsCacheMachineSystem m_cache;
+};
+
+#endif // __UIMachineSettingsSystem_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui	(revision 33882)
@@ -0,0 +1,690 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsSystem</class>
+ <widget class="QWidget" name="UIMachineSettingsSystem">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>461</width>
+    <height>378</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="mLtMain">
+   <item>
+    <widget class="QITabWidget" name="mTwSystem">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="mTabMotherboard">
+      <attribute name="title">
+       <string>&amp;Motherboard</string>
+      </attribute>
+      <layout class="QGridLayout" name="mLtMotherboard">
+       <item row="0" column="0">
+        <widget class="QLabel" name="mLbMemory">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>Base &amp;Memory:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy">
+          <cstring>mLeMemory</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" rowspan="2" colspan="2">
+        <layout class="QVBoxLayout" name="mLtMemorySlider">
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="VBoxGuestRAMSlider" name="mSlMemory">
+           <property name="whatsThis">
+            <string>Controls the amount of memory provided to the virtual machine. If you assign too much, the machine might not start.</string>
+           </property>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksBelow</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="mLtMemoryLegend">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="mLbMemoryMin">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="mSpHor1">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="mLbMemoryMax">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="alignment">
+              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item row="0" column="3">
+        <layout class="QHBoxLayout" name="mLtMemoryUnits">
+         <item>
+          <widget class="QILineEdit" name="mLeMemory">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="whatsThis">
+            <string>Controls the amount of memory provided to the virtual machine. If you assign too much, the machine might not start.</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="mLbMemoryUnit">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>MB</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item row="2" column="0">
+        <widget class="QLabel" name="mLbBootOrder">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;Boot Order:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy">
+          <cstring>mTwBootOrder</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" rowspan="2" colspan="2">
+        <layout class="QHBoxLayout" name="mLtBootOrder">
+         <property name="spacing">
+          <number>1</number>
+         </property>
+         <item>
+          <widget class="VBoxBootTable" name="mTwBootOrder">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="whatsThis">
+            <string>Defines the boot device order. Use the checkboxes on the left to enable or disable individual boot devices. Move items up and down to change the device order.</string>
+           </property>
+           <property name="verticalScrollBarPolicy">
+            <enum>Qt::ScrollBarAlwaysOff</enum>
+           </property>
+           <property name="horizontalScrollBarPolicy">
+            <enum>Qt::ScrollBarAlwaysOff</enum>
+           </property>
+           <property name="alternatingRowColors">
+            <bool>true</bool>
+           </property>
+           <property name="rootIsDecorated">
+            <bool>false</bool>
+           </property>
+           <property name="uniformRowHeights">
+            <bool>true</bool>
+           </property>
+           <column>
+            <property name="text">
+             <string/>
+            </property>
+           </column>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="mLtBootOrderButtons">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QIToolButton" name="mTbBootItemUp">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="focusPolicy">
+              <enum>Qt::StrongFocus</enum>
+             </property>
+             <property name="toolTip">
+              <string>Move Up (Ctrl-Up)</string>
+             </property>
+             <property name="whatsThis">
+              <string>Moves the selected boot device up.</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>../images/list_moveup_16px.png</normaloff>../images/list_moveup_16px.png</iconset>
+             </property>
+             <property name="autoRaise">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QIToolButton" name="mTbBootItemDown">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="focusPolicy">
+              <enum>Qt::StrongFocus</enum>
+             </property>
+             <property name="toolTip">
+              <string>Move Down (Ctrl-Down)</string>
+             </property>
+             <property name="whatsThis">
+              <string>Moves the selected boot device down.</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="icon">
+              <iconset>
+               <normaloff>../images/list_movedown_16px.png</normaloff>../images/list_movedown_16px.png</iconset>
+             </property>
+             <property name="autoRaise">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="mSpVer2">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="mSpHor2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>0</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item row="4" column="0">
+        <widget class="QLabel" name="mLbChipset">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;Chipset:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy">
+          <cstring>mCbChipset</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1">
+        <widget class="QComboBox" name="mCbChipset">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>Defines chipset type used in this VM.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0">
+        <widget class="QLabel" name="mLbMotherboardExtended">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>Extended Features:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1" colspan="3">
+        <widget class="QCheckBox" name="mCbApic">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>When checked, the virtual machine will support the Input Output APIC (IO APIC), which may slightly decrease performance. &lt;b&gt;Note:&lt;/b&gt; don't disable this feature after having installed a Windows guest operating system!</string>
+         </property>
+         <property name="text">
+          <string>Enable &amp;IO APIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="1" colspan="3">
+        <widget class="QCheckBox" name="mCbEFI">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>When checked, the guest will support the Extended Firmware Interface (EFI), which is required to boot certain guest OSes. Non-EFI aware OSes will not be able to boot if this option is activated.</string>
+         </property>
+         <property name="text">
+          <string>Enable &amp;EFI (special OSes only)</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="1" colspan="3">
+        <widget class="QCheckBox" name="mCbTCUseUTC" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+           </sizepolicy>
+         </property>
+         <property name="whatsThis" >
+          <string>If checked, the RTC device will report the time in UTC, otherwise in local (host) time. Unix usually expects the hardware clock to be set to UTC.</string>
+         </property>
+         <property name="text" >
+          <string>Hardware clock in &amp;UTC time</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="1" colspan="3">
+        <widget class="QCheckBox" name="mCbUseAbsHID" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+           </sizepolicy>
+         </property>
+         <property name="whatsThis" >
+          <string>If checked, an absolute pointing device (a USB tablet) will be supported. Otherwise, only a standard PS/2 mouse will be emulated.</string>
+         </property>
+         <property name="text" >
+          <string>Enable &amp;absolute pointing device</string>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="0" colspan="4">
+        <spacer name="mSpVer1">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mTabProcessor">
+      <attribute name="title">
+       <string>&amp;Processor</string>
+      </attribute>
+      <layout class="QGridLayout" name="mLtProcessor">
+       <item row="0" column="0">
+        <widget class="QLabel" name="mLbCPU">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&amp;Processor(s):</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+         <property name="buddy">
+          <cstring>mLeCPU</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" rowspan="2">
+        <layout class="QVBoxLayout" name="mLtCPUSlider">
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QIAdvancedSlider" name="mSlCPU">
+           <property name="whatsThis">
+            <string>Controls the number of virtual CPUs in the virtual machine. You need hardware virtualization support on your host system to use more than one virtual CPU.</string>
+           </property>
+           <property name="maximum">
+            <number>4096</number>
+           </property>
+           <property name="singleStep">
+            <number>200</number>
+           </property>
+           <property name="value">
+            <number>512</number>
+           </property>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksBelow</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="mLtCPULegend">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="mLbCPUMin">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="mSpHor4">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="mLbCPUMax">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="alignment">
+              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item row="0" column="2">
+        <widget class="QILineEdit" name="mLeCPU">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>Controls the number of virtual CPUs in the virtual machine. You need hardware virtualization support on your host system to use more than one virtual CPU.</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <widget class="QLabel" name="mLbProcessorExtended">
+         <property name="text">
+          <string>Extended Features:</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" colspan="2">
+        <widget class="QCheckBox" name="mCbPae">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>When checked, the Physical Address Extension (PAE) feature of the host CPU will be exposed to the virtual machine.</string>
+         </property>
+         <property name="text">
+          <string>Enable PA&amp;E/NX</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0" colspan="3">
+        <spacer name="mSpVer3">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="mTabAcceleration">
+      <attribute name="title">
+       <string>Acce&amp;leration</string>
+      </attribute>
+      <layout class="QGridLayout" name="mLtAcceleration">
+       <item row="0" column="0">
+        <widget class="QLabel" name="mLbVirt">
+         <property name="text">
+          <string>Hardware Virtualization:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QCheckBox" name="mCbVirt">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>When checked, the virtual machine will try to make use of the host CPU's hardware virtualization extensions such as Intel VT-x and AMD-V.</string>
+         </property>
+         <property name="text">
+          <string>Enable &amp;VT-x/AMD-V</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QCheckBox" name="mCbNestedPaging">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="whatsThis">
+          <string>When checked, the virtual machine will try to make use of the nested paging extension of Intel VT-x and AMD-V.</string>
+         </property>
+         <property name="text">
+          <string>Enable Nested Pa&amp;ging</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" colspan="2">
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>VBoxBootTable</class>
+   <extends>QTreeWidget</extends>
+   <header>VBoxBootTable.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QILineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>QILineEdit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIAdvancedSlider</class>
+   <extends>QSlider</extends>
+   <header>QIAdvancedSlider.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxGuestRAMSlider</class>
+   <extends>QIAdvancedSlider</extends>
+   <header>VBoxGuestRAMSlider.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIToolButton</class>
+   <extends>QToolButton</extends>
+   <header>QIToolButton.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QITabWidget</class>
+   <extends>QTabWidget</extends>
+   <header>QITabWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mCbVirt</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mCbNestedPaging</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>195</x>
+     <y>50</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>196</x>
+     <y>72</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp	(revision 33882)
@@ -0,0 +1,800 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsUSB class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Local includes */
+#include "QIWidgetValidator.h"
+#include "UIIconPool.h"
+#include "VBoxGlobal.h"
+#include "UIToolBar.h"
+#include "UIMachineSettingsUSB.h"
+#include "UIMachineSettingsUSBFilterDetails.h"
+
+/* Global includes */
+#include <QHeaderView>
+
+UIMachineSettingsUSB::UIMachineSettingsUSB(UISettingsPageType type)
+    : UISettingsPage(type)
+    , mValidator(0)
+    , mNewAction(0), mAddAction(0), mEdtAction(0), mDelAction(0)
+    , mMupAction(0), mMdnAction(0)
+    , mMenu(0), mUSBDevicesMenu(0)
+    , mUSBFilterListModified(false)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsUSB::setupUi (this);
+
+    /* Prepare actions */
+    mNewAction = new QAction (mTwFilters);
+    mAddAction = new QAction (mTwFilters);
+    mEdtAction = new QAction (mTwFilters);
+    mDelAction = new QAction (mTwFilters);
+    mMupAction = new QAction (mTwFilters);
+    mMdnAction = new QAction (mTwFilters);
+
+    mNewAction->setShortcut (QKeySequence ("Ins"));
+    mAddAction->setShortcut (QKeySequence ("Alt+Ins"));
+    mEdtAction->setShortcut (QKeySequence ("Ctrl+Return"));
+    mDelAction->setShortcut (QKeySequence ("Del"));
+    mMupAction->setShortcut (QKeySequence ("Ctrl+Up"));
+    mMdnAction->setShortcut (QKeySequence ("Ctrl+Down"));
+
+    mNewAction->setIcon(UIIconPool::iconSet(":/usb_new_16px.png",
+                                            ":/usb_new_disabled_16px.png"));
+    mAddAction->setIcon(UIIconPool::iconSet(":/usb_add_16px.png",
+                                            ":/usb_add_disabled_16px.png"));
+    mEdtAction->setIcon(UIIconPool::iconSet(":/usb_filter_edit_16px.png",
+                                            ":/usb_filter_edit_disabled_16px.png"));
+    mDelAction->setIcon(UIIconPool::iconSet(":/usb_remove_16px.png",
+                                            ":/usb_remove_disabled_16px.png"));
+    mMupAction->setIcon(UIIconPool::iconSet(":/usb_moveup_16px.png",
+                                            ":/usb_moveup_disabled_16px.png"));
+    mMdnAction->setIcon(UIIconPool::iconSet(":/usb_movedown_16px.png",
+                                            ":/usb_movedown_disabled_16px.png"));
+
+    /* Prepare menu and toolbar */
+    mMenu = new QMenu (mTwFilters);
+    mMenu->addAction (mNewAction);
+    mMenu->addAction (mAddAction);
+    mMenu->addSeparator();
+    mMenu->addAction (mEdtAction);
+    mMenu->addSeparator();
+    mMenu->addAction (mDelAction);
+    mMenu->addSeparator();
+    mMenu->addAction (mMupAction);
+    mMenu->addAction (mMdnAction);
+
+    /* Prepare toolbar */
+    UIToolBar *toolBar = new UIToolBar (mWtFilterHandler);
+    toolBar->setUsesTextLabel (false);
+    toolBar->setIconSize (QSize (16, 16));
+    toolBar->setOrientation (Qt::Vertical);
+    toolBar->addAction (mNewAction);
+    toolBar->addAction (mAddAction);
+    toolBar->addAction (mEdtAction);
+    toolBar->addAction (mDelAction);
+    toolBar->addAction (mMupAction);
+    toolBar->addAction (mMdnAction);
+    toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
+    toolBar->updateGeometry();
+    toolBar->setMinimumHeight (toolBar->sizeHint().height());
+    mWtFilterHandler->layout()->addWidget (toolBar);
+
+    /* Setup connections */
+    connect (mGbUSB, SIGNAL (toggled (bool)),
+             this, SLOT (usbAdapterToggled (bool)));
+    connect (mTwFilters, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
+             this, SLOT (currentChanged (QTreeWidgetItem*, QTreeWidgetItem*)));
+    connect (mTwFilters, SIGNAL (customContextMenuRequested (const QPoint &)),
+             this, SLOT (showContextMenu (const QPoint &)));
+    connect (mTwFilters, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)),
+             this, SLOT (edtClicked()));
+    connect (mTwFilters, SIGNAL (itemChanged (QTreeWidgetItem *, int)),
+             this, SLOT (sltUpdateActivityState(QTreeWidgetItem *)));
+
+    mUSBDevicesMenu = new VBoxUSBMenu (this);
+    connect (mUSBDevicesMenu, SIGNAL (triggered (QAction*)),
+             this, SLOT (addConfirmed (QAction *)));
+    connect (mNewAction, SIGNAL (triggered (bool)),
+             this, SLOT (newClicked()));
+    connect (mAddAction, SIGNAL (triggered (bool)),
+             this, SLOT (addClicked()));
+    connect (mEdtAction, SIGNAL (triggered (bool)),
+             this, SLOT (edtClicked()));
+    connect (mDelAction, SIGNAL (triggered (bool)),
+             this, SLOT (delClicked()));
+    connect (mMupAction, SIGNAL (triggered (bool)),
+             this, SLOT (mupClicked()));
+    connect (mMdnAction, SIGNAL (triggered (bool)),
+             this, SLOT (mdnClicked()));
+
+    /* Setup dialog */
+    mTwFilters->header()->hide();
+
+    /* Applying language settings */
+    retranslateUi();
+
+#ifndef VBOX_WITH_EHCI
+    mCbUSB2->setHidden(true);
+#endif
+}
+
+bool UIMachineSettingsUSB::isOHCIEnabled() const
+{
+    return mGbUSB->isChecked();
+}
+
+/* Load data to cashe from corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsUSB::loadToCacheFrom(QVariant &data)
+{
+    /* Fetch data to properties & settings or machine: */
+    fetchData(data);
+
+    /* Depending on page type: */
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+        {
+            /* Fill internal variables with corresponding values: */
+            m_cache.m_fUSBEnabled = false;
+            m_cache.m_fEHCIEnabled = false;
+            const CHostUSBDeviceFilterVector &filters = vboxGlobal().virtualBox().GetHost().GetUSBDeviceFilters();
+            for (int iFilterIndex = 0; iFilterIndex < filters.size(); ++iFilterIndex)
+            {
+                const CHostUSBDeviceFilter &filter = filters[iFilterIndex];
+                UIUSBFilterData data;
+                data.m_fActive = filter.GetActive();
+                data.m_strName = filter.GetName();
+                data.m_strVendorId = filter.GetVendorId();
+                data.m_strProductId = filter.GetProductId();
+                data.m_strRevision = filter.GetRevision();
+                data.m_strManufacturer = filter.GetManufacturer();
+                data.m_strProduct = filter.GetProduct();
+                data.m_strSerialNumber = filter.GetSerialNumber();
+                data.m_strPort = filter.GetPort();
+                data.m_strRemote = filter.GetRemote();
+                data.m_action = filter.GetAction();
+                CHostUSBDevice hostUSBDevice(filter);
+                if (!hostUSBDevice.isNull())
+                {
+                    data.m_fHostUSBDevice = true;
+                    data.m_hostUSBDeviceState = hostUSBDevice.GetState();
+                }
+                else
+                {
+                    data.m_fHostUSBDevice = false;
+                    data.m_hostUSBDeviceState = KUSBDeviceState_NotSupported;
+                }
+                m_cache.m_items << data;
+            }
+            break;
+        }
+        case UISettingsPageType_Machine:
+        {
+            /* Initialize machine COM storage: */
+            m_machine = data.value<UISettingsDataMachine>().m_machine;
+            /* Fill internal variables with corresponding values: */
+            const CUSBController &ctl = m_machine.GetUSBController();
+            bool fIsControllerAvailable = !ctl.isNull();
+            m_cache.m_fUSBEnabled = fIsControllerAvailable && ctl.GetEnabled();
+            m_cache.m_fEHCIEnabled = fIsControllerAvailable && ctl.GetEnabledEhci();
+            if (fIsControllerAvailable)
+            {
+                const CUSBDeviceFilterVector &filters = ctl.GetDeviceFilters();
+                for (int iFilterIndex = 0; iFilterIndex < filters.size(); ++iFilterIndex)
+                {
+                    const CUSBDeviceFilter &filter = filters[iFilterIndex];
+                    UIUSBFilterData data;
+                    data.m_fActive = filter.GetActive();
+                    data.m_strName = filter.GetName();
+                    data.m_strVendorId = filter.GetVendorId();
+                    data.m_strProductId = filter.GetProductId();
+                    data.m_strRevision = filter.GetRevision();
+                    data.m_strManufacturer = filter.GetManufacturer();
+                    data.m_strProduct = filter.GetProduct();
+                    data.m_strSerialNumber = filter.GetSerialNumber();
+                    data.m_strPort = filter.GetPort();
+                    data.m_strRemote = filter.GetRemote();
+                    data.m_fHostUSBDevice = false;
+                    m_cache.m_items << data;
+                }
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    /* Upload properties & settings or machine to data: */
+    uploadData(data);
+}
+
+/* Load data to corresponding widgets from cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsUSB::getFromCache()
+{
+    /* Depending on page type: */
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+        {
+            /* Apply internal variables data to QWidget(s): */
+            mGbUSB->setVisible(false);
+            mCbUSB2->setVisible(false);
+            break;
+        }
+        case UISettingsPageType_Machine:
+        {
+            /* Apply internal variables data to QWidget(s): */
+            mGbUSB->setChecked(m_cache.m_fUSBEnabled);
+            mCbUSB2->setChecked(m_cache.m_fEHCIEnabled);
+            usbAdapterToggled(mGbUSB->isChecked());
+            break;
+        }
+        default:
+            break;
+    }
+    /* Apply internal variables data to QWidget(s): */
+    for (int iFilterIndex = 0; iFilterIndex < m_cache.m_items.size(); ++iFilterIndex)
+        addUSBFilter(m_cache.m_items[iFilterIndex], false /* its new? */);
+    /* Choose first filter as current: */
+    mTwFilters->setCurrentItem(mTwFilters->topLevelItem(0));
+    currentChanged(mTwFilters->currentItem());
+    /* Mark dialog as not edited:  */
+    mUSBFilterListModified = false;
+
+    /* Revalidate if possible: */
+    if (mValidator) mValidator->revalidate();
+}
+
+/* Save data from corresponding widgets to cache,
+ * this task SHOULD be performed in GUI thread only: */
+void UIMachineSettingsUSB::putToCache()
+{
+    /* Depending on page type: */
+    switch (type())
+    {
+        case UISettingsPageType_Machine:
+        {
+            /* Gather internal variables data from QWidget(s): */
+            m_cache.m_fUSBEnabled = mGbUSB->isChecked();
+            m_cache.m_fEHCIEnabled = mCbUSB2->isChecked();
+            break;
+        }
+        default:
+            break;
+    }
+}
+
+/* Save data from cache to corresponding external object(s),
+ * this task COULD be performed in other than GUI thread: */
+void UIMachineSettingsUSB::saveFromCacheTo(QVariant &data)
+{
+    /* Fetch data to properties & settings or machine: */
+    fetchData(data);
+
+    /* Depending on page type: */
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+        {
+            /* Gather corresponding values from internal variables: */
+            if (mUSBFilterListModified)
+            {
+                /* Get host: */
+                CHost host = vboxGlobal().virtualBox().GetHost();
+                /* First, remove all old filters: */
+                for (ulong count = host.GetUSBDeviceFilters().size(); count; --count)
+                    host.RemoveUSBDeviceFilter(0);
+                /* Then add all new filters: */
+                for (int iFilterIndex = 0; iFilterIndex < m_cache.m_items.size(); ++iFilterIndex)
+                {
+                    UIUSBFilterData data = m_cache.m_items[iFilterIndex];
+                    CHostUSBDeviceFilter hostFilter = host.CreateUSBDeviceFilter(data.m_strName);
+                    hostFilter.SetActive(data.m_fActive);
+                    hostFilter.SetVendorId(data.m_strVendorId);
+                    hostFilter.SetProductId(data.m_strProductId);
+                    hostFilter.SetRevision(data.m_strRevision);
+                    hostFilter.SetManufacturer(data.m_strManufacturer);
+                    hostFilter.SetProduct(data.m_strProduct);
+                    hostFilter.SetSerialNumber(data.m_strSerialNumber);
+                    hostFilter.SetPort(data.m_strPort);
+                    hostFilter.SetRemote(data.m_strRemote);
+                    hostFilter.SetAction(data.m_action);
+                    host.InsertUSBDeviceFilter(host.GetUSBDeviceFilters().size(), hostFilter);
+                }
+            }
+            break;
+        }
+        case UISettingsPageType_Machine:
+        {
+            /* Initialize machine COM storage: */
+            m_machine = data.value<UISettingsDataMachine>().m_machine;
+            /* Get machine USB controller: */
+            CUSBController ctl = m_machine.GetUSBController();
+            /* Gather corresponding values from internal variables: */
+            if (!ctl.isNull())
+            {
+                ctl.SetEnabled(m_cache.m_fUSBEnabled);
+                ctl.SetEnabledEhci(m_cache.m_fEHCIEnabled);
+                if (mUSBFilterListModified)
+                {
+                    /* First, remove all old filters: */
+                    for (ulong count = ctl.GetDeviceFilters().size(); count; --count)
+                        ctl.RemoveDeviceFilter(0);
+                    /* Then add all new filters: */
+                    for (int iFilterIndex = 0; iFilterIndex < m_cache.m_items.size(); ++iFilterIndex)
+                    {
+                        const UIUSBFilterData &data = m_cache.m_items[iFilterIndex];
+                        CUSBDeviceFilter filter = ctl.CreateDeviceFilter(data.m_strName);
+                        filter.SetActive(data.m_fActive);
+                        filter.SetVendorId(data.m_strVendorId);
+                        filter.SetProductId(data.m_strProductId);
+                        filter.SetRevision(data.m_strRevision);
+                        filter.SetManufacturer(data.m_strManufacturer);
+                        filter.SetProduct(data.m_strProduct);
+                        filter.SetSerialNumber(data.m_strSerialNumber);
+                        filter.SetPort(data.m_strPort);
+                        filter.SetRemote(data.m_strRemote);
+                        ctl.InsertDeviceFilter(~0, filter);
+                    }
+                }
+            }
+            break;
+        }
+        default:
+            break;
+    }
+
+    /* Upload properties & settings or machine to data: */
+    uploadData(data);
+}
+
+void UIMachineSettingsUSB::setValidator (QIWidgetValidator *aVal)
+{
+    mValidator = aVal;
+    connect (mGbUSB, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
+}
+
+void UIMachineSettingsUSB::setOrderAfter (QWidget *aWidget)
+{
+    setTabOrder (aWidget, mGbUSB);
+    setTabOrder (mGbUSB, mCbUSB2);
+    setTabOrder (mCbUSB2, mTwFilters);
+}
+
+void UIMachineSettingsUSB::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsUSB::retranslateUi (this);
+
+    mNewAction->setText (tr ("&Add Empty Filter"));
+    mAddAction->setText (tr ("A&dd Filter From Device"));
+    mEdtAction->setText (tr ("&Edit Filter"));
+    mDelAction->setText (tr ("&Remove Filter"));
+    mMupAction->setText (tr ("&Move Filter Up"));
+    mMdnAction->setText (tr ("M&ove Filter Down"));
+
+    mNewAction->setToolTip (mNewAction->text().remove ('&') +
+        QString (" (%1)").arg (mNewAction->shortcut().toString()));
+    mAddAction->setToolTip (mAddAction->text().remove ('&') +
+        QString (" (%1)").arg (mAddAction->shortcut().toString()));
+    mEdtAction->setToolTip (mEdtAction->text().remove ('&') +
+        QString (" (%1)").arg (mEdtAction->shortcut().toString()));
+    mDelAction->setToolTip (mDelAction->text().remove ('&') +
+        QString (" (%1)").arg (mDelAction->shortcut().toString()));
+    mMupAction->setToolTip (mMupAction->text().remove ('&') +
+        QString (" (%1)").arg (mMupAction->shortcut().toString()));
+    mMdnAction->setToolTip (mMdnAction->text().remove ('&') +
+        QString (" (%1)").arg (mMdnAction->shortcut().toString()));
+
+    mNewAction->setWhatsThis (tr ("Adds a new USB filter with all fields "
+                                  "initially set to empty strings. Note "
+                                  "that such a filter will match any "
+                                  "attached USB device."));
+    mAddAction->setWhatsThis (tr ("Adds a new USB filter with all fields "
+                                  "set to the values of the selected USB "
+                                  "device attached to the host PC."));
+    mEdtAction->setWhatsThis (tr ("Edits the selected USB filter."));
+    mDelAction->setWhatsThis (tr ("Removes the selected USB filter."));
+    mMupAction->setWhatsThis (tr ("Moves the selected USB filter up."));
+    mMdnAction->setWhatsThis (tr ("Moves the selected USB filter down."));
+
+    mUSBFilterName = tr ("New Filter %1", "usb");
+}
+
+void UIMachineSettingsUSB::usbAdapterToggled (bool aOn)
+{
+    mGbUSBFilters->setEnabled (aOn);
+}
+
+void UIMachineSettingsUSB::currentChanged (QTreeWidgetItem *aItem,
+                                        QTreeWidgetItem *)
+{
+    /* Make sure only the current item if present => selected */
+    if (mTwFilters->selectedItems().count() != 1 ||
+        mTwFilters->selectedItems() [0] != aItem)
+    {
+        QList<QTreeWidgetItem*> list = mTwFilters->selectedItems();
+        for (int i = 0; i < list.size(); ++ i)
+            list [i]->setSelected (false);
+        if (aItem)
+            aItem->setSelected (true);
+    }
+
+    /* Enable/disable operational buttons */
+    mEdtAction->setEnabled (aItem);
+    mDelAction->setEnabled (aItem);
+    mMupAction->setEnabled (aItem && mTwFilters->itemAbove (aItem));
+    mMdnAction->setEnabled (aItem && mTwFilters->itemBelow (aItem));
+}
+
+void UIMachineSettingsUSB::newClicked()
+{
+    /* Search for the max available filter index */
+    int maxFilterIndex = 0;
+    QRegExp regExp (QString ("^") + mUSBFilterName.arg ("([0-9]+)") + QString ("$"));
+    QTreeWidgetItemIterator iterator (mTwFilters);
+    while (*iterator)
+    {
+        QString filterName = (*iterator)->text (0);
+        int pos = regExp.indexIn (filterName);
+        if (pos != -1)
+            maxFilterIndex = regExp.cap (1).toInt() > maxFilterIndex ?
+                             regExp.cap (1).toInt() : maxFilterIndex;
+        ++ iterator;
+    }
+
+    /* Add new corresponding list item to the cache: */
+    UIUSBFilterData data;
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+            data.m_action = KUSBDeviceFilterAction_Hold;
+            break;
+        default:
+            break;
+    }
+    data.m_fActive = true;
+    data.m_strName = mUSBFilterName.arg(maxFilterIndex + 1);
+    data.m_fHostUSBDevice = false;
+    m_cache.m_items << data;
+
+    /* Add new corresponding tree-widget-item to the tree-widget: */
+    addUSBFilter(data, true /* its new? */);
+    /* Mark filter's list as edited: */
+    markSettingsChanged();
+    /* Revalidate if possible: */
+    if (mValidator)
+        mValidator->revalidate();
+}
+
+void UIMachineSettingsUSB::addClicked()
+{
+    mUSBDevicesMenu->exec (QCursor::pos());
+}
+
+void UIMachineSettingsUSB::addConfirmed (QAction *aAction)
+{
+    /* Get USB device: */
+    CUSBDevice usb = mUSBDevicesMenu->getUSB (aAction);
+    /* if null then some other item but a USB device is selected */
+    if (usb.isNull())
+        return;
+
+    /* Add new corresponding list item to the cache: */
+    UIUSBFilterData data;
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+            data.m_action = KUSBDeviceFilterAction_Hold;
+            /* Check that under host (global) USB settings if they will be enabled! */
+            data.m_fHostUSBDevice = false;
+            break;
+        case UISettingsPageType_Machine:
+            data.m_fHostUSBDevice = false;
+            break;
+        default:
+            break;
+    }
+    data.m_fActive = true;
+    data.m_strName = vboxGlobal().details(usb);
+    data.m_strVendorId = QString().sprintf("%04hX", usb.GetVendorId());
+    data.m_strProductId = QString().sprintf("%04hX", usb.GetProductId());
+    data.m_strRevision = QString().sprintf("%04hX", usb.GetRevision());
+    /* The port property depends on the host computer rather than on the USB
+     * device itself; for this reason only a few people will want to use it
+     * in the filter since the same device plugged into a different socket
+     * will not match the filter in this case. */
+#if 0
+    data.m_strPort = QString().sprintf("%04hX", usb.GetPort());
+#endif
+    data.m_strManufacturer = usb.GetManufacturer();
+    data.m_strProduct = usb.GetProduct();
+    data.m_strSerialNumber = usb.GetSerialNumber();
+    data.m_strRemote = QString::number(usb.GetRemote());
+    m_cache.m_items << data;
+
+    /* Add new corresponding tree-widget-item to the tree-widget: */
+    addUSBFilter(data, true /* its new? */);
+    /* Mark filter's list as edited: */
+    markSettingsChanged();
+    /* Revalidate if possible: */
+    if (mValidator)
+        mValidator->revalidate();
+}
+
+void UIMachineSettingsUSB::edtClicked()
+{
+    /* Get current USB filter item: */
+    QTreeWidgetItem *pItem = mTwFilters->currentItem();
+    Assert(pItem);
+    UIUSBFilterData &data = m_cache.m_items[mTwFilters->indexOfTopLevelItem(pItem)];
+
+    /* Configure USB filter details dialog: */
+    UIMachineSettingsUSBFilterDetails dlgFilterDetails(type(), this);
+    dlgFilterDetails.mLeName->setText(data.m_strName);
+    dlgFilterDetails.mLeVendorID->setText(data.m_strVendorId);
+    dlgFilterDetails.mLeProductID->setText(data.m_strProductId);
+    dlgFilterDetails.mLeRevision->setText(data.m_strRevision);
+    dlgFilterDetails.mLePort->setText(data.m_strPort);
+    dlgFilterDetails.mLeManufacturer->setText(data.m_strManufacturer);
+    dlgFilterDetails.mLeProduct->setText(data.m_strProduct);
+    dlgFilterDetails.mLeSerialNo->setText(data.m_strSerialNumber);
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+        {
+            if (data.m_action == KUSBDeviceFilterAction_Ignore)
+                dlgFilterDetails.mCbAction->setCurrentIndex(0);
+            else if (data.m_action == KUSBDeviceFilterAction_Hold)
+                dlgFilterDetails.mCbAction->setCurrentIndex(1);
+            else
+                AssertMsgFailed(("Invalid USBDeviceFilterAction type"));
+            break;
+        }
+        case UISettingsPageType_Machine:
+        {
+            QString strRemote = data.m_strRemote.toLower();
+            if (strRemote == "yes" || strRemote == "true" || strRemote == "1")
+                dlgFilterDetails.mCbRemote->setCurrentIndex(ModeOn);
+            else if (strRemote == "no" || strRemote == "false" || strRemote == "0")
+                dlgFilterDetails.mCbRemote->setCurrentIndex(ModeOff);
+            else
+                dlgFilterDetails.mCbRemote->setCurrentIndex(ModeAny);
+            break;
+        }
+        default:
+            break;
+    }
+
+    /* Run USB filter details dialog: */
+    if (dlgFilterDetails.exec() == QDialog::Accepted)
+    {
+        data.m_strName = dlgFilterDetails.mLeName->text().isEmpty() ? QString::null : dlgFilterDetails.mLeName->text();
+        data.m_strVendorId = dlgFilterDetails.mLeVendorID->text().isEmpty() ? QString::null : dlgFilterDetails.mLeVendorID->text();
+        data.m_strProductId = dlgFilterDetails.mLeProductID->text().isEmpty() ? QString::null : dlgFilterDetails.mLeProductID->text();
+        data.m_strRevision = dlgFilterDetails.mLeRevision->text().isEmpty() ? QString::null : dlgFilterDetails.mLeRevision->text();
+        data.m_strManufacturer = dlgFilterDetails.mLeManufacturer->text().isEmpty() ? QString::null : dlgFilterDetails.mLeManufacturer->text();
+        data.m_strProduct = dlgFilterDetails.mLeProduct->text().isEmpty() ? QString::null : dlgFilterDetails.mLeProduct->text();
+        data.m_strSerialNumber = dlgFilterDetails.mLeSerialNo->text().isEmpty() ? QString::null : dlgFilterDetails.mLeSerialNo->text();
+        data.m_strPort = dlgFilterDetails.mLePort->text().isEmpty() ? QString::null : dlgFilterDetails.mLePort->text();
+        switch (type())
+        {
+            case UISettingsPageType_Global:
+            {
+                data.m_action = vboxGlobal().toUSBDevFilterAction(dlgFilterDetails.mCbAction->currentText());
+                break;
+            }
+            case UISettingsPageType_Machine:
+            {
+                switch (dlgFilterDetails.mCbRemote->currentIndex())
+                {
+                    case ModeAny: data.m_strRemote = QString(); break;
+                    case ModeOn:  data.m_strRemote = QString::number(1); break;
+                    case ModeOff: data.m_strRemote = QString::number(0); break;
+                    default: AssertMsgFailed(("Invalid combo box index"));
+                }
+                break;
+            }
+            default:
+                break;
+        }
+        pItem->setText(0, data.m_strName);
+        pItem->setToolTip(0, toolTipFor(data));
+        /* Mark filter's list as edited: */
+        markSettingsChanged();
+    }
+}
+
+void UIMachineSettingsUSB::delClicked()
+{
+    /* Get current USB filter item: */
+    QTreeWidgetItem *pItem = mTwFilters->currentItem();
+    Assert(pItem);
+
+    /* Delete corresponding items: */
+    m_cache.m_items.removeAt(mTwFilters->indexOfTopLevelItem(pItem));
+    delete pItem;
+
+    /* Update current item: */
+    currentChanged(mTwFilters->currentItem());
+    /* Mark filter's list as edited: */
+    markSettingsChanged();
+    /* Revalidate if possible: */
+    if (!mTwFilters->topLevelItemCount())
+    {
+        if (mValidator)
+        {
+            mValidator->rescan();
+            mValidator->revalidate();
+        }
+    }
+}
+
+void UIMachineSettingsUSB::mupClicked()
+{
+    QTreeWidgetItem *item = mTwFilters->currentItem();
+    Assert (item);
+
+    int index = mTwFilters->indexOfTopLevelItem (item);
+    QTreeWidgetItem *takenItem = mTwFilters->takeTopLevelItem (index);
+    Assert (item == takenItem);
+    mTwFilters->insertTopLevelItem (index - 1, takenItem);
+    m_cache.m_items.swap (index, index - 1);
+
+    mTwFilters->setCurrentItem (takenItem);
+    markSettingsChanged();
+}
+
+void UIMachineSettingsUSB::mdnClicked()
+{
+    QTreeWidgetItem *item = mTwFilters->currentItem();
+    Assert (item);
+
+    int index = mTwFilters->indexOfTopLevelItem (item);
+    QTreeWidgetItem *takenItem = mTwFilters->takeTopLevelItem (index);
+    Assert (item == takenItem);
+    mTwFilters->insertTopLevelItem (index + 1, takenItem);
+    m_cache.m_items.swap (index, index + 1);
+
+    mTwFilters->setCurrentItem (takenItem);
+    markSettingsChanged();
+}
+
+void UIMachineSettingsUSB::showContextMenu (const QPoint &aPos)
+{
+    mMenu->exec (mTwFilters->mapToGlobal (aPos));
+}
+
+void UIMachineSettingsUSB::sltUpdateActivityState(QTreeWidgetItem *pChangedItem)
+{
+    /* Check changed USB filter item: */
+    Assert(pChangedItem);
+
+    /* Delete corresponding items: */
+    UIUSBFilterData &data = m_cache.m_items[mTwFilters->indexOfTopLevelItem(pChangedItem)];
+    data.m_fActive = pChangedItem->checkState(0) == Qt::Checked;
+
+    markSettingsChanged();
+}
+
+void UIMachineSettingsUSB::markSettingsChanged()
+{
+    mUSBFilterListModified = true;
+}
+
+void UIMachineSettingsUSB::addUSBFilter(const UIUSBFilterData &data, bool fIsNew)
+{
+    /* Append tree-widget with item: */
+    QTreeWidgetItem *pItem = new QTreeWidgetItem;
+    pItem->setCheckState(0, data.m_fActive ? Qt::Checked : Qt::Unchecked);
+    pItem->setText(0, data.m_strName);
+    pItem->setToolTip(0, toolTipFor(data));
+    mTwFilters->addTopLevelItem(pItem);
+
+    /* Select this item if its new: */
+    if (fIsNew)
+        mTwFilters->setCurrentItem(pItem);
+}
+
+/* Fetch data to m_properties & m_settings or m_machine: */
+void UIMachineSettingsUSB::fetchData(const QVariant &data)
+{
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+        {
+            m_properties = data.value<UISettingsDataGlobal>().m_properties;
+            m_settings = data.value<UISettingsDataGlobal>().m_settings;
+            break;
+        }
+        case UISettingsPageType_Machine:
+        {
+            m_machine = data.value<UISettingsDataMachine>().m_machine;
+            break;
+        }
+        default:
+            break;
+    }
+}
+
+/* Upload m_properties & m_settings or m_machine to data: */
+void UIMachineSettingsUSB::uploadData(QVariant &data) const
+{
+    switch (type())
+    {
+        case UISettingsPageType_Global:
+        {
+            data = QVariant::fromValue(UISettingsDataGlobal(m_properties, m_settings));
+            break;
+        }
+        case UISettingsPageType_Machine:
+        {
+            data = QVariant::fromValue(UISettingsDataMachine(m_machine));
+            break;
+        }
+        default:
+            break;
+    }
+}
+
+/* static */ QString UIMachineSettingsUSB::toolTipFor(const UIUSBFilterData &data)
+{
+    /* Prepare tool-tip: */
+    QString strToolTip;
+
+    QString strVendorId = data.m_strVendorId;
+    if (!strVendorId.isEmpty())
+        strToolTip += tr("<nobr>Vendor ID: %1</nobr>", "USB filter tooltip").arg(strVendorId);
+
+    QString strProductId = data.m_strProductId;
+    if (!strProductId.isEmpty())
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>Product ID: %2</nobr>", "USB filter tooltip").arg(strProductId);
+
+    QString strRevision = data.m_strRevision;
+    if (!strRevision.isEmpty())
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>Revision: %3</nobr>", "USB filter tooltip").arg(strRevision);
+
+    QString strProduct = data.m_strProduct;
+    if (!strProduct.isEmpty())
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>Product: %4</nobr>", "USB filter tooltip").arg(strProduct);
+
+    QString strManufacturer = data.m_strManufacturer;
+    if (!strManufacturer.isEmpty())
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>Manufacturer: %5</nobr>", "USB filter tooltip").arg(strManufacturer);
+
+    QString strSerial = data.m_strSerialNumber;
+    if (!strSerial.isEmpty())
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>Serial No.: %1</nobr>", "USB filter tooltip").arg(strSerial);
+
+    QString strPort = data.m_strPort;
+    if (!strPort.isEmpty())
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>Port: %1</nobr>", "USB filter tooltip").arg(strPort);
+
+    /* Add the state field if it's a host USB device: */
+    if (data.m_fHostUSBDevice)
+    {
+        strToolTip += strToolTip.isEmpty() ? "":"<br/>" + tr("<nobr>State: %1</nobr>", "USB filter tooltip")
+                                                          .arg(vboxGlobal().toString(data.m_hostUSBDeviceState));
+    }
+
+    return strToolTip;
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h	(revision 33882)
@@ -0,0 +1,153 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsUSB class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsUSB_h__
+#define __UIMachineSettingsUSB_h__
+
+#include "UISettingsPage.h"
+#include "UIMachineSettingsUSB.gen.h"
+#include "COMDefs.h"
+
+class VBoxUSBMenu;
+
+/* Common settings / USB page / Filter data: */
+struct UIUSBFilterData
+{
+    /* Common: */
+    bool m_fActive;
+    QString m_strName;
+    QString m_strVendorId;
+    QString m_strProductId;
+    QString m_strRevision;
+    QString m_strManufacturer;
+    QString m_strProduct;
+    QString m_strSerialNumber;
+    QString m_strPort;
+    QString m_strRemote;
+
+    /* Host only: */
+    KUSBDeviceFilterAction m_action;
+    bool m_fHostUSBDevice;
+    KUSBDeviceState m_hostUSBDeviceState;
+};
+
+/* Common settings / USB page / Cache: */
+struct UISettingsCacheCommonUSB
+{
+    bool m_fUSBEnabled;
+    bool m_fEHCIEnabled;
+    QList<UIUSBFilterData> m_items;
+};
+
+/* Common settings / USB page: */
+class UIMachineSettingsUSB : public UISettingsPage,
+                          public Ui::UIMachineSettingsUSB
+{
+    Q_OBJECT;
+
+public:
+
+    enum RemoteMode
+    {
+        ModeAny = 0,
+        ModeOn,
+        ModeOff
+    };
+
+    UIMachineSettingsUSB(UISettingsPageType type);
+
+    bool isOHCIEnabled() const;
+
+protected:
+
+    /* Load data to cashe from corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void loadToCacheFrom(QVariant &data);
+    /* Load data to corresponding widgets from cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void getFromCache();
+
+    /* Save data from corresponding widgets to cache,
+     * this task SHOULD be performed in GUI thread only: */
+    void putToCache();
+    /* Save data from cache to corresponding external object(s),
+     * this task COULD be performed in other than GUI thread: */
+    void saveFromCacheTo(QVariant &data);
+
+    void setValidator (QIWidgetValidator *aVal);
+
+    void setOrderAfter (QWidget *aWidget);
+
+    void retranslateUi();
+
+private slots:
+
+    void usbAdapterToggled (bool aOn);
+    void currentChanged (QTreeWidgetItem *aItem = 0,
+                         QTreeWidgetItem *aPrev = 0);
+
+    void newClicked();
+    void addClicked();
+    void edtClicked();
+    void addConfirmed (QAction *aAction);
+    void delClicked();
+    void mupClicked();
+    void mdnClicked();
+    void showContextMenu (const QPoint &aPos);
+    void sltUpdateActivityState(QTreeWidgetItem *pChangedItem);
+    void markSettingsChanged();
+
+private:
+
+    void addUSBFilter(const UIUSBFilterData &data, bool fIsNew);
+
+    /* Fetch data to m_properties, m_settings or m_machine: */
+    void fetchData(const QVariant &data);
+
+    /* Upload m_properties, m_settings or m_machine to data: */
+    void uploadData(QVariant &data) const;
+
+    /* Returns the multi-line description of the given USB filter: */
+    static QString toolTipFor(const UIUSBFilterData &data);
+
+    /* Global data source: */
+    CSystemProperties m_properties;
+    VBoxGlobalSettings m_settings;
+
+    /* Machine data source: */
+    CMachine m_machine;
+
+    /* Other variables: */
+    QIWidgetValidator *mValidator;
+    QAction *mNewAction;
+    QAction *mAddAction;
+    QAction *mEdtAction;
+    QAction *mDelAction;
+    QAction *mMupAction;
+    QAction *mMdnAction;
+    QMenu *mMenu;
+    VBoxUSBMenu *mUSBDevicesMenu;
+    bool mUSBFilterListModified;
+    QString mUSBFilterName;
+
+    /* Cache: */
+    UISettingsCacheCommonUSB m_cache;
+};
+
+#endif // __UIMachineSettingsUSB_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.ui	(revision 33882)
@@ -0,0 +1,160 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsUSB</class>
+ <widget class="QWidget" name="UIMachineSettingsUSB" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>468</width>
+    <height>328</height>
+   </rect>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" colspan="2" >
+    <widget class="QCheckBox" name="mGbUSB" >
+     <property name="whatsThis" >
+      <string>When checked, enables the virtual USB controller of this machine.</string>
+     </property>
+     <property name="text" >
+      <string>Enable &amp;USB Controller</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QWidget" native="1" name="mUSBChild" >
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>0</number>
+      </property>
+      <property name="topMargin" >
+       <number>0</number>
+      </property>
+      <property name="rightMargin" >
+       <number>0</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>0</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QCheckBox" name="mCbUSB2" >
+        <property name="whatsThis" >
+         <string>When checked, enables the virtual USB EHCI controller of this machine. The USB EHCI controller provides USB 2.0 support.</string>
+        </property>
+        <property name="text" >
+         <string>Enable USB 2.0 (E&amp;HCI) Controller</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QILabelSeparator" name="mGbUSBFilters" >
+        <property name="text" >
+         <string>USB Device &amp;Filters</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mTwFilters</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0" >
+       <widget class="QWidget" native="1" name="mWtFilterHandler" >
+        <layout class="QHBoxLayout" >
+         <property name="leftMargin" >
+          <number>0</number>
+         </property>
+         <property name="topMargin" >
+          <number>0</number>
+         </property>
+         <property name="rightMargin" >
+          <number>0</number>
+         </property>
+         <property name="bottomMargin" >
+          <number>0</number>
+         </property>
+         <property name="spacing" >
+          <number>1</number>
+         </property>
+         <item>
+          <widget class="QTreeWidget" name="mTwFilters" >
+           <property name="contextMenuPolicy" >
+            <enum>Qt::CustomContextMenu</enum>
+           </property>
+           <property name="whatsThis" >
+            <string>Lists all USB filters of this machine. The checkbox to the left defines whether the particular filter is enabled or not. Use the context menu or buttons to the right to add or remove USB filters.</string>
+           </property>
+           <property name="rootIsDecorated" >
+            <bool>false</bool>
+           </property>
+           <column>
+            <property name="text" >
+             <string>[filter]</string>
+            </property>
+           </column>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabelSeparator</class>
+   <extends>QLabel</extends>
+   <header>QILabelSeparator.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mGbUSB</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>mUSBChild</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>233</x>
+     <y>19</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>246</x>
+     <y>177</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp	(revision 33882)
@@ -0,0 +1,68 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsUSBFilterDetails class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "UIMachineSettingsUSBFilterDetails.h"
+#include "VBoxGlobal.h"
+
+UIMachineSettingsUSBFilterDetails::UIMachineSettingsUSBFilterDetails(UISettingsPageType type, QWidget *pParent /* = 0 */)
+    : QIWithRetranslateUI2<QIDialog>(pParent, Qt::Sheet)
+    , m_type(type)
+{
+    /* Apply UI decorations */
+    Ui::UIMachineSettingsUSBFilterDetails::setupUi (this);
+
+    mCbRemote->insertItem (UIMachineSettingsUSB::ModeAny, ""); /* Any */
+    mCbRemote->insertItem (UIMachineSettingsUSB::ModeOn,  ""); /* Yes */
+    mCbRemote->insertItem (UIMachineSettingsUSB::ModeOff, ""); /* No */
+    mLbRemote->setHidden (m_type != UISettingsPageType_Machine);
+    mCbRemote->setHidden (m_type != UISettingsPageType_Machine);
+
+    mCbAction->insertItem (0, ""); /* KUSBDeviceFilterAction_Ignore */
+    mCbAction->insertItem (1, ""); /* KUSBDeviceFilterAction_Hold */
+    mLbAction->setHidden (m_type != UISettingsPageType_Global);
+    mCbAction->setHidden (m_type != UISettingsPageType_Global);
+
+    mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this));
+    mLeVendorID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this));
+    mLeProductID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this));
+    mLeRevision->setValidator (new QRegExpValidator (QRegExp ("[0-9]{0,4}"), this));
+    mLePort->setValidator (new QRegExpValidator (QRegExp ("[0-9]*"), this));
+
+    /* Applying language settings */
+    retranslateUi();
+
+    resize (minimumSize());
+    setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
+}
+
+void UIMachineSettingsUSBFilterDetails::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIMachineSettingsUSBFilterDetails::retranslateUi (this);
+
+    mCbRemote->setItemText (UIMachineSettingsUSB::ModeAny, tr ("Any", "remote"));
+    mCbRemote->setItemText (UIMachineSettingsUSB::ModeOn,  tr ("Yes", "remote"));
+    mCbRemote->setItemText (UIMachineSettingsUSB::ModeOff, tr ("No",  "remote"));
+
+    mCbAction->setItemText (0,
+        vboxGlobal().toString (KUSBDeviceFilterAction_Ignore));
+    mCbAction->setItemText (1,
+        vboxGlobal().toString (KUSBDeviceFilterAction_Hold));
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.h	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.h	(revision 33882)
@@ -0,0 +1,47 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIMachineSettingsUSBFilterDetails class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMachineSettingsUSBFilterDetails_h__
+#define __UIMachineSettingsUSBFilterDetails_h__
+
+#include "UIMachineSettingsUSBFilterDetails.gen.h"
+#include "QIWithRetranslateUI.h"
+#include "QIDialog.h"
+#include "UIMachineSettingsUSB.h"
+
+class UIMachineSettingsUSBFilterDetails : public QIWithRetranslateUI2<QIDialog>,
+                                       public Ui::UIMachineSettingsUSBFilterDetails
+{
+    Q_OBJECT;
+
+public:
+
+    UIMachineSettingsUSBFilterDetails(UISettingsPageType type, QWidget *pParent = 0);
+
+protected:
+
+    void retranslateUi();
+
+private:
+
+    /* Private member vars */
+    UISettingsPageType m_type;
+};
+
+#endif /* __UIMachineSettingsUSBFilterDetails_h__ */
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.ui	(revision 33882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.ui	(revision 33882)
@@ -0,0 +1,311 @@
+<ui version="4.0" >
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008 Oracle Corporation
+
+     This file is part of VirtualBox Open Source Edition (OSE), as
+     available from http://www.virtualbox.org. This file is free software;
+     you can redistribute it and/or modify it under the terms of the GNU
+     General Public License (GPL) as published by the Free Software
+     Foundation, in version 2 as it comes in the "COPYING" file of the
+     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ </comment>
+ <class>UIMachineSettingsUSBFilterDetails</class>
+ <widget class="QDialog" name="UIMachineSettingsUSBFilterDetails" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>350</width>
+    <height>363</height>
+   </rect>
+  </property>
+  <property name="minimumSize" >
+   <size>
+    <width>350</width>
+    <height>0</height>
+   </size>
+  </property>
+  <property name="windowTitle" >
+   <string>USB Filter Details</string>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" >
+    <widget class="QLabel" name="mLbName" >
+     <property name="text" >
+      <string>&amp;Name:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeName</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" >
+    <widget class="QLineEdit" name="mLeName" >
+     <property name="toolTip" >
+      <string>Displays the filter name.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <widget class="QLabel" name="mLbVendorID" >
+     <property name="text" >
+      <string>&amp;Vendor ID:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeVendorID</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QLineEdit" name="mLeVendorID" >
+     <property name="toolTip" >
+      <string>Defines the vendor ID filter. The &lt;i>exact match&lt;/i> string format is &lt;tt>XXXX&lt;/tt> where &lt;tt>X&lt;/tt> is a hexadecimal digit. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" >
+    <widget class="QLabel" name="mLbProductID" >
+     <property name="text" >
+      <string>&amp;Product ID:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeProductID</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1" >
+    <widget class="QLineEdit" name="mLeProductID" >
+     <property name="toolTip" >
+      <string>Defines the product ID filter. The &lt;i>exact match&lt;/i> string format is &lt;tt>XXXX&lt;/tt> where &lt;tt>X&lt;/tt> is a hexadecimal digit. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" >
+    <widget class="QLabel" name="mLbRevision" >
+     <property name="text" >
+      <string>&amp;Revision:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeRevision</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1" >
+    <widget class="QLineEdit" name="mLeRevision" >
+     <property name="toolTip" >
+      <string>Defines the revision number filter. The &lt;i>exact match&lt;/i> string format is &lt;tt>IIFF&lt;/tt> where &lt;tt>I&lt;/tt> is a decimal digit of the integer part and &lt;tt>F&lt;/tt> is a decimal digit of the fractional part. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0" >
+    <widget class="QLabel" name="mLbManufacturer" >
+     <property name="text" >
+      <string>&amp;Manufacturer:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeManufacturer</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1" >
+    <widget class="QLineEdit" name="mLeManufacturer" >
+     <property name="toolTip" >
+      <string>Defines the manufacturer filter as an &lt;i>exact match&lt;/i> string. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0" >
+    <widget class="QLabel" name="mLbProduct" >
+     <property name="text" >
+      <string>Pro&amp;duct:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeProduct</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="1" >
+    <widget class="QLineEdit" name="mLeProduct" >
+     <property name="toolTip" >
+      <string>Defines the product name filter as an &lt;i>exact match&lt;/i> string. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="0" >
+    <widget class="QLabel" name="mLbSerialNo" >
+     <property name="text" >
+      <string>&amp;Serial No.:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLeSerialNo</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1" >
+    <widget class="QLineEdit" name="mLeSerialNo" >
+     <property name="toolTip" >
+      <string>Defines the serial number filter as an &lt;i>exact match&lt;/i> string. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0" >
+    <widget class="QLabel" name="mLbPort" >
+     <property name="text" >
+      <string>Por&amp;t:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mLePort</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="1" >
+    <widget class="QLineEdit" name="mLePort" >
+     <property name="toolTip" >
+      <string>Defines the host USB port filter as an &lt;i>exact match&lt;/i> string. An empty string will match any value.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="0" >
+    <widget class="QLabel" name="mLbRemote" >
+     <property name="text" >
+      <string>R&amp;emote:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mCbRemote</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="1" >
+    <widget class="QComboBox" name="mCbRemote" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="toolTip" >
+      <string>Defines whether this filter applies to USB devices attached locally to the host computer (&lt;i>No&lt;/i>), to a VRDP client's computer (&lt;i>Yes&lt;/i>), or both (&lt;i>Any&lt;/i>).</string>
+     </property>
+    </widget>
+   </item>
+   <item row="9" column="0" >
+    <widget class="QLabel" name="mLbAction" >
+     <property name="text" >
+      <string>&amp;Action:</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy" >
+      <cstring>mCbAction</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="9" column="1" >
+    <widget class="QComboBox" name="mCbAction" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="toolTip" >
+      <string>Defines an action performed by the host computer when a matching device is attached: give it up to the host OS (&lt;i>Ignore&lt;/i>) or grab it for later usage by virtual machines (&lt;i>Hold&lt;/i>).</string>
+     </property>
+    </widget>
+   </item>
+   <item row="10" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="11" column="0" colspan="2" >
+    <widget class="QIDialogButtonBox" name="mButtonBox" >
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QIDialogButtonBox</class>
+   <extends>QDialogButtonBox</extends>
+   <header>QIDialogButtonBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>mButtonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>UIMachineSettingsUSBFilterDetails</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>162</x>
+     <y>339</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>162</x>
+     <y>179</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>mButtonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>UIMachineSettingsUSBFilterDetails</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>162</x>
+     <y>339</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>162</x>
+     <y>179</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp	(revision 33882)
@@ -23,5 +23,4 @@
 #include "VBoxGlobal.h"
 #include "VBoxProblemReporter.h"
-#include "VBoxVMSettingsHD.h"
 
 UIFirstRunWzd::UIFirstRunWzd(QWidget *pParent, const CMachine &machine) : QIWizard(pParent)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp	(revision 33881)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp	(revision 33882)
@@ -27,5 +27,5 @@
 #include "QIFileDialog.h"
 #include "VBoxProblemReporter.h"
-#include "VBoxVMSettingsHD.h"
+#include "UIMachineSettingsStorage.h"
 
 /* Globals */
@@ -878,5 +878,5 @@
         case KStorageBus_IDE:
         {
-            strControllerName = VBoxVMSettingsHD::tr("IDE Controller");
+            strControllerName = UIMachineSettingsStorage::tr("IDE Controller");
             ++m_iIDECount;
             if (m_iIDECount > 1)
@@ -886,5 +886,5 @@
         case KStorageBus_SATA:
         {
-            strControllerName = VBoxVMSettingsHD::tr("SATA Controller");
+            strControllerName = UIMachineSettingsStorage::tr("SATA Controller");
             ++m_iSATACount;
             if (m_iSATACount > 1)
@@ -894,5 +894,5 @@
         case KStorageBus_SCSI:
         {
-            strControllerName = VBoxVMSettingsHD::tr("SCSI Controller");
+            strControllerName = UIMachineSettingsStorage::tr("SCSI Controller");
             ++m_iSCSICount;
             if (m_iSCSICount > 1)
@@ -902,5 +902,5 @@
         case KStorageBus_Floppy:
         {
-            strControllerName = VBoxVMSettingsHD::tr("Floppy Controller");
+            strControllerName = UIMachineSettingsStorage::tr("Floppy Controller");
             ++m_iFloppyCount;
             if (m_iFloppyCount > 1)
@@ -910,5 +910,5 @@
         case KStorageBus_SAS:
         {
-            strControllerName = VBoxVMSettingsHD::tr("SAS Controller");
+            strControllerName = UIMachineSettingsStorage::tr("SAS Controller");
             ++m_iSASCount;
             if (m_iSASCount > 1)
