Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 37873)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 37874)
@@ -267,4 +267,5 @@
 	src/VBoxGlobalSettings.h \
 	src/VBoxMediaManagerDlg.h \
+	src/UIMediumTypeChangeDialog.h \
 	src/VBoxSnapshotDetailsDlg.h \
 	src/VBoxTakeSnapshotDlg.h \
@@ -431,4 +432,5 @@
 	src/VBoxHelpActions.cpp \
 	src/VBoxMediaManagerDlg.cpp \
+	src/UIMediumTypeChangeDialog.cpp \
 	src/VBoxMedium.cpp \
 	src/VBoxSnapshotDetailsDlg.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.cpp	(revision 37874)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.cpp	(revision 37874)
@@ -0,0 +1,181 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt GUI ("VirtualBox"):
+ * UIMediumTypeChangeDialog class implementation
+ */
+
+/*
+ * Copyright (C) 2011 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Global includes: */
+#include <QVBoxLayout>
+#include <QGroupBox>
+#include <QRadioButton>
+#include <QPushButton>
+
+/* Local includes: */
+#include "UIMediumTypeChangeDialog.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "QILabel.h"
+#include "QIDialogButtonBox.h"
+
+/* Constructor: */
+UIMediumTypeChangeDialog::UIMediumTypeChangeDialog(QWidget *pParent, const QString &strMediumId)
+    : QIWithRetranslateUI<QDialog>(pParent)
+{
+    /* Search for corresponding medium: */
+    m_medium = vboxGlobal().findMedium(strMediumId).medium();
+    m_oldMediumType = m_medium.GetType();
+    m_newMediumType = m_oldMediumType;
+
+    /* Enable size-grip: */
+    setSizeGripEnabled(true);
+
+    /* Create main layout: */
+    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
+
+    /* Create description label: */
+    m_pLabel = new QILabel(this);
+    m_pLabel->setWordWrap(true);
+    m_pLabel->useSizeHintForWidth(400);
+    m_pLabel->updateGeometry();
+    pMainLayout->addWidget(m_pLabel);
+
+    /* Create group-box: */
+    m_pGroupBox = new QGroupBox(this);
+    pMainLayout->addWidget(m_pGroupBox);
+
+    /* Create button-box: */
+    m_pButtonBox = new QIDialogButtonBox(this);
+    m_pButtonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+    m_pButtonBox->button(QDialogButtonBox::Ok)->setDefault(true);
+    connect(m_pButtonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(sltAccept()));
+    connect(m_pButtonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(sltReject()));
+    pMainLayout->addWidget(m_pButtonBox);
+
+    /* Finally, add a stretch: */
+    pMainLayout->addStretch();
+
+    /* Create radio-buttons: */
+    createMediumTypeButtons();
+
+    /* Retranslate: */
+    retranslateUi();
+
+    /* Resize: */
+    resize(minimumSizeHint());
+}
+
+/* Accept finisher: */
+void UIMediumTypeChangeDialog::sltAccept()
+{
+    /* Try to assign new medium type: */
+    m_medium.SetType(m_newMediumType);
+    /* Check for result: */
+    if (!m_medium.isOk())
+    {
+        /* Show error message: */
+        vboxProblem().cannotChangeMediumType(this, m_medium, m_oldMediumType, m_newMediumType);
+        return;
+    }
+    /* Accept dialog with parent class method: */
+    QIWithRetranslateUI<QDialog>::accept();
+}
+
+/* Reject finisher: */
+void UIMediumTypeChangeDialog::sltReject()
+{
+    /* Reject dialog with parent class method: */
+    QIWithRetranslateUI<QDialog>::reject();
+}
+
+/* Translation stuff: */
+void UIMediumTypeChangeDialog::retranslateUi()
+{
+    /* Translate window title: */
+    setWindowTitle(tr("Change medium type"));
+
+    /* Translate description: */
+    m_pLabel->setText(tr("<p>You are about to change the medium type of the virtual disk located in %1.</p>"
+                         "<p>Please choose one of the following medium types and press <b>OK</b> button "
+                         "if you really want to proceed or <b>Cancel</b> button otherwise.</p>")
+                      .arg(m_medium.GetLocation()));
+
+    /* Translate group-box: */
+    m_pGroupBox->setTitle(tr("Choose medium type:"));
+
+    /* Translate radio-buttons: */
+    QList<QRadioButton*> buttons = findChildren<QRadioButton*>();
+    for (int i = 0; i < buttons.size(); ++i)
+        buttons[i]->setText(vboxGlobal().toString(buttons[i]->property("mediumType").value<KMediumType>()));
+}
+
+void UIMediumTypeChangeDialog::sltValidate()
+{
+    /* Search for the checked button: */
+    QRadioButton *pCheckedButton = 0;
+    QList<QRadioButton*> buttons = findChildren<QRadioButton*>();
+    for (int i = 0; i < buttons.size(); ++i)
+    {
+        if (buttons[i]->isChecked())
+        {
+            pCheckedButton = buttons[i];
+            break;
+        }
+    }
+    /* Determine chosen type: */
+    m_newMediumType = pCheckedButton->property("mediumType").value<KMediumType>();
+    /* Enable/disable OK button depending on chosen type,
+     * for now only the previous type is restricted, others are free to choose: */
+    m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_oldMediumType != m_newMediumType);
+}
+
+/* Create medium-type radio-buttons: */
+void UIMediumTypeChangeDialog::createMediumTypeButtons()
+{
+    /* Register required meta-type: */
+    qRegisterMetaType<KMediumType>();
+    /* Create group-box layout: */
+    m_pGroupBoxLayout = new QVBoxLayout(m_pGroupBox);
+    /* Populate radio-buttons: */
+    createMediumTypeButton(KMediumType_Normal);
+    createMediumTypeButton(KMediumType_Immutable);
+    createMediumTypeButton(KMediumType_Writethrough);
+    createMediumTypeButton(KMediumType_Shareable);
+    createMediumTypeButton(KMediumType_MultiAttach);
+    /* Make sure button reflecting previoius type is checked: */
+    QList<QRadioButton*> buttons = findChildren<QRadioButton*>();
+    for (int i = 0; i < buttons.size(); ++i)
+    {
+        if (buttons[i]->property("mediumType").value<KMediumType>() == m_oldMediumType)
+        {
+            buttons[i]->setChecked(true);
+            buttons[i]->setFocus();
+            break;
+        }
+    }
+    /* Revalidate finally: */
+    sltValidate();
+}
+
+/* Create radio-button for the passed medium-type: */
+void UIMediumTypeChangeDialog::createMediumTypeButton(KMediumType mediumType)
+{
+    /* Create corresponding radio-button: */
+    QRadioButton *pRadioButton = new QRadioButton(m_pGroupBox);
+    connect(pRadioButton, SIGNAL(clicked()), this, SLOT(sltValidate()));
+    pRadioButton->setProperty("mediumType", QVariant::fromValue(mediumType));
+    m_pGroupBoxLayout->addWidget(pRadioButton);
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.h	(revision 37874)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.h	(revision 37874)
@@ -0,0 +1,78 @@
+/** @file
+ *
+ * VBox frontends: Qt GUI ("VirtualBox"):
+ * UIMediumTypeChangeDialog class declaration
+ */
+
+/*
+ * Copyright (C) 2011 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __UIMediumTypeChangeDialog_h__
+#define __UIMediumTypeChangeDialog_h__
+
+/* Global includes: */
+#include <QDialog>
+
+/* Local includes: */
+#include "QIWithRetranslateUI.h"
+#include "COMDefs.h"
+
+/* Forward declarations: */
+class QVBoxLayout;
+class QILabel;
+class QGroupBox;
+class QRadioButton;
+class QIDialogButtonBox;
+
+/* Dialog providing user with possibility to change medium type: */
+class UIMediumTypeChangeDialog : public QIWithRetranslateUI<QDialog>
+{
+    Q_OBJECT;
+
+public:
+
+    /* Constructor: */
+    UIMediumTypeChangeDialog(QWidget *pParent, const QString &strMediumId);
+
+protected:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+protected slots:
+
+    /* Finisher(s): */
+    void sltAccept();
+    void sltReject();
+
+    /* Validation stuff: */
+    void sltValidate();
+
+private:
+
+    /* Various helping stuff: */
+    void createMediumTypeButtons();
+    void createMediumTypeButton(KMediumType mediumType);
+
+    /* Widgets: */
+    QILabel *m_pLabel;
+    QGroupBox *m_pGroupBox;
+    QVBoxLayout *m_pGroupBoxLayout;
+    QIDialogButtonBox *m_pButtonBox;
+
+    /* Variables: */
+    CMedium m_medium;
+    KMediumType m_oldMediumType;
+    KMediumType m_newMediumType;
+};
+
+#endif // __UIMediumTypeChangeDialog_h__
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 37873)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 37874)
@@ -44,4 +44,5 @@
 #include "UIIconPool.h"
 #include "UIVirtualBoxEventHandler.h"
