Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp	(revision 72409)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp	(revision 72410)
@@ -30,4 +30,5 @@
 # include "QITabWidget.h"
 # include "VBoxGlobal.h"
+# include "UIDesktopWidgetWatchdog.h"
 # include "UIExtraDataManager.h"
 # include "UIMediumSelector.h"
@@ -63,4 +64,5 @@
     , m_pAttachedSubTreeRoot(0)
     , m_pNotAttachedSubTreeRoot(0)
+    , m_pParent(pParent)
 {
     configure();
@@ -89,5 +91,5 @@
     if (m_pActionAdd)
     {
-        m_pActionAdd->setText(QApplication::translate("UIMediumManager", "&Add..."));
+        m_pActionAdd->setText(QApplication::translate("UIMediumManager", "&Add from file..."));
         m_pActionAdd->setToolTip(QApplication::translate("UIMediumManager", "Add Disk Image File"));
         m_pActionAdd->setStatusTip(QApplication::translate("UIMediumManager", "Add disk image file"));
@@ -102,4 +104,9 @@
     if (m_pButtonBox)
         m_pButtonBox->button(QDialogButtonBox::Ok)->setText("Add Selected");
+
+    if (m_pTreeWidget)
+    {
+        m_pTreeWidget->headerItem()->setText(0, QApplication::translate("UIMediumManager","Name"));
+    }
 }
 
@@ -108,7 +115,10 @@
     /* Apply window icons: */
     setWindowIcon(UIIconPool::iconSetFull(":/diskimage_32px.png", ":/diskimage_16px.png"));
+
+
     prepareActions();
     prepareWidgets();
     prepareConnections();
+
 }
 
@@ -166,4 +176,13 @@
     if (m_pActionRefresh)
         connect(m_pActionRefresh, &QAction::triggered, this, &UIMediumSelector::sltHandleRefresh);
+
+    if (m_pTreeWidget)
+        connect(m_pTreeWidget, &QITreeWidget::itemSelectionChanged, this, &UIMediumSelector::sltHandleItemSelectionChanged);
+
+    if (m_pButtonBox)
+    {
+        connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIMediumSelector::close);
+        connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIMediumSelector::accept);
+    }
 }
 
@@ -244,10 +263,9 @@
     {
         m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
-        //connect(m_pTreeWidget, &QITreeWidget::currentItemChanged, this, &UIMediumSelector::sltHandleCurrentItemChanged);
-        connect(m_pTreeWidget, &QITreeWidget::itemSelectionChanged, this, &UIMediumSelector::sltHandleItemSelectionChanged);
         m_pMainLayout->addWidget(m_pTreeWidget);
-    }
-
-        m_pButtonBox = new QIDialogButtonBox;
+
+    }
+
+    m_pButtonBox = new QIDialogButtonBox;
     if (m_pButtonBox)
     {
@@ -255,7 +273,4 @@
         m_pButtonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
         m_pButtonBox->button(QDialogButtonBox::Cancel)->setShortcut(Qt::Key_Escape);
-        // connect(m_pButtonBox, &QIDialogButtonBox::helpRequested, &msgCenter(), &UIMessageCenter::sltShowHelpHelpDialog);
-        connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIMediumSelector::close);
-        connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIMediumSelector::accept);
 
         /* Add button-box into main layout: */
@@ -338,4 +353,32 @@
     /* Apply language settings: */
     retranslateUi();
+}
+
+void UIMediumSelector::showEvent(QShowEvent *pEvent)
+{
+
+    /* Try to determine the initial size: */
+    QSize proposedSize;
+    int iHostScreen = 0;
+    if (m_pParent)
+        iHostScreen = gpDesktop->screenNumber(m_pParent);
+    else
+        iHostScreen = gpDesktop->screenNumber(this);
+    if (iHostScreen >= 0 && iHostScreen < gpDesktop->screenCount())
+    {
+        /* On the basis of current host-screen geometry if possible: */
+        const QRect screenGeometry = gpDesktop->screenGeometry(iHostScreen);
+        if (screenGeometry.isValid())
+            proposedSize = screenGeometry.size() * 7 / 15;
+    }
+    /* Fallback to default size if we failed: */
+    if (proposedSize.isNull())
+        proposedSize = QSize(800, 600);
+    /* Resize to initial size: */
+    resize(proposedSize);
+
+    if (m_pParent)
+        VBoxGlobal::centerWidget(this, m_pParent, false);
+
 }
 
