Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp	(revision 50966)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp	(revision 50967)
@@ -1216,12 +1216,15 @@
 }
 
-void UIMediumManager::prepareInformationContainer(UIMediumType, int)
+void UIMediumManager::prepareInformationContainer(UIMediumType type, int iFields)
 {
     /* Information-panes created in .ui file. */
     {
         /* Configure information-panes: */
-        QList<QILabel*> panes = findChildren<QILabel*>();
-        foreach (QILabel *pPane, panes)
-            pPane->setFullSizeSelection(true);
+        for (int i = 0; i < iFields; ++i)
+        {
+            QILabel *pField = infoField(type, i);
+            if (pField)
+                pField->setFullSizeSelection(true);
+        }
     }
 }
@@ -1535,14 +1538,6 @@
     {
         /* Just clear information panes: */
-        if (m_pTypePane)
-            m_pTypePane->clear();
-        if (m_pLocationPane)
-            m_pLocationPane->clear();
-        if (m_pFormatPane)
-            m_pFormatPane->clear();
-        if (m_pDetailsPane)
-            m_pDetailsPane->clear();
-        if (m_pUsagePane)
-            m_pUsagePane->clear();
+        for (int i = 0; i < 5; ++i)
+            infoField(UIMediumType_HardDisk, i)->clear();
     }
     /* If current item is set: */
@@ -1554,19 +1549,19 @@
                            formatPaneText(QApplication::translate("VBoxMediaManagerDlg", "<i>Not&nbsp;Attached</i>"), false) :
                            formatPaneText(pCurrentItem->usage());
-        if (m_pTypePane)
-            m_pTypePane->setText(pCurrentItem->hardDiskType());
-        if (m_pLocationPane)
-            m_pLocationPane->setText(formatPaneText(pCurrentItem->location(), true, "end"));
-        if (m_pFormatPane)
-            m_pFormatPane->setText(pCurrentItem->hardDiskFormat());
-        if (m_pDetailsPane)
-            m_pDetailsPane->setText(strDetails);
-        if (m_pUsagePane)
-            m_pUsagePane->setText(strUsage);
+        if (infoField(UIMediumType_HardDisk, 0))
+            infoField(UIMediumType_HardDisk, 0)->setText(pCurrentItem->hardDiskType());
+        if (infoField(UIMediumType_HardDisk, 1))
+            infoField(UIMediumType_HardDisk, 1)->setText(formatPaneText(pCurrentItem->location(), true, "end"));
+        if (infoField(UIMediumType_HardDisk, 2))
+            infoField(UIMediumType_HardDisk, 2)->setText(pCurrentItem->hardDiskFormat());
+        if (infoField(UIMediumType_HardDisk, 3))
+            infoField(UIMediumType_HardDisk, 3)->setText(strDetails);
+        if (infoField(UIMediumType_HardDisk, 4))
+            infoField(UIMediumType_HardDisk, 4)->setText(strUsage);
     }
 
     /* Enable/disable information-panes container: */
-    if (mHDContainer)
-        mHDContainer->setEnabled(pCurrentItem);
+    if (infoContainer(UIMediumType_HardDisk))
+        infoContainer(UIMediumType_HardDisk)->setEnabled(pCurrentItem);
 }
 
@@ -1580,8 +1575,6 @@
     {
         /* Just clear information panes: */
-        if (mIpCD1)
-            mIpCD1->clear();
-        if (mIpCD2)
-            mIpCD2->clear();
+        for (int i = 0; i < 2; ++i)
+            infoField(UIMediumType_DVD, i)->clear();
     }
     /* If current item is set: */
@@ -1592,13 +1585,13 @@
                            formatPaneText(QApplication::translate("VBoxMediaManagerDlg", "<i>Not&nbsp;Attached</i>"), false) :
                            formatPaneText(pCurrentItem->usage());
-        if (mIpCD1)
-            mIpCD1->setText(formatPaneText(pCurrentItem->location(), true, "end"));
-        if (mIpCD2)
-            mIpCD2->setText(strUsage);
+        if (infoField(UIMediumType_DVD, 0))
+            infoField(UIMediumType_DVD, 0)->setText(formatPaneText(pCurrentItem->location(), true, "end"));
+        if (infoField(UIMediumType_DVD, 1))
+            infoField(UIMediumType_DVD, 1)->setText(strUsage);
     }
 
     /* Enable/disable information-panes container: */
