Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 37330)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 37331)
@@ -320,5 +320,5 @@
 	src/settings/machine/UIMachineSettingsSFDetails.h \
 	src/wizards/newvm/UINewVMWzd.h \
-	src/wizards/newhd/UINewHDWzd.h \
+	src/wizards/newhd/UINewHDWizard.h \
 	src/wizards/firstrun/UIFirstRunWzd.h \
 	src/wizards/exportappliance/UIExportApplianceWzd.h \
@@ -394,5 +394,6 @@
 	src/runtime/UIIndicatorsPool.cpp \
 	src/runtime/UIMachine.cpp \
-	src/runtime/UIMachineMenuBar.cpp
+	src/runtime/UIMachineMenuBar.cpp \
+	src/wizards/newhd/UINewHDWizard.cpp
 
 VirtualBox_QT_MOCSRCS.darwin += \
@@ -485,5 +486,5 @@
 	src/settings/machine/UIMachineSettingsSFDetails.cpp \
 	src/wizards/newvm/UINewVMWzd.cpp \
-	src/wizards/newhd/UINewHDWzd.cpp \
+	src/wizards/newhd/UINewHDWizard.cpp \
 	src/wizards/firstrun/UIFirstRunWzd.cpp \
 	src/wizards/exportappliance/UIExportApplianceWzd.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 37330)
+++ /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 37331)
@@ -53,8 +53,9 @@
     src/wizards/newvm/UINewVMWzdPage4.ui \
     src/wizards/newvm/UINewVMWzdPage5.ui \
-    src/wizards/newhd/UINewHDWzdPage1.ui \
-    src/wizards/newhd/UINewHDWzdPage2.ui \
-    src/wizards/newhd/UINewHDWzdPage3.ui \
-    src/wizards/newhd/UINewHDWzdPage4.ui \
+    src/wizards/newhd/UINewHDWizardPageWelcome.ui \
+    src/wizards/newhd/UINewHDWizardPageFormat.ui \
+    src/wizards/newhd/UINewHDWizardPageVariant.ui \
+    src/wizards/newhd/UINewHDWizardPageOptions.ui \
+    src/wizards/newhd/UINewHDWizardPageSummary.ui \
     src/wizards/firstrun/UIFirstRunWzdPage1.ui \
     src/wizards/firstrun/UIFirstRunWzdPage2.ui \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 37330)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 37331)
@@ -37,5 +37,5 @@
 #include "VBoxGlobal.h"
 #include "VBoxMediaManagerDlg.h"
-#include "UINewHDWzd.h"
+#include "UINewHDWizard.h"
 #include "VBoxProblemReporter.h"
 #include "UIToolBar.h"
@@ -952,5 +952,5 @@
     AssertReturnVoid (currentTreeWidgetType() == VBoxDefs::MediumType_HardDisk);
 
-    UINewHDWzd dlg (this);
+    UINewHDWizard dlg (this);
 
     if (dlg.exec() == QDialog::Accepted)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h	(revision 37330)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h	(revision 37331)
@@ -633,5 +633,5 @@
     // constructors & destructor
 