+#include "UIMediumTypeChangeDialog.h"
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
 
@@ -205,6 +206,4 @@
     , mShowDiffs (true)
     , mSetupMode (false)
-    , m_previousMediumType(KMediumType_Normal)
-    , m_fParentMediumType(true)
 {
     /* Apply UI decorations */
@@ -287,6 +286,7 @@
 
     /* Setup information pane: */
-    qRegisterMetaType<KMediumType>();
-    connect(m_pTypeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(sltCurrentMediumTypeChanged()));
+    m_pChangeMediumTypeButton->setIcon(UIIconPool::iconSet(":/arrow_down_10px.png"));
+    connect(m_pChangeMediumTypeButton, SIGNAL(clicked()), this, SLOT(sltOpenMediumTypeChangeDialog()));
+    m_pChangeMediumTypeButton->setIconSize(QSize(10, 10));
 
     /* Context menu composing */
@@ -653,49 +653,8 @@
 #endif /* QT_MAC_USE_COCOA */
 
-    if (mDoSelect)
-        mButtonBox->button (QDialogButtonBox::Ok)->setText (tr ("&Select"));
+    mButtonBox->button(QDialogButtonBox::Ok)->setText(mDoSelect ? tr("&Select") : tr("C&lose"));
 
     if (mTwHD->model()->rowCount() || mTwCD->model()->rowCount() || mTwFD->model()->rowCount())
         refreshAll();
-
-    /* Translate medium type combo: */
-    repopulateMediumTypeCombo();
-}
-
-void VBoxMediaManagerDlg::repopulateMediumTypeCombo()
-{
-    /* Block signals: */
-    m_pTypeCombo->blockSignals(true);
-
-    /* Remember current index: */
-    int iCurrentIndex = m_pTypeCombo->currentIndex();
-
-    /* Repopulate medium types: */
-    m_pTypeCombo->clear();
-
-    /* Check parent mode: */
-    if (m_fParentMediumType)
-    {
-        /* Populate possible types for parent disks: */
-        m_pTypeCombo->insertItem(0, vboxGlobal().toString(KMediumType_Normal), QVariant::fromValue(KMediumType_Normal));
-        m_pTypeCombo->insertItem(1, vboxGlobal().toString(KMediumType_Immutable), QVariant::fromValue(KMediumType_Immutable));
-        m_pTypeCombo->insertItem(2, vboxGlobal().toString(KMediumType_Writethrough), QVariant::fromValue(KMediumType_Writethrough));
-        m_pTypeCombo->insertItem(3, vboxGlobal().toString(KMediumType_Shareable), QVariant::fromValue(KMediumType_Shareable));
-        m_pTypeCombo->insertItem(4, vboxGlobal().toString(KMediumType_MultiAttach), QVariant::fromValue(KMediumType_MultiAttach));
-    }
-    else
-    {
-        /* Just one 'differencing' type for children disks: */
-        m_pTypeCombo->insertItem(0, vboxGlobal().differencingMediumTypeName());
-    }
-
-    /* Choose current index again if still possible: */
-    if (iCurrentIndex >= 0 && iCurrentIndex < m_pTypeCombo->count())
-        m_pTypeCombo->setCurrentIndex(iCurrentIndex);
-    else
-        m_pTypeCombo->setCurrentIndex(0);
-
-    /* Unblock signals: */
-    m_pTypeCombo->blockSignals(false);
 }
 