-    if (mCDContainer)
-        mCDContainer->setEnabled(pCurrentItem);
+    if (infoContainer(UIMediumType_DVD))
+        infoContainer(UIMediumType_DVD)->setEnabled(pCurrentItem);
 }
 
@@ -1612,8 +1605,6 @@
     {
         /* Just clear information panes: */
-        if (mIpFD1)
-            mIpFD1->clear();
-        if (mIpFD2)
-            mIpFD2->clear();
+        for (int i = 0; i < 2; ++i)
+            infoField(UIMediumType_Floppy, i)->clear();
     }
     /* If current item is set: */
@@ -1624,13 +1615,13 @@
                            formatPaneText(QApplication::translate("VBoxMediaManagerDlg", "<i>Not&nbsp;Attached</i>"), false) :
                            formatPaneText(pCurrentItem->usage());
-        if (mIpFD1)
-            mIpFD1->setText(formatPaneText(pCurrentItem->location(), true, "end"));
-        if (mIpFD2)
-            mIpFD2->setText(strUsage);
+        if (infoField(UIMediumType_Floppy, 0))
+            infoField(UIMediumType_Floppy, 0)->setText(formatPaneText(pCurrentItem->location(), true, "end"));
+        if (infoField(UIMediumType_Floppy, 1))
+            infoField(UIMediumType_Floppy, 1)->setText(strUsage);
     }
 
     /* Enable/disable information-panes container: */
-    if (mFDContainer)
-        mFDContainer->setEnabled(pCurrentItem);
+    if (infoContainer(UIMediumType_Floppy))
+        infoContainer(UIMediumType_Floppy)->setEnabled(pCurrentItem);
 }
 
@@ -1727,14 +1718,14 @@
 
     /* Translate HD information-labels: */
-    if (m_pTypeLabel)
-        m_pTypeLabel->setText(QApplication::translate("VBoxMediaManagerDlg", "Type:"));
-    if (m_pLocationLabel)
-        m_pLocationLabel->setText(QApplication::translate("VBoxMediaManagerDlg", "Location:"));
-    if (m_pFormatLabel)
-        m_pFormatLabel->setText(QApplication::translate("VBoxMediaManagerDlg", "Format:"));
-    if (m_pDetailsLabel)
-        m_pDetailsLabel->setText(QApplication::translate("VBoxMediaManagerDlg", "Storage details:"));
-    if (m_pUsageLabel)
-        m_pUsageLabel->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
+    if (infoLabel(UIMediumType_HardDisk, 0))
+        infoLabel(UIMediumType_HardDisk, 0)->setText(QApplication::translate("VBoxMediaManagerDlg", "Type:"));
+    if (infoLabel(UIMediumType_HardDisk, 1))
+        infoLabel(UIMediumType_HardDisk, 1)->setText(QApplication::translate("VBoxMediaManagerDlg", "Location:"));
+    if (infoLabel(UIMediumType_HardDisk, 2))
+        infoLabel(UIMediumType_HardDisk, 2)->setText(QApplication::translate("VBoxMediaManagerDlg", "Format:"));
+    if (infoLabel(UIMediumType_HardDisk, 3))
+        infoLabel(UIMediumType_HardDisk, 3)->setText(QApplication::translate("VBoxMediaManagerDlg", "Storage details:"));
+    if (infoLabel(UIMediumType_HardDisk, 4))
+        infoLabel(UIMediumType_HardDisk, 4)->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
 
     /* Translate CD tree-widget: */
@@ -1747,8 +1738,8 @@
 
     /* Translate CD information-labels: */
-    if (mLbCD1)
-        mLbCD1->setText(QApplication::translate("VBoxMediaManagerDlg", "Location:"));
-    if (mLbCD2)
-        mLbCD2->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
+    if (infoLabel(UIMediumType_DVD, 0))
+        infoLabel(UIMediumType_DVD, 0)->setText(QApplication::translate("VBoxMediaManagerDlg", "Location:"));
+    if (infoLabel(UIMediumType_DVD, 1))
+        infoLabel(UIMediumType_DVD, 1)->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
 
     /* Translate FD tree-widget: */
@@ -1761,8 +1752,8 @@
 
     /* Translate FD information-labels: */
-    if (mLbFD1)
-        mLbFD1->setText(QApplication::translate("VBoxMediaManagerDlg", "Location:"));
-    if (mLbFD2)
-        mLbFD2->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
+    if (infoLabel(UIMediumType_Floppy, 0))
+        infoLabel(UIMediumType_Floppy, 0)->setText(QApplication::translate("VBoxMediaManagerDlg", "Location:"));
+    if (infoLabel(UIMediumType_Floppy, 1))
+        infoLabel(UIMediumType_Floppy, 1)->setText(QApplication::translate("VBoxMediaManagerDlg", "Attached to:"));
 
     /* Translate progress-bar: */
