Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 27089)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 27090)
@@ -62,4 +62,7 @@
     prepareFilters();
 
+    /* Prepare connections: */
+    prepareConnections();
+
     /* Prepare console connections: */
     prepareConsoleConnections();
@@ -137,114 +140,4 @@
 {
     calculateDesktopGeometry();
-}
-
-void UIMachineViewNormal::prepareFilters()
-{
-    /* Base class filters: */
-    UIMachineView::prepareFilters();
-
-    /* Menu bar filters: */
-    qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
-}
-
-void UIMachineViewNormal::prepareConsoleConnections()
-{
-    /* Base class connections: */
-    UIMachineView::prepareConsoleConnections();
-
-    /* Guest additions state-change updater: */
-    connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltAdditionsStateChanged()));
-}
-
-void UIMachineViewNormal::loadMachineViewSettings()
-{
-    /* Base class settings: */
-    UIMachineView::loadMachineViewSettings();
-
-    /* Global settings: */
-    {
-        connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltDesktopResized()));
-    }
-}
-
-void UIMachineViewNormal::setGuestAutoresizeEnabled(bool fEnabled)
-{
-    if (m_bIsGuestAutoresizeEnabled != fEnabled)
-    {
-        m_bIsGuestAutoresizeEnabled = fEnabled;
-
-        maybeRestrictMinimumSize();
-
-        if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
-            sltPerformGuestResize();
-    }
-}
-
-void UIMachineViewNormal::normalizeGeometry(bool bAdjustPosition)
-{
-    QWidget *pTopLevelWidget = window();
-
-    /* Make no normalizeGeometry in case we are in manual resize mode or main window is maximized: */
-    if (pTopLevelWidget->isMaximized())
-        return;
-
-    /* Calculate client window offsets: */
-    QRect frameGeo = pTopLevelWidget->frameGeometry();
-    QRect geo = pTopLevelWidget->geometry();
-    int dl = geo.left() - frameGeo.left();
-    int dt = geo.top() - frameGeo.top();
-    int dr = frameGeo.right() - geo.right();
-    int db = frameGeo.bottom() - geo.bottom();
-
-    /* Get the best size w/o scroll bars: */
-    QSize s = pTopLevelWidget->sizeHint();
-
-    /* Resize the frame to fit the contents: */
-    s -= pTopLevelWidget->size();
-    frameGeo.setRight(frameGeo.right() + s.width());
-    frameGeo.setBottom(frameGeo.bottom() + s.height());
-
-    if (bAdjustPosition)
-    {
-        QRegion availableGeo;
-        QDesktopWidget *dwt = QApplication::desktop();
-        if (dwt->isVirtualDesktop())
-            /* Compose complex available region */
-            for (int i = 0; i < dwt->numScreens(); ++ i)
-                availableGeo += dwt->availableGeometry(i);
-        else
-            /* Get just a simple available rectangle */
-            availableGeo = dwt->availableGeometry(pTopLevelWidget->pos());
-
-        frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo, mode() != VBoxDefs::SDLMode /* can resize? */);
-    }
-
-#if 0
-    /* Center the frame on the desktop: */
-    frameGeo.moveCenter(availableGeo.center());
-#endif
-
-    /* Finally, set the frame geometry */
-    pTopLevelWidget->setGeometry(frameGeo.left() + dl, frameGeo.top() + dt, frameGeo.width() - dl - dr, frameGeo.height() - dt - db);
-}
-
-QRect UIMachineViewNormal::availableGeometry()
-{
-    return QApplication::desktop()->availableGeometry(this);
-}
-
-void UIMachineViewNormal::maybeRestrictMinimumSize()
-{
-    /* Sets the minimum size restriction depending on the auto-resize feature state and the current rendering mode.
-     * Currently, the restriction is set only in SDL mode and only when the auto-resize feature is inactive.
-     * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.
-     * In all other modes, or when auto-resize is in force, this function does nothing. */
-    if (mode() == VBoxDefs::SDLMode)
-    {
-        if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)
-            setMinimumSize(sizeHint());
-        else
-            setMinimumSize(0, 0);
-    }
 }
 
@@ -432,2 +325,106 @@
 }
 