@@ -396,51 +439,3 @@
         m_pTreeWidget->expandItem(m_pNotAttachedSubTreeRoot);
 
-    // QItemSelectionModel *selectionModel = m_pTreeWidget->selectionModel();
-    // selectionModel->clearSelection();
-
-    // /* Remember current medium-items: */
-    // if (UIMediumItem *pMediumItem = mediumItem(UIMediumType_HardDisk))
-    //     m_strCurrentIdHD = pMediumItem->id();
-    // if (UIMediumItem *pMediumItem = mediumItem(UIMediumType_DVD))
-    //     m_strCurrentIdCD = pMediumItem->id();
-    // if (UIMediumItem *pMediumItem = mediumItem(UIMediumType_Floppy))
-    //     m_strCurrentIdFD = pMediumItem->id();
-
-    // /* Clear tree-widgets: */
-    // QITreeWidget *pTreeWidgetHD = treeWidget(UIMediumType_HardDisk);
-    // if (pTreeWidgetHD)
-    // {
-    //     setCurrentItem(pTreeWidgetHD, 0);
-    //     pTreeWidgetHD->clear();
-    // }
-    // QITreeWidget *pTreeWidgetCD = treeWidget(UIMediumType_DVD);
-    // if (pTreeWidgetCD)
-    // {
-    //     setCurrentItem(pTreeWidgetCD, 0);
-    //     pTreeWidgetCD->clear();
-    // }
-    // QITreeWidget *pTreeWidgetFD = treeWidget(UIMediumType_Floppy);
-    // if (pTreeWidgetFD)
-    // {
-    //     setCurrentItem(pTreeWidgetFD, 0);
-    //     pTreeWidgetFD->clear();
-    // }
-
-    // /* Create medium-items (do not change current one): */
-    // m_fPreventChangeCurrentItem = true;
-
-    // m_fPreventChangeCurrentItem = false;
-
-    // /* Select first item as current one if nothing selected: */
-    // if (pTreeWidgetHD && !mediumItem(UIMediumType_HardDisk))
-    //     if (QTreeWidgetItem *pItem = pTreeWidgetHD->topLevelItem(0))
-    //         setCurrentItem(pTreeWidgetHD, pItem);
-    // if (pTreeWidgetCD && !mediumItem(UIMediumType_DVD))
-    //     if (QTreeWidgetItem *pItem = pTreeWidgetCD->topLevelItem(0))
-    //         setCurrentItem(pTreeWidgetCD, pItem);
-    // if (pTreeWidgetFD && !mediumItem(UIMediumType_Floppy))
-    //     if (QTreeWidgetItem *pItem = pTreeWidgetFD->topLevelItem(0))
-    //         setCurrentItem(pTreeWidgetFD, pItem);
-
-
-}
+}
Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h	(revision 72409)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h	(revision 72410)
@@ -37,5 +37,5 @@
 
 
-/** QIDialog extension providing GUI with the dialog to select an existing media. */
+/** QIDialog extension providing GUI with a dialog to select an existing medium. */
 class SHARED_LIBRARY_STUFF UIMediumSelector : public QIWithRetranslateUI<QIDialog>
 {
@@ -50,8 +50,11 @@
     QStringList selectedMediumIds() const;
 
+protected:
+
+    void showEvent(QShowEvent *pEvent);
+
 private slots:
 
     void sltAddMedium();
-    //void sltHandleCurrentItemChanged();
     void sltHandleItemSelectionChanged();
     void sltHandleMediumEnumerationStart();
@@ -97,4 +100,5 @@
     /** All the known media that are not attached to any vm are added under the following top level tree item */
     QITreeWidgetItem  *m_pNotAttachedSubTreeRoot;
+    QWidget           *m_pParent;
 };
 