@@ -2014,4 +2005,106 @@
 }
 
+QFrame* UIMediumManager::infoContainer(UIMediumType type) const
+{
+    /* Return corresponding tree-widget for known medium types: */
+    switch (type)
+    {
+        case UIMediumType_HardDisk: return mHDContainer;
+        case UIMediumType_DVD:      return mCDContainer;
+        case UIMediumType_Floppy:   return mFDContainer;
+        default: AssertMsgFailed(("Unknown medium type: %d\n", type)); break;
+    }
+    /* Null by default: */
+    return 0;
+}
+
+QLabel* UIMediumManager::infoLabel(UIMediumType type, int iLabelIndex) const
+{
+    /* Return corresponding tree-widget for known medium types: */
+    switch (type)
+    {
+        case UIMediumType_HardDisk:
+        {
+            switch (iLabelIndex)
+            {
+                case 0: return m_pTypeLabel;
+                case 1: return m_pLocationLabel;
+                case 2: return m_pFormatLabel;
+                case 3: return m_pDetailsLabel;
+                case 4: return m_pUsageLabel;
+                default: AssertMsgFailed(("Label index out of bounds: %d\n", iLabelIndex)); break;
+            }
+            break;
+        }
+        case UIMediumType_DVD:
+        {
+            switch (iLabelIndex)
+            {
+                case 0: return mLbCD1;
+                case 1: return mLbCD2;
+                default: AssertMsgFailed(("Label index out of bounds: %d\n", iLabelIndex)); break;
+            }
+            break;
+        }
+        case UIMediumType_Floppy:
+        {
+            switch (iLabelIndex)
+            {
+                case 0: return mLbFD1;
+                case 1: return mLbFD2;
+                default: AssertMsgFailed(("Label index out of bounds: %d\n", iLabelIndex)); break;
+            }
+            break;
+        }
+        default: AssertMsgFailed(("Unknown medium type: %d\n", type)); break;
+    }
+    /* Null by default: */
+    return 0;
+}
+
+QILabel* UIMediumManager::infoField(UIMediumType type, int iFieldIndex) const
+{
+    /* Return corresponding tree-widget for known medium types: */
+    switch (type)
+    {
+        case UIMediumType_HardDisk:
+        {
+            switch (iFieldIndex)
+            {
+                case 0: return m_pTypePane;
+                case 1: return m_pLocationPane;
+                case 2: return m_pFormatPane;
+                case 3: return m_pDetailsPane;
+                case 4: return m_pUsagePane;
+                default: AssertMsgFailed(("Field index out of bounds: %d\n", iFieldIndex)); break;
+            }
+            break;
+        }
+        case UIMediumType_DVD:
+        {
+            switch (iFieldIndex)
+            {
+                case 0: return mIpCD1;
+                case 1: return mIpCD2;
+                default: AssertMsgFailed(("Field index out of bounds: %d\n", iFieldIndex)); break;
+            }
+            break;
+        }
+        case UIMediumType_Floppy:
+        {
+            switch (iFieldIndex)
+            {
+                case 0: return mIpFD1;
+                case 1: return mIpFD2;
+                default: AssertMsgFailed(("Field index out of bounds: %d\n", iFieldIndex)); break;
+            }
+            break;
+        }
+        default: AssertMsgFailed(("Unknown medium type: %d\n", type)); break;
+    }
+    /* Null by default: */
+    return 0;
+}
+
 UIMediumType UIMediumManager::mediumType(QTreeWidget *pTreeWidget) const
 {
Index: trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h	(revision 50966)
+++ trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h	(revision 50967)
@@ -178,4 +178,10 @@
     /** Returns item for passed medium @a type. */
     UIMediumItem* mediumItem(UIMediumType type) const;
+    /** Returns information-container for passed medium @a type. */
+    QFrame* infoContainer(UIMediumType type) const;
+    /** Returns information-label for passed medium @a type and @a iLabelIndex. */
+    QLabel* infoLabel(UIMediumType type, int iLabelIndex) const;
+    /** Returns information-field for passed medium @a type and @a iFieldIndex. */
+    QILabel* infoField(UIMediumType type, int iFieldIndex) const;
 
     /** Returns medium type for passed @a pTreeWidget. */