+void UIMachineViewNormal::prepareFilters()
+{
+    /* Base class filters: */
+    UIMachineView::prepareFilters();
+
+    /* Menu bar filters: */
+    qobject_cast<QIMainDialog*>(machineWindowWrapper()->machineWindow())->menuBar()->installEventFilter(this);
+}
+
+void UIMachineViewNormal::prepareConnections()
+{
+    connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltDesktopResized()));
+}
+
+void UIMachineViewNormal::prepareConsoleConnections()
+{
+    /* Base class connections: */
+    UIMachineView::prepareConsoleConnections();
+
+    /* Guest additions state-change updater: */
+    connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltAdditionsStateChanged()));
+}
+
+void UIMachineViewNormal::setGuestAutoresizeEnabled(bool fEnabled)
+{
+    if (m_bIsGuestAutoresizeEnabled != fEnabled)
+    {
+        m_bIsGuestAutoresizeEnabled = fEnabled;
+
+        maybeRestrictMinimumSize();
+
+        if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
+            sltPerformGuestResize();
+    }
+}
+
+void UIMachineViewNormal::normalizeGeometry(bool bAdjustPosition)
+{
+    QWidget *pTopLevelWidget = window();
+
+    /* Make no normalizeGeometry in case we are in manual resize mode or main window is maximized: */
+    if (pTopLevelWidget->isMaximized())
+        return;
+
+    /* Calculate client window offsets: */
+    QRect frameGeo = pTopLevelWidget->frameGeometry();
+    QRect geo = pTopLevelWidget->geometry();
+    int dl = geo.left() - frameGeo.left();
+    int dt = geo.top() - frameGeo.top();
+    int dr = frameGeo.right() - geo.right();
+    int db = frameGeo.bottom() - geo.bottom();
+
+    /* Get the best size w/o scroll bars: */
+    QSize s = pTopLevelWidget->sizeHint();
+
+    /* Resize the frame to fit the contents: */
+    s -= pTopLevelWidget->size();
+    frameGeo.setRight(frameGeo.right() + s.width());
+    frameGeo.setBottom(frameGeo.bottom() + s.height());
+
+    if (bAdjustPosition)
+    {
+        QRegion availableGeo;
+        QDesktopWidget *dwt = QApplication::desktop();
+        if (dwt->isVirtualDesktop())
+            /* Compose complex available region */
+            for (int i = 0; i < dwt->numScreens(); ++ i)
+                availableGeo += dwt->availableGeometry(i);
+        else
+            /* Get just a simple available rectangle */
+            availableGeo = dwt->availableGeometry(pTopLevelWidget->pos());
+
+        frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo, mode() != VBoxDefs::SDLMode /* can resize? */);
+    }
+
+#if 0
+    /* Center the frame on the desktop: */
+    frameGeo.moveCenter(availableGeo.center());
+#endif
+
+    /* Finally, set the frame geometry */
+    pTopLevelWidget->setGeometry(frameGeo.left() + dl, frameGeo.top() + dt, frameGeo.width() - dl - dr, frameGeo.height() - dt - db);
+}
+
+QRect UIMachineViewNormal::availableGeometry()
+{
+    return QApplication::desktop()->availableGeometry(this);
+}
+
+void UIMachineViewNormal::maybeRestrictMinimumSize()
+{
+    /* Sets the minimum size restriction depending on the auto-resize feature state and the current rendering mode.
+     * Currently, the restriction is set only in SDL mode and only when the auto-resize feature is inactive.
+     * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.
+     * In all other modes, or when auto-resize is in force, this function does nothing. */
+    if (mode() == VBoxDefs::SDLMode)
+    {
+        if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)
+            setMinimumSize(sizeHint());
+        else
+            setMinimumSize(0, 0);
+    }
+}
+
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 27089)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 27090)
@@ -44,9 +44,9 @@
 private slots:
 
+    /* Slot to perform guest resize: */
+    void sltPerformGuestResize(const QSize &size = QSize());
+
     /* Console callback handlers: */
     void sltAdditionsStateChanged();
-
-    /* Slot to perform guest resize: */
-    void sltPerformGuestResize(const QSize &size = QSize());
 
     /* Watch dog for desktop resizes: */
@@ -55,13 +55,17 @@
 private:
 
+    /* Event handlers: */
+    bool event(QEvent *pEvent);
+    bool eventFilter(QObject *pWatched, QEvent *pEvent);
+
     /* Prepare helpers: */
     void prepareFilters();
+    void prepareConnections();
     void prepareConsoleConnections();
-    void loadMachineViewSettings();
 
     /* Cleanup helpers: */
-    //void saveMachineViewSettings() {}
     //void cleanupConsoleConnections() {}
-    //cleanupFilters() {}
+    //void prepareConnections() {}
+    //void cleanupFilters() {}
 
     /* Hidden setters: */
@@ -72,8 +76,4 @@
     QRect availableGeometry();
     void maybeRestrictMinimumSize();
-
-    /* Event handlers: */
-    bool event(QEvent *pEvent);
-    bool eventFilter(QObject *pWatched, QEvent *pEvent);
 
     /* Private members: */