-    CInterface() 
+    CInterface()
     {
         clear();
@@ -639,19 +639,19 @@
 
     CInterface (const CInterface &that) : B (that)
-    {   
-        clear(); 
+    {
+        clear();
         mIface = that.mIface;
         addref(ptr());
     }
 
-    CInterface (I *aIface) 
-    { 
+    CInterface (I *aIface)
+    {
         clear();
         setPtr (aIface);
-        addref (aIface); 
-    }
-
-    virtual ~CInterface() 
-    { 
+        addref (aIface);
+    }
+
+    virtual ~CInterface()
+    {
         detach();
 #ifdef DEBUG
@@ -677,10 +677,10 @@
                                                   (void **) &pObj);
 #endif
-             
+
             if (SUCCEEDED (B::mRC))
                setPtr(pObj);
             else
                setPtr(NULL);
-            
+
             /* fetch error info, but don't assert if it's missing -- many other
              * reasons can lead to an error (w/o providing error info), not only
@@ -732,20 +732,20 @@
 
     /** Detaches from the underlying interface pointer. */
-    void detach() 
-    { 
+    void detach()
+    {
 #ifdef DEBUG
        Assert(!mDead);
 #endif
-       release (ptr()); 
-       setPtr(NULL); 
+       release (ptr());
+       setPtr(NULL);
     }
 
     /** Returns @c true if not attached to any interface pointer. */
-    bool isNull() const 
-    { 
+    bool isNull() const
+    {
 #ifdef DEBUG
        Assert(!mDead);
 #endif
-       return mIface == NULL; 
+       return mIface == NULL;
     }
 
@@ -786,5 +786,5 @@
      * else but in generated wrappers and for debugging. You've been warned.
      */
-    I *raw() const 
+    I *raw() const
     {
        return ptr();
@@ -819,5 +819,5 @@
     void clear()
     {
-       mIface = NULL;       
+       mIface = NULL;
 #ifdef DEBUG
        mDead = false;
@@ -910,4 +910,5 @@
 Q_DECLARE_METATYPE(CConsole);
 Q_DECLARE_METATYPE(CHostNetworkInterface);
+Q_DECLARE_METATYPE(CMediumFormat);
 
 /** @} */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 37330)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 37331)
@@ -21,5 +21,5 @@
 #include "QIWidgetValidator.h"
 #include "UIIconPool.h"
-#include "UINewHDWzd.h"
+#include "UINewHDWizard.h"
 #include "VBoxGlobal.h"
 #include "QIFileDialog.h"
@@ -2918,11 +2918,9 @@
 QString UIMachineSettingsStorage::getWithNewHDWizard()
 {
-    /* Run New HD Wizard */
-    UINewHDWzd dlg(this);
     /* Initialize variables: */
     CGuestOSType guestOSType = vboxGlobal().virtualBox().GetGuestOSType(m_strMachineGuestOSTypeId);
-    dlg.setRecommendedSize(guestOSType.GetRecommendedHDD());
     QFileInfo fileInfo(m_strMachineSettingsFilePath);
-    dlg.setDefaultPath(fileInfo.absolutePath());
+    /* Run New HD Wizard: */
+    UINewHDWizard dlg(this, QString(), fileInfo.absolutePath(), guestOSType.GetRecommendedHDD());
 
     return dlg.exec() == QDialog::Accepted ? dlg.hardDisk().GetId() : QString();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp	(revision 37331)
@@ -0,0 +1,914 @@
+/* $Id$ */
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UINewHDWizard class implementation
+ */
+
+/*
+ * Copyright (C) 2006-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 <QCheckBox>
+#include <QRadioButton>
+#include <QRegExpValidator>
+
+/* Local includes: */
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "QIFileDialog.h"
+#include "UIIconPool.h"
+#include "UINewHDWizard.h"
+#include "iprt/path.h"
+
+/* Class to manage page variants: */
+class UIExclusivenessManager : public QObject
+{
+    Q_OBJECT;
+
+public:
+
+    /* Constructor: */
+    UIExclusivenessManager(QWidget *pParent) : QObject(pParent) {}
+
+    /* Wrapper for adding different children: */
+    void addWidget(QWidget *pWidget, const QVariant &data)
+    {
+        /* Add radio-button: */
+        if (QRadioButton *pRadioButton = qobject_cast<QRadioButton*>(pWidget))
+            addRadioButton(pRadioButton, data);
+        /* Add check-box: */
+        if (QCheckBox *pCheckBox = qobject_cast<QCheckBox*>(pWidget))
+            addCheckBox(pCheckBox, data);
+    }
+
+    /* Wrapper for different children data: */
+    QVariant data(QWidget *pWidget) const
+    {
+        /* Return data for radio-button: */
+        if (QRadioButton *pRadioButton = qobject_cast<QRadioButton*>(pWidget))
+            return dataOfRadioButton(pRadioButton);
+        /* Return data for check-box: */
+        if (QCheckBox *pCheckBox = qobject_cast<QCheckBox*>(pWidget))
+            return dataOfCheckBox(pCheckBox);
+        /* Return empty data: */
+        return QVariant();
+    }
+
+    void reset()
+    {
+        /* Make sure all radio-buttons are unchecked: */
+        QList<QRadioButton*> radioButtons = m_radioButtons.keys();
+        for (int i = 0; i < radioButtons.size(); ++i)
+        {
+            if (radioButtons[i]->isChecked())
+            {
+                radioButtons[i]->setAutoExclusive(false);
+                radioButtons[i]->setChecked(false);
+                radioButtons[i]->setAutoExclusive(true);
+            }
+        }
+        /* Make sure all check-boxes are unchecked: */
+        QList<QCheckBox*> checkBoxes = m_checkBoxes.keys();
+        for (int i = 0; i < checkBoxes.size(); ++i)
+        {
+            if (checkBoxes[i]->isChecked())
+                checkBoxes[i]->setChecked(false);
+        }
+    }
+
+signals:
+
+    void sigNotifyAboutStateChange(QVariant exclusiveData, QList<QVariant> optionsData);
+
+private slots:
+
+    void sltRadioButtonToggled()
+    {
+        recalculateState();
+    }
+
+    void sltCheckBoxToggled()
+    {
+        recalculateState();
+    }
+
+private:
+
+    void addRadioButton(QRadioButton *pRadioButton, const QVariant &exclusiveData)
+    {
+        /* Setup the connections: */
+        connect(pRadioButton, SIGNAL(toggled(bool)), this, SLOT(sltRadioButtonToggled()));
+        /* Add radio-button into corresponding list: */
+        m_radioButtons.insert(pRadioButton, exclusiveData);
+    }
+
+    void addCheckBox(QCheckBox *pCheckBox, const QVariant &optionData)
+    {
+        /* Setup the connections: */
+        connect(pCheckBox, SIGNAL(toggled(bool)), this, SLOT(sltCheckBoxToggled()));
+        /* Add check-box into corresponding list: */
+        m_checkBoxes.insert(pCheckBox, optionData);
+    }
+
+    QVariant dataOfRadioButton(QRadioButton *pRadioButton) const
+    {
+        /* Return radio-button data if present: */
+        if (m_radioButtons.contains(pRadioButton))
+            return m_radioButtons[pRadioButton];
+        /* Return empty data: */
+        return QVariant();
+    }
+
+    QVariant dataOfCheckBox(QCheckBox *pCheckBox) const
+    {
+        /* Return check-box data if present: */
+        if (m_checkBoxes.contains(pCheckBox))
+            return m_checkBoxes[pCheckBox];
+        /* Return empty data: */
+        return QVariant();
+    }
+
+    void recalculateState()
+    {
+        /* Prepare current state: */
+        QList<bool> currentState;
+        /* Get the list of radio-buttons: */
+        QList<QRadioButton*> radioButtons = m_radioButtons.keys();
+        /* Get the list of check-boxes: */
+        QList<QCheckBox*> checkBoxes = m_checkBoxes.keys();
+
+        /* Calculate current state: */
+        for (int i = 0; i < radioButtons.size(); ++i)
+            currentState << radioButtons[i]->isChecked();
+        for (int i = 0; i < checkBoxes.size(); ++i)
+            currentState << checkBoxes[i]->isChecked();
+
+        /* Check if state was changed: */
+        if (m_state == currentState)
+            return;
+
+        /* Search for exclusive data: */
+        QVariant exclusiveData;
+        for (int i = 0; i < radioButtons.size(); ++i)
+        {
+            if (radioButtons[i]->isChecked())
+            {
+                exclusiveData = m_radioButtons[radioButtons[i]];
+                break;
+            }
+        }
+
+        /* Search for options data: */
+        QList<QVariant> optionsData;
+        for (int i = 0; i < checkBoxes.size(); ++i)
+        {
+            if (checkBoxes[i]->isChecked())
+                optionsData << m_checkBoxes[checkBoxes[i]];
+        }
+
+        /* Notify listeners about state-change: */
+        emit sigNotifyAboutStateChange(exclusiveData, optionsData);
+    }
+
+    QMap<QRadioButton*, QVariant> m_radioButtons;
+    QMap<QCheckBox*, QVariant> m_checkBoxes;
+    QList<bool> m_state;
+};
+
+UINewHDWizard::UINewHDWizard(QWidget *pParent, const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize)
+    : QIWizard(pParent)
+{
+    /* Create & add pages: */
+    addPage(new UINewHDWizardPageWelcome);
+    addPage(new UINewHDWizardPageFormat);
+    addPage(new UINewHDWizardPageVariant);
+    addPage(new UINewHDWizardPageOptions(strDefaultName, strDefaultPath, uDefaultSize));
+    addPage(new UINewHDWizardPageSummary);
+
+    /* Translate wizard: */
+    retranslateUi();
+
+    /* Translate wizard pages: */
+    retranslateAllPages();
+
+    /* Resize wizard to 'golden ratio': */
+    resizeToGoldenRatio();
+
+#ifdef Q_WS_MAC
+    /* Assign background image: */
+    assignBackground(":/vmw_new_harddisk_bg.png");
+#else /* Q_WS_MAC */
+    /* Assign watermark: */
+    assignWatermark(":/vmw_new_harddisk.png");
+#endif /* Q_WS_MAC */
+}
+
+CMedium UINewHDWizard::hardDisk() const
+{
+    /* Return 'hardDisk' field value from 'summary' page: */
+    return field("hardDisk").value<CMedium>();
+}
+
+void UINewHDWizard::retranslateUi()
+{
+    /* Assign wizard title: */
+    setWindowTitle(tr("Create New Virtual Disk"));
+}
+
+UINewHDWizardPageWelcome::UINewHDWizardPageWelcome()
+{
+    /* Decorate page: */
+    Ui::UINewHDWizardPageWelcome::setupUi(this);
+}
+
+void UINewHDWizardPageWelcome::retranslateUi()
+{
+    /* Translate uic generated strings: */
+    Ui::UINewHDWizardPageWelcome::retranslateUi(this);
+
+    /* Set 'welcome' page title: */
+    setTitle(tr("Welcome to the virtual disk creation wizard"));
+
+    /* Append page text with common part: */
+    QString strCommonPart = QString("<p>%1</p>").arg(standardHelpText());
+    m_pLabel->setText(m_pLabel->text() + strCommonPart);
+}
+
+void UINewHDWizardPageWelcome::initializePage()
+{
+    /* Retranslate page: */
+    retranslateUi();
+}
+
+UINewHDWizardPageFormat::UINewHDWizardPageFormat()
+    : m_pExclusivenessManager(0)
+    , m_pDefaultButton(0)
+{
+    /* Decorate page: */
+    Ui::UINewHDWizardPageFormat::setupUi(this);
+
+    /* Register extended metatypes: */
+    qRegisterMetaType<CMediumFormat>();
+
+    /* Register 'mediumFormat' field: */
+    registerField("mediumFormat", this, "mediumFormat");
+
+    /* Create exclusiveness manager: */
+    m_pExclusivenessManager = new UIExclusivenessManager(this);
+    connect(m_pExclusivenessManager, SIGNAL(sigNotifyAboutStateChange(QVariant, QList<QVariant>)), this, SLOT(sltUpdateFormat(QVariant)));
+
+    /* Enumerate supportable formats: */
+    CSystemProperties systemProperties = vboxGlobal().virtualBox().GetSystemProperties();
+    QVector<CMediumFormat> mediumFormats = systemProperties.GetMediumFormats();
+    for (int iMediumFormatIndex = 0; iMediumFormatIndex < mediumFormats.size(); ++iMediumFormatIndex)
+    {
+        /* Get iterated medium format: */
+        CMediumFormat mediumFormat = mediumFormats[iMediumFormatIndex];
+
+        /* Check that medium format supports creation: */
+        ULONG uFormatCapabilities = mediumFormat.GetCapabilities();
+        if (!(uFormatCapabilities & MediumFormatCapabilities_CreateFixed ||
+              uFormatCapabilities & MediumFormatCapabilities_CreateDynamic))
+            continue;
+
+        /* Check that medium format supports creation of hard-disks: */
+        QVector<QString> fileExtensions;
+        QVector<KDeviceType> deviceTypes;
+        mediumFormat.DescribeFileExtensions(fileExtensions, deviceTypes);
+        if (!deviceTypes.contains(KDeviceType_HardDisk))
+            continue;
+
+        /* Create corresponding radio-button: */
+        QRadioButton *pFormatButton = new QRadioButton(m_pFormatContainer);
+        m_pExclusivenessManager->addWidget(pFormatButton, QVariant::fromValue(mediumFormat));
+        if (mediumFormat.GetName().toLower() == "vdi")
+        {
+            m_pFormatsLayout->insertWidget(0, pFormatButton);
+            m_pDefaultButton = pFormatButton;
+        }
+        else
+            m_pFormatsLayout->addWidget(pFormatButton);
+    }
+}
+
+/* static */
+QString UINewHDWizardPageFormat::fullFormatName(const QString &strBaseFormatName)
+{
+    if (strBaseFormatName == "VDI")
+        return tr("&VDI (VirtualBox hard disk file)");
+    else if (strBaseFormatName == "VHD")
+        return tr("V&HD");
+    else if (strBaseFormatName == "VMDK")
+        return tr("V&MDK");
+    return strBaseFormatName;
+}
+
+void UINewHDWizardPageFormat::sltUpdateFormat(QVariant formatData)
+{
+    /* Get medium format: */
+    CMediumFormat mediumFormat = formatData.value<CMediumFormat>();
+
+    /* Check if medium format was changed: */
+    if (m_mediumFormat == mediumFormat)
+        return;
+
+    /* Update medium format: */
+    m_mediumFormat = mediumFormat;
+
+    /* Notify wizard sub-system about complete status changed: */
+    emit completeChanged();
+}
+
+void UINewHDWizardPageFormat::retranslateUi()
+{
+    /* Translate uic generated strings: */
+    Ui::UINewHDWizardPageFormat::retranslateUi(this);
+
+    /* Set 'format' page title: */
+    setTitle(tr("Virtual disk file type"));
+
+    /* Translate 'format' buttons: */
+    QList<QRadioButton*> formatButtons = findChildren<QRadioButton*>();
+    for (int i = 0; i < formatButtons.size(); ++i)
+    {
+        QRadioButton *pFormatButton = formatButtons[i];
+        CMediumFormat mediumFormat = m_pExclusivenessManager->data(pFormatButton).value<CMediumFormat>();
+        pFormatButton->setText(fullFormatName(mediumFormat.GetName()));
+    }
+}
+
+void UINewHDWizardPageFormat::initializePage()
+{
+    /* Retranslate page: */
+    retranslateUi();
+
+    /* Make sure first of buttons (default) is checked: */
+    m_pDefaultButton->setChecked(true);
+    m_pDefaultButton->setFocus();
+}
+
+void UINewHDWizardPageFormat::cleanupPage()
+{
+    /* Reset exclusiveness manager: */
+    m_pExclusivenessManager->reset();
+    /* Call for base-class: */
+    UINewHDWizardPage::cleanupPage();
+}
+
+bool UINewHDWizardPageFormat::isComplete() const
+{
+    return !m_mediumFormat.isNull();
+}
+
+UINewHDWizardPageVariant::UINewHDWizardPageVariant()
+    : m_pExclusivenessManager(0)
+    , m_pDynamicalButton(0), m_pFixedButton(0), m_pSplitBox(0)
+    , m_uMediumVariant(KMediumVariant_Max)
+{
+    /* Decorate page: */
+    Ui::UINewHDWizardPageVariant::setupUi(this);
+
+    /* Register 'mediumVariant' field: */
+    registerField("mediumVariant", this, "mediumVariant");
+
+    /* Unfortuanelly, KMediumVariant is very messy,
+     * so we can't enumerate it to make sure GUI will not hard-code its values,
+     * we can only use hard-coded values that we need: */
+
+    /* Create exclusiveness manager: */
+    m_pExclusivenessManager = new UIExclusivenessManager(this);
+    connect(m_pExclusivenessManager, SIGNAL(sigNotifyAboutStateChange(QVariant, QList<QVariant>)), this, SLOT(sltUpdateVariant(QVariant, QList<QVariant>)));
+
+    /* Create 'dynamical' (standard) variant radio-button: */
+    m_pDynamicalButton = new QRadioButton(m_pVariantContainer);
+    m_pVariantsLayout->addWidget(m_pDynamicalButton);
+    m_pExclusivenessManager->addWidget(m_pDynamicalButton, QVariant((qulonglong)KMediumVariant_Standard));
+
+    /* Create 'fixed' variant radio-button: */
+    m_pFixedButton = new QRadioButton(m_pVariantContainer);
+    m_pVariantsLayout->addWidget(m_pFixedButton);
+    m_pExclusivenessManager->addWidget(m_pFixedButton, QVariant((qulonglong)(KMediumVariant_Standard | KMediumVariant_Fixed)));
+
+    /* Create '2GByte' variant check-box: */
+    m_pSplitBox = new QCheckBox(m_pVariantContainer);
+    m_pVariantsLayout->addWidget(m_pSplitBox);
+    m_pExclusivenessManager->addWidget(m_pSplitBox, QVariant((qulonglong)(KMediumVariant_VmdkSplit2G)));
+}
+
+/* static */
+QString UINewHDWizardPageVariant::variantToString(qulonglong uMediumVariant)
+{
+    switch (uMediumVariant)
+    {
+        case (qulonglong)KMediumVariant_Standard:
+            return tr("Dynamically expanding storage");
+        case (qulonglong)(KMediumVariant_Standard | KMediumVariant_Fixed):
+            return tr("Fixed size storage");
+        case (qulonglong)(KMediumVariant_Standard | KMediumVariant_VmdkSplit2G):
+            return tr("Dynamically expanding storage split into files of less than 2GB");
+        case (qulonglong)(KMediumVariant_Standard | KMediumVariant_Fixed | KMediumVariant_VmdkSplit2G):
+            return tr("Fixed size storage split into files of less than 2GB");
+        default:
+            break;
+    }
+    return QString();
+}
+
+void UINewHDWizardPageVariant::sltUpdateVariant(QVariant exclusiveData, QList<QVariant> optionsData)
+{
+    /* Gather new data: */
+    qulonglong uMediumVariant = exclusiveData.isNull() ? (qulonglong)KMediumVariant_Max : exclusiveData.toULongLong();
+    for (int i = 0; i < optionsData.size(); ++i)
+        uMediumVariant |= optionsData[i].toULongLong();
+
+    /* Check if medium variant was changed: */
+    if (m_uMediumVariant == uMediumVariant)
+        return;
+
+    /* Update medium variant: */
+    m_uMediumVariant = uMediumVariant;
+
+    /* Notify wizard sub-system about complete status changed: */
+    emit completeChanged();
+}
+
+void UINewHDWizardPageVariant::retranslateUi()
+{
+    /* Translate uic generated strings: */
+    Ui::UINewHDWizardPageVariant::retranslateUi(this);
+
+    /* Set 'variant' page title: */
+    setTitle(tr("Virtual disk storage details"));
+
+    /* Translate other text: */
+    QString strText = m_pLabel->text();
+    CMediumFormat mediumFormat = field("mediumFormat").value<CMediumFormat>();
+    if (mediumFormat.isNull() || (mediumFormat.GetCapabilities() & KMediumFormatCapabilities_CreateDynamic))
+        strText += tr("<p>A <b>dynamically expanding</b> virtual disk file will only use space on your physical hard disk as it fills up, "
+                      "although it will not shrink again automatically when space on it is freed.</p>");
+    if (mediumFormat.isNull() || (mediumFormat.GetCapabilities() & KMediumFormatCapabilities_CreateFixed))
+        strText += tr("<p>A <b>fixed size</b> virtual disk file may take longer to create on some systems but is often faster to use.</p>");
+    if (mediumFormat.isNull() || (mediumFormat.GetCapabilities() & KMediumFormatCapabilities_CreateSplit2G))
+        strText += tr("<p>You can also choose to <b>split</b> the virtual disk into several files of up to two gigabytes each. "
+                      "This is mainly useful if you wish to store the virtual machine on removable USB devices or old systems, "
+                      "some of which cannot handle very large files.");
+    m_pLabel->setText(strText);
+
+    /* Translate buttons: */
+    m_pDynamicalButton->setText(tr("&Dynamically expanding"));
+    m_pFixedButton->setText(tr("&Fixed size"));
+    m_pSplitBox->setText(tr("&Split into files of less than 2GB"));
+}
+
+void UINewHDWizardPageVariant::initializePage()
+{
+    /* Retranslate page: */
+    retranslateUi();
+
+    /* Setup visibility: */
+    CMediumFormat mediumFormat = field("mediumFormat").value<CMediumFormat>();
+    ULONG uCapabilities = mediumFormat.GetCapabilities();
+    m_pDynamicalButton->setVisible(uCapabilities & KMediumFormatCapabilities_CreateDynamic);
+    m_pFixedButton->setVisible(uCapabilities & KMediumFormatCapabilities_CreateFixed);
+    m_pSplitBox->setVisible(uCapabilities & KMediumFormatCapabilities_CreateSplit2G);
+    /* Make sure first of buttons (default) is checked if visible: */
+    if (!m_pDynamicalButton->isHidden())
+    {
+        m_pDynamicalButton->setChecked(true);
+        m_pDynamicalButton->setFocus();
+    }
+}
+
+void UINewHDWizardPageVariant::cleanupPage()
+{
+    /* Reset exclusiveness manager: */
+    m_pExclusivenessManager->reset();
+    /* Call for base-class: */
+    UINewHDWizardPage::cleanupPage();
+}
+
+bool UINewHDWizardPageVariant::isComplete() const
+{
+    return m_uMediumVariant != KMediumVariant_Max;
+}
+
+UINewHDWizardPageOptions::UINewHDWizardPageOptions(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize)
+    : m_strDefaultPath(strDefaultPath)
+    , m_strMediumName(strDefaultName.isEmpty() ? QString("NewHardDisk1") : strDefaultName)
+    , m_uMediumSize(uDefaultSize == 0 ? (qulonglong)_1G * 2 : uDefaultSize)
+    , m_uMediumSizeMin(_4M)
+    , m_uMediumSizeMax(vboxGlobal().virtualBox().GetSystemProperties().GetInfoVDSize())
+    , m_iSliderScale(0)
+{
+    /* Decorate page: */
+    Ui::UINewHDWizardPageOptions::setupUi(this);
+
+    /* Register 'mediumName', 'mediumPath', 'mediumSize' fields: */
+    registerField("mediumName", this, "mediumName");
+    registerField("mediumPath", this, "mediumPath");
+    registerField("mediumSize", this, "mediumSize");
+
+    /* Detect how many steps to recognize between adjacent powers of 2
+     * to ensure that the last slider step is exactly m_uMediumSizeMax: */
+    int iPower = log2i(m_uMediumSizeMax);
+    qulonglong uTickMB = qulonglong (1) << iPower;
+    if (uTickMB < m_uMediumSizeMax)
+    {
+        qulonglong uTickMBNext = qulonglong (1) << (iPower + 1);
+        qulonglong uGap = uTickMBNext - m_uMediumSizeMax;
+        m_iSliderScale = (int)((uTickMBNext - uTickMB) / uGap);
+    }
+    m_iSliderScale = qMax(m_iSliderScale, 8);
+
+    /* Setup size-editor field: */
+    m_pSizeEditor->setFixedWidthByText("88888.88 MB");
+    m_pSizeEditor->setAlignment(Qt::AlignRight);
+    m_pSizeEditor->setValidator(new QRegExpValidator(QRegExp(vboxGlobal().sizeRegexp()), this));
+
+    /* Setup size-slider: */
+    m_pSizeSlider->setFocusPolicy(Qt::StrongFocus);
+    m_pSizeSlider->setPageStep(m_iSliderScale);
+    m_pSizeSlider->setSingleStep(m_iSliderScale / 8);
+    m_pSizeSlider->setTickInterval(0);
+    m_pSizeSlider->setMinimum(sizeMBToSlider(m_uMediumSizeMin, m_iSliderScale));
+    m_pSizeSlider->setMaximum(sizeMBToSlider(m_uMediumSizeMax, m_iSliderScale));
+    m_pSizeMin->setText(vboxGlobal().formatSize(m_uMediumSizeMin));
+    m_pSizeMax->setText(vboxGlobal().formatSize(m_uMediumSizeMax));
+
+    /* Attach button icon: */
+    m_pLocationSelector->setIcon(UIIconPool::iconSet(":/select_file_16px.png", "select_file_dis_16px.png"));
+
+    /* Setup page connections: */
+    connect(m_pLocationEditor, SIGNAL(textChanged(const QString &)), this, SLOT(sltLocationEditorTextChanged(const QString &)));
+    connect(m_pLocationSelector, SIGNAL(clicked()), this, SLOT(sltSelectLocationButtonClicked()));
+    connect(m_pSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(sltSizeSliderValueChanged(int)));
+    connect(m_pSizeEditor, SIGNAL(textChanged(const QString &)), this, SLOT(sltSizeEditorTextChanged(const QString &)));
+}
+
+void UINewHDWizardPageOptions::retranslateUi()
+{
+    /* Translate uic generated strings: */
+    Ui::UINewHDWizardPageOptions::retranslateUi(this);
+
+    /* Set 'options' page title: */
+    setTitle(tr("Virtual disk file location and size"));
+}
+
+void UINewHDWizardPageOptions::initializePage()
+{
+    /* Retranslate page: */
+    retranslateUi();
+
+    /* Initialize name: */
+    m_pLocationEditor->setText(m_strMediumName);
+    /* Initialize size: */
+    m_pSizeSlider->setValue(sizeMBToSlider(m_uMediumSize, m_iSliderScale));
+    /* 'Size' editor should have focus initially: */
+    m_pSizeEditor->setFocus();
+    /* Get default extension: */
+    m_strDefaultExtension = defaultExtension(field("mediumFormat").value<CMediumFormat>());
+    m_strMediumPath = absoluteFilePath(toFileName(m_strMediumName, m_strDefaultExtension), m_strDefaultPath);
+}
+
+void UINewHDWizardPageOptions::cleanupPage()
+{
+    /* Reset widgets: */
+    m_pLocationEditor->clear();
+    m_pSizeSlider->setValue(0);
+    /* Call for base-class: */
+    UINewHDWizardPage::cleanupPage();
+}
+
+bool UINewHDWizardPageOptions::isComplete() const
+{
+    /* Check what current size feats the bounds & current name is not empty! */
+    return m_uMediumSize >= m_uMediumSizeMin && m_uMediumSize <= m_uMediumSizeMax &&
+           !m_strMediumName.trimmed().isEmpty();
+}
+
+bool UINewHDWizardPageOptions::validatePage()
+{
+    if (QFileInfo(m_strMediumPath).exists())
+    {
+        vboxProblem().sayCannotOverwriteHardDiskStorage(this, m_strMediumPath);
+        return false;
+    }
+    return true;
+}
+
+void UINewHDWizardPageOptions::sltLocationEditorTextChanged(const QString &strText)
+{
+    /* Set current medium name: */
+    m_strMediumName = strText;
+    /* Set current medium path: */
+    m_strMediumPath = absoluteFilePath(toFileName(m_strMediumName, m_strDefaultExtension), m_strDefaultPath);
+
+    /* Notify wizard sub-system about complete status changed: */
+    emit completeChanged();
+}
+
+void UINewHDWizardPageOptions::sltSelectLocationButtonClicked()
+{
+    /* Get current folder and filename: */
+    QFileInfo fullFilePath(m_strMediumPath);
+    QDir folder = fullFilePath.path();
+    QString strFileName = fullFilePath.fileName();
+
+    /* Set the first parent folder that exists as the current: */
+    while (!folder.exists() && !folder.isRoot())
+    {
+        QFileInfo folderInfo(folder.absolutePath());
+        if (folder == QDir(folderInfo.absolutePath()))
+            break;
+        folder = folderInfo.absolutePath();
+    }
+
+    /* But if it doesn't exists at all: */
+    if (!folder.exists() || folder.isRoot())
+    {
+        /* Use recommended one folder: */
+        QFileInfo defaultFilePath(absoluteFilePath(strFileName, m_strDefaultPath));
+        folder = defaultFilePath.path();
+    }
+
+    /* Prepare backends list: */
+    CMediumFormat mediumFormat = field("mediumFormat").value<CMediumFormat>();
+    QVector<QString> fileExtensions;
+    QVector<KDeviceType> deviceTypes;
+    mediumFormat.DescribeFileExtensions(fileExtensions, deviceTypes);
+    QStringList validExtensionList;
+    for (int i = 0; i < fileExtensions.size(); ++i)
+        if (deviceTypes[i] == KDeviceType_HardDisk)
+            validExtensionList << QString("*.%1").arg(fileExtensions[i]);
+    /* Compose full filter list: */
+    QString strBackendsList = QString("%1 (%2)").arg(mediumFormat.GetName()).arg(validExtensionList.join(" "));
+
+    /* Open corresponding file-dialog: */
+    QString strChosenFilePath = QIFileDialog::getSaveFileName(folder.absoluteFilePath(strFileName),
+                                                              strBackendsList, this,
+                                                              tr("Select a file for the new hard disk image file"));
+
+    /* If there was something really chosen: */
+    if (!strChosenFilePath.isEmpty())
+    {
+        /* If valid file extension is missed, append it: */
+        if (QFileInfo(strChosenFilePath).completeSuffix().isEmpty())
+            strChosenFilePath += QString(".%1").arg(m_strDefaultExtension);
+        m_pLocationEditor->setText(QDir::toNativeSeparators(strChosenFilePath));
+        m_pLocationEditor->selectAll();
+        m_pLocationEditor->setFocus();
+    }
+}
+
+void UINewHDWizardPageOptions::sltSizeSliderValueChanged(int iValue)
+{
+    /* Update currently stored size: */
+    m_uMediumSize = sliderToSizeMB(iValue, m_iSliderScale);
+    /* Update tooltip: */
+    updateSizeToolTip(m_uMediumSize);
+    /* Notify size-editor about size had changed preventing callback: */
+    m_pSizeEditor->blockSignals(true);
+    m_pSizeEditor->setText(vboxGlobal().formatSize(m_uMediumSize));
+    m_pSizeEditor->blockSignals(false);
+
+    /* Notify wizard sub-system about complete status changed: */
+    emit completeChanged();
+}
+
+void UINewHDWizardPageOptions::sltSizeEditorTextChanged(const QString &strValue)
+{
+    /* Update currently stored size: */
+    m_uMediumSize = vboxGlobal().parseSize(strValue);
+    /* Update tooltip: */
+    updateSizeToolTip(m_uMediumSize);
+    /* Notify size-slider about size had changed preventing callback: */
+    m_pSizeSlider->blockSignals(true);
+    m_pSizeSlider->setValue(sizeMBToSlider(m_uMediumSize, m_iSliderScale));
+    m_pSizeSlider->blockSignals(false);
+
+    /* Notify wizard sub-system about complete status changed: */
+    emit completeChanged();
+}
+
+/* static */
+QString UINewHDWizardPageOptions::absoluteFilePath(const QString &strFileName, const QString &strDefaultPath)
+{
+    /* Wrap file-info around received file name: */
+    QFileInfo fileInfo(strFileName);
+    /* If path-info is relative or there is no path-info at all: */
+    if (fileInfo.fileName() == strFileName || fileInfo.isRelative())
+    {
+        /* Resolve path on the basis of default path we have: */
+        fileInfo = QFileInfo(strDefaultPath, strFileName);
+    }
+    /* Return full absolute hard disk file path: */
+    return QDir::toNativeSeparators(fileInfo.absoluteFilePath());
+}
+
+/* static */
+QString UINewHDWizardPageOptions::toFileName(const QString &strName, const QString &strExtension)
+{
+    /* Convert passed name to native separators (it can be full, actually): */
+    QString strFileName = QDir::toNativeSeparators(strName);
+
+    /* Remove all trailing dots to avoid multiple dots before extension: */
+    int iLen;
+    while (iLen = strFileName.length(), iLen > 0 && strFileName[iLen - 1] == '.')
+        strFileName.truncate(iLen - 1);
+
+    /* Add passed extension if its not done yet: */
+    if (QFileInfo(strFileName).completeSuffix().toLower() != strExtension)
+        strFileName += QString(".%1").arg(strExtension);
+
+    /* Return result: */
+    return strFileName;
+}
+
+/* static */
+QString UINewHDWizardPageOptions::defaultExtension(CMediumFormat mediumFormat)
+{
+    /* Load extension / device list: */
+    QVector<QString> fileExtensions;
+    QVector<KDeviceType> deviceTypes;
+    mediumFormat.DescribeFileExtensions(fileExtensions, deviceTypes);
+    for (int i = 0; i < fileExtensions.size(); ++i)
+        if (deviceTypes[i] == KDeviceType_HardDisk)
+            return fileExtensions[i].toLower();
+    AssertMsgFailed(("Extension can't be NULL!\n"));
+    return QString();
+}
+
+/* static */
+int UINewHDWizardPageOptions::log2i(qulonglong uValue)
+{
+    int iPower = -1;
+    while (uValue)
+    {
+        ++iPower;
+        uValue >>= 1;
+    }
+    return iPower;
+}
+
+/* static */
+int UINewHDWizardPageOptions::sizeMBToSlider(qulonglong uValue, int iSliderScale)
+{
+    int iPower = log2i(uValue);
+    qulonglong uTickMB = qulonglong (1) << iPower;
+    qulonglong uTickMBNext = qulonglong (1) << (iPower + 1);
+    int iStep = (uValue - uTickMB) * iSliderScale / (uTickMBNext - uTickMB);
+    return iPower * iSliderScale + iStep;
+}
+
+/* static */
+qulonglong UINewHDWizardPageOptions::sliderToSizeMB(int uValue, int iSliderScale)
+{
+    int iPower = uValue / iSliderScale;
+    int iStep = uValue % iSliderScale;
+    qulonglong uTickMB = qulonglong (1) << iPower;
+    qulonglong uTickMBNext = qulonglong (1) << (iPower + 1);
+    return uTickMB + (uTickMBNext - uTickMB) * iStep / iSliderScale;
+}
+
+void UINewHDWizardPageOptions::updateSizeToolTip(qulonglong uSize)
+{
+    QString strToolTip = tr("<nobr>%1 (%2 B)</nobr>").arg(vboxGlobal().formatSize(uSize)).arg(uSize);
+    m_pSizeSlider->setToolTip(strToolTip);
+    m_pSizeEditor->setToolTip(strToolTip);
+}
+
+UINewHDWizardPageSummary::UINewHDWizardPageSummary()
+{
+    /* Decorate page: */
+    Ui::UINewHDWizardPageSummary::setupUi(this);
+
+    /* Register CMedium class: */
+    qRegisterMetaType<CMedium>();
+
+    /* Register 'hardDisk' field: */
+    registerField("hardDisk", this, "hardDisk");
+
+    /* Disable the background painting of the summary widget: */
+    m_pSummaryText->viewport()->setAutoFillBackground(false);
+}
+
+void UINewHDWizardPageSummary::retranslateUi()
+{
+    /* Translate uic generated strings: */
+    Ui::UINewHDWizardPageSummary::retranslateUi(this);
+
+    /* Set 'summary' page title: */
+    setTitle(tr("Summary"));
+
+    /* Compose common summary: */
+    QString strSummary;
+
+    CMediumFormat mediumFormat = field("mediumFormat").value<CMediumFormat>();
+    qulonglong uVariant = field("mediumVariant").toULongLong();
+    QString strMediumPath = field("mediumPath").toString();
+    QString sizeFormatted = VBoxGlobal::formatSize(field("mediumSize").toULongLong());
+    QString sizeUnformatted = tr("%1 B").arg(field("mediumSize").toULongLong());
+
+    strSummary += QString
+    (
+        "<tr><td><nobr>%1: </nobr></td><td><nobr>%2</nobr></td></tr>"
+        "<tr><td><nobr>%3: </nobr></td><td><nobr>%4</nobr></td></tr>"
+        "<tr><td><nobr>%5: </nobr></td><td><nobr>%6</nobr></td></tr>"
+        "<tr><td><nobr>%7: </nobr></td><td><nobr>%8 (%9)</nobr></td></tr>"
+    )
+    .arg(tr("File type", "summary"), mediumFormat.isNull() ? QString() : VBoxGlobal::removeAccelMark(UINewHDWizardPageFormat::fullFormatName(mediumFormat.GetName())))
+    .arg(tr("Details", "summary"), UINewHDWizardPageVariant::variantToString(uVariant))
+    .arg(tr("Location", "summary"), strMediumPath)
+    .arg(tr("Size", "summary"), sizeFormatted, sizeUnformatted);
+
+    /* Feat summary to 4 lines: */
+    setSummaryFieldLinesNumber(m_pSummaryText, 4);
+
+    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + strSummary + "</table>");
+
+    m_pLabel2->setText(tr("If the above settings are correct, press the <b>%1</b> button. "
+                          "Once you press it a new virtual disk file will be created.")
+                          .arg(VBoxGlobal::replaceHtmlEntities(VBoxGlobal::removeAccelMark(wizard()->buttonText(QWizard::FinishButton)))));
+}
+
+void UINewHDWizardPageSummary::initializePage()
+{
+    /* Retranslate page: */
+    retranslateUi();
+
+    /* Summary should have focus initially: */
+    m_pSummaryText->setFocus();
+}
+
+bool UINewHDWizardPageSummary::validatePage()
+{
+    /* Start performing long-time operation: */
+    startProcessing();
+    /* Try to construct hard disk: */
+    bool fResult = createHardDisk();
+    /* Finish performing long-time operation: */
+    endProcessing();
+    /* Return operation result: */
+    return fResult;
+}
+
+bool UINewHDWizardPageSummary::createHardDisk()
+{
+    /* Gather attributes: */
+    CMediumFormat mediumFormat = field("mediumFormat").value<CMediumFormat>();
+    qulonglong uVariant = field("mediumVariant").toULongLong();
+    QString strMediumPath = field("mediumPath").toString();
+    qulonglong uSize = field("mediumSize").toULongLong();
+
+    AssertReturn(!strMediumPath.isNull(), false);
+    AssertReturn(uSize > 0, false);
+
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+
+    CProgress progress;
+
+    CMedium hardDisk = vbox.CreateHardDisk(mediumFormat.GetName(), strMediumPath);
+
+    if (!vbox.isOk())
+    {
+        vboxProblem().cannotCreateHardDiskStorage(this, vbox, strMediumPath, hardDisk, progress);
+        return false;
+    }
+
+    progress = hardDisk.CreateBaseStorage(uSize, uVariant);
+
+    if (!hardDisk.isOk())
+    {
+        vboxProblem().cannotCreateHardDiskStorage(this, vbox, strMediumPath, hardDisk, progress);
+        return false;
+    }
+
+    vboxProblem().showModalProgressDialog(progress, windowTitle(), ":/progress_media_create_90px.png", this, true);
+
+    if (progress.GetCanceled())
+        return false;
+
+    if (!progress.isOk() || progress.GetResultCode() != 0)
+    {
+        vboxProblem().cannotCreateHardDiskStorage(this, vbox, strMediumPath, hardDisk, progress);
+        return false;
+    }
+
+    /* Inform everybody there is a new medium: */
+    vboxGlobal().addMedium(VBoxMedium(CMedium(hardDisk), VBoxDefs::MediumType_HardDisk, KMediumState_Created));
+
+    m_HardDisk = hardDisk;
+    return true;
+}
+
+#include "UINewHDWizard.moc"
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.h	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.h	(revision 37331)
@@ -0,0 +1,299 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UINewHDWizard class declaration
+ */
+
+/*
+ * Copyright (C) 2006-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 __UINewHDWizard_h__
+#define __UINewHDWizard_h__
+
+/* Local includes: */
+#include "QIWizard.h"
+#include "COMDefs.h"
+
+/* Generated includes: */
+#include "UINewHDWizardPageWelcome.gen.h"
+#include "UINewHDWizardPageFormat.gen.h"
+#include "UINewHDWizardPageVariant.gen.h"
+#include "UINewHDWizardPageOptions.gen.h"
+#include "UINewHDWizardPageSummary.gen.h"
+
+/* Forward declarations: */
+class QRadioButton;
+class QCheckBox;
+class UIExclusivenessManager;
+
+/* New hard disk wizard class: */
+class UINewHDWizard : public QIWizard
+{
+    Q_OBJECT;
+
+public:
+
+    /* Constructor: */
+    UINewHDWizard(QWidget *pParent, const QString &strDefaultName = QString(), const QString &strDefaultPath = QString(), qulonglong uDefaultSize = 0);
+
+    /* Returns created hard disk: */
+    CMedium hardDisk() const;
+
+private:
+
+    /* Translation stuff: */
+    void retranslateUi();
+};
+
+/* Base wrapper for the wizard page
+ * of the new hard disk wizard class: */
+class UINewHDWizardPage : public QIWizardPage
+{
+    Q_OBJECT;
+
+public:
+
+    /* Constructor: */
+    UINewHDWizardPage() {}
+
+protected:
+
+    /* Returns parent wizard object: */
+    UINewHDWizard* wizard() { return qobject_cast<UINewHDWizard*>(QIWizardPage::wizard()); }
+};
+
+/* Welcome page of the new hard-disk wizard: */
+class UINewHDWizardPageWelcome : public UINewHDWizardPage, public Ui::UINewHDWizardPageWelcome
+{
+    Q_OBJECT;
+
+public:
+
+    /* Constructor: */
+    UINewHDWizardPageWelcome();
+
+private:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+    /* Prepare page: */
+    void initializePage();
+};
+
+/* Format page of the new hard-disk wizard: */
+class UINewHDWizardPageFormat : public UINewHDWizardPage, public Ui::UINewHDWizardPageFormat
+{
+    Q_OBJECT;
+    Q_PROPERTY(CMediumFormat mediumFormat READ mediumFormat WRITE setMediumFormat);
+
+public:
+
+    /* Constructor: */
+    UINewHDWizardPageFormat();
+
+    /* Returns full medium format name: */
+    static QString fullFormatName(const QString &strBaseFormatName);
+
+private slots:
+
+    /* Handler for the 'format'-change signal: */
+    void sltUpdateFormat(QVariant formatData);
+
+private:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+    /* Prepare page: */
+    void initializePage();
+    /* Cleanup page: */
+    void cleanupPage();
+
+    /* Completeness validator: */
+    bool isComplete() const;
+
+    /* Exclusiveness manager: */
+    UIExclusivenessManager *m_pExclusivenessManager;
+
+    /* Defaut format (VDI) button: */
+    QRadioButton *m_pDefaultButton;
+
+    /* Stuff for 'mediumFormat' field: */
+    CMediumFormat mediumFormat() const { return m_mediumFormat; }
+    void setMediumFormat(const CMediumFormat &mediumFormat) { m_mediumFormat = mediumFormat; }
+    CMediumFormat m_mediumFormat;
+};
+
+/* Variant page of the new hard-disk wizard: */
+class UINewHDWizardPageVariant : public UINewHDWizardPage, public Ui::UINewHDWizardPageVariant
+{
+    Q_OBJECT;
+    Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant);
+
+public:
+
+    /* Constructor: */
+    UINewHDWizardPageVariant();
+
+    /* Returns the name of passed medium variant: */
+    static QString variantToString(qulonglong uMediumVariant);
+
+private slots:
+
+    /* Handler for the 'variant'-change signal: */
+    void sltUpdateVariant(QVariant exclusiveData, QList<QVariant> optionsData);
+
+private:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+    /* Prepare page: */
+    void initializePage();
+    /* Cleanup page: */
+    void cleanupPage();
+
+    /* Completeness validator: */
+    bool isComplete() const;
+
+    /* Exclusiveness manager: */
+    UIExclusivenessManager *m_pExclusivenessManager;
+
+    /* Defaut variant (dynamic) button: */
+    QRadioButton *m_pDynamicalButton;
+    QRadioButton *m_pFixedButton;
+    QCheckBox *m_pSplitBox;
+
+    /* Stuff for 'variant' field: */
+    qulonglong mediumVariant() const { return m_uMediumVariant; }
+    void setMediumVariant(qulonglong uMediumVariant) { m_uMediumVariant = uMediumVariant; }
+    qulonglong m_uMediumVariant;
+};
+
+/* Options page of the new hard-disk wizard: */
+class UINewHDWizardPageOptions : public UINewHDWizardPage, public Ui::UINewHDWizardPageOptions
+{
+    Q_OBJECT;
+    Q_PROPERTY(QString mediumName READ mediumName WRITE setMediumName);
+    Q_PROPERTY(QString mediumPath READ mediumPath WRITE setMediumPath);
+    Q_PROPERTY(qulonglong mediumSize READ mediumSize WRITE setMediumSize);
+
+public:
+
+    /* Constructor: */
+    UINewHDWizardPageOptions(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize);
+
+protected:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+    /* Prepare page: */
+    void initializePage();
+    /* Cleanup page: */
+    void cleanupPage();
+
+    /* Completeness validator: */
+    bool isComplete() const;
+    /* Completeness finisher: */
+    bool validatePage();
+
+private slots:
+
+    /* Location editors stuff: */
+    void sltLocationEditorTextChanged(const QString &strName);
+    void sltSelectLocationButtonClicked();
+
+    /* Size editors stuff: */
+    void sltSizeSliderValueChanged(int iValue);
+    void sltSizeEditorTextChanged(const QString &strValue);
+
+private:
+
+    /* Returns 'file name' for the passed 'name': */
+    static QString toFileName(const QString &strName, const QString &strExtension);
+    /* Returns 'absolute file path' for the passed 'file name': */
+    static QString absoluteFilePath(const QString &strFileName, const QString &strDefaultPath);
+    /* Returns default extension for the passed medium format: */
+    static QString defaultExtension(CMediumFormat mediumFormat);
+
+    /* Size editors stuff: */
+    static int log2i(qulonglong uValue);
+    static int sizeMBToSlider(qulonglong uValue, int iSliderScale);
+    static qulonglong sliderToSizeMB(int uValue, int iSliderScale);
+    void updateSizeToolTip(qulonglong uSize);
+
+    /* The default extension for the hard disk file: */
+    QString m_strDefaultExtension;
+
+    /* The default path for the hard disk file: */
+    QString m_strDefaultPath;
+
+    /* Stuff for 'mediumName' field: */
+    QString mediumName() const { return m_strMediumName; }
+    void setMediumName(const QString &strMediumName) { m_strMediumName = strMediumName; }
+    QString m_strMediumName;
+
+    /* Stuff for 'mediumPath' field: */
+    QString mediumPath() const { return m_strMediumPath; }
+    void setMediumPath(const QString &strMediumPath) { m_strMediumPath = strMediumPath; }
+    QString m_strMediumPath;
+
+    /* Stuff for 'mediumSize' field: */
+    qulonglong mediumSize() const { return m_uMediumSize; }
+    void setMediumSize(qulonglong uMediumSize) { m_uMediumSize = uMediumSize; }
+    qulonglong m_uMediumSize;
+
+    /* Other size editors stuff: */
+    qulonglong m_uMediumSizeMin;
+    qulonglong m_uMediumSizeMax;
+    int m_iSliderScale;
+};
+
+/* Summary page of the new hard-disk wizard: */
+class UINewHDWizardPageSummary : public UINewHDWizardPage, public Ui::UINewHDWizardPageSummary
+{
+    Q_OBJECT;
+    Q_PROPERTY(CMedium hardDisk READ hardDisk WRITE setHardDisk);
+
+public:
+
+    /* Constructor: */
+    UINewHDWizardPageSummary();
+
+protected:
+
+    /* Translation stuff: */
+    void retranslateUi();
+
+    /* Prepare page: */
+    void initializePage();
+
+    /* Completeness finisher: */
+    bool validatePage();
+
+private:
+
+    /* Creates hard disk: */
+    bool createHardDisk();
+
+    /* Stuff for 'hardDisk' field: */
+    CMedium hardDisk() const { return m_HardDisk; }
+    void setHardDisk(const CMedium &hardDisk) { m_HardDisk = hardDisk; }
+    CMedium m_HardDisk;
+};
+
+Q_DECLARE_METATYPE(CMedium);
+
+#endif // __UINewHDWizard_h__
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageFormat.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageFormat.ui	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageFormat.ui	(revision 37331)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-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.
+ </comment>
+ <class>UINewHDWizardPageFormat</class>
+ <widget class="QWidget" name="UINewHDWizardPageFormat">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QVBoxLayout" name="m_pMainLayout">
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QILabel" name="m_pLabel">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>&lt;p&gt;Please choose the type of file that you would like to use for the new virtual disk. If you do not need to use this virtual machine with other virtualization software you can leave this setting unchanged.&lt;/p&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pFormatContainer">
+     <property name="title">
+      <string>File type</string>
+     </property>
+     <layout class="QVBoxLayout" name="m_pFormatsLayout"/>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageOptions.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageOptions.ui	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageOptions.ui	(revision 37331)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-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.
+ </comment>
+ <class>UINewHDWizardPageOptions</class>
+ <widget class="QWidget" name="UINewHDWizardPageOptions">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QVBoxLayout" name="m_pMainLayout">
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QILabel" name="m_pLabel1">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>&lt;p&gt;Press the &lt;b&gt;Select&lt;/b&gt; button to select the location of a file to store the virtual disk data or type a file name in the entry field.&lt;/p&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pLocationCnt">
+     <property name="title">
+      <string>&amp;Location</string>
+     </property>
+     <layout class="QHBoxLayout" name="m_pOptionsLayout">
+      <item>
+       <widget class="QLineEdit" name="m_pLocationEditor"/>
+      </item>
+      <item>
+       <widget class="QIToolButton" name="m_pLocationSelector">
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pLabel2">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>&lt;p&gt;Select the size of the virtual disk in megabytes. This size will be reported to the Guest OS as the maximum size of this virtual disk.&lt;/p&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pSizeCnt">
+     <property name="title">
+      <string>&amp;Size</string>
+     </property>
+     <layout class="QGridLayout" name="m_pSizeLayout">
+      <item row="0" column="0" colspan="3">
+       <widget class="QSlider" name="m_pSizeSlider">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="tickPosition">
+         <enum>QSlider::TicksBelow</enum>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="3">
+       <widget class="QILineEdit" name="m_pSizeEditor">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="m_pSizeMin">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <spacer name="m_pSizeSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="1" column="2">
+       <widget class="QLabel" name="m_pSizeMax">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QIToolButton</class>
+   <extends>QToolButton</extends>
+   <header>QIToolButton.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QILineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>QILineEdit.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageSummary.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageSummary.ui	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageSummary.ui	(revision 37331)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-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.
+ </comment>
+ <class>UINewHDWizardPageSummary</class>
+ <widget class="QWidget" name="UINewHDWizardPageSummary">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QVBoxLayout" name="m_pMainLayout">
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QILabel" name="m_pLabel1">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>You are going to create a new virtual disk with the following parameters:</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QTextEdit" name="m_pSummaryText">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>300</width>
+       <height>0</height>
+      </size>
+     </property>
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="readOnly">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pLabel2">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageVariant.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageVariant.ui	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageVariant.ui	(revision 37331)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-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.
+ </comment>
+ <class>UINewHDWizardPageVariant</class>
+ <widget class="QWidget" name="UINewHDWizardPageVariant">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QVBoxLayout" name="m_pMainLayout">
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QILabel" name="m_pLabel">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>&lt;p&gt;Please choose whether the new virtual disk file should expand as it is used or be created fully expanded.&lt;/p&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pVariantContainer">
+     <property name="title">
+      <string>Storage details</string>
+     </property>
+     <layout class="QVBoxLayout" name="m_pVariantsLayout"/>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageWelcome.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageWelcome.ui	(revision 37331)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageWelcome.ui	(revision 37331)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-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.
+ </comment>
+ <class>UINewHDWizardPageWelcome</class>
+ <widget class="QWidget" name="UINewHDWizardPageWelcome">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QVBoxLayout" name="m_pMainLayout">
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QILabel" name="m_pLabel">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>&lt;p&gt;This wizard will help you to create a new virtual disk for your virtual machine.&lt;/p&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp	(revision 37330)
+++ 	(revision )
@@ -1,544 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * UINewHDWzd class implementation
- */
-
-/*
- * Copyright (C) 2006-2010 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.
- */
-
-/* Local includes */
-#include "UIIconPool.h"
-#include "UINewHDWzd.h"
-#include "VBoxGlobal.h"
-#include "VBoxProblemReporter.h"
-
-/* Global includes */
-#include "iprt/path.h"
-#include <QFileDialog>
-#include <QRegExpValidator>
-
-
-UINewHDWzd::UINewHDWzd(QWidget *pParent) : QIWizard(pParent)
-{
-    /* Create & add pages */
-    addPage(new UINewHDWzdPage1);
-    addPage(new UINewHDWzdPage2);
-    addPage(new UINewHDWzdPage3);
-    addPage(new UINewHDWzdPage4);
-
-    /* Initial translate */
-    retranslateUi();
-
-    /* Initial translate all pages */
-    retranslateAllPages();
-
-    /* Resize to 'golden ratio' */
-    resizeToGoldenRatio();
-
-#ifdef Q_WS_MAC
-    /* Assign background image */
-    assignBackground(":/vmw_new_harddisk_bg.png");
-#else /* Q_WS_MAC */
-    /* Assign watermark */
-    assignWatermark(":/vmw_new_harddisk.png");
-#endif /* Q_WS_MAC */
-}
-
-CMedium UINewHDWzd::hardDisk() const
-{
-    /* Get 'hardDisk' field value from page 4 */
-    return field("hardDisk").value<CMedium>();
-}
-
-void UINewHDWzd::setRecommendedName(const QString &strName)
-{
-    /* Set 'initialName' field value for page 3 */
-    setField("initialName", strName);
-}
-
-void UINewHDWzd::setRecommendedSize(qulonglong uSize)
-{
-    /* Set 'initialSize' field value for page 3 */
-    setField("initialSize", uSize);
-}
-
-void UINewHDWzd::setDefaultPath(const QString &strDefaultPath)
-{
-    m_strDefaultPath = strDefaultPath;
-}
-
-QString UINewHDWzd::absoluteFilePath(const QString &strFileName)
-{
-    /* Wrap file-info around received file name: */
-    QFileInfo fi(strFileName);
-    /* If there is no path info at all or its relative: */
-    if (fi.fileName() == strFileName || fi.isRelative())
-    {
-        /* Resolve path on the basis of m_strDefaultPath: */
-        fi = QFileInfo(m_strDefaultPath, strFileName);
-    }
-    /* Return full absolute hard disk file path: */
-    return QDir::toNativeSeparators(fi.absoluteFilePath());
-}
-
-void UINewHDWzd::retranslateUi()
-{
-    /* Wizard title */
-    setWindowTitle(tr("Create New Virtual Disk"));
-}
-
-UINewHDWzdPage1::UINewHDWzdPage1()
-{
-    /* Decorate page */
-    Ui::UINewHDWzdPage1::setupUi(this);
-}
-
-void UINewHDWzdPage1::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::UINewHDWzdPage1::retranslateUi(this);
-
-    /* Wizard page 1 title */
-    setTitle(tr("Welcome to the Create New Virtual Disk Wizard!"));
-
-
-    m_pPage1Text1->setText(tr("<p>This wizard will help you to create a new virtual hard disk "
-                              "for your virtual machine.</p><p>%1</p>")
-                           .arg(standardHelpText()));
-}
-
-void UINewHDWzdPage1::initializePage()
-{
-    /* Fill and translate */
-    retranslateUi();
-}
-
-UINewHDWzdPage2::UINewHDWzdPage2()
-    : m_strType(QString())
-    , m_bFixed(false)
-{
-    /* Decorate page */
-    Ui::UINewHDWzdPage2::setupUi(this);
-
-    /* Register 'type', 'fixed' fields */
-    registerField("type*", this, "type");
-    registerField("fixed", this, "fixed");
-
-    /* Setup connections */
-    connect (m_pTypeDynamic, SIGNAL(clicked(bool)), this, SLOT(onTypeChanged()));
-    connect (m_pTypeFixed, SIGNAL(clicked(bool)), this, SLOT(onTypeChanged()));
-}
-
-void UINewHDWzdPage2::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::UINewHDWzdPage2::retranslateUi(this);
-
-    /* Wizard page 2 title */
-    setTitle(tr("Hard Disk Storage Type"));
-}
-
-void UINewHDWzdPage2::initializePage()
-{
-    /* Fill and translate */
-    retranslateUi();
-
-    /* Prepare initial choice */
-    m_pTypeDynamic->click();
-
-    /* 'Dynamic' choice should have focus initially */
-    m_pTypeDynamic->setFocus();
-}
-
-void UINewHDWzdPage2::onTypeChanged()
-{
-    if (m_pTypeDynamic->isChecked())
-    {
-        /* 'Dynamic' storage type */
-        m_strType = VBoxGlobal::removeAccelMark(m_pTypeDynamic->text());
-        m_bFixed = false;
-    }
-    else if (m_pTypeFixed->isChecked())
-    {
-        /* 'Fixed' storage type */
-        m_strType = VBoxGlobal::removeAccelMark(m_pTypeFixed->text());
-        m_bFixed = true;
-    }
-    else
-    {
-        /* Not complete */
-        m_strType.clear();
-        m_bFixed = false;
-    }
-    emit completeChanged();
-}
-
-UINewHDWzdPage3::UINewHDWzdPage3()
-    : m_strInitialName("NewHardDisk1.vdi")
-    , m_strCurrentName(QString())
-    , m_strLocation(QString())
-    , m_uInitialSize(2 * _1K)
-    , m_uCurrentSize(0)
-    , m_uMinVDISize(_4M)
-    , m_uMaxVDISize(vboxGlobal().virtualBox().GetSystemProperties().GetInfoVDSize())
-    , m_iSliderScale(0)
-{
-    /* Decorate page */
-    Ui::UINewHDWzdPage3::setupUi(this);
-
-    /* Register 'initialName', 'currentName', 'location' &
-     * 'initialSize', 'currentSize' fields */
-    registerField("initialName", this, "initialName");
-    registerField("currentName", this, "currentName");
-    registerField("location", this, "location");
-    registerField("initialSize", this, "initialSize");
-    registerField("currentSize", this, "currentSize");
-
-    /* Detect how many steps to recognize between adjacent powers of 2
-     * to ensure that the last slider step is exactly m_uMaxVDISize */
-    int iPower = log2i(m_uMaxVDISize);
-    qulonglong uTickMB = qulonglong (1) << iPower;
-    if (uTickMB < m_uMaxVDISize)
-    {
-        qulonglong uTickMBNext = qulonglong (1) << (iPower + 1);
-        qulonglong uGap = uTickMBNext - m_uMaxVDISize;
-        m_iSliderScale = (int)((uTickMBNext - uTickMB) / uGap);
-    }
-    m_iSliderScale = qMax(m_iSliderScale, 8);
-
-    /* Setup size-editor field */
-    m_pSizeEditor->setFixedWidthByText("88888.88 MB");
-    m_pSizeEditor->setAlignment(Qt::AlignRight);
-    m_pSizeEditor->setValidator(new QRegExpValidator(QRegExp(vboxGlobal().sizeRegexp()), this));
-
-    /* Setup size-slider */
-    m_pSizeSlider->setFocusPolicy(Qt::StrongFocus);
-    m_pSizeSlider->setPageStep(m_iSliderScale);
-    m_pSizeSlider->setSingleStep(m_iSliderScale / 8);
-    m_pSizeSlider->setTickInterval(0);
-    m_pSizeSlider->setMinimum(sizeMBToSlider(m_uMinVDISize, m_iSliderScale));
-    m_pSizeSlider->setMaximum(sizeMBToSlider(m_uMaxVDISize, m_iSliderScale));
-    m_pSizeMin->setText(vboxGlobal().formatSize(m_uMinVDISize));
-    m_pSizeMax->setText(vboxGlobal().formatSize(m_uMaxVDISize));
-
-    /* Attach button icon */
-    m_pLocationSelector->setIcon(UIIconPool::iconSet(":/select_file_16px.png",
-                                                     "select_file_dis_16px.png"));
-
-    /* Setup page connections */
-    connect(m_pLocationEditor, SIGNAL(textChanged(const QString &)), this, SLOT(onLocationEditorTextChanged(const QString &)));
-    connect(m_pLocationSelector, SIGNAL(clicked()), this, SLOT(onSelectLocationButtonClicked()));
-    connect(m_pSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(onSizeSliderValueChanged(int)));
-    connect(m_pSizeEditor, SIGNAL(textChanged(const QString &)), this, SLOT(onSizeEditorTextChanged(const QString &)));
-}
-
-void UINewHDWzdPage3::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::UINewHDWzdPage3::retranslateUi(this);
-
-    /* Wizard page 3 title */
-    setTitle(tr("Virtual Disk Location and Size"));
-}
-
-void UINewHDWzdPage3::initializePage()
-{
-    /* Fill and translate */
-    retranslateUi();
-
-    /* Initialise location */
-    m_pLocationEditor->setText(m_strInitialName);
-
-    /* Initialise size */
-    m_pSizeSlider->setValue(sizeMBToSlider(m_uInitialSize, m_iSliderScale));
-
-    /* 'Size' editor should have focus initially */
-    m_pSizeEditor->setFocus();
-}
-
-void UINewHDWzdPage3::cleanupPage()
-{
-    /* Do not call superclass method! */
-}
-
-bool UINewHDWzdPage3::isComplete() const
-{
-    /* Check what 'currentSize' field value feats the bounds &
-     *       what 'currentName' field text is not empty! */
-    return field("currentSize").toULongLong() >= m_uMinVDISize &&
-           field("currentSize").toULongLong() <= m_uMaxVDISize &&
-           !field("currentName").toString().trimmed().isEmpty();
-}
-
-bool UINewHDWzdPage3::validatePage()
-{
-    QString location = qobject_cast<UINewHDWzd*>(wizard())->absoluteFilePath(m_strLocation);
-    if (QFileInfo(location).exists())
-    {
-        vboxProblem().sayCannotOverwriteHardDiskStorage(this, location);
-        return false;
-    }
-    return true;
-}
-
-void UINewHDWzdPage3::onLocationEditorTextChanged(const QString &strText)
-{
-    /* Set current name */
-    m_strCurrentName = strText;
-
-    /* Set current fileName */
-    m_strLocation = toFileName(strText);
-
-    /* Notify wizard sub-system about complete status changed: */
-    emit completeChanged();
-}
-
-void UINewHDWzdPage3::onSelectLocationButtonClicked()
-{
-    /* Get parent wizard: */
-    UINewHDWzd *pWizard = qobject_cast<UINewHDWzd*>(wizard());
-
-    /* Get current folder and filename: */
-    QFileInfo fullFilePath(pWizard->absoluteFilePath(m_strLocation));
-    QDir folder = fullFilePath.path();
-    QString strFileName = fullFilePath.fileName();
-
-    /* Set the first parent foler that exists as the current: */
-    while (!folder.exists() && !folder.isRoot())
-        folder = QFileInfo(folder.absolutePath()).dir();
-
-    /* But if it doesn't exists at all: */
-    if (!folder.exists() || folder.isRoot())
-    {
-        /* Use recommended one folder: */
-        QFileInfo defaultFilePath(pWizard->absoluteFilePath(strFileName));
-        folder = defaultFilePath.path();
-    }
-
-    QString selected = QFileDialog::getSaveFileName(this, tr("Select a file for the new hard disk image file"),
-                                                    folder.absoluteFilePath(strFileName), tr("Hard disk images (*.vdi)"));
-
-    if (!selected.isEmpty())
-    {
-        if (QFileInfo(selected).completeSuffix().isEmpty())
-            selected += ".vdi";
-        m_pLocationEditor->setText(QDir::toNativeSeparators(selected));
-        m_pLocationEditor->selectAll();
-        m_pLocationEditor->setFocus();
-    }
-}
-
-void UINewHDWzdPage3::onSizeSliderValueChanged(int iValue)
-{
-    /* Update currently stored size: */
-    m_uCurrentSize = sliderToSizeMB(iValue, m_iSliderScale);
-    /* Update tooltip: */
-    updateSizeToolTip(m_uCurrentSize);
-    /* Notify size-editor about size had changed preventing callback: */
-    m_pSizeEditor->blockSignals(true);
-    m_pSizeEditor->setText(vboxGlobal().formatSize(m_uCurrentSize));
-    m_pSizeEditor->blockSignals(false);
-    /* Notify wizard sub-system about complete status changed: */
-    emit completeChanged();
-}
-
-void UINewHDWzdPage3::onSizeEditorTextChanged(const QString &strValue)
-{
-    /* Update currently stored size: */
-    m_uCurrentSize = vboxGlobal().parseSize(strValue);
-    /* Update tooltip: */
-    updateSizeToolTip(m_uCurrentSize);
-    /* Notify size-slider about size had changed preventing callback: */
-    m_pSizeSlider->blockSignals(true);
-    m_pSizeSlider->setValue(sizeMBToSlider(m_uCurrentSize, m_iSliderScale));
-    m_pSizeSlider->blockSignals(false);
-    /* Notify wizard sub-system about complete status changed: */
-    emit completeChanged();
-}
-
-QString UINewHDWzdPage3::toFileName(const QString &strName)
-{
-    QString fileName = QDir::toNativeSeparators(strName);
-
-    /* Remove all trailing dots to avoid multiple dots before .vdi */
-    int len;
-    while (len = fileName.length(), len > 0 && fileName [len - 1] == '.')
-        fileName.truncate(len - 1);
-
-    QString ext = QFileInfo(fileName).completeSuffix();
-
-    if (RTPathCompare(ext.toUtf8(), "vdi") != 0)
-        fileName += ".vdi";
-
-    return fileName;
-}
-
-int UINewHDWzdPage3::log2i(qulonglong uValue)
-{
-    int iPower = -1;
-    while (uValue)
-    {
-        ++ iPower;
-        uValue >>= 1;
-    }
-    return iPower;
-}
-
-int UINewHDWzdPage3::sizeMBToSlider(qulonglong uValue, int iSliderScale)
-{
-    int iPower = log2i(uValue);
-    qulonglong uTickMB = qulonglong (1) << iPower;
-    qulonglong uTickMBNext = qulonglong (1) << (iPower + 1);
-    int iStep = (uValue - uTickMB) * iSliderScale / (uTickMBNext - uTickMB);
-    return iPower * iSliderScale + iStep;
-}
-
-qulonglong UINewHDWzdPage3::sliderToSizeMB(int uValue, int iSliderScale)
-{
-    int iPower = uValue / iSliderScale;
-    int iStep = uValue % iSliderScale;
-    qulonglong uTickMB = qulonglong (1) << iPower;
-    qulonglong uTickMBNext = qulonglong (1) << (iPower + 1);
-    return uTickMB + (uTickMBNext - uTickMB) * iStep / iSliderScale;
-}
-
-void UINewHDWzdPage3::updateSizeToolTip(qulonglong uSize)
-{
-    QString strToolTip = tr("<nobr>%1 (%2 B)</nobr>").arg(vboxGlobal().formatSize(uSize)).arg(uSize);
-    m_pSizeSlider->setToolTip(strToolTip);
-    m_pSizeEditor->setToolTip(strToolTip);
-}
-
-UINewHDWzdPage4::UINewHDWzdPage4()
-{
-    /* Decorate page */
-    Ui::UINewHDWzdPage4::setupUi(this);
-
-    /* Register CMedium class */
-    qRegisterMetaType<CMedium>();
-
-    /* Register 'hardDisk' field */
-    registerField("hardDisk", this, "hardDisk");
-
-    /* Disable the background painting of the summary widget */
-    m_pSummaryText->viewport()->setAutoFillBackground (false);
-    /* Make the summary field read-only */
-    m_pSummaryText->setReadOnly (true);
-}
-
-void UINewHDWzdPage4::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::UINewHDWzdPage4::retranslateUi(this);
-
-    /* Wizard page 4 title */
-    setTitle(tr("Summary"));
-
-    /* Compose common summary */
-    QString summary;
-
-    QString type = field("type").toString();
-    QString location = qobject_cast<UINewHDWzd*>(wizard())->absoluteFilePath(field("location").toString());
-    QString sizeFormatted = VBoxGlobal::formatSize(field("currentSize").toULongLong());
-    QString sizeUnformatted = tr("%1 B").arg(field("currentSize").toULongLong());
-
-    summary += QString
-    (
-        "<tr><td><nobr>%1: </nobr></td><td><nobr>%2</nobr></td></tr>"
-        "<tr><td><nobr>%3: </nobr></td><td><nobr>%4</nobr></td></tr>"
-        "<tr><td><nobr>%5: </nobr></td><td><nobr>%6 (%7)</nobr></td></tr>"
-    )
-    .arg (tr("Type", "summary"), type)
-    .arg (tr("Location", "summary"), location)
-    .arg (tr("Size", "summary"), sizeFormatted, sizeUnformatted)
-    ;
-    /* Feat summary to 3 lines */
-    setSummaryFieldLinesNumber(m_pSummaryText, 3);
-
-    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>");
-
-    m_pPage4Text2->setText(tr("If the above settings are correct, press the <b>%1</b> button. "
-                              "Once you press it, a new hard disk will be created.")
-                           .arg(VBoxGlobal::replaceHtmlEntities(VBoxGlobal::removeAccelMark(wizard()->buttonText(QWizard::FinishButton)))));
-}
-
-void UINewHDWzdPage4::initializePage()
-{
-    /* Fill and translate */
-    retranslateUi();
-
-    /* Summary should have focus initially */
-    m_pSummaryText->setFocus();
-}
-
-bool UINewHDWzdPage4::validatePage()
-{
-    startProcessing();
-    /* Try to construct hard disk */
-    bool fResult = createHardDisk();
-    endProcessing();
-    return fResult;
-}
-
-bool UINewHDWzdPage4::createHardDisk()
-{
-    KMediumVariant variant = KMediumVariant_Standard;
-    QString location = qobject_cast<UINewHDWzd*>(wizard())->absoluteFilePath(field("location").toString());
-    qulonglong size = field("currentSize").toULongLong();
-    bool isFixed = field("fixed").toBool();
-
-    AssertReturn(!location.isNull(), false);
-    AssertReturn(size > 0, false);
-
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-
-    CProgress progress;
-
-    CMedium hardDisk = vbox.CreateHardDisk(QString("VDI"), location);
-
-    if (!vbox.isOk())
-    {
-        vboxProblem().cannotCreateHardDiskStorage(this, vbox, location, hardDisk, progress);
-        return false;
-    }
-
-    if (isFixed)
-        variant = (KMediumVariant)(KMediumVariant_Standard | KMediumVariant_Fixed);
-
-    progress = hardDisk.CreateBaseStorage(size, variant);
-
-    if (!hardDisk.isOk())
-    {
-        vboxProblem().cannotCreateHardDiskStorage(this, vbox, location, hardDisk, progress);
-        return false;
-    }
-
-    vboxProblem().showModalProgressDialog(progress, windowTitle(), ":/progress_media_create_90px.png", this, true);
-
-    if (progress.GetCanceled())
-        return false;
-
-    if (!progress.isOk() || progress.GetResultCode() != 0)
-    {
-        vboxProblem().cannotCreateHardDiskStorage(this, vbox, location, hardDisk, progress);
-        return false;
-    }
-
-    /* Inform everybody there is a new medium */
-    vboxGlobal().addMedium(VBoxMedium(CMedium(hardDisk), VBoxDefs::MediumType_HardDisk, KMediumState_Created));
-
-    m_HardDisk = hardDisk;
-    return true;
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.h	(revision 37330)
+++ 	(revision )
@@ -1,198 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * UINewHDWzd class declaration
- */
-
-/*
- * Copyright (C) 2006-2010 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 __UINewHDWzd_h__
-#define __UINewHDWzd_h__
-
-/* Local includes */
-#include "QIWizard.h"
-#include "COMDefs.h"
-
-/* Generated includes */
-#include "UINewHDWzdPage1.gen.h"
-#include "UINewHDWzdPage2.gen.h"
-#include "UINewHDWzdPage3.gen.h"
-#include "UINewHDWzdPage4.gen.h"
-
-class UINewHDWzd : public QIWizard
-{
-    Q_OBJECT;
-
-public:
-
-    UINewHDWzd(QWidget *pParent);
-
-    CMedium hardDisk() const;
-
-    void setRecommendedName(const QString &strName);
-    void setRecommendedSize(qulonglong uSize);
-
-    void setDefaultPath(const QString &strPath);
-    QString absoluteFilePath(const QString &strFileName);
-
-protected:
-
-    void retranslateUi();
-
-private:
-
-    QString m_strDefaultPath;
-};
-
-class UINewHDWzdPage1 : public QIWizardPage, public Ui::UINewHDWzdPage1
-{
-    Q_OBJECT;
-
-public:
-
-    UINewHDWzdPage1();
-
-protected:
-
-    void retranslateUi();
-
-    void initializePage();
-};
-
-class UINewHDWzdPage2 : public QIWizardPage, public Ui::UINewHDWzdPage2
-{
-    Q_OBJECT;
-    Q_PROPERTY(QString type READ type WRITE setType);
-    Q_PROPERTY(bool fixed READ fixed WRITE setFixed);
-
-public:
-
-    UINewHDWzdPage2();
-
-protected:
-
-    void retranslateUi();
-
-    void initializePage();
-
-private slots:
-
-    void onTypeChanged();
-
-private:
-
-    QString type() const { return m_strType; }
-    void setType(const QString &strType) { m_strType = strType; }
-    QString m_strType;
-
-    bool fixed() const { return m_bFixed; }
-    void setFixed(bool bFixed) { m_bFixed = bFixed; }
-    bool m_bFixed;
-};
-
-class UINewHDWzdPage3 : public QIWizardPage, public Ui::UINewHDWzdPage3
-{
-    Q_OBJECT;
-    Q_PROPERTY(QString initialName READ initialName WRITE setInitialName);
-    Q_PROPERTY(QString currentName READ currentName WRITE setCurrentName);
-    Q_PROPERTY(QString location READ location WRITE setLocation);
-    Q_PROPERTY(qulonglong initialSize READ initialSize WRITE setInitialSize);
-    Q_PROPERTY(qulonglong currentSize READ currentSize WRITE setCurrentSize);
-
-public:
-
-    UINewHDWzdPage3();
-
-protected:
-
-    void retranslateUi();
-
-    void initializePage();
-    void cleanupPage();
-
-    bool isComplete() const;
-    bool validatePage();
-
-private slots:
-
-    void onLocationEditorTextChanged(const QString &strName);
-    void onSelectLocationButtonClicked();
-
-    void onSizeSliderValueChanged(int iValue);
-    void onSizeEditorTextChanged(const QString &strValue);
-
-private:
-
-    static QString toFileName(const QString &strName);
-
-    static int log2i(qulonglong uValue);
-    static int sizeMBToSlider(qulonglong uValue, int iSliderScale);
-    static qulonglong sliderToSizeMB(int uValue, int iSliderScale);
-
-    void updateSizeToolTip(qulonglong uSize);
-
-    QString initialName() const { return m_strInitialName; }
-    void setInitialName(const QString &strInitialName) { m_strInitialName = strInitialName; }
-    QString m_strInitialName;
-
-    QString currentName() const { return m_strCurrentName; }
-    void setCurrentName(const QString &strCurrentName) { m_strCurrentName = strCurrentName; }
-    QString m_strCurrentName;
-
-    QString location() const { return m_strLocation; }
-    void setLocation(const QString &strLocation) { m_strLocation = strLocation; }
-    QString m_strLocation;
-
-    qulonglong initialSize() const { return m_uInitialSize; }
-    void setInitialSize(qulonglong uInitialSize) { m_uInitialSize = uInitialSize; }
-    qulonglong m_uInitialSize;
-
-    qulonglong currentSize() const { return m_uCurrentSize; }
-    void setCurrentSize(qulonglong uCurrentSize) { m_uCurrentSize = uCurrentSize; }
-    qulonglong m_uCurrentSize;
-
-    qulonglong m_uMinVDISize;
-    qulonglong m_uMaxVDISize;
-    int m_iSliderScale;
-};
-
-class UINewHDWzdPage4 : public QIWizardPage, public Ui::UINewHDWzdPage4
-{
-    Q_OBJECT;
-    Q_PROPERTY(CMedium hardDisk READ hardDisk WRITE setHardDisk);
-
-public:
-
-    UINewHDWzdPage4();
-
-protected:
-
-    void retranslateUi();
-
-    void initializePage();
-
-    bool validatePage();
-
-private:
-
-    bool createHardDisk();
-
-    CMedium hardDisk() const { return m_HardDisk; }
-    void setHardDisk(const CMedium &hardDisk) { m_HardDisk = hardDisk; }
-    CMedium m_HardDisk;
-};
-
-Q_DECLARE_METATYPE(CMedium);
-
-#endif // __UINewHDWzd_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage1.ui	(revision 37330)
+++ 	(revision )
@@ -1,64 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2009-2010 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.
- </comment>
- <class>UINewHDWzdPage1</class>
- <widget class="QWidget" name="UINewHDWzdPage1">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QVBoxLayout" name="m_pLayout1">
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QILabel" name="m_pPage1Text1">
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <spacer name="m_pSpacer1">
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage2.ui	(revision 37330)
+++ 	(revision )
@@ -1,90 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2009-2010 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.
- </comment>
- <class>UINewHDWzdPage2</class>
- <widget class="QWidget" name="UINewHDWzdPage2">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QVBoxLayout" name="m_pLayout1">
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QILabel" name="m_pPage2Text1">
-     <property name="text">
-      <string>&lt;p&gt;Select the type of virtual hard disk you want to create.&lt;/p&gt;&lt;p&gt;A &lt;b&gt;dynamically expanding storage&lt;/b&gt; initially occupies a very small amount of space on your physical hard disk. It will grow dynamically (up to the size specified) as the Guest OS claims disk space.&lt;/p&gt;&lt;p&gt;A &lt;b&gt;fixed-size storage&lt;/b&gt; does not grow. It is stored in a file of approximately the same size as the size of the virtual hard disk. The creation of a fixed-size storage may take a long time depending on the storage size and the write performance of your harddisk.&lt;/p&gt;</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QGroupBox" name="m_pTypeCnt">
-     <property name="title">
-      <string>Storage Type</string>
-     </property>
-     <layout class="QVBoxLayout" name="m_pLayout2">
-      <item>
-       <widget class="QRadioButton" name="m_pTypeDynamic">
-        <property name="text">
-         <string>&amp;Dynamically expanding storage</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QRadioButton" name="m_pTypeFixed">
-        <property name="text">
-         <string>&amp;Fixed-size storage</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <spacer name="m_pSpacer1">
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage3.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage3.ui	(revision 37330)
+++ 	(revision )
@@ -1,174 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2009-2010 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.
- </comment>
- <class>UINewHDWzdPage3</class>
- <widget class="QWidget" name="UINewHDWzdPage3">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QVBoxLayout" name="m_pLayout1">
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QILabel" name="m_pPage3Text1">
-     <property name="text">
-      <string>&lt;p&gt;Press the &lt;b&gt;Select&lt;/b&gt; button to select the location of a file to store the hard disk data or type a file name in the entry field.&lt;/p&gt;</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QGroupBox" name="m_pLocationCnt">
-     <property name="title">
-      <string>&amp;Location</string>
-     </property>
-     <layout class="QHBoxLayout" name="m_pLayout2">
-      <item>
-       <widget class="QLineEdit" name="m_pLocationEditor"/>
-      </item>
-      <item>
-       <widget class="QIToolButton" name="m_pLocationSelector">
-        <property name="autoRaise">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <widget class="QILabel" name="m_pPage3Text2">
-     <property name="text">
-      <string>&lt;p&gt;Select the size of the virtual hard disk in megabytes. This size will be reported to the Guest OS as the maximum size of this hard disk.&lt;/p&gt;</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QGroupBox" name="m_pSizeCnt">
-     <property name="title">
-      <string>&amp;Size</string>
-     </property>
-     <layout class="QGridLayout" name="m_pLayout3">
-      <item row="0" column="0" colspan="3">
-       <widget class="QSlider" name="m_pSizeSlider">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="tickPosition">
-         <enum>QSlider::TicksBelow</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="3">
-       <widget class="QILineEdit" name="m_pSizeEditor">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="m_pSizeMin">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <spacer name="m_pSpacer1">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>0</width>
-          <height>0</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item row="1" column="2">
-       <widget class="QLabel" name="m_pSizeMax">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <spacer name="m_pSpacer2">
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QIToolButton</class>
-   <extends>QToolButton</extends>
-   <header>QIToolButton.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QILineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>QILineEdit.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage4.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage4.ui	(revision 37330)
+++ 	(revision )
@@ -1,96 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2009-2010 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.
- </comment>
- <class>UINewHDWzdPage4</class>
- <widget class="QWidget" name="UINewHDWzdPage4">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QVBoxLayout" name="m_pLayout1">
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QILabel" name="m_pPage4Text1">
-     <property name="text">
-      <string>You are going to create a new virtual hard disk with the following parameters:</string>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QTextEdit" name="m_pSummaryText">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>300</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::NoFrame</enum>
-     </property>
-     <property name="readOnly">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QILabel" name="m_pPage4Text2">
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <spacer name="m_pSpacer1">
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp	(revision 37330)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp	(revision 37331)
@@ -23,5 +23,5 @@
 /* Local includes */
 #include "UIIconPool.h"
-#include "UINewHDWzd.h"
+#include "UINewHDWizard.h"
 #include "UINewVMWzd.h"
 #include "QIFileDialog.h"
@@ -561,8 +561,5 @@
 bool UINewVMWzdPage4::getWithNewHardDiskWizard()
 {
-    UINewHDWzd dlg(this);
-    dlg.setRecommendedName(field("name").toString());
-    dlg.setRecommendedSize(field("type").value<CGuestOSType>().GetRecommendedHDD());
-    dlg.setDefaultPath(field("machineFolder").toString());
+    UINewHDWizard dlg(this, field("name").toString(), field("machineFolder").toString(), field("type").value<CGuestOSType>().GetRecommendedHDD());
 
     if (dlg.exec() == QDialog::Accepted)