@@ -1483,21 +1442,10 @@
         if (item->treeWidget() == mTwHD)
         {
-            /* Update parent mode: */
-            m_fParentMediumType = !item->medium().parent();
-            /* Repopulate combo: */
-            repopulateMediumTypeCombo();
-
-            /* Block signals: */
-            m_pTypeCombo->blockSignals(true);
-            /* Choose the correct one medium type: */
-            int iIndexOfType = m_pTypeCombo->findText(item->hardDiskType());
-            AssertMsg(iIndexOfType != -1, ("Incorrect medium type: %s\n", item->hardDiskType().toLatin1().constData()));
-            m_pTypeCombo->setCurrentIndex(iIndexOfType);
-            /* Remember new medium type: */
-            m_previousMediumType = m_pTypeCombo->itemData(m_pTypeCombo->currentIndex()).value<KMediumType>();
-            /* Unblock signals: */
-            m_pTypeCombo->blockSignals(false);
+            /* Check if thats parent medium: */
+            bool fIsThatParentMedium = !item->medium().parent();
+            m_pChangeMediumTypeButton->setEnabled(fIsThatParentMedium);
 
             /* Other panes: */
+            m_pTypePane->setText(item->hardDiskType());
             m_pLocationPane->setText(formatPaneText(item->location(), true, "end"));
             m_pFormatPane->setText(item->hardDiskFormat());
@@ -1598,32 +1546,12 @@
 }
 
