Index: trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp	(revision 107292)
+++ trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp	(revision 107293)
@@ -32,8 +32,6 @@
 # include <QStyle>
 #endif
-#include <QUuid>
 
 /* GUI includes */
-#include "UIActionPoolManager.h"
 #include "UICommon.h"
 #include "UIDetails.h"
@@ -41,5 +39,4 @@
 #include "UIFileManager.h"
 #include "UIGlobalSession.h"
-#include "UIIconPool.h"
 #include "UISnapshotPane.h"
 #include "UIToolPaneMachine.h"
@@ -47,5 +44,4 @@
 #include "UIVMActivityToolWidget.h"
 #include "UIVMLogViewerWidget.h"
-
 
 /* Other VBox includes: */
@@ -65,5 +61,4 @@
     , m_fActive(false)
 {
-    /* Prepare: */
     prepare();
 }
@@ -71,5 +66,4 @@
 UIToolPaneMachine::~UIToolPaneMachine()
 {
-    /* Cleanup: */
     cleanup();
 }
@@ -96,5 +90,4 @@
 bool UIToolPaneMachine::isToolOpened(UIToolType enmType) const
 {
-    /* Search through the stacked widgets: */
     for (int iIndex = 0; iIndex < m_pLayout->count(); ++iIndex)
         if (m_pLayout->widget(iIndex)->property("ToolType").value<UIToolType>() == enmType)
@@ -127,13 +120,12 @@
                 /* Create Error pane: */
                 m_pPaneError = new UIErrorPane;
-                if (m_pPaneError)
-                {
+                AssertPtrReturnVoid(m_pPaneError);
+                {
+                    /* Configure pane: */
+                    m_pPaneError->setProperty("ToolType", QVariant::fromValue(UIToolType_Error));
 #ifndef VBOX_WS_MAC
                     const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
                     m_pPaneError->setContentsMargins(iMargin, 0, iMargin, 0);
 #endif
-
-                    /* Configure pane: */
-                    m_pPaneError->setProperty("ToolType", QVariant::fromValue(UIToolType_Error));
 
                     /* Add into layout: */
@@ -168,9 +160,4 @@
                 AssertPtrReturnVoid(m_pPaneSnapshots);
                 {
-#ifndef VBOX_WS_MAC
-                    const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
-                    m_pPaneSnapshots->setContentsMargins(iMargin, 0, iMargin, 0);
-#endif
-
                     /* Configure pane: */
                     m_pPaneSnapshots->setProperty("ToolType", QVariant::fromValue(UIToolType_Snapshots));
@@ -178,4 +165,8 @@
                             this, &UIToolPaneMachine::sigCurrentSnapshotItemChange);
                     m_pPaneSnapshots->setMachineItems(m_items);
+#ifndef VBOX_WS_MAC
+                    const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
+                    m_pPaneSnapshots->setContentsMargins(iMargin, 0, iMargin, 0);
+#endif
 
                     /* Add into layout: */
@@ -187,13 +178,8 @@
             case UIToolType_Logs:
             {
-                /* Create the Logviewer pane: */
+                /* Create Logviewer pane: */
                 m_pPaneLogViewer = new UIVMLogViewerWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */);
                 AssertPtrReturnVoid(m_pPaneLogViewer);
                 {
-#ifndef VBOX_WS_MAC
-                    const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
-                    m_pPaneLogViewer->setContentsMargins(iMargin, 0, iMargin, 0);
-#endif
-
                     /* Configure pane: */
                     m_pPaneLogViewer->setProperty("ToolType", QVariant::fromValue(UIToolType_Logs));
@@ -201,4 +187,8 @@
                             this, &UIToolPaneMachine::sltDetachToolPane);
                     m_pPaneLogViewer->setSelectedVMListItems(m_items);
+#ifndef VBOX_WS_MAC
+                    const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
+                    m_pPaneLogViewer->setContentsMargins(iMargin, 0, iMargin, 0);
+#endif
 
                     /* Add into layout: */
@@ -210,25 +200,28 @@
             case UIToolType_VMActivity:
             {
+                /* Create Activity pane: */
                 m_pPaneVMActivityMonitor = new UIVMActivityToolWidget(EmbedTo_Stack, m_pActionPool,
                                                                       false /* Show toolbar */, 0 /* Parent */);
                 AssertPtrReturnVoid(m_pPaneVMActivityMonitor);
-#ifndef VBOX_WS_MAC
-                const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
-                m_pPaneVMActivityMonitor->setContentsMargins(iMargin, 0, iMargin, 0);
-#endif
-
-                /* Configure pane: */
-                m_pPaneVMActivityMonitor->setProperty("ToolType", QVariant::fromValue(UIToolType_VMActivity));
-                m_pPaneVMActivityMonitor->setSelectedVMListItems(m_items);
-                /* Add into layout: */
-                m_pLayout->addWidget(m_pPaneVMActivityMonitor);
-                m_pLayout->setCurrentWidget(m_pPaneVMActivityMonitor);
-
-                connect(m_pPaneVMActivityMonitor, &UIVMActivityToolWidget::sigSwitchToActivityOverviewPane,
-                        this, &UIToolPaneMachine::sigSwitchToActivityOverviewPane);
+                {
+                    /* Configure pane: */
+                    m_pPaneVMActivityMonitor->setProperty("ToolType", QVariant::fromValue(UIToolType_VMActivity));
+                    m_pPaneVMActivityMonitor->setSelectedVMListItems(m_items);
+                    connect(m_pPaneVMActivityMonitor, &UIVMActivityToolWidget::sigSwitchToActivityOverviewPane,
+                            this, &UIToolPaneMachine::sigSwitchToActivityOverviewPane);
+#ifndef VBOX_WS_MAC
+                    const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
+                    m_pPaneVMActivityMonitor->setContentsMargins(iMargin, 0, iMargin, 0);
+#endif
+
+                    /* Add into layout: */
+                    m_pLayout->addWidget(m_pPaneVMActivityMonitor);
+                    m_pLayout->setCurrentWidget(m_pPaneVMActivityMonitor);
+                }
                 break;
             }
             case UIToolType_FileManager:
             {
+                /* Create File Manager pane: */
                 if (!m_items.isEmpty())
                     m_pPaneFileManager = new UIFileManager(EmbedTo_Stack, m_pActionPool,
@@ -239,14 +232,17 @@
                                                            0, false /* fShowToolbar */);
                 AssertPtrReturnVoid(m_pPaneFileManager);
-#ifndef VBOX_WS_MAC
-                const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
-                m_pPaneFileManager->setContentsMargins(iMargin, 0, iMargin, 0);
-#endif
-                /* Configure pane: */
-                m_pPaneFileManager->setProperty("ToolType", QVariant::fromValue(UIToolType_FileManager));
-                m_pPaneFileManager->setSelectedVMListItems(m_items);
-                /* Add into layout: */
-                m_pLayout->addWidget(m_pPaneFileManager);
-                m_pLayout->setCurrentWidget(m_pPaneFileManager);
+                {
+                    /* Configure pane: */
+                    m_pPaneFileManager->setProperty("ToolType", QVariant::fromValue(UIToolType_FileManager));
+                    m_pPaneFileManager->setSelectedVMListItems(m_items);
+#ifndef VBOX_WS_MAC
+                    const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4;
+                    m_pPaneFileManager->setContentsMargins(iMargin, 0, iMargin, 0);
+#endif
+
+                    /* Add into layout: */
+                    m_pLayout->addWidget(m_pPaneFileManager);
+                    m_pLayout->setCurrentWidget(m_pPaneFileManager);
+                }
                 break;
             }
@@ -279,4 +275,5 @@
             case UIToolType_Logs:        m_pPaneLogViewer = 0; break;
             case UIToolType_VMActivity:  m_pPaneVMActivityMonitor = 0; break;
+            case UIToolType_FileManager: m_pPaneFileManager = 0; break;
             default: break;
         }
@@ -291,4 +288,33 @@
 }
 
+QString UIToolPaneMachine::currentHelpKeyword() const
+{
+    QWidget *pCurrentToolWidget = 0;
+    switch (currentTool())
+    {
+        case UIToolType_Error:
+            pCurrentToolWidget = m_pPaneError;
+            break;
+        case UIToolType_Details:
+            pCurrentToolWidget = m_pPaneDetails;
+            break;
+        case UIToolType_Snapshots:
+            pCurrentToolWidget = m_pPaneSnapshots;
+            break;
+        case UIToolType_Logs:
+            pCurrentToolWidget = m_pPaneLogViewer;
+            break;
+        case UIToolType_VMActivity:
+            pCurrentToolWidget = m_pPaneVMActivityMonitor;
+            break;
+        case UIToolType_FileManager:
+            pCurrentToolWidget = m_pPaneFileManager;
+            break;
+        default:
+            break;
+    }
+    return uiCommon().helpKeyword(pCurrentToolWidget);
+}
+
 void UIToolPaneMachine::setErrorDetails(const QString &strDetails)
 {
@@ -344,58 +370,4 @@
 {
     return m_pPaneSnapshots ? m_pPaneSnapshots->currentSnapshotId() : QUuid();
-}
-
-QString UIToolPaneMachine::currentHelpKeyword() const
-{
-    QWidget *pCurrentToolWidget = 0;
-    switch (currentTool())
-    {
-        case UIToolType_Error:
-            pCurrentToolWidget = m_pPaneError;
-            break;
-        case UIToolType_Details:
-            pCurrentToolWidget = m_pPaneDetails;
-            break;
-        case UIToolType_Snapshots:
-            pCurrentToolWidget = m_pPaneSnapshots;
-            break;
-        case UIToolType_Logs:
-            pCurrentToolWidget = m_pPaneLogViewer;
-            break;
-        case UIToolType_VMActivity:
-            pCurrentToolWidget = m_pPaneVMActivityMonitor;
-            break;
-        case UIToolType_FileManager:
-            pCurrentToolWidget = m_pPaneFileManager;
-            break;
-        default:
-            break;
-    }
-    return uiCommon().helpKeyword(pCurrentToolWidget);
-}
-
-void UIToolPaneMachine::prepare()
-{
-    /* Create stacked-layout: */
-    m_pLayout = new QStackedLayout(this);
-
-    /* Create Details pane: */
-    openTool(UIToolType_Details);
-}
-
-void UIToolPaneMachine::cleanup()
-{
-    /* Remove all widgets prematurelly: */
-    while (m_pLayout->count())
-    {
-        QWidget *pWidget = m_pLayout->widget(0);
-        m_pLayout->removeWidget(pWidget);
-        delete pWidget;
-    }
-}
-
-void UIToolPaneMachine::handleTokenChange()
-{
-    // printf("UIToolPaneMachine::handleTokenChange: Active = %d, current tool = %d\n", m_fActive, currentTool());
 }
 
@@ -406,6 +378,30 @@
     if (sender() == m_pPaneLogViewer)
         enmToolType = UIToolType_Logs;
-
     if (enmToolType != UIToolType_Invalid)
         emit sigDetachToolPane(enmToolType);
 }
+
+void UIToolPaneMachine::prepare()
+{
+    /* Create stacked-layout: */
+    m_pLayout = new QStackedLayout(this);
+
+    /* Create Details pane: */
+    openTool(UIToolType_Details);
+}
+
+void UIToolPaneMachine::cleanup()
+{
+    /* Remove all widgets prematurelly: */
+    while (m_pLayout->count())
+    {
+        QWidget *pWidget = m_pLayout->widget(0);
+        m_pLayout->removeWidget(pWidget);
+        delete pWidget;
+    }
+}
+
+void UIToolPaneMachine::handleTokenChange()
+{
+    // printf("UIToolPaneMachine::handleTokenChange: Active = %d, current tool = %d\n", m_fActive, currentTool());
+}
Index: trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h	(revision 107292)
+++ trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h	(revision 107293)
@@ -39,11 +39,6 @@
 #include "UIExtraDataDefs.h"
 
-/* COM includes: */
-#include "CMachine.h"
-
 /* Forward declarations: */
-class QHBoxLayout;
 class QStackedLayout;
-class QVBoxLayout;
 class UIActionPool;
 class UIDetails;
@@ -55,5 +50,5 @@
 class UIFileManager;
 
-/** QWidget subclass representing container for tool panes. */
+/** QWidget subclass representing container for Machine tool panes. */
 class UIToolPaneMachine : public QWidget
 {
@@ -99,4 +94,7 @@
     void closeTool(UIToolType enmType);
 
+    /** Returns the help keyword of the current tool's widget. */
+    QString currentHelpKeyword() const;
+
     /** Defines error @a strDetails and switches to Error pane. */
     void setErrorDetails(const QString &strDetails);
@@ -110,7 +108,4 @@
     /** Returns currently selected snapshot ID if any. */
     QUuid currentSnapshotId();
-
-    /** Returns the help keyword of the current tool's widget. */
-    QString currentHelpKeyword() const;
 
 private slots:
@@ -135,17 +130,17 @@
 
     /** Holds the stacked-layout instance. */
-    QStackedLayout      *m_pLayout;
+    QStackedLayout         *m_pLayout;
     /** Holds the Error pane instance. */
-    UIErrorPane         *m_pPaneError;
+    UIErrorPane            *m_pPaneError;
     /** Holds the Details pane instance. */
-    UIDetails           *m_pPaneDetails;
+    UIDetails              *m_pPaneDetails;
     /** Holds the Snapshots pane instance. */
-    UISnapshotPane      *m_pPaneSnapshots;
+    UISnapshotPane         *m_pPaneSnapshots;
     /** Holds the Logviewer pane instance. */
-    UIVMLogViewerWidget *m_pPaneLogViewer;
+    UIVMLogViewerWidget    *m_pPaneLogViewer;
     /** Holds the Performance Monitor pane instance. */
     UIVMActivityToolWidget *m_pPaneVMActivityMonitor;
     /** Holds the File Manager pane instance. */
-    UIFileManager *m_pPaneFileManager;
+    UIFileManager          *m_pPaneFileManager;
 
     /** Holds whether this pane is active. */
