Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp	(revision 50957)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp	(revision 50959)
@@ -921,22 +921,4 @@
     /* Prepare this: */
     prepareThis();
-    /* Prepare actions: */
-    prepareActions();
-    /* Prepare menu-bar: */
-    prepareMenuBar();
-    /* Prepare tool-bar: */
-    prepareToolBar();
-    /* Prepare context-menu: */
-    prepareContextMenu();
-    /* Prepare tab-widget: */
-    prepareTabWidget();
-    /* Prepare tree-widgets: */
-    prepareTreeWidgets();
-    /* Prepare information-panes: */
-    prepareInformationPanes();
-    /* Prepare button-box: */
-    prepareButtonBox();
-    /* Prepare progress-bar: */
-    prepareProgressBar();
 
     /* Translate dialog: */
@@ -974,5 +956,4 @@
     /* Dialog should delete itself on 'close': */
     setAttribute(Qt::WA_DeleteOnClose);
-
     /* And no need to count it as important for application.
      * This way it will NOT be taken into account
@@ -987,4 +968,14 @@
     Ui::UIMediumManager::setupUi(this);
 
+    /* Prepare connections: */
+    prepareConnections();
+    /* Prepare actions: */
+    prepareActions();
+    /* Prepare central-widget: */
+    prepareCentralWidget();
+}
+
+void UIMediumManager::prepareConnections()
+{
     /* Configure medium-processing connections: */
     connect(&vboxGlobal(), SIGNAL(sigMediumCreated(const QString&)),
@@ -1046,4 +1037,9 @@
     /* Update action icons: */
     updateActionIcons();
+
+    /* Prepare menu-bar: */
+    prepareMenuBar();
+    /* Prepare context-menu: */
+    prepareContextMenu();
 }
 
@@ -1060,4 +1056,27 @@
         m_pMenu->addAction(m_pActionRefresh);
     }
+}
+
+void UIMediumManager::prepareContextMenu()
+{
+    /* Create context-menu: */
+    m_pContextMenu = new QMenu(this);
+    {
+        /* Configure contex-menu: */
+        m_pContextMenu->addAction(m_pActionCopy);
+        m_pContextMenu->addAction(m_pActionModify);
+        m_pContextMenu->addAction(m_pActionRemove);
+        m_pContextMenu->addAction(m_pActionRelease);
+    }
+}
+
+void UIMediumManager::prepareCentralWidget()
+{
+    /* Prepare tool-bar: */
+    prepareToolBar();
+    /* Prepare tab-widget: */
+    prepareTabWidget();
+    /* Prepare button-box: */
+    prepareButtonBox();
 }
 
@@ -1097,17 +1116,4 @@
 }
 
-void UIMediumManager::prepareContextMenu()
-{
-    /* Create context-menu: */
-    m_pContextMenu = new QMenu(this);
-    {
-        /* Configure contex-menu: */
-        m_pContextMenu->addAction(m_pActionCopy);
-        m_pContextMenu->addAction(m_pActionModify);
-        m_pContextMenu->addAction(m_pActionRemove);
-        m_pContextMenu->addAction(m_pActionRelease);
-    }
-}
-
 void UIMediumManager::prepareTabWidget()
 {
@@ -1120,4 +1126,8 @@
         mTabWidget->setTabIcon(TabIndex_FD, m_iconFD);
         connect(mTabWidget, SIGNAL(currentChanged(int)), this, SLOT(sltHandleCurrentTabChanged()));
+        /* Prepare tree-widgets: */
+        prepareTreeWidgets();
+        /* Prepare information-panes: */
+        prepareInformationPanes();
     }
 }
@@ -1231,4 +1241,6 @@
         connect(mButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
         connect(mButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));
+        /* Prepare progress-bar: */
+        prepareProgressBar();
     }
 }
@@ -1855,4 +1867,26 @@
 }
 
+QTreeWidget* UIMediumManager::treeWidget(UIMediumType type) const
+{
+    /* Return corresponding tree-widget for known medium types: */
+    switch (type)
+    {
+        case UIMediumType_HardDisk: return mTwHD;
+        case UIMediumType_DVD:      return mTwCD;
+        case UIMediumType_Floppy:   return mTwFD;
+        default: AssertMsgFailed(("Unknown medium type: %d\n", type)); break;
+    }
+    /* Null by default: */
+    return 0;
+}
+
+UIMediumItem* UIMediumManager::mediumItem(UIMediumType type) const
+{
+    /* Get corresponding tree-widget: */
+    QTreeWidget *pTreeWidget = treeWidget(type);
+    /* Return corresponding medium-item: */
+    return pTreeWidget ? toMediumItem(pTreeWidget->currentItem()) : 0;
+}
+
 UIMediumType UIMediumManager::currentMediumType() const
 {
@@ -1869,30 +1903,8 @@
 }
 
-QTreeWidget* UIMediumManager::treeWidget(UIMediumType type) const
-{
-    /* Return corresponding tree-widget for known medium types: */
-    switch (type)
-    {
-        case UIMediumType_HardDisk: return mTwHD;
-        case UIMediumType_DVD:      return mTwCD;
-        case UIMediumType_Floppy:   return mTwFD;
-        default: AssertMsgFailed(("Unknown medium type: %d\n", type)); break;
-    }
-    /* Null by default: */
-    return 0;
-}
-
 QTreeWidget* UIMediumManager::currentTreeWidget() const
 {
     /* Return current tree-widget: */
     return treeWidget(currentMediumType());
-}
-
-UIMediumItem* UIMediumManager::mediumItem(UIMediumType type) const
-{
-    /* Get corresponding tree-widget: */
-    QTreeWidget *pTreeWidget = treeWidget(type);
-    /* Return corresponding medium-item: */
-    return pTreeWidget ? toMediumItem(pTreeWidget->currentItem()) : 0;
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h	(revision 50957)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h	(revision 50959)
@@ -104,12 +104,16 @@
     /** Prepare dialog. */
     void prepareThis();
+    /** Prepare connections. */
+    void prepareConnections();
     /** Prepare actions. */
     void prepareActions();
     /** Prepare menu-bar. */
     void prepareMenuBar();
+    /** Prepare context-menu. */
+    void prepareContextMenu();
+    /** Prepare central-widget. */
+    void prepareCentralWidget();
     /** Prepare tool-bar. */
     void prepareToolBar();
-    /** Prepare context-menu. */
-    void prepareContextMenu();
     /** Prepare tab-widget. */
     void prepareTabWidget();
@@ -177,17 +181,15 @@
     void deleteMediumItem(const QString &strMediumID);
 
-    /** Determines medium type for passed @a pTreeWidget. */
+    /** Returns medium type for passed @a pTreeWidget. */
     UIMediumType mediumType(QTreeWidget *pTreeWidget) const;
+    /** Returns tree-widget for passed medium @a type. */
+    QTreeWidget* treeWidget(UIMediumType type) const;
+    /** Returns item for passed medium @a type. */
+    UIMediumItem* mediumItem(UIMediumType type) const;
 
     /** Returns current medium type. */
     UIMediumType currentMediumType() const;
-
-    /** Returns tree-widget for passed medium @a type. */
-    QTreeWidget* treeWidget(UIMediumType type) const;
     /** Returns current tree-widget. */
     QTreeWidget* currentTreeWidget() const;
-
-    /** Returns item for passed medium @a type. */
-    UIMediumItem* mediumItem(UIMediumType type) const;
     /** Returns current item. */
     UIMediumItem* currentMediumItem() const;