-void VBoxMediaManagerDlg::sltCurrentMediumTypeChanged()
-{
-    /* Get new medium type: */
-    KMediumType newMediumType = m_pTypeCombo->itemData(m_pTypeCombo->currentIndex()).value<KMediumType>();
-
-    /* Check that new type exists and differs from the old one: */
-    if (newMediumType == m_previousMediumType)
-        return;
-
+void VBoxMediaManagerDlg::sltOpenMediumTypeChangeDialog()
+{
     MediaItem *pMediumItem = toMediaItem(currentTreeWidget()->currentItem());
-    CMedium medium = pMediumItem->medium().medium();
-    medium.SetType(newMediumType);
-    if (!medium.isOk())
-    {
-        /* Revert medium type: */
-        m_pTypeCombo->blockSignals(true);
-        int iPreviousIndex = m_pTypeCombo->findText(vboxGlobal().toString(m_previousMediumType));
-        m_pTypeCombo->setCurrentIndex(iPreviousIndex);
-        m_pTypeCombo->blockSignals(false);
-        /* Show warning: */
-        vboxProblem().cannotChangeMediumType(this, medium, m_previousMediumType, newMediumType);
-    }
-    else
-    {
-        /* Remember new medium type: */
-        m_previousMediumType = m_pTypeCombo->itemData(m_pTypeCombo->currentIndex()).value<KMediumType>();
-        /* Refresh related VMM item: */
+    UIMediumTypeChangeDialog dlg(this, pMediumItem->id());
+    if (dlg.exec() == QDialog::Accepted)
+    {
         pMediumItem->refreshAll();
+        m_pTypePane->setText(pMediumItem->hardDiskType());
     }
 }
@@ -1907,5 +1835,5 @@
 void VBoxMediaManagerDlg::clearInfoPanes()
 {
-    m_pTypeCombo->setCurrentIndex(-1); m_pLocationPane->clear(); m_pFormatPane->clear(); m_pDetailsPane->clear(); m_pUsagePane->clear();
+    m_pTypePane->clear(); m_pLocationPane->clear(); m_pFormatPane->clear(); m_pDetailsPane->clear(); m_pUsagePane->clear();
     mIpCD1->clear(); mIpCD2->clear();
     mIpFD1->clear(); mIpFD2->clear();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.h	(revision 37873)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.h	(revision 37874)
@@ -70,5 +70,4 @@
 
     void retranslateUi();
-    void repopulateMediumTypeCombo();
     virtual void closeEvent (QCloseEvent *aEvent);
     virtual bool eventFilter (QObject *aObject, QEvent *aEvent);
@@ -102,5 +101,5 @@
     void performTablesAdjustment();
 
-    void sltCurrentMediumTypeChanged();
+    void sltOpenMediumTypeChangeDialog();
 
 private:
@@ -148,8 +147,4 @@
     bool mSetupMode : 1;
 
-    /* Medium type related variables: */
-    KMediumType m_previousMediumType;
-    bool m_fParentMediumType;
-
     /* Icon definitions */
     QIcon mHardDiskIcon;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.ui	(revision 37873)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.ui	(revision 37874)
@@ -104,12 +104,26 @@
            </item>
            <item row="0" column="1" >
-            <widget class="QComboBox" name="m_pTypeCombo" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-            </widget>
+            <layout class="QHBoxLayout">
+             <item>
+              <widget class="QILabel" name="m_pTypePane">
+               <property name="sizePolicy">
+                <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QIToolButton" name="m_pChangeMediumTypeButton">
+               <property name="autoRaise">
+                <bool>true</bool>
+               </property>
+               <property name="toolTip">
+                <string>Change medium type...</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
            </item>
            <item row="1" column="0" >
@@ -399,4 +413,9 @@
    <header>QITabWidget.h</header>
   </customwidget>
+  <customwidget>
+   <class>QIToolButton</class>
+   <extends>QToolButton</extends>
+   <header>QIToolButton.h</header>
+  </customwidget>
  </customwidgets>
  <resources/>
