Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 26079)
@@ -5,5 +5,5 @@
 
 #
-# Copyright (C) 2006-2009 Sun Microsystems, Inc.
+# Copyright (C) 2006-2010 Sun Microsystems, Inc.
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -220,4 +220,5 @@
 	./src/wizards/exportappliance \
 	./src/wizards/importappliance \
+	./src/wizards/registration \
 	./src/widgets \
 	./src/X11 \
@@ -284,5 +285,4 @@
 	src/VBoxGlobalSettings.h \
 	src/VBoxMediaManagerDlg.h \
-	src/VBoxRegistrationDlg.h \
 	src/VBoxSelectorWnd.h \
 	src/VBoxSnapshotDetailsDlg.h \
@@ -296,5 +296,4 @@
 	src/globals/VBoxProblemReporter.h \
 	src/globals/VBoxUtils.h \
-	src/extensions/QIAbstractWizard.h \
 	src/extensions/QIAdvancedSlider.h \
 	src/extensions/QIArrowButtonPress.h \
@@ -318,4 +317,5 @@
 	src/extensions/QITreeWidget.h \
 	src/extensions/QIWidgetValidator.h \
+	src/extensions/QIWizard.h \
 	src/settings/VBoxSettingsDialog.h \
 	src/settings/VBoxSettingsDialogSpecific.h \
@@ -340,9 +340,10 @@
 	src/settings/vm/VBoxVMSettingsSF.h \
 	src/settings/vm/VBoxVMSettingsSFDetails.h \
-	src/wizards/newvm/VBoxNewVMWzd.h \
-	src/wizards/newhd/VBoxNewHDWzd.h \
-	src/wizards/firstrun/VBoxVMFirstRunWzd.h \
-	src/wizards/exportappliance/VBoxExportApplianceWzd.h \
-	src/wizards/importappliance/VBoxImportApplianceWzd.h \
+	src/wizards/newvm/UINewVMWzd.h \
+	src/wizards/newhd/UINewHDWzd.h \
+	src/wizards/firstrun/UIFirstRunWzd.h \
+	src/wizards/exportappliance/UIExportApplianceWzd.h \
+	src/wizards/importappliance/UIImportApplianceWzd.h \
+	src/wizards/registration/UIRegistrationWzd.h \
 	src/widgets/VBoxApplianceEditorWgt.h \
 	src/widgets/VBoxBootTable.h \
@@ -364,5 +365,6 @@
 	src/VBoxSelectorWnd.cpp \
 	src/VBoxConsoleWnd.cpp \
-	src/VBoxMediaManagerDlg.cpp
+	src/VBoxMediaManagerDlg.cpp \
+	src/wizards/registration/UIRegistrationWzd.cpp
 ifdef VBOX_WITH_XPCOM
  VirtualBox_QT_MOCSRCS += \
@@ -385,5 +387,4 @@
 	src/VBoxMediaManagerDlg.cpp \
 	src/VBoxMedium.cpp \
-	src/VBoxRegistrationDlg.cpp \
 	src/VBoxSelectorWnd.cpp \
 	src/VBoxSnapshotDetailsDlg.cpp \
@@ -398,5 +399,4 @@
 	src/globals/VBoxGlobal.cpp \
 	src/globals/VBoxProblemReporter.cpp \
-	src/extensions/QIAbstractWizard.cpp \
 	src/extensions/QIAdvancedSlider.cpp \
 	src/extensions/QIArrowButtonPress.cpp \
@@ -420,4 +420,5 @@
 	src/extensions/QITreeWidget.cpp \
 	src/extensions/QIWidgetValidator.cpp \
+	src/extensions/QIWizard.cpp \
 	src/settings/VBoxSettingsDialog.cpp \
 	src/settings/VBoxSettingsDialogSpecific.cpp \
@@ -441,9 +442,10 @@
 	src/settings/vm/VBoxVMSettingsSF.cpp \
 	src/settings/vm/VBoxVMSettingsSFDetails.cpp \
-	src/wizards/newvm/VBoxNewVMWzd.cpp \
-	src/wizards/newhd/VBoxNewHDWzd.cpp \
-	src/wizards/firstrun/VBoxVMFirstRunWzd.cpp \
-	src/wizards/exportappliance/VBoxExportApplianceWzd.cpp \
-	src/wizards/importappliance/VBoxImportApplianceWzd.cpp \
+	src/wizards/newvm/UINewVMWzd.cpp \
+	src/wizards/newhd/UINewHDWzd.cpp \
+	src/wizards/firstrun/UIFirstRunWzd.cpp \
+	src/wizards/exportappliance/UIExportApplianceWzd.cpp \
+	src/wizards/importappliance/UIImportApplianceWzd.cpp \
+	src/wizards/registration/UIRegistrationWzd.cpp \
 	src/widgets/VBoxApplianceEditorWgt.cpp \
 	src/widgets/VBoxBootTable.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro	(revision 26079)
@@ -7,5 +7,5 @@
 
 #
-# Copyright (C) 2006-2007 Sun Microsystems, Inc.
+# Copyright (C) 2006-2010 Sun Microsystems, Inc.
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -31,5 +31,4 @@
     src/VBoxSnapshotDetailsDlg.ui \
     src/VBoxSnapshotsWgt.ui \
-    src/VBoxRegistrationDlg.ui \
     src/VBoxTakeSnapshotDlg.ui \
     src/VBoxUpdateDlg.ui \
@@ -54,9 +53,23 @@
     src/settings/global/VBoxGLSettingsNetwork.ui \
     src/settings/global/VBoxGLSettingsNetworkDetails.ui \
-    src/wizards/newvm/VBoxNewVMWzd.ui \
-    src/wizards/newhd/VBoxNewHDWzd.ui \
-    src/wizards/firstrun/VBoxVMFirstRunWzd.ui \
-    src/wizards/exportappliance/VBoxExportApplianceWzd.ui \
-    src/wizards/importappliance/VBoxImportApplianceWzd.ui \
+    src/wizards/newvm/UINewVMWzdPage1.ui \
+    src/wizards/newvm/UINewVMWzdPage2.ui \
+    src/wizards/newvm/UINewVMWzdPage3.ui \
+    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/firstrun/UIFirstRunWzdPage1.ui \
+    src/wizards/firstrun/UIFirstRunWzdPage2.ui \
+    src/wizards/firstrun/UIFirstRunWzdPage3.ui \
+    src/wizards/exportappliance/UIExportApplianceWzdPage1.ui \
+    src/wizards/exportappliance/UIExportApplianceWzdPage2.ui \
+    src/wizards/exportappliance/UIExportApplianceWzdPage3.ui \
+    src/wizards/exportappliance/UIExportApplianceWzdPage4.ui \
+    src/wizards/importappliance/UIImportApplianceWzdPage1.ui \
+    src/wizards/importappliance/UIImportApplianceWzdPage2.ui \
+    src/wizards/registration/UIRegistrationWzdPage1.ui \
     src/widgets/VBoxApplianceEditorWgt.ui
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2009 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -57,5 +57,5 @@
 #include "VBoxProblemReporter.h"
 #include "VBoxTakeSnapshotDlg.h"
-#include "VBoxVMFirstRunWzd.h"
+#include "UIFirstRunWzd.h"
 #include "VBoxVMSettingsNetwork.h"
 #include "VBoxVMSettingsSF.h"
@@ -1797,5 +1797,5 @@
     if (mIsFirstTimeStarted)
     {
-        VBoxVMFirstRunWzd wzd (machine, this);
+        UIFirstRunWzd wzd (this, machine);
         wzd.exec();
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2009 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -40,5 +40,5 @@
 #include "VBoxGlobal.h"
 #include "VBoxMediaManagerDlg.h"
-#include "VBoxNewHDWzd.h"
+#include "UINewHDWzd.h"
 #include "VBoxProblemReporter.h"
 #include "VBoxToolBar.h"
@@ -930,5 +930,5 @@
     AssertReturnVoid (currentTreeWidgetType() == VBoxDefs::MediumType_HardDisk);
 
-    VBoxNewHDWzd dlg (this);
+    UINewHDWzd dlg (this);
 
     if (dlg.exec() == QDialog::Accepted)
Index: unk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.cpp	(revision 26078)
+++ 	(revision )
@@ -1,807 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxRegistrationDlg class implementation
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifdef VBOX_WITH_PRECOMPILED_HEADERS
-# include "precomp.h"
-#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
-#include "QIHttp.h"
-#include "VBoxGlobal.h"
-#include "VBoxProblemReporter.h"
-#include "VBoxRegistrationDlg.h"
-
-/* Qt includes */
-#include <QTimer>
-#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
-/**
- *  This class is used to encode/decode the registration data.
- */
-class VBoxRegistrationData
-{
-public:
-
-    VBoxRegistrationData (const QString &aString, bool aEncode)
-        : mIsValid (aEncode), mIsRegistered (aEncode)
-        , mTriesLeft (3 /* the initial tries value */)
-    {
-        aEncode ? encode (aString) : decode (aString);
-    }
-
-    bool isValid() const { return mIsValid; }
-    bool isRegistered() const { return mIsRegistered; }
-
-    const QString &data() const { return mData; }
-    const QString &account() const { return mAccount; }
-
-    uint triesLeft() const { return mTriesLeft; }
-
-private:
-
-    void decode (const QString &aData)
-    {
-        if (aData.isEmpty())
-            return;
-
-        mData = aData;
-
-        /* Decoding number of left tries */
-        if (mData.startsWith ("triesLeft="))
-        {
-            bool ok = false;
-            uint uTriesLeft = mData.section ('=', 1, 1).toUInt (&ok);
-            if (!ok)
-                return;
-            mTriesLeft = uTriesLeft;
-            mIsValid = true;
-            return;
-        }
-
-        /* Decoding CRC32 */
-        QString sData = mData;
-        QString crcData = sData.right (2 * sizeof (ulong));
-        ulong crcNeed = 0;
-        for (long i = 0; i < crcData.length(); i += 2)
-        {
-            crcNeed <<= 8;
-            uchar curByte = (uchar) crcData.mid (i, 2).toUShort (0, 16);
-            crcNeed += curByte;
-        }
-        sData.truncate (sData.length() - 2 * sizeof (ulong));
-
-        /* Decoding data */
-        QString result;
-        for (long i = 0; i < sData.length(); i += 4)
-            result += QChar (sData.mid (i, 4).toUShort (0, 16));
-        ulong crcNow = crc32 ((uchar*)result.toAscii().constData(), result.length());
-
-        /* Check the CRC32 */
-        if (crcNeed != crcNow)
-            return;
-
-        /* Split values list */
-        QStringList list (result.split ("|"));
-
-        /* Ignore the old format */
-        if (list.size() > 1)
-            return;
-
-        /* Result value */
-        mIsValid = true;
-        mIsRegistered = true;
-        mAccount = list [0];
-    }
-
-    void encode (const QString &aAccount)
-    {
-        if (aAccount.isEmpty())
-            return;
-
-        mAccount = aAccount;
-
-        /* Encoding data */
-        QString sData = QString ("%1").arg (mAccount);
-        mData = QString::null;
-        for (long i = 0; i < sData.length(); ++ i)
-        {
-            QString curPair = QString::number (sData.at (i).unicode(), 16);
-            while (curPair.length() < 4)
-                curPair.prepend ('0');
-            mData += curPair;
-        }
-
-        /* Enconding CRC32 */
-        ulong crcNow = crc32 ((uchar*)sData.toAscii().constData(), sData.length());
-        QString crcData;
-        for (ulong i = 0; i < sizeof (ulong); ++ i)
-        {
-            ushort curByte = crcNow & 0xFF;
-            QString curPair = QString::number (curByte, 16);
-            if (curPair.length() == 1)
-                curPair.prepend ("0");
-            crcData = curPair + crcData;
-            crcNow >>= 8;
-        }
-
-        mData += crcData;
-    }
-
-    ulong crc32 (unsigned char *aBufer, int aSize)
-    {
-        /* Filling CRC32 table */
-        ulong crc32;
-        ulong crc_table [256];
-        ulong temp;
-        for (int i = 0; i < 256; ++ i)
-        {
-            temp = i;
-            for (int j = 8; j > 0; -- j)
-            {
-                if (temp & 1)
-                    temp = (temp >> 1) ^ 0xedb88320;
-                else
-                    temp >>= 1;
-            };
-            crc_table [i] = temp;
-        }
-
-        /* CRC32 calculation */
-        crc32 = 0xffffffff;
-        for (int i = 0; i < aSize; ++ i)
-        {
-            crc32 = crc_table [(crc32 ^ (*aBufer ++)) & 0xff] ^ (crc32 >> 8);
-        }
-        crc32 = crc32 ^ 0xffffffff;
-        return crc32;
-    };
-
-    bool mIsValid : 1;
-    bool mIsRegistered : 1;
-
-    uint mTriesLeft;
-
-    QString mAccount;
-    QString mData;
-};
-
-/* Static member to check if registration dialog necessary. */
-bool VBoxRegistrationDlg::hasToBeShown()
-{
-    VBoxRegistrationData data (vboxGlobal().virtualBox().
-        GetExtraData (VBoxDefs::GUI_RegistrationData), false);
-
-    return (!data.isValid()) ||
-           (!data.isRegistered() && data.triesLeft() > 0);
-}
-
-VBoxRegistrationDlg::VBoxRegistrationDlg (VBoxRegistrationDlg **aSelf, QWidget * /* aParent */)
-    : QIWithRetranslateUI <QIAbstractWizard> (0)
-    , mSelf (aSelf)
-    , mWvalReg (0)
-    , mUrl ("http://registration.virtualbox.org/register763.php")
-    , mHttp (new QIHttp (this, mUrl.host()))
-{
-    /* Store external pointer to this dialog */
-    *mSelf = this;
-
-    /* Apply UI decorations */
-    Ui::VBoxRegistrationDlg::setupUi (this);
-
-    /* Apply window icons */
-    setWindowIcon (vboxGlobal().iconSetFull (QSize (32, 32), QSize (16, 16),
-                                             ":/register_32px.png", ":/register_16px.png"));
-
-    /* Setup widgets */
-    QSizePolicy sp (mTextRegInfo->sizePolicy());
-    sp.setHeightForWidth (true);
-    mTextRegInfo->setSizePolicy (sp);
-
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
-    /* Setup validations for line-edit fields */
-    QRegExp nameExp ("[\\S\\s]+");
-    /* E-mail address is validated according to RFC2821, RFC2822,
-     * see http://en.wikipedia.org/wiki/E-mail_address */
-    QRegExp emailExp ("(([a-zA-Z0-9_\\-\\.!#$%\\*/?|^{}`~&'\\+=]*"
-                        "[a-zA-Z0-9_\\-!#$%\\*/?|^{}`~&'\\+=])|"
-                      "(\"([\\x0001-\\x0008,\\x000B,\\x000C,\\x000E-\\x0019,\\x007F,"
-                            "\\x0021,\\x0023-\\x005B,\\x005D-\\x007E,"
-                            "\\x0009,\\x0020]|"
-                          "(\\\\[\\x0001-\\x0009,\\x000B,\\x000C,"
-                                "\\x000E-\\x007F]))*\"))"
-                      "@"
-                      "[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)*");
-    /*
-     * According to sun.online this are the allowed characters:
-     * A-Z a-z 0-9 [ ! # $ % = + | ~ ` : ; , { } < > / * ( ) ' ? " & ]
-     */
-    QRegExp passwordExp ("[a-zA-Z0-9_\\-\\+=`~!@#$%^&\\*\\(\\)?\\[\\]:;,\\./\\{\\}<>]+");
-
-    mLeOldEmail->setMaxLength (50);
-    /* New accounts *must* have a valid email as user name. Thats not the case
-     * for old existing accounts. So we don't force the email format, so that
-     * old accounts could be used for registration also. */
-    mLeOldEmail->setValidator (new QRegExpValidator (nameExp, this));
-
-    mLeOldPassword->setMaxLength (20);
-    mLeOldPassword->setValidator (new QRegExpValidator (passwordExp, this));
-
-    mLeNewFirstName->setMaxLength (50);
-    mLeNewFirstName->setValidator (new QRegExpValidator (nameExp, this));
-
-    mLeNewLastName->setMaxLength (50);
-    mLeNewLastName->setValidator (new QRegExpValidator (nameExp, this));
-
-    mLeNewCompany->setMaxLength (50);
-    mLeNewCompany->setValidator (new QRegExpValidator (nameExp, this));
-
-    mLeNewEmail->setMaxLength (50);
-    mLeNewEmail->setValidator (new QRegExpValidator (emailExp, this));
-
-    mLeNewPassword->setMaxLength (20);
-    mLeNewPassword->setValidator (new QRegExpValidator (passwordExp, this));
-
-    mLeNewPassword2->setMaxLength (20);
-    mLeNewPassword2->setValidator (new QRegExpValidator (passwordExp, this));
-
-    populateCountries();
-
-    /* Setup validation */
-    mWvalReg = new QIWidgetValidator (mPageReg, this);
-    connect (mWvalReg, SIGNAL (validityChanged (const QIWidgetValidator *)),
-             this, SLOT (enableNext (const QIWidgetValidator *)));
-    connect (mWvalReg, SIGNAL (isValidRequested (QIWidgetValidator *)),
-             this, SLOT (revalidate (QIWidgetValidator *)));
-
-    connect (mRbOld, SIGNAL (toggled (bool)), this, SLOT (radioButtonToggled()));
-    connect (mRbNew, SIGNAL (toggled (bool)), this, SLOT (radioButtonToggled()));
-    connect (mCbNewCountry, SIGNAL (currentIndexChanged (int)), mWvalReg, SLOT (revalidate()));
-
-    /* Setup other connections */
-    connect (vboxGlobal().mainWindow(), SIGNAL (closing()), this, SLOT (reject()));
-
-    /* Setup initial dialog parameters. */
-    VBoxRegistrationData data (vboxGlobal().virtualBox().
-        GetExtraData (VBoxDefs::GUI_RegistrationData), false);
-    mLeOldEmail->setText (data.account());
-
-    radioButtonToggled();
-
-    /* Initialize wizard hdr */
-    initializeWizardFtr();
-
-    retranslateUi();
-
-    /* Fix minimum possible size */
-    resize (minimumSizeHint());
-    qApp->processEvents();
-    setFixedSize (size());
-}
-
-VBoxRegistrationDlg::~VBoxRegistrationDlg()
-{
-    /* Erase dialog handle in config file. */
-    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID,
-                                            QString::null);
-
-    /* Erase external pointer to this dialog. */
-    *mSelf = 0;
-}
-
-void VBoxRegistrationDlg::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxRegistrationDlg::retranslateUi (this);
-
-    /* Translate the first element of countries list */
-    mCbNewCountry->setItemText (0, tr ("Select Country/Territory"));
-}
-
-void VBoxRegistrationDlg::radioButtonToggled()
-{
-    QRadioButton *current = mRbOld->isChecked() ? mRbOld : mRbNew;
-
-    mLeOldEmail->setEnabled (current == mRbOld);
-    mLeOldPassword->setEnabled (current == mRbOld);
-    mLeNewFirstName->setEnabled (current == mRbNew);
-    mLeNewLastName->setEnabled (current == mRbNew);
-    mLeNewCompany->setEnabled (current == mRbNew);
-    mCbNewCountry->setEnabled (current == mRbNew);
-    mLeNewEmail->setEnabled (current == mRbNew);
-    mLeNewPassword->setEnabled (current == mRbNew);
-    mLeNewPassword2->setEnabled (current == mRbNew);
-
-    mWvalReg->revalidate();
-}
-
-/* Post the handshake request into the register site. */
-void VBoxRegistrationDlg::accept()
-{
-    /* Disable control elements */
-    mLeOldEmail->setEnabled (false);
-    mLeOldPassword->setEnabled (false);
-    mLeNewFirstName->setEnabled (false);
-    mLeNewLastName->setEnabled (false);
-    mLeNewCompany->setEnabled (false);
-    mCbNewCountry->setEnabled (false);
-    mLeNewEmail->setEnabled (false);
-    mLeNewPassword->setEnabled (false);
-    mLeNewPassword2->setEnabled (false);
-    finishButton()->setEnabled (false);
-    cancelButton()->setEnabled (false);
-
-    /* Set busy cursor */
-    setCursor (QCursor (Qt::BusyCursor));
-
-    /* Perform connection handshake */
-    QTimer::singleShot (0, this, SLOT (handshakeStart()));
-}
-
-void VBoxRegistrationDlg::reject()
-{
-    /* Decrement the triesLeft. */
-    VBoxRegistrationData data (vboxGlobal().virtualBox().
-                               GetExtraData (VBoxDefs::GUI_RegistrationData), false);
-    if (!data.isValid() || !data.isRegistered())
-    {
-        uint triesLeft = data.triesLeft();
-        if (triesLeft)
-        {
-            -- triesLeft;
-            vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationData,
-                                                    QString ("triesLeft=%1")
-                                                    .arg (triesLeft));
-        }
-    }
-
-    QIAbstractWizard::reject();
-}
-
-void VBoxRegistrationDlg::reinit()
-{
-    /* Read all the dirty data */
-    mHttp->disconnect (this);
-    mHttp->readAll();
-
-    /* Enable control elements */
-    radioButtonToggled();
-    finishButton()->setEnabled (true);
-    cancelButton()->setEnabled (true);
-
-    /* Return 'default' attribute loosed
-     * when button was disabled... */
-    finishButton()->setDefault (true);
-    finishButton()->setFocus();
-
-    /* Unset busy cursor */
-    unsetCursor();
-}
-
-void VBoxRegistrationDlg::handshakeStart()
-{
-    /* Compose query */
-    QUrl url (mUrl);
-    url.addQueryItem ("version", vboxGlobal().virtualBox().GetVersion());
-
-    /* Handshake */
-    connect (mHttp, SIGNAL (allIsDone (bool)), this, SLOT (handshakeResponse (bool)));
-    mHttp->post (url.toEncoded());
-}
-
-void VBoxRegistrationDlg::handshakeResponse (bool aError)
-{
-    /* Block all the other incoming signals */
-    mHttp->disconnect (this);
-
-    /* Process error if present */
-    if (aError)
-        return abortRequest (mHttp->errorString());
-
-    /* Read received data */
-    mKey = mHttp->readAll();
-
-    /* Verifying key correctness */
-    if (QString (mKey).indexOf (QRegExp ("^[a-zA-Z0-9]{32}$")))
-        return abortRequest (tr ("Could not perform connection handshake."));
-
-    /* Perform registration */
-    QTimer::singleShot (0, this, SLOT (registrationStart()));
-}
-
-void VBoxRegistrationDlg::registrationStart()
-{
-    /* Compose query */
-    QUrl url (mUrl);
-
-    /* Basic set */
-    url.addQueryItem ("version", vboxGlobal().virtualBox().GetVersion());
-    url.addQueryItem ("key", mKey);
-    url.addQueryItem ("platform", vboxGlobal().platformInfo());
-
-    if (mRbOld->isChecked())
-    {
-        /* Light set */
-        url.addQueryItem ("email", mLeOldEmail->text());
-        url.addQueryItem ("password", mLeOldPassword->text());
-    }
-    else if (mRbNew->isChecked())
-    {
-        /* Full set */
-        url.addQueryItem ("email", mLeNewEmail->text());
-        url.addQueryItem ("password", mLeNewPassword->text());
-        url.addQueryItem ("firstname", mLeNewFirstName->text());
-        url.addQueryItem ("lastname", mLeNewLastName->text());
-        url.addQueryItem ("company", mLeNewCompany->text());
-        url.addQueryItem ("country", mCbNewCountry->currentText());
-    }
-
-    /* Registration */
-    connect (mHttp, SIGNAL (allIsDone (bool)), this, SLOT (registrationResponse (bool)));
-    mHttp->post (url.toEncoded());
-}
-
-void VBoxRegistrationDlg::registrationResponse (bool aError)
-{
-    /* Block all the other incoming signals */
-    mHttp->disconnect (this);
-
-    /* Process error if present */
-    if (aError)
-        return abortRequest (mHttp->errorString());
-
-    /* Read received data */
-    QString data (mHttp->readAll());
-
-    /* Show registration result */
-    vboxProblem().showRegisterResult (this, data);
-
-    /* Close the dialog */
-    data == "OK" ? finish() : reinit();
-}
-
-void VBoxRegistrationDlg::revalidate (QIWidgetValidator *aWval)
-{
-    bool valid = true;
-
-    if (mRbOld->isChecked())
-    {
-        /* Check for fields correctness */
-        if (!isFieldValid (mLeOldEmail) || !isFieldValid (mLeOldPassword))
-            valid = false;
-    }
-    if (mRbNew->isChecked())
-    {
-        /* Check for fields correctness */
-        if (!isFieldValid (mLeNewFirstName) || !isFieldValid (mLeNewLastName) ||
-            !isFieldValid (mLeNewCompany) || !isFieldValid (mCbNewCountry) ||
-            !isFieldValid (mLeNewEmail) ||
-            !isFieldValid (mLeNewPassword) || !isFieldValid (mLeNewPassword2))
-            valid = false;
-
-        /* Check for password correctness */
-        if (mLeNewPassword->text() != mLeNewPassword2->text())
-            valid = false;
-    }
-
-    aWval->setOtherValid (valid);
-}
-
-void VBoxRegistrationDlg::enableNext (const QIWidgetValidator *aWval)
-{
-    /* Validate all the subscribed widgets */
-    aWval->isValid();
-    /* But control dialog only with necessary */
-    finishButton()->setEnabled (aWval->isOtherValid());
-    /* Return 'default' attribute loosed
-     * when button was disabled... */
-    finishButton()->setDefault (true);
-}
-
-void VBoxRegistrationDlg::onPageShow()
-{
-    Assert (mPageStack->currentWidget() == mPageReg);
-    mLeOldEmail->setFocus();
-}
-
-void VBoxRegistrationDlg::populateCountries()
-{
-    QStringList list ("Empty");
-    list << "Afghanistan"
-         << "Albania"
-         << "Algeria"
-         << "American Samoa"
-         << "Andorra"
-         << "Angola"
-         << "Anguilla"
-         << "Antartica"
-         << "Antigua & Barbuda"
-         << "Argentina"
-         << "Armenia"
-         << "Aruba"
-         << "Ascension Island"
-         << "Australia"
-         << "Austria"
-         << "Azerbaijan"
-         << "Bahamas"
-         << "Bahrain"
-         << "Bangladesh"
-         << "Barbados"
-         << "Belarus"
-         << "Belgium"
-         << "Belize"
-         << "Benin"
-         << "Bermuda"
-         << "Bhutan"
-         << "Bolivia"
-         << "Bosnia and Herzegovina"
-         << "Botswana"
-         << "Bouvet Island"
-         << "Brazil"
-         << "British Indian Ocean Territory"
-         << "Brunei Darussalam"
-         << "Bulgaria"
-         << "Burkina Faso"
-         << "Burundi"
-         << "Cambodia"
-         << "Cameroon"
-         << "Canada"
-         << "Cape Verde"
-         << "Cayman Islands"
-         << "Central African Republic"
-         << "Chad"
-         << "Chile"
-         << "China"
-         << "Christmas Island"
-         << "Cocos (Keeling) Islands"
-         << "Colombia"
-         << "Comoros"
-         << "Congo, Democratic People's Republic"
-         << "Congo, Republic of"
-         << "Cook Islands"
-         << "Costa Rica"
-         << "Cote d'Ivoire"
-         << "Croatia/Hrvatska"
-         << "Cyprus"
-         << "Czech Republic"
-         << "Denmark"
-         << "Djibouti"
-         << "Dominica"
-         << "Dominican Republic"
-         << "East Timor"
-         << "Ecuador"
-         << "Egypt"
-         << "El Salvador"
-         << "Equatorial Guinea"
-         << "Eritrea"
-         << "Estonia"
-         << "Ethiopia"
-         << "Falkland Islands (Malvina)"
-         << "Faroe Islands"
-         << "Fiji"
-         << "Finland"
-         << "France"
-         << "French Guiana"
-         << "French Polynesia"
-         << "French Southern Territories"
-         << "Gabon"
-         << "Gambia"
-         << "Georgia"
-         << "Germany"
-         << "Ghana"
-         << "Gibraltar"
-         << "Greece"
-         << "Greenland"
-         << "Grenada"
-         << "Guadeloupe"
-         << "Guam"
-         << "Guatemala"
-         << "Guernsey"
-         << "Guinea"
-         << "Guinea-Bissau"
-         << "Guyana"
-         << "Haiti"
-         << "Heard and McDonald Islands"
-         << "Holy See (City Vatican State)"
-         << "Honduras"
-         << "Hong Kong"
-         << "Hungary"
-         << "Iceland"
-         << "India"
-         << "Indonesia"
-         << "Iraq"
-         << "Ireland"
-         << "Isle of Man"
-         << "Israel"
-         << "Italy"
-         << "Jamaica"
-         << "Japan"
-         << "Jersey"
-         << "Jordan"
-         << "Kazakhstan"
-         << "Kenya"
-         << "Kiribati"
-         << "Korea, Republic of"
-         << "Kuwait"
-         << "Kyrgyzstan"
-         << "Lao People's Democratic Republic"
-         << "Latvia"
-         << "Lebanon"
-         << "Lesotho"
-         << "Liberia"
-         << "Libyan Arab Jamahiriya"
-         << "Liechtenstein"
-         << "Lithuania"
-         << "Luxembourg"
-         << "Macau"
-         << "Macedonia, Former Yugoslav Republic"
-         << "Madagascar"
-         << "Malawi"
-         << "Malaysia"
-         << "Maldives"
-         << "Mali"
-         << "Malta"
-         << "Marshall Islands"
-         << "Martinique"
-         << "Mauritania"
-         << "Mauritius"
-         << "Mayotte"
-         << "Mexico"
-         << "Micronesia, Federal State of"
-         << "Moldova, Republic of"
-         << "Monaco"
-         << "Mongolia"
-         << "Montenegro"
-         << "Montserrat"
-         << "Morocco"
-         << "Mozambique"
-         << "Namibia"
-         << "Nauru"
-         << "Nepal"
-         << "Netherlands"
-         << "Netherlands Antilles"
-         << "New Caledonia"
-         << "New Zealand"
-         << "Nicaragua"
-         << "Niger"
-         << "Nigeria"
-         << "Niue"
-         << "Norfolk Island"
-         << "Northern Mariana Island"
-         << "Norway"
-         << "Oman"
-         << "Pakistan"
-         << "Palau"
-         << "Panama"
-         << "Papua New Guinea"
-         << "Paraguay"
-         << "Peru"
-         << "Philippines"
-         << "Pitcairn Island"
-         << "Poland"
-         << "Portugal"
-         << "Puerto Rico"
-         << "Qatar"
-         << "Reunion Island"
-         << "Romania"
-         << "Russian Federation"
-         << "Rwanda"
-         << "Saint Kitts and Nevis"
-         << "Saint Lucia"
-         << "Saint Vincent and the Grenadines"
-         << "San Marino"
-         << "Sao Tome & Principe"
-         << "Saudi Arabia"
-         << "Senegal"
-         << "Serbia"
-         << "Seychelles"
-         << "Sierra Leone"
-         << "Singapore"
-         << "Slovak Republic"
-         << "Slovenia"
-         << "Solomon Islands"
-         << "Somalia"
-         << "South Africa"
-         << "South Georgia and the South Sandwich Islands"
-         << "Spain"
-         << "Sri Lanka"
-         << "St Pierre and Miquelon"
-         << "St. Helena"
-         << "Suriname"
-         << "Svalbard And Jan Mayen Island"
-         << "Swaziland"
-         << "Sweden"
-         << "Switzerland"
-         << "Taiwan"
-         << "Tajikistan"
-         << "Tanzania"
-         << "Thailand"
-         << "Togo"
-         << "Tokelau"
-         << "Tonga"
-         << "Trinidad and Tobago"
-         << "Tunisia"
-         << "Turkey"
-         << "Turkmenistan"
-         << "Turks and Ciacos Islands"
-         << "Tuvalu"
-         << "US Minor Outlying Islands"
-         << "Uganda"
-         << "Ukraine"
-         << "United Arab Emirates"
-         << "United Kingdom"
-         << "United States"
-         << "Uruguay"
-         << "Uzbekistan"
-         << "Vanuatu"
-         << "Venezuela"
-         << "Vietnam"
-         << "Virgin Island (British)"
-         << "Virgin Islands (USA)"
-         << "Wallis And Futuna Islands"
-         << "Western Sahara"
-         << "Western Samoa"
-         << "Yemen"
-         << "Zambia"
-         << "Zimbabwe";
-    mCbNewCountry->addItems (list);
-}
-
-/* This wrapper displays an error message box (unless aReason is QString::null)
- * with the cause of the request-send procedure termination. After the message
- * box dismissed, the registration dialog signals to close itself on the next
- * event loop iteration. */
-void VBoxRegistrationDlg::abortRequest (const QString &aReason)
-{
-    if (!aReason.isNull())
-        vboxProblem().cannotConnectRegister (this, mUrl.toString(), aReason);
-
-    /* Allows all the queued signals to be processed before quit. */
-    QTimer::singleShot (0, this, SLOT (reinit()));
-}
-
-void VBoxRegistrationDlg::finish()
-{
-    QString acc (mRbOld->isChecked() ? mLeOldEmail->text() :
-                 mRbNew->isChecked() ? mLeNewEmail->text() : QString::null);
-
-    VBoxRegistrationData data (acc, true);
-    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationData,
-                                            data.data());
-
-    QIAbstractWizard::accept();
-}
-
-bool VBoxRegistrationDlg::isFieldValid (QWidget *aWidget) const
-{
-    if (QLineEdit *le = qobject_cast <QLineEdit*> (aWidget))
-    {
-        QString text (le->text());
-        int position;
-        return le->validator()->validate (text, position) == QValidator::Acceptable;
-    }
-    else if (QComboBox *cb = qobject_cast <QComboBox*> (aWidget))
-    {
-        return cb->currentIndex() > 0;
-    }
-    return false;
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.h	(revision 26078)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxRegistrationDlg class declaration
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __VBoxRegistrationDlg_h__
-#define __VBoxRegistrationDlg_h__
-
-#include "QIAbstractWizard.h"
-#include "QIWidgetValidator.h"
-#include "QIWithRetranslateUI.h"
-#include "VBoxRegistrationDlg.gen.h"
-
-/* Qt includes */
-#include <QUrl>
-
-class QIHttp;
-
-class VBoxRegistrationDlg : public QIWithRetranslateUI <QIAbstractWizard>,
-                            public Ui::VBoxRegistrationDlg
-{
-    Q_OBJECT;
-
-public:
-
-    static bool hasToBeShown();
-
-    VBoxRegistrationDlg (VBoxRegistrationDlg **aSelf, QWidget *aParent = 0);
-   ~VBoxRegistrationDlg();
-
-protected:
-
-    void retranslateUi();
-
-private slots:
-
-    void radioButtonToggled();
-
-    void accept();
-    void reject();
-    void reinit();
-
-    void handshakeStart();
-    void handshakeResponse (bool aError);
-
-    void registrationStart();
-    void registrationResponse (bool aError);
-
-    void revalidate (QIWidgetValidator *aWval);
-    void enableNext (const QIWidgetValidator *aWval);
-    void onPageShow();
-
-private:
-
-    void populateCountries();
-    void abortRequest (const QString &aReason);
-    void finish();
-
-    bool isFieldValid (QWidget *aWidget) const;
-
-    VBoxRegistrationDlg **mSelf;
-    QIWidgetValidator    *mWvalReg;
-    QUrl                  mUrl;
-    QIHttp               *mHttp;
-    QString               mKey;
-};
-
-#endif // __VBoxRegistrationDlg_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.ui	(revision 26078)
+++ 	(revision )
@@ -1,461 +1,0 @@
-<ui version="4.0" >
- <class>VBoxRegistrationDlg</class>
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2008 Sun Microsystems, Inc.
-
-     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.
-
-     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-     Clara, CA 95054 USA or visit http://www.sun.com if you need
-     additional information or have any questions.
- </comment>
- <widget class="QDialog" name="VBoxRegistrationDlg" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>639</width>
-    <height>513</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>VirtualBox Registration Dialog</string>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="leftMargin" >
-    <number>0</number>
-   </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QStackedWidget" name="mPageStack" >
-     <property name="currentIndex" >
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="mPageReg" >
-      <layout class="QGridLayout" name="gridLayout" >
-       <item row="0" column="0" colspan="4" >
-        <widget class="QLabel" name="mPageSummaryHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Welcome to the VirtualBox Registration Form!</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0" colspan="4" >
-        <widget class="Line" name="line11" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item rowspan="15" row="2" column="0" >
-        <widget class="QLabel" name="mLogoSummary" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="autoFillBackground" >
-          <bool>true</bool>
-         </property>
-         <property name="pixmap" >
-          <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_user.png</pixmap>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="1" colspan="3" >
-        <widget class="QILabel" name="mTextRegInfo" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize" >
-          <size>
-           <width>500</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text" >
-          <string>&lt;p&gt;Please fill out this registration form to let us know that you use VirtualBox and, optionally, to keep you informed about VirtualBox news and updates.&lt;/p&gt;&lt;p&gt;Please use Latin characters only to fill in  the fields below. Sun Microsystems will use this information only to gather product usage statistics and to send you VirtualBox newsletters. In particular, Sun Microsystems will never pass your data to third parties. Detailed information about how we use your personal data can be found in the &lt;b&gt;Privacy Policy&lt;/b&gt; section of the VirtualBox Manual or on the &lt;a href=http://www.virtualbox.org/wiki/PrivacyPolicy&gt;Privacy Policy&lt;/a&gt; page of the VirtualBox web-site.&lt;/p&gt;</string>
-         </property>
-         <property name="wordWrap" >
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="1" colspan="3" >
-        <widget class="Line" name="line14" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="1" colspan="3" >
-        <widget class="QRadioButton" name="mRbOld" >
-         <property name="text" >
-          <string>I &amp;already have a Sun Online account:</string>
-         </property>
-         <property name="checked" >
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item rowspan="2" row="5" column="1" >
-        <spacer name="mHorizontalSpacer1" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType" >
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>20</width>
-           <height>0</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="5" column="2" >
-        <widget class="QLabel" name="mTxOldEmail" >
-         <property name="text" >
-          <string>&amp;E-mail:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeOldEmail</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="3" >
-        <widget class="QLineEdit" name="mLeOldEmail" >
-         <property name="whatsThis" >
-          <string>Enter your e-mail address. Please use a valid address here.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="2" >
-        <widget class="QLabel" name="mTxOldPassword" >
-         <property name="text" >
-          <string>&amp;Password:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeOldPassword</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="3" >
-        <widget class="QLineEdit" name="mLeOldPassword" >
-         <property name="whatsThis" >
-          <string>Enter your e-mail address. Please use a valid address here.</string>
-         </property>
-         <property name="echoMode" >
-          <enum>QLineEdit::Password</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="7" column="1" colspan="3" >
-        <widget class="Line" name="line13" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="8" column="1" colspan="3" >
-        <widget class="QRadioButton" name="mRbNew" >
-         <property name="text" >
-          <string>I &amp;would like to create a new Sun Online account:</string>
-         </property>
-        </widget>
-       </item>
-       <item rowspan="8" row="9" column="1" >
-        <spacer name="mHorizontalSpacer2" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType" >
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>20</width>
-           <height>0</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="9" column="2" >
-        <widget class="QLabel" name="mTxNewFirstName" >
-         <property name="text" >
-          <string>&amp;First Name:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNewFirstName</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="9" column="3" >
-        <widget class="QLineEdit" name="mLeNewFirstName" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="10" column="2" >
-        <widget class="QLabel" name="mTxNewLastName" >
-         <property name="text" >
-          <string>&amp;Last Name:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNewLastName</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="10" column="3" >
-        <widget class="QLineEdit" name="mLeNewLastName" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="11" column="2" >
-        <widget class="QLabel" name="mTxNewCompany" >
-         <property name="text" >
-          <string>&amp;Company:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNewCompany</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="11" column="3" >
-        <widget class="QLineEdit" name="mLeNewCompany" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="12" column="2" >
-        <widget class="QLabel" name="mTxNewCountry" >
-         <property name="text" >
-          <string>Co&amp;untry:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mCbNewCountry</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="12" column="3" >
-        <widget class="QComboBox" name="mCbNewCountry" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="13" column="2" colspan="2" >
-        <spacer name="mVerticalSpacer2" >
-         <property name="orientation" >
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeType" >
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>0</width>
-           <height>5</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="14" column="2" >
-        <widget class="QLabel" name="mTxNewEmail" >
-         <property name="text" >
-          <string>E-&amp;mail:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNewEmail</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="14" column="3" >
-        <widget class="QLineEdit" name="mLeNewEmail" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-        </widget>
-       </item>
-       <item row="15" column="2" >
-        <widget class="QLabel" name="mTxNewPassword" >
-         <property name="text" >
-          <string>P&amp;assword:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNewPassword</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="15" column="3" >
-        <widget class="QLineEdit" name="mLeNewPassword" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-         <property name="echoMode" >
-          <enum>QLineEdit::Password</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="16" column="2" >
-        <widget class="QLabel" name="mTxNewPassword2" >
-         <property name="text" >
-          <string>Co&amp;nfirm Password:</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-         </property>
-         <property name="buddy" >
-          <cstring>mLeNewPassword2</cstring>
-         </property>
-        </widget>
-       </item>
-       <item row="16" column="3" >
-        <widget class="QLineEdit" name="mLeNewPassword2" >
-         <property name="whatsThis" >
-          <string>Enter your full name using Latin characters.</string>
-         </property>
-         <property name="echoMode" >
-          <enum>QLineEdit::Password</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="17" column="0" colspan="4" >
-        <widget class="Line" name="line12" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="18" column="0" colspan="4" >
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer name="mHorizontalSpacer1" >
-           <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>
-          <widget class="QPushButton" name="mBtnFinish" >
-           <property name="text" >
-            <string>&amp;Register</string>
-           </property>
-           <property name="default" >
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="mHorizontalSpacer2" >
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>mBtnFinish</tabstop>
-  <tabstop>mBtnCancel</tabstop>
- </tabstops>
- <resources>
-  <include location="../VirtualBox1.qrc" />
- </resources>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2009 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -31,8 +31,8 @@
 
 #include "VBoxSnapshotsWgt.h"
-#include "VBoxNewVMWzd.h"
+#include "UINewVMWzd.h"
 #include "VBoxMediaManagerDlg.h"
-#include "VBoxImportApplianceWzd.h"
-#include "VBoxExportApplianceWzd.h"
+#include "UIImportApplianceWzd.h"
+#include "UIExportApplianceWzd.h"
 #include "VBoxSettingsDialogSpecific.h"
 #include "VBoxVMLogViewer.h"
@@ -770,5 +770,5 @@
 void VBoxSelectorWnd::fileImportAppliance()
 {
-    VBoxImportApplianceWzd wzd (this);
+    UIImportApplianceWzd wzd (this);
 
     wzd.exec();
@@ -783,5 +783,5 @@
         name = item->name();
 
-    VBoxExportApplianceWzd wzd (this, name);
+    UIExportApplianceWzd wzd (this, name);
 
     wzd.exec();
@@ -820,5 +820,5 @@
 void VBoxSelectorWnd::vmNew()
 {
-    VBoxNewVMWzd wzd (this);
+    UINewVMWzd wzd (this);
     if (wzd.exec() == QDialog::Accepted)
     {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -22,16 +22,14 @@
 
 #ifdef VBOX_WITH_PRECOMPILED_HEADERS
-# include "precomp.h"
-#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
-/* Common includes */
+#include "precomp.h"
+#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
+/* Global includes */
+#include <QTimer>
+/* Local includes */
 #include "QIHttp.h"
 #include "VBoxGlobal.h"
 #include "VBoxProblemReporter.h"
 #include "VBoxUpdateDlg.h"
-
-/* Qt includes */
-#include <QTimer>
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
 
 /* VBoxVersion stuff */
@@ -71,5 +69,4 @@
 };
 
-
 /* VBoxUpdateData stuff */
 QList <UpdateDay> VBoxUpdateData::mDayList = QList <UpdateDay>();
@@ -193,5 +190,5 @@
             mDate = date.isValid() ? date : QDate::currentDate();
         }
-            
+
         /* Parse 'branch' value */
         if (parser.size() > 2)
@@ -237,5 +234,4 @@
 }
 
-
 /* VBoxUpdateDlg stuff */
 bool VBoxUpdateDlg::isNecessary()
@@ -248,5 +244,5 @@
 
 VBoxUpdateDlg::VBoxUpdateDlg (VBoxUpdateDlg **aSelf, bool aForceRun, QWidget *aParent)
-    : QIWithRetranslateUI <QIAbstractWizard> (aParent)
+    : QIWithRetranslateUI <QDialog> (aParent)
     , mSelf (aSelf)
     , mUrl ("http://update.virtualbox.org/query.php")
@@ -264,12 +260,6 @@
                                              ":/refresh_32px.png", ":/refresh_16px.png"));
 
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
     /* Setup other connections */
     connect (mBtnCheck, SIGNAL (clicked()), this, SLOT (search()));
-
-    /* Initialize wizard hdr */
-    initializeWizardFtr();
 
     /* Setup initial condition */
@@ -339,5 +329,5 @@
                                             newData.data());
 
-    QIAbstractWizard::accept();
+    QDialog::accept();
 }
 
@@ -356,9 +346,9 @@
     /* Compose query */
     QUrl url (mUrl);
-    url.addQueryItem ("platform", vboxGlobal().virtualBox().GetPackageType());   
+    url.addQueryItem ("platform", vboxGlobal().virtualBox().GetPackageType());
     /* Branding: Check whether we have a local branding file which tells us our version suffix "FOO"
                      (e.g. 3.06.54321_FOO) to identify this installation */
     if (vboxGlobal().brandingIsActive())
-    {        
+    {
         url.addQueryItem ("version", QString ("%1_%2_%3").arg (vboxGlobal().virtualBox().GetVersion())
                                                          .arg (vboxGlobal().virtualBox().GetRevision())
@@ -454,12 +444,4 @@
 }
 
-void VBoxUpdateDlg::onPageShow()
-{
-    if (mPageStack->currentWidget() == mPageUpdate)
-        mBtnCheck->setFocus();
-    else
-        mBtnFinish->setFocus();
-}
-
 void VBoxUpdateDlg::abortRequest (const QString &aReason)
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.h	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.h	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,12 +24,13 @@
 #define __VBoxUpdateDlg_h__
 
-#include "QIAbstractWizard.h"
+/* Global includes */
+#include <QUrl>
+#include <QDate>
+
+/* Local includes */
 #include "QIWithRetranslateUI.h"
 #include "VBoxUpdateDlg.gen.h"
 
-/* Qt includes */
-#include <QUrl>
-#include <QDate>
-
+/* Global forwards */
 class QIHttp;
 
@@ -111,5 +112,5 @@
 };
 
-class VBoxUpdateDlg : public QIWithRetranslateUI <QIAbstractWizard>,
+class VBoxUpdateDlg : public QIWithRetranslateUI <QDialog>,
                       public Ui::VBoxUpdateDlg
 {
@@ -135,5 +136,4 @@
     void accept();
     void searchResponse (bool aError);
-    void onPageShow();
 
 private:
Index: unk/src/VBox/Frontends/VirtualBox/src/extensions/QIAbstractWizard.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAbstractWizard.cpp	(revision 26078)
+++ 	(revision )
@@ -1,257 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * QIAbstractWizard class implementation
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#include "QIAbstractWizard.h"
-#include "QILabel.h"
-
-/* Qt includes */
-#include <QStackedWidget>
-#include <QPushButton>
-#include <QScrollBar>
-#include <VBoxGlobal.h>
-
-QITextEdit::QITextEdit (QWidget *aParent)
-    : QTextEdit (aParent)
-{
-    /* Disable the background painting of the editor widget. */
-    viewport()->setAutoFillBackground (false);
-    /* Make editor readonly by default. */
-    setReadOnly (true);
-}
-
-QSize QITextEdit::sizeHint() const
-{
-    /* If there is an updated sizeHint() present - using it. */
-    return mOwnSizeHint.isValid() ? mOwnSizeHint : QTextEdit::sizeHint();
-}
-
-QSize QITextEdit::minimumSizeHint() const
-{
-    /* Viewer should not influent layout if there is no text. */
-    return QSize (0, 0);
-}
-
-void QITextEdit::updateSizeHint()
-{
-    if (document())
-    {
-        int w = (int)document()->size().width();
-        int h = (int)document()->size().height() + 2;
-        if (horizontalScrollBar()->isVisible())
-            h += horizontalScrollBar()->height();
-        mOwnSizeHint = QSize (w, h);
-    }
-    updateGeometry();
-}
-
-void QITextEdit::setText (const QString &aText)
-{
-    QTextEdit::setText (aText);
-    updateSizeHint();
-}
-
-
-QIAbstractWizard::QIAbstractWizard (QWidget *aParent,
-                                    Qt::WindowFlags aFlags)
-    : QDialog (aParent, aFlags)
-    , mStackedWidget (0)
-    , mFinishButton (0)
-{
-}
-
-void QIAbstractWizard::initializeWizardHdr()
-{
-    /* Search for widget stack of inherited dialog.
-     * Please note what widget stack should have objectName()
-     * equal "mPageStack". */
-    mStackedWidget = findChild<QStackedWidget*> ("mPageStack");
-    Assert (mStackedWidget);
-    connect (mStackedWidget, SIGNAL (currentChanged (int)),
-             this, SLOT (onPageShow()));
-    mStackedWidget->setCurrentIndex (0);
-
-    /* Assigning all next buttons of inherited dialog.
-     * Please note what all next buttons should have objectName()
-     * matching mBtnNext<number> rule. */
-    for (int i = 0; i < mStackedWidget->count() - 1; ++ i)
-    {
-        QWidget *page = mStackedWidget->widget (i);
-        QList<QPushButton*> list =
-            page->findChildren<QPushButton*> (QRegExp ("mBtnNext\\d*"));
-        Assert (list.count() <= 1);
-        if (list.count() == 1)
-        {
-            connect (list [0], SIGNAL (clicked()), this, SLOT (showNextPage()));
-            mNextButtons << list [0];
-        }
-    }
-
-    /* Assigning all back buttons of inherited dialog.
-     * Please note what all back buttons should have objectName()
-     * matching mBtnBack<number> rule. */
-    for (int i = 0; i < mStackedWidget->count(); ++ i)
-    {
-        QWidget *page = mStackedWidget->widget (i);
-        QList<QPushButton*> list =
-            page->findChildren<QPushButton*> (QRegExp ("mBtnBack\\d*"));
-        Assert (list.count() <= 1);
-        if (list.count() == 1)
-        {
-            connect (list [0], SIGNAL (clicked()), this, SLOT (showBackPage()));
-            mBackButtons << list [0];
-        }
-    }
-
-    /* Assigning all cancel buttons of inherited dialog.
-     * Please note what all cancel buttons should have objectName()
-     * matching mBtnCancel<number> rule. */
-    for (int i = 0; i < mStackedWidget->count(); ++ i)
-    {
-        QWidget *page = mStackedWidget->widget (i);
-        QList<QPushButton*> list =
-            page->findChildren<QPushButton*> (QRegExp ("mBtnCancel\\d*"));
-        Assert (list.count() <= 1);
-        if (list.count() == 1)
-        {
-            connect (list [0], SIGNAL (clicked()), this, SLOT (reject()));
-            mCancelButtons << list [0];
-        }
-    }
-
-    /* Assigning finish button of inherited dialog.
-     * Please note what finish button should have objectName()
-     * matching mBtnFinish. */
-    mFinishButton = findChild<QPushButton*> ("mBtnFinish");
-    Assert (mFinishButton);
-    connect (mFinishButton, SIGNAL (clicked()), this, SLOT (accept()));
-
-    /* Decorating all wizard logo images of inherited dialog.
-     * Please note what all logo images should have objectName()
-     * matching mLogo<subname> rule. */
-    QList<QLabel*> logoImages =
-        findChildren<QLabel*> (QRegExp ("mLogo.+"));
-    Assert (logoImages.count());
-    for (int i = 0; i < logoImages.count(); ++ i)
-        VBoxGlobal::adoptLabelPixmap (logoImages [i]);
-
-#ifdef Q_WS_MAC
-    /* On the Mac we need at least a size of 14 points. */
-    QList<QLabel*> pageHeaders =
-        findChildren<QLabel*> (QRegExp ("m.+Hdr"));
-    for (int i = 0; i < pageHeaders.count(); ++i)
-    {
-        QLabel *lb = pageHeaders [i];
-        QFont f = lb->font();
-        f.setPointSize (14);
-        lb->setFont (f);
-    }
-#endif /* Q_WS_MAC */
-}
-
-void QIAbstractWizard::initializeWizardFtr()
-{
-    /* Update sizeHint() of all text labels of inherited dialog.
-     * Please note what all text labels should have objectName()
-     * matching mText<subname> rule. */
-    QList<QILabel*> textLabels =
-        findChildren<QILabel*> (QRegExp ("mText.+"));
-    for (int i = 0; i < textLabels.count(); ++ i)
-        textLabels [i]->useSizeHintForWidth (400);
-
-    /* Update sizeHint() of summary viewer of inherited dialog.
-     * Please note what summary viewer should have objectName()
-     * matching mTeSummary. */
-    QITextEdit *teSummary = findChild<QITextEdit*> ("mTeSummary");
-    if (teSummary)
-    {
-        teSummary->setMinimumWidth (400);
-        teSummary->updateSizeHint();
-    }
-}
-
-QPushButton* QIAbstractWizard::nextButton (QWidget *aOfPage)
-{
-    return getButton (aOfPage ? aOfPage : mStackedWidget->currentWidget(),
-                      "mBtnNext\\d*");
-}
-
-QPushButton* QIAbstractWizard::backButton (QWidget *aOfPage)
-{
-    return getButton (aOfPage ? aOfPage : mStackedWidget->currentWidget(),
-                      "mBtnBack\\d*");
-}
-
-QPushButton* QIAbstractWizard::cancelButton (QWidget *aOfPage)
-{
-    return getButton (aOfPage ? aOfPage : mStackedWidget->currentWidget(),
-                      "mBtnCancel\\d*");
-}
-
-QPushButton* QIAbstractWizard::finishButton()
-{
-    return getButton (mStackedWidget->widget (mStackedWidget->count() - 1),
-                      "mBtnFinish");
-}
-
-void QIAbstractWizard::showEvent (QShowEvent *aEvent)
-{
-    QDialog::showEvent (aEvent);
-
-    resize (minimumSize());
-
-    onPageShow();
-
-    VBoxGlobal::centerWidget (this, parentWidget());
-}
-
-void QIAbstractWizard::showNextPage()
-{
-    /* Switch to the next page */
-    mStackedWidget->setCurrentIndex (nextButtonIndex (nextButton()) + 1);
-}
-
-void QIAbstractWizard::showBackPage()
-{
-    /* Switch to the previous page */
-    mStackedWidget->setCurrentIndex (backButtonIndex (backButton()) - 1);
-}
-
-int QIAbstractWizard::nextButtonIndex (QPushButton *aNextButton)
-{
-    return mNextButtons.indexOf (aNextButton);
-}
-
-int QIAbstractWizard::backButtonIndex (QPushButton *aBackButton)
-{
-    return mBackButtons.indexOf (aBackButton);
-}
-
-QPushButton* QIAbstractWizard::getButton (QWidget *aOfPage,
-                                          const QString &aRegExp)
-{
-    Assert (aOfPage && !aRegExp.isNull());
-    QList<QPushButton*> buttonsList =
-        aOfPage->findChildren<QPushButton*> (QRegExp (aRegExp));
-    Assert (buttonsList.count() == 1);
-    return buttonsList [0];
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/extensions/QIAbstractWizard.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAbstractWizard.h	(revision 26078)
+++ 	(revision )
@@ -1,119 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * QIAbstractWizard class declaration
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __QIAbstractWizard_h__
-#define __QIAbstractWizard_h__
-
-/* Qt includes */
-#include <QTextEdit>
-#include <QLabel>
-#include <QDialog>
-
-class QStackedWidget;
-
-/**
- *  QTextEdit reimplementation used as summary viewer in different wizards:
- *  1. Enforces parent layout to ignore viewer if there is no text.
- *  2. Updates sizeHint() & geometry after setting new text for getting
- *     more compact layout.
- *  3. Tries to take into account horizontal scrollbar if present to avoid
- *     vertical scrollbar appearing.
- *  4. Makes the paper color similar to the background color.
- */
-class QITextEdit : public QTextEdit
-{
-    Q_OBJECT;
-
-public:
-
-    QITextEdit (QWidget *aParent);
-
-    QSize sizeHint() const;
-    QSize minimumSizeHint() const;
-    void updateSizeHint();
-
-public slots:
-
-    void setText (const QString &aText);
-
-private:
-
-    QSize mOwnSizeHint;
-};
-
-/**
- *  QLabel reimplementation used as text viewers in different wizards:
- *  1. Updates sizeHint() on request to feat some minimum width
- *     for getting more compact layout.
- *  2. Tries to take into account horizontal scrollbar if present to avoid
- *     vertical scrollbar appearing.
- *
- * --> uses now global QILabel
- */
-
-/**
- *  QDialog reimplementation used as abstract interface in different wizards:
- *  1. Performs most of initializations for inherited wizards including
- *     next, back, cancel, finish buttons, icons and text labels.
- *  2. Handles show event common for all wizards.
- */
-class QIAbstractWizard : public QDialog
-{
-    Q_OBJECT;
-
-public:
-
-    QIAbstractWizard (QWidget *aParent = 0, Qt::WindowFlags aFlags = 0);
-
-protected:
-
-    void initializeWizardHdr();
-    void initializeWizardFtr();
-
-    QPushButton* nextButton (QWidget *aOfPage = 0);
-    QPushButton* backButton (QWidget *aOfPage = 0);
-    QPushButton* cancelButton (QWidget *aOfPage = 0);
-    QPushButton* finishButton();
-
-    void showEvent (QShowEvent *aEvent);
-
-protected slots:
-
-    virtual void showNextPage();
-    virtual void showBackPage();
-    virtual void onPageShow() = 0;
-
-private:
-
-    int nextButtonIndex (QPushButton *aNextButton);
-    int backButtonIndex (QPushButton *aBackButton);
-    QPushButton* getButton (QWidget *aOfPage, const QString &aRegExp);
-
-    QStackedWidget      *mStackedWidget;
-    QList<QPushButton*>  mNextButtons;
-    QList<QPushButton*>  mBackButtons;
-    QList<QPushButton*>  mCancelButtons;
-    QPushButton         *mFinishButton;
-};
-
-#endif // __QIAbstractWizard_h__
-
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.h	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.h	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2009 Sun Microsystems, Inc.
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -32,4 +32,5 @@
 {
     Q_OBJECT;
+    Q_PROPERTY(int value READ value WRITE setValue);
 
 public:
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.cpp	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.cpp	(revision 26079)
@@ -0,0 +1,168 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * QIWizard class implementation
+ */
+
+/*
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Global includes */
+#include <QLayout>
+#include <QTextEdit>
+
+/* Local includes */
+#include "QIWizard.h"
+#include "QILabel.h"
+
+/* System includes */
+#include <math.h>
+
+QIWizard::QIWizard(QWidget *pParent) : QIWithRetranslateUI<QWizard>(pParent)
+{
+}
+
+void QIWizard::resizeToGoldenRatio()
+{
+    /* Random initial QILabel width() to be adjusted! */
+    int iLabelsWidth = 400;
+    resizeAccordingLabelWidth(iLabelsWidth);
+
+    /* Label delta for 'golden ratio' calculation. */
+    int iLabelDelta = width() - iLabelsWidth;
+
+    /* Calculating nearest 'golden ratio' width. */
+    int iGoldRatioWidth = sqrt(1.61 * width() * height());
+    int iNewLabelWidth = iGoldRatioWidth - iLabelDelta;
+    resizeAccordingLabelWidth(iNewLabelWidth);
+}
+
+void QIWizard::assignWatermark(const QString &strWatermark)
+{
+    /* Create initial watermark. */
+    QPixmap pixWaterMark(strWatermark);
+
+    /* Convert watermark to image which
+     * allows to manage pixel data directly. */
+    QImage imgWatermark = pixWaterMark.toImage();
+
+    /* Create final image on the basis of incoming, applying the rules. */
+    QImage imgWatermarkNew(imgWatermark.width(), qMax(imgWatermark.height(), height()), imgWatermark.format());
+    for (int y = 0; y < imgWatermarkNew.height(); ++ y)
+    {
+        for (int x = 0; x < imgWatermarkNew.width(); ++ x)
+        {
+            /* Border rule 1 - draw border for ClassicStyle */
+            if (wizardStyle() == QWizard::ClassicStyle &&
+                (x == 0 || y == 0 || x == imgWatermarkNew.width() - 1 || y == imgWatermarkNew.height() - 1))
+                imgWatermarkNew.setPixel(x, y, qRgb(0, 0, 0));
+            /* Border rule 2 - draw border for ModernStyle */
+            else if (wizardStyle() == QWizard::ModernStyle && x == imgWatermarkNew.width() - 1)
+                imgWatermarkNew.setPixel(x, y, qRgb(0, 0, 0));
+            /* Horizontal extension rule - use last used color */
+            else if (x >= imgWatermark.width() && y < imgWatermark.height())
+                imgWatermarkNew.setPixel(x, y, imgWatermark.pixel(imgWatermark.width() - 1, y));
+            /* Vertical extension rule - use last used color */
+            else if (y >= imgWatermark.height() && x < imgWatermark.width())
+                imgWatermarkNew.setPixel(x, y, imgWatermark.pixel(x, imgWatermark.height() - 1));
+            /* Common extension rule - use last used color */
+            else if (x >= imgWatermark.width() && y >= imgWatermark.height())
+                imgWatermarkNew.setPixel(x, y, imgWatermark.pixel(imgWatermark.width() - 1, imgWatermark.height() - 1));
+            /* Else just copy color */
+            else
+                imgWatermarkNew.setPixel(x, y, imgWatermark.pixel(x, y));
+        }
+    }
+
+    /* Convert processed image to pixmap and assign it to wizard's watermark. */
+    QPixmap pixWatermarkNew = QPixmap::fromImage(imgWatermarkNew);
+    setPixmap(QWizard::WatermarkPixmap, pixWatermarkNew);
+}
+
+void QIWizard::resizeAccordingLabelWidth(int iLabelsWidth)
+{
+    /* Update QILabels size-hints */
+    QList<QILabel*> labels = findChildren<QILabel*>();
+    foreach (QILabel *pLabel, labels)
+    {
+        pLabel->useSizeHintForWidth(iLabelsWidth);
+        pLabel->updateGeometry();
+    }
+
+    /* Unfortunately QWizard hides some of useful API in private part,
+     * BUT it also have few layouting bugs which could be easy fixed
+     * by that API, so we will use QWizard::restart() method
+     * to call the same functionality indirectly...
+     * Early call restart() which is usually goes on show()! */
+    restart();
+
+    /* Now we have correct size-hints calculated for all the pages.
+     * We have to make sure all the pages uses maximum size-hint
+     * of all the available. */
+    QSize maxOfSizeHints;
+    QList<QIWizardPage*> pages = findChildren<QIWizardPage*>();
+    /* Search for the maximum available size-hint */
+    foreach (QIWizardPage *pPage, pages)
+    {
+        maxOfSizeHints.rwidth() = pPage->sizeHint().width() > maxOfSizeHints.width() ?
+                                  pPage->sizeHint().width() : maxOfSizeHints.width();
+        maxOfSizeHints.rheight() = pPage->sizeHint().height() > maxOfSizeHints.height() ?
+                                   pPage->sizeHint().height() : maxOfSizeHints.height();
+    }
+    /* Use that size-hint for all the pages */
+    foreach (QIWizardPage *pPage, pages)
+    {
+        pPage->setMinimumSizeHint(maxOfSizeHints);
+        pPage->updateGeometry();
+    }
+
+    /* Reactivate layouts tree */
+    QList<QLayout*> layouts = findChildren<QLayout*>();
+    foreach (QLayout *pLayout, layouts)
+        pLayout->activate();
+
+    /* Unfortunately QWizard hides some of useful API in private part,
+     * BUT it also have few layouting bugs which could be easy fixed
+     * by that API, so we will use QWizard::restart() method
+     * to call the same functionality indirectly...
+     * And now we call restart() after layout update procedure! */
+    restart();
+
+    /* Resize to minimum possible size */
+    resize(minimumSizeHint());
+}
+
+QIWizardPage::QIWizardPage()
+{
+}
+
+QSize QIWizardPage::minimumSizeHint() const
+{
+    return m_MinimumSizeHint.isValid() ? m_MinimumSizeHint : QWizardPage::minimumSizeHint();
+}
+
+void QIWizardPage::setMinimumSizeHint(const QSize &minimumSizeHint)
+{
+    m_MinimumSizeHint = minimumSizeHint;
+}
+
+void QIWizardPage::setSummaryFieldLinesNumber(QTextEdit *pSummaryField, int iNumber)
+{
+    /* Set the minimum height for the <pSummaryField> to <iNumber> lines of text including text margins */
+    int lineHeight = pSummaryField->fontMetrics().height();
+    int textMargin = 4; /* QTextDocument::documentMargin() returns '4' but available only since Qt 4.5 */
+    pSummaryField->setFixedHeight(lineHeight * iNumber + textMargin * 2);
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h	(revision 26079)
@@ -0,0 +1,73 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * QIWizard class declaration
+ */
+
+/*
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __QIWizard_h__
+#define __QIWizard_h__
+
+/* Global includes */
+#include <QWizard>
+
+/* Local includes */
+#include "QIWithRetranslateUI.h"
+
+/* Global forwards */
+class QTextEdit;
+
+class QIWizard : public QIWithRetranslateUI<QWizard>
+{
+    Q_OBJECT;
+
+public:
+
+    QIWizard(QWidget *pParent);
+
+protected:
+
+    void resizeToGoldenRatio();
+    void assignWatermark(const QString &strWaterMark);
+
+private:
+
+    void resizeAccordingLabelWidth(int iLabelWidth);
+};
+
+class QIWizardPage : public QIWithRetranslateUI<QWizardPage>
+{
+    Q_OBJECT;
+
+public:
+
+    QIWizardPage();
+
+    QSize minimumSizeHint() const;
+    void setMinimumSizeHint(const QSize &minimumSizeHint);
+
+protected:
+
+    static void setSummaryFieldLinesNumber(QTextEdit *pSummaryField, int iNumber);
+
+private:
+
+    QSize m_MinimumSizeHint;
+};
+
+#endif // __QIWizard_h__
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2008-2009 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -34,5 +34,5 @@
 
 #ifdef VBOX_WITH_REGISTRATION
-#include "VBoxRegistrationDlg.h"
+#include "UIRegistrationWzd.h"
 #endif
 #include "VBoxUpdateDlg.h"
@@ -2866,39 +2866,4 @@
 }
 
-/**
- *  Sets the QLabel background and frame colors according tho the pixmap
- *  contents. The bottom right pixel of the label pixmap defines the
- *  background color of the label, the top right pixel defines the color of
- *  the one-pixel frame around it. This function also sets the alignment of
- *  the pixmap to AlignVTop (to correspond to the color choosing logic).
- *
- *  This method is useful to provide nice scaling of pixmal labels without
- *  scaling pixmaps themselves. To see th eeffect, the size policy of the
- *  label in the corresponding direction (vertical, for now) should be set to
- *  something like MinimumExpanding.
- *
- *  @todo Parametrize corners to select pixels from and set the alignment
- *  accordingly.
- */
-/* static */
-void VBoxGlobal::adoptLabelPixmap (QLabel *aLabel)
-{
-    AssertReturnVoid (aLabel);
-
-    aLabel->setAlignment (Qt::AlignTop);
-    aLabel->setFrameShape (QFrame::Box);
-    aLabel->setFrameShadow (QFrame::Plain);
-
-    const QPixmap *pix = aLabel->pixmap();
-    QImage img = pix->toImage();
-    QRgb rgbBack = img.pixel (img.width() - 1, img.height() - 1);
-    QRgb rgbFrame = img.pixel (img.width() - 1, 0);
-
-    QPalette pal = aLabel->palette();
-    pal.setColor (QPalette::Window, rgbBack);
-    pal.setColor (QPalette::WindowText, rgbFrame);
-    aLabel->setPalette (pal);
-}
-
 const char *gVBoxLangSubDir = "/nls";
 const char *gVBoxLangFileBase = "VirtualBox_";
@@ -4330,5 +4295,5 @@
 {
 #ifdef VBOX_WITH_REGISTRATION
-    if (!aForce && !VBoxRegistrationDlg::hasToBeShown())
+    if (!aForce && !UIRegistrationWzd::hasToBeShown())
         return;
 
@@ -4354,6 +4319,5 @@
         {
             /* We've got the "mutex", create a new registration dialog */
-            VBoxRegistrationDlg *dlg =
-                new VBoxRegistrationDlg (&mRegDlg, mMainWindow);
+            UIRegistrationWzd *dlg = new UIRegistrationWzd (&mRegDlg);
             dlg->setAttribute (Qt::WA_DeleteOnClose);
             Assert (dlg == mRegDlg);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2009 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -274,5 +274,5 @@
 class VBoxSelectorWnd;
 class VBoxConsoleWnd;
-class VBoxRegistrationDlg;
+class UIRegistrationWzd;
 class VBoxUpdateDlg;
 
@@ -728,6 +728,4 @@
 
     static bool isDOSType (const QString &aOSTypeId);
-
-    static void adoptLabelPixmap (QLabel *);
 
     static QString languageId();
@@ -902,5 +900,5 @@
 
 #ifdef VBOX_WITH_REGISTRATION
-    VBoxRegistrationDlg *mRegDlg;
+    UIRegistrationWzd *mRegDlg;
 #endif
     VBoxUpdateDlg *mUpdDlg;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2009 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -37,5 +37,5 @@
 #include "VBoxToolBar.h"
 #include "VBoxMediaManagerDlg.h"
-#include "VBoxNewHDWzd.h"
+#include "UINewHDWzd.h"
 
 /* String Tags */
@@ -2534,5 +2534,5 @@
 {
     /* Run New HD Wizard */
-    VBoxNewHDWzd dlg (this);
+    UINewHDWzd dlg (this);
 
     return dlg.exec() == QDialog::Accepted ? dlg.hardDisk().GetId() : QString();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.cpp	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.cpp	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2008 Sun Microsystems, Inc.
+ * Copyright (C) 2008-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -39,7 +39,10 @@
     , mCbFamily (new QComboBox (this))
     , mCbType (new QComboBox (this))
-    , mPolished (false)
     , mLayoutPosition (-1)
-{
+    , mLayoutActivated (false)
+{
+    /* Register CGuestOSType type */
+    qRegisterMetaType<CGuestOSType>();
+
     /* Setup widgets */
     mTxFamilyName->setAlignment (Qt::AlignRight);
@@ -121,4 +124,28 @@
 }
 
+void VBoxOSTypeSelectorWidget::activateLayout()
+{
+    if (mLayoutActivated)
+        return;
+
+    mLayoutActivated = true;
+
+    /* Layouting widgets */
+    QVBoxLayout *layout1 = new QVBoxLayout();
+    layout1->setSpacing (0);
+    layout1->addWidget (mPxTypeIcon);
+    layout1->addStretch();
+
+    QGridLayout *layout2 = layout() ? static_cast <QGridLayout*> (layout()) :
+                                      new QGridLayout (this);
+    layout2->setMargin (0);
+    int row = mLayoutPosition == -1 ? layout2->rowCount() : mLayoutPosition;
+    layout2->addWidget (mTxFamilyName, row, 0);
+    layout2->addWidget (mCbFamily, row, 1);
+    layout2->addWidget (mTxTypeName, row + 1, 0);
+    layout2->addWidget (mCbType, row + 1, 1);
+    layout2->addLayout (layout1, row, 2, 2, 1);
+}
+
 void VBoxOSTypeSelectorWidget::retranslateUi()
 {
@@ -134,25 +161,5 @@
 void VBoxOSTypeSelectorWidget::showEvent (QShowEvent *aEvent)
 {
-    if (!mPolished)
-    {
-        /* Finally polishing just before first show event */
-        mPolished = true;
-
-        /* Layouting widgets */
-        QVBoxLayout *layout1 = new QVBoxLayout();
-        layout1->setSpacing (0);
-        layout1->addWidget (mPxTypeIcon);
-        layout1->addStretch();
-
-        QGridLayout *layout2 = layout() ? static_cast <QGridLayout*> (layout()) :
-                                          new QGridLayout (this);
-        layout2->setMargin (0);
-        int row = mLayoutPosition == -1 ? layout2->rowCount() : mLayoutPosition;
-        layout2->addWidget (mTxFamilyName, row, 0);
-        layout2->addWidget (mCbFamily, row, 1);
-        layout2->addWidget (mTxTypeName, row + 1, 0);
-        layout2->addWidget (mCbType, row + 1, 1);
-        layout2->addLayout (layout1, row, 2, 2, 1);
-    }
+    activateLayout(); /* if not yet */
     QIWithRetranslateUI <QWidget>::showEvent (aEvent);
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.h	(revision 26078)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorWidget.h	(revision 26079)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2008 Sun Microsystems, Inc.
+ * Copyright (C) 2008-2010 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -30,10 +30,12 @@
 
 class QComboBox;
-class CGuestOSType;
 class QLabel;
+
+Q_DECLARE_METATYPE (CGuestOSType);
 
 class VBoxOSTypeSelectorWidget : public QIWithRetranslateUI <QWidget>
 {
     Q_OBJECT;
+    Q_PROPERTY(CGuestOSType type READ type WRITE setType);
 
 public:
@@ -45,4 +47,5 @@
 
     void setLayoutPosition (int aPos);
+    void activateLayout();
 
 signals:
@@ -71,6 +74,6 @@
     QMap <QString, QString> mCurrentIds;
 
-    bool mPolished;
     int mLayoutPosition;
+    bool mLayoutActivated;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp	(revision 26079)
@@ -0,0 +1,651 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIExportApplianceWzd class implementation
+ */
+
+/*
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Global includes */
+#include <QDir>
+
+/* Local includes */
+#include "UIExportApplianceWzd.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+
+class VMListWidgetItems : public QListWidgetItem
+{
+public:
+
+    VMListWidgetItems(QPixmap &pixIcon, QString &strText, QListWidget *pParent)
+        : QListWidgetItem(pixIcon, strText, pParent)
+    {
+    }
+
+    /* Sort like in the VM selector of the main window */
+    bool operator<(const QListWidgetItem &other) const
+    {
+        return text().toLower() < other.text().toLower();
+    }
+};
+
+UIExportApplianceWzd::UIExportApplianceWzd(QWidget *pParent, const QString &strSelectName) : QIWizard(pParent)
+{
+    /* Create & add pages */
+    addPage(new UIExportApplianceWzdPage1);
+    addPage(new UIExportApplianceWzdPage2);
+    addPage(new UIExportApplianceWzdPage3);
+    addPage(new UIExportApplianceWzdPage4);
+
+    /* Set 'selectedVMName' field for wizard page 1 */
+    setField("selectedVMName", strSelectName);
+
+    /* Translate */
+    retranslateUi();
+
+    /* Resize to 'golden ratio' */
+    resizeToGoldenRatio();
+
+    /* Assign watermark */
+    assignWatermark(":/vmw_ovf_import.png");
+
+    /* Setup connections */
+    connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(sltCurrentIdChanged(int)));
+    AssertMsg(!field("applianceWidget").value<ExportAppliancePointer>().isNull(),
+              ("Appliance Widget Pointer is not set!\n"));
+    connect(this, SIGNAL(customButtonClicked(int)),
+            field("applianceWidget").value<ExportAppliancePointer>(), SLOT(restoreDefaults()));
+}
+
+void UIExportApplianceWzd::retranslateUi()
+{
+    /* Wizard title */
+    setWindowTitle(tr("Appliance Export Wizard"));
+
+    /* Extra buttons */
+    setButtonText(QWizard::CustomButton1, tr("Restore Defaults"));
+}
+
+void UIExportApplianceWzd::sltCurrentIdChanged(int iId)
+{
+    setOption(QWizard::HaveCustomButton1, iId == 1 /* Page #2 */);
+}
+
+UIExportApplianceWzdPage1::UIExportApplianceWzdPage1()
+{
+    /* Decorate page */
+    Ui::UIExportApplianceWzdPage1::setupUi(this);
+
+    /* Register 'selectedVMName', 'machineNames', 'machineIDs' fields! */
+    registerField("selectedVMName", this, "selectedVMName");
+    registerField("machineNames", this, "machineNames");
+    registerField("machineIDs", this, "machineIDs");
+
+    /* Configure 'VM Selector' settings */
+    m_pVMSelector->setAlternatingRowColors(true);
+    m_pVMSelector->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+    /* Configure 'VM Selector' connections */
+    connect(m_pVMSelector, SIGNAL(itemSelectionChanged()), this, SLOT(sltSelectedVMChanged()));
+
+    /* Fill 'VM Selector' */
+    populateVMSelectorItems();
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIExportApplianceWzdPage1::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIExportApplianceWzdPage1::retranslateUi(this);
+
+    /* Wizard page 1 title */
+    setTitle(tr("Welcome to the Appliance Export Wizard!"));
+}
+
+void UIExportApplianceWzdPage1::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Choose initially selected item (if passed) */
+    QList<QListWidgetItem*> list = m_pVMSelector->findItems(m_strSelectedVMName, Qt::MatchExactly);
+    if (list.size() > 0)
+        m_pVMSelector->setCurrentItem(list.first());
+}
+
+void UIExportApplianceWzdPage1::cleanupPage()
+{
+    /* Do NOT call superclass method, it will clean defailt (initially set) field - 'selectedVMName'! */
+}
+
+bool UIExportApplianceWzdPage1::isComplete() const
+{
+    /* There should be at least one vm selected! */
+    return m_pVMSelector->selectedItems().size() > 0;
+}
+
+void UIExportApplianceWzdPage1::sltSelectedVMChanged()
+{
+    /* Clear lists initially */
+    m_MachineNames.clear();
+    m_MachineIDs.clear();
+    /* Iterate over all the selected items */
+    foreach (QListWidgetItem *item, m_pVMSelector->selectedItems())
+    {
+        m_MachineNames << item->text();
+        m_MachineIDs << item->data(Qt::UserRole).toString();
+    }
+    /* Revalidate page */
+    emit completeChanged();
+}
+
+void UIExportApplianceWzdPage1::populateVMSelectorItems()
+{
+    /* Add all VM items into 'VM Selector' */
+    foreach (const CMachine &m, vboxGlobal().virtualBox().GetMachines())
+    {
+        QPixmap pixIcon;
+        QString strName;
+        QString strUuid;
+        bool bEnabled;
+        if (m.GetAccessible())
+        {
+            pixIcon = vboxGlobal().vmGuestOSTypeIcon(m.GetOSTypeId()).scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+            strName = m.GetName();
+            strUuid = m.GetId();
+            bEnabled = m.GetSessionState() == KSessionState_Closed;
+        }
+        else
+        {
+            QString settingsFile = m.GetSettingsFilePath();
+            QFileInfo fi(settingsFile);
+            strName = fi.completeSuffix().toLower() == "xml" ? fi.completeBaseName() : fi.fileName();
+            pixIcon = QPixmap(":/os_other.png").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+            bEnabled = false;
+        }
+        QListWidgetItem *item = new VMListWidgetItems(pixIcon, strName, m_pVMSelector);
+        item->setData(Qt::UserRole, strUuid);
+        if (!bEnabled)
+            item->setFlags(0);
+        m_pVMSelector->addItem(item);
+    }
+    m_pVMSelector->sortItems();
+}
+
+UIExportApplianceWzdPage2::UIExportApplianceWzdPage2()
+{
+    /* Decorate page */
+    Ui::UIExportApplianceWzdPage2::setupUi(this);
+
+    /* Register ExportAppliancePointer class */
+    qRegisterMetaType<ExportAppliancePointer>();
+
+    /* Register 'applianceWidget' field! */
+    registerField("applianceWidget", this, "applianceWidget");
+    m_pApplianceWidget = m_pSettingsCnt;
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIExportApplianceWzdPage2::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIExportApplianceWzdPage2::retranslateUi(this);
+
+    /* Wizard page 2 title */
+    setTitle(tr("Appliance Export Settings"));
+}
+
+void UIExportApplianceWzdPage2::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* We propose a filename the first time the second page is displayed */
+    prepareSettingsWidget();
+}
+
+void UIExportApplianceWzdPage2::cleanupPage()
+{
+    /* Do NOT call superclass method, it will clean defailt (initially set) field - 'applianceWidget'! */
+}
+
+int UIExportApplianceWzdPage2::nextId() const
+{
+    /* Skip next (3rd, storage-type) page for now! */
+    return wizard()->page(QIWizardPage::nextId())->nextId();
+}
+
+bool UIExportApplianceWzdPage2::prepareSettingsWidget()
+{
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    CAppliance *appliance = m_pSettingsCnt->init();
+    bool fResult = appliance->isOk();
+    if (fResult)
+    {
+        /* Iterate over all the selected machine ids */
+        QStringList uuids = field("machineIDs").toStringList();
+        foreach (const QString &uuid, uuids)
+        {
+            /* Get the machine with the uuid */
+            CMachine m = vbox.GetMachine(uuid);
+            fResult = m.isOk();
+            if (fResult)
+            {
+                /* Add the export description to our appliance object */
+                CVirtualSystemDescription vsd = m.Export(*appliance);
+                fResult = m.isOk();
+                if (!fResult)
+                {
+                    vboxProblem().cannotExportAppliance(m, appliance, this);
+                    return false;
+                }
+                /* Now add some new fields the user may change */
+                vsd.AddDescription(KVirtualSystemDescriptionType_Product, "", "");
+                vsd.AddDescription(KVirtualSystemDescriptionType_ProductUrl, "", "");
+                vsd.AddDescription(KVirtualSystemDescriptionType_Vendor, "", "");
+                vsd.AddDescription(KVirtualSystemDescriptionType_VendorUrl, "", "");
+                vsd.AddDescription(KVirtualSystemDescriptionType_Version, "", "");
+                vsd.AddDescription(KVirtualSystemDescriptionType_License, "", "");
+            }
+            else
+                break;
+        }
+        /* Make sure the settings widget get the new descriptions */
+        m_pSettingsCnt->populate();
+    }
+    if (!fResult)
+        vboxProblem().cannotExportAppliance(appliance, this);
+    return fResult;
+}
+
+UIExportApplianceWzdPage3::UIExportApplianceWzdPage3()
+{
+    /* Decorate page */
+    Ui::UIExportApplianceWzdPage3::setupUi(this);
+
+    /* Register StorageType class */
+    qRegisterMetaType<StorageType>();
+
+    /* Register 'storageType' field! */
+    registerField("storageType", this, "storageType");
+
+    /* Setup connections */
+    connect (m_pTypeLocalFilesystem, SIGNAL(clicked()), this, SLOT(sltStorageTypeChanged()));
+    connect (m_pTypeSunCloud, SIGNAL(clicked()), this, SLOT(sltStorageTypeChanged()));
+    connect (m_pTypeSimpleStorageSystem, SIGNAL(clicked()), this, SLOT(sltStorageTypeChanged()));
+
+#if 0
+    /* Load storage-type from GUI extra data */
+    bool ok;
+    StorageType storageType =
+        StorageType(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_Export_StorageType).toInt(&ok));
+    if (ok)
+    {
+        switch (storageType)
+        {
+            case Filesystem:
+                m_pTypeLocalFilesystem->setChecked(true);
+                m_pTypeLocalFilesystem->setFocus();
+                break;
+            case SunCloud:
+                m_pTypeSunCloud->setChecked(true);
+                m_pTypeSunCloud->setFocus();
+                break;
+            case S3:
+                m_pTypeSimpleStorageSystem->setChecked(true);
+                m_pTypeSimpleStorageSystem->setFocus();
+                break;
+        }
+    }
+#else
+    /* Just select first of types */
+    m_pTypeLocalFilesystem->click();
+#endif
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIExportApplianceWzdPage3::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIExportApplianceWzdPage3::retranslateUi(this);
+
+    /* Wizard page 3 title */
+    setTitle(tr("Appliance Export Settings"));
+}
+
+void UIExportApplianceWzdPage3::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Revert to initial choice */
+    m_pTypeLocalFilesystem->click();
+}
+
+void UIExportApplianceWzdPage3::sltStorageTypeChanged()
+{
+    /* Update selected storage-type */
+    if (m_pTypeLocalFilesystem->isChecked())
+        m_StorageType = Filesystem;
+    else if (m_pTypeSunCloud->isChecked())
+        m_StorageType = SunCloud;
+    else if (m_pTypeSimpleStorageSystem->isChecked())
+        m_StorageType = S3;
+    else
+        m_StorageType = Filesystem;
+    /* Revalidate page */
+    emit completeChanged();
+}
+
+UIExportApplianceWzdPage4::UIExportApplianceWzdPage4()
+{
+    /* Decorate page */
+    Ui::UIExportApplianceWzdPage4::setupUi(this);
+
+    /* Configure the file selector */
+    m_pFileSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Save);
+    m_pFileSelector->setEditable(true);
+    m_pFileSelector->setButtonPosition(VBoxEmptyFileSelector::RightPosition);
+    m_pFileSelector->setDefaultSaveExt("ovf");
+
+    /* Complete validators for the file selector page */
+    connect(m_pLeUsername, SIGNAL(textChanged(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLePassword, SIGNAL(textChanged(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeHostname, SIGNAL(textChanged(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeBucket, SIGNAL(textChanged(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pFileSelector, SIGNAL(pathChanged(const QString &)), this, SIGNAL(completeChanged()));
+
+#if 0
+    /* Load default attributes from GUI extra data */
+    m_pLeUsername->setText(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_Export_Username));
+    m_pLeHostname->setText(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_Export_Hostname));
+    m_pLeBucket->setText(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_Export_Bucket));
+#endif
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIExportApplianceWzdPage4::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIExportApplianceWzdPage4::retranslateUi(this);
+
+    /* Wizard page 4 title */
+    setTitle(tr("Appliance Export Settings"));
+
+    /* Setup defaults */
+    m_strDefaultApplianceName = tr("Appliance");
+
+    /* Translate the file selector */
+    m_pFileSelector->setFileDialogTitle(tr("Select a file to export into"));
+    m_pFileSelector->setFileFilters(tr("Open Virtualization Format (%1)").arg("*.ovf"));
+}
+
+void UIExportApplianceWzdPage4::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Setup components for chosen storage-type */
+    StorageType storageType = field("storageType").value<StorageType>();
+    switch (storageType)
+    {
+        case Filesystem:
+            m_pPage4Text1->setText(tr("Please choose a filename to export the OVF to."));
+            m_pTxUsername->setVisible(false);
+            m_pLeUsername->setVisible(false);
+            m_pTxPassword->setVisible(false);
+            m_pLePassword->setVisible(false);
+            m_pTxHostname->setVisible(false);
+            m_pLeHostname->setVisible(false);
+            m_pTxBucket->setVisible(false);
+            m_pLeBucket->setVisible(false);
+            m_pSelectOVF09->setVisible(true);
+            m_pFileSelector->setChooserVisible(true);
+            m_pFileSelector->setFocus();
+            break;
+        case SunCloud:
+            m_pPage4Text1->setText(tr("Please complete the additional fields like the username, password "
+                                      "and the bucket, and provide a filename for the OVF target."));
+            m_pTxUsername->setVisible(true);
+            m_pLeUsername->setVisible(true);
+            m_pTxPassword->setVisible(true);
+            m_pLePassword->setVisible(true);
+            m_pTxHostname->setVisible(false);
+            m_pLeHostname->setVisible(false);
+            m_pTxBucket->setVisible(true);
+            m_pLeBucket->setVisible(true);
+            m_pSelectOVF09->setVisible(false);
+            m_pSelectOVF09->setChecked(false);
+            m_pFileSelector->setChooserVisible(false);
+            m_pLeUsername->setFocus();
+            break;
+        case S3:
+            m_pPage4Text1->setText(tr("Please complete the additional fields like the username, password, "
+                                      "hostname and the bucket, and provide a filename for the OVF target."));
+            m_pTxUsername->setVisible(true);
+            m_pLeUsername->setVisible(true);
+            m_pTxPassword->setVisible(true);
+            m_pLePassword->setVisible(true);
+            m_pTxHostname->setVisible(true);
+            m_pLeHostname->setVisible(true);
+            m_pTxBucket->setVisible(true);
+            m_pLeBucket->setVisible(true);
+            m_pSelectOVF09->setVisible(true);
+            m_pFileSelector->setChooserVisible(false);
+            m_pLeUsername->setFocus();
+            break;
+    }
+
+    if (!m_pFileSelector->path().isEmpty())
+    {
+        QFileInfo fi(m_pFileSelector->path());
+        QString strName = fi.fileName();
+        if (storageType == Filesystem)
+            strName = QDir::toNativeSeparators(QString("%1/%2").arg(vboxGlobal().documentsPath()).arg(strName));
+        m_pFileSelector->setPath(strName);
+    }
+
+    if (m_pFileSelector->path().isEmpty())
+    {
+        /* Set the default filename */
+        QString strName = m_strDefaultApplianceName;
+        /* If it is one VM only, we use the VM name as file name */
+        if (field("machineNames").toStringList().size() == 1)
+            strName = field("machineNames").toStringList()[0];
+
+        strName += ".ovf";
+
+        if (storageType == Filesystem)
+            strName = QDir::toNativeSeparators(QString("%1/%2").arg(vboxGlobal().documentsPath()).arg(strName));
+        m_pFileSelector->setPath(strName);
+    }
+    AssertMsg(!field("applianceWidget").value<ExportAppliancePointer>().isNull(),
+              ("Appliance Widget Pointer is not set!\n"));
+    field("applianceWidget").value<ExportAppliancePointer>()->prepareExport();
+}
+
+bool UIExportApplianceWzdPage4::isComplete() const
+{
+    bool bComplete = m_pFileSelector->path().toLower().endsWith(".ovf");
+    StorageType storageType = field("storageType").value<StorageType>();
+    switch (storageType)
+    {
+        case Filesystem:
+            break;
+        case SunCloud:
+            bComplete &= !m_pLeUsername->text().isEmpty() && !m_pLePassword->text().isEmpty() &&
+                         !m_pLeBucket->text().isEmpty();
+            break;
+        case S3:
+            bComplete &= !m_pLeUsername->text().isEmpty() && !m_pLePassword->text().isEmpty() &&
+                         !m_pLeHostname->text().isEmpty() && !m_pLeBucket->text().isEmpty();
+            break;
+    }
+    return bComplete;
+}
+
+bool UIExportApplianceWzdPage4::validatePage()
+{
+    return exportAppliance();
+}
+
+bool UIExportApplianceWzdPage4::exportAppliance()
+{
+    AssertMsg(!field("applianceWidget").value<ExportAppliancePointer>().isNull(),
+              ("Appliance Widget Pointer is not set!\n"));
+    CAppliance *appliance = field("applianceWidget").value<ExportAppliancePointer>()->appliance();
+    QFileInfo fi(m_pFileSelector->path());
+    QVector<QString> files;
+    files << fi.fileName();
+    /* We need to know every filename which will be created, so that we can
+     * ask the user for confirmation of overwriting. For that we iterating
+     * over all virtual systems & fetch all descriptions of the type
+     * HardDiskImage. */
+    CVirtualSystemDescriptionVector vsds = appliance->GetVirtualSystemDescriptions();
+    for (int i = 0; i < vsds.size(); ++ i)
+    {
+        QVector<KVirtualSystemDescriptionType> types;
+        QVector<QString> refs, origValues, configValues, extraConfigValues;
+        vsds[i].GetDescriptionByType(KVirtualSystemDescriptionType_HardDiskImage, types,
+                                     refs, origValues, configValues, extraConfigValues);
+        foreach (const QString &s, origValues)
+            files << QString("%2").arg(s);
+    }
+    CVFSExplorer explorer = appliance->CreateVFSExplorer(uri());
+    CProgress progress = explorer.Update();
+    bool fResult = explorer.isOk();
+    if (fResult)
+    {
+        /* Show some progress, so the user know whats going on */
+        vboxProblem().showModalProgressDialog(progress, tr("Checking files ..."), this);
+        if (progress.GetCanceled())
+            return false;
+        if (!progress.isOk() || progress.GetResultCode() != 0)
+        {
+            vboxProblem().cannotCheckFiles(progress, this);
+            return false;
+        }
+    }
+    QVector<QString> exists = explorer.Exists(files);
+    /* Check if the file exists already, if yes get confirmation for overwriting from the user. */
+    if (!vboxProblem().askForOverridingFiles(exists, this))
+        return false;
+    /* Ok all is confirmed so delete all the files which exists */
+    if (!exists.isEmpty())
+    {
+        CProgress progress1 = explorer.Remove(exists);
+        fResult = explorer.isOk();
+        if (fResult)
+        {
+            /* Show some progress, so the user know whats going on */
+            vboxProblem().showModalProgressDialog(progress1, tr("Removing files ..."), this);
+            if (progress1.GetCanceled())
+                return false;
+            if (!progress1.isOk() || progress1.GetResultCode() != 0)
+            {
+                vboxProblem().cannotRemoveFiles(progress1, this);
+                return false;
+            }
+        }
+    }
+
+    /* Export the VMs, on success we are finished */
+    if (exportVMs(*appliance))
+    {
+#if 0
+        /* Save attributes to GUI extra data */
+        StorageType storageType = field("storageType").value<StorageType>();
+        vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_Export_StorageType, QString::number(storageType));
+        vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_Export_Username, m_pLeUsername->text());
+        vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_Export_Hostname, m_pLeHostname->text());
+        vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_Export_Bucket, m_pLeBucket->text());
+#endif
+        return true;
+    }
+    return false;
+}
+
+bool UIExportApplianceWzdPage4::exportVMs(CAppliance &appliance)
+{
+    /* Write the appliance */
+    QString version = m_pSelectOVF09->isChecked() ? "ovf-0.9" : "ovf-1.0";
+    CProgress progress = appliance.Write(version, uri());
+    bool fResult = appliance.isOk();
+    if (fResult)
+    {
+        /* Show some progress, so the user know whats going on */
+        vboxProblem().showModalProgressDialog(progress, tr("Exporting Appliance ..."), this);
+        if (progress.GetCanceled())
+            return false;
+        if (!progress.isOk() || progress.GetResultCode() != 0)
+        {
+            vboxProblem().cannotExportAppliance(progress, &appliance, this);
+            return false;
+        }
+        else
+            return true;
+    }
+    if (!fResult)
+        vboxProblem().cannotExportAppliance(&appliance, this);
+    return false;
+}
+
+QString UIExportApplianceWzdPage4::uri() const
+{
+    StorageType type = field("storageType").value<StorageType>();
+    switch (type)
+    {
+        case Filesystem:
+        {
+            return m_pFileSelector->path();
+        }
+        case SunCloud:
+        {
+            QString uri("SunCloud://");
+            if (!m_pLeUsername->text().isEmpty())
+                uri = QString("%1%2").arg(uri).arg(m_pLeUsername->text());
+            if (!m_pLePassword->text().isEmpty())
+                uri = QString("%1:%2").arg(uri).arg(m_pLePassword->text());
+            if (!m_pLeUsername->text().isEmpty() || !m_pLePassword->text().isEmpty())
+                uri = QString("%1@").arg(uri);
+            uri = QString("%1%2/%3/%4").arg(uri).arg("object.storage.network.com").arg(m_pLeBucket->text()).arg(m_pFileSelector->path());
+            return uri;
+        }
+        case S3:
+        {
+            QString uri("S3://");
+            if (!m_pLeUsername->text().isEmpty())
+                uri = QString("%1%2").arg(uri).arg(m_pLeUsername->text());
+            if (!m_pLePassword->text().isEmpty())
+                uri = QString("%1:%2").arg(uri).arg(m_pLePassword->text());
+            if (!m_pLeUsername->text().isEmpty() || !m_pLePassword->text().isEmpty())
+                uri = QString("%1@").arg(uri);
+            uri = QString("%1%2/%3/%4").arg(uri).arg(m_pLeHostname->text()).arg(m_pLeBucket->text()).arg(m_pFileSelector->path());
+            return uri;
+        }
+    }
+    return QString();
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.h	(revision 26079)
@@ -0,0 +1,184 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIExportApplianceWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __UIExportApplianceWzd_h__
+#define __UIExportApplianceWzd_h__
+
+/* Global includes */
+#include <QPointer>
+
+/* Local includes */
+#include "QIWizard.h"
+
+/* Generated includes */
+#include "UIExportApplianceWzdPage1.gen.h"
+#include "UIExportApplianceWzdPage2.gen.h"
+#include "UIExportApplianceWzdPage3.gen.h"
+#include "UIExportApplianceWzdPage4.gen.h"
+
+/* Local forwards */
+class CAppliance;
+
+enum StorageType { Filesystem, SunCloud, S3 };
+Q_DECLARE_METATYPE(StorageType);
+
+typedef QPointer<VBoxExportApplianceWgt> ExportAppliancePointer;
+Q_DECLARE_METATYPE(ExportAppliancePointer);
+
+class UIExportApplianceWzd : public QIWizard
+{
+    Q_OBJECT;
+
+public:
+
+    UIExportApplianceWzd(QWidget *pParent, const QString &strSelectedVMName = QString());
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void sltCurrentIdChanged(int iId);
+};
+
+class UIExportApplianceWzdPage1 : public QIWizardPage, public Ui::UIExportApplianceWzdPage1
+{
+    Q_OBJECT;
+    Q_PROPERTY(QString selectedVMName READ selectedVMName WRITE setSelectedVMName);
+    Q_PROPERTY(QStringList machineNames READ machineNames WRITE setMachineNames);
+    Q_PROPERTY(QStringList machineIDs READ machineIDs WRITE setMachineIDs);
+
+public:
+
+    UIExportApplianceWzdPage1();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+    void cleanupPage();
+
+    bool isComplete() const;
+
+private slots:
+
+    void sltSelectedVMChanged();
+
+private:
+
+    void populateVMSelectorItems();
+
+    QString selectedVMName() const { return m_strSelectedVMName; }
+    void setSelectedVMName(const QString &strSelectedVMName) { m_strSelectedVMName = strSelectedVMName; }
+    QString m_strSelectedVMName;
+
+    QStringList machineNames() const { return m_MachineNames; }
+    void setMachineNames(const QStringList &machineNames) { m_MachineNames = machineNames; }
+    QStringList m_MachineNames;
+
+    QStringList machineIDs() const { return m_MachineIDs; }
+    void setMachineIDs(const QStringList &machineIDs) { m_MachineIDs = machineIDs; }
+    QStringList m_MachineIDs;
+};
+
+class UIExportApplianceWzdPage2 : public QIWizardPage, public Ui::UIExportApplianceWzdPage2
+{
+    Q_OBJECT;
+    Q_PROPERTY(ExportAppliancePointer applianceWidget READ applianceWidget WRITE setApplianceWidget);
+
+public:
+
+    UIExportApplianceWzdPage2();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+    void cleanupPage();
+
+    int nextId() const;
+
+private:
+
+    bool prepareSettingsWidget();
+
+    ExportAppliancePointer applianceWidget() const { return m_pApplianceWidget; }
+    void setApplianceWidget(const ExportAppliancePointer &pApplianceWidget) { m_pApplianceWidget = pApplianceWidget; }
+    ExportAppliancePointer m_pApplianceWidget;
+};
+
+class UIExportApplianceWzdPage3 : public QIWizardPage, public Ui::UIExportApplianceWzdPage3
+{
+    Q_OBJECT;
+    Q_PROPERTY(StorageType storageType READ storageType WRITE setStorageType);
+
+public:
+
+    UIExportApplianceWzdPage3();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+
+private slots:
+
+    void sltStorageTypeChanged();
+
+private:
+
+    StorageType storageType() const { return m_StorageType; }
+    void setStorageType(StorageType storageType) { m_StorageType = storageType; }
+    StorageType m_StorageType;
+};
+
+class UIExportApplianceWzdPage4 : public QIWizardPage, public Ui::UIExportApplianceWzdPage4
+{
+    Q_OBJECT;
+
+public:
+
+    UIExportApplianceWzdPage4();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+
+    bool isComplete() const;
+    bool validatePage();
+
+private:
+
+    bool exportAppliance();
+    bool exportVMs(CAppliance &appliance);
+    QString uri() const;
+
+    QString m_strDefaultApplianceName;
+};
+
+#endif /* __UIExportApplianceWzd_h__ */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage1.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage1.ui	(revision 26079)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIExportApplianceWzdPage1</class>
+ <widget class="QWidget" name="UIExportApplianceWzdPage1">
+  <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="text">
+      <string>&lt;p&gt;This wizard will guide you through the process of exporting an appliance.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page.&lt;/p&gt;&lt;p&gt;Please select the virtual machines that you wish to the appliance. You can select more than one. Please note that these machines have to be turned off before they can be exported.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QListWidget" name="m_pVMSelector"/>
+   </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/exportappliance/UIExportApplianceWzdPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage2.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage2.ui	(revision 26079)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIExportApplianceWzdPage2</class>
+ <widget class="QWidget" name="UIExportApplianceWzdPage2">
+  <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>Here you can change additional configuration values of the selected virtual machines. You can modify most of the properties shown by double-clicking on the items.</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="VBoxExportApplianceWgt" name="m_pSettingsCnt" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxExportApplianceWgt</class>
+   <extends>QWidget</extends>
+   <header>VBoxExportApplianceWgt.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage3.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage3.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage3.ui	(revision 26079)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIExportApplianceWzdPage3</class>
+ <widget class="QWidget" name="UIExportApplianceWzdPage3">
+  <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>Please specify the target for the OVF export. You can choose between a local file system export, uploading the OVF to the Sun Cloud service or an S3 storage server.</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QRadioButton" name="m_pTypeLocalFilesystem">
+     <property name="text">
+      <string>&amp;Local Filesystem </string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QRadioButton" name="m_pTypeSunCloud">
+     <property name="text">
+      <string>Sun &amp;Cloud</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QRadioButton" name="m_pTypeSimpleStorageSystem">
+     <property name="text">
+      <string>&amp;Simple Storage System (S3)</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer1">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>252</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/exportappliance/UIExportApplianceWzdPage4.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage4.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzdPage4.ui	(revision 26079)
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIExportApplianceWzdPage4</class>
+ <widget class="QWidget" name="UIExportApplianceWzdPage4">
+  <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="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QGridLayout" name="m_pLayout2">
+     <item row="0" column="0">
+      <widget class="QLabel" name="m_pTxUsername">
+       <property name="text">
+        <string>&amp;Username:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="buddy">
+        <cstring>m_pLeUsername</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="m_pLeUsername"/>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="m_pTxPassword">
+       <property name="text">
+        <string>&amp;Password:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="buddy">
+        <cstring>m_pLePassword</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="m_pLePassword">
+       <property name="echoMode">
+        <enum>QLineEdit::Password</enum>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="m_pTxHostname">
+       <property name="text">
+        <string>&amp;Hostname:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="buddy">
+        <cstring>m_pLeHostname</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="m_pLeHostname"/>
+     </item>
+     <item row="3" column="0">
+      <widget class="QLabel" name="m_pTxBucket">
+       <property name="text">
+        <string>&amp;Bucket:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="buddy">
+        <cstring>m_pLeBucket</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <widget class="QLineEdit" name="m_pLeBucket"/>
+     </item>
+     <item row="5" column="0">
+      <widget class="QLabel" name="m_pTxFile">
+       <property name="text">
+        <string>&amp;File:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="buddy">
+        <cstring>m_pFileSelector</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="1">
+      <widget class="VBoxEmptyFileSelector" name="m_pFileSelector" native="true"/>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="m_pSelectOVF09">
+     <property name="toolTip">
+      <string>Write in legacy OVF 0.9 format for compatibility with other virtualization products.</string>
+     </property>
+     <property name="text">
+      <string>&amp;Write legacy OVF 0.9</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer1">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>174</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxEmptyFileSelector</class>
+   <extends>QWidget</extends>
+   <header>VBoxFilePathSelectorWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/VBoxExportApplianceWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/VBoxExportApplianceWzd.cpp	(revision 26078)
+++ 	(revision )
@@ -1,523 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxExportAppliance class implementation
- */
-
-/*
- * Copyright (C) 2009 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#include "VBoxExportApplianceWzd.h"
-#include "VBoxGlobal.h"
-#include "QIWidgetValidator.h"
-#include "VBoxProblemReporter.h"
-
-/* Qt includes */
-#include <QDir>
-
-class VMListWidgetItems: public QListWidgetItem
-{
-public:
-    VMListWidgetItems (QPixmap &aIcon, QString &aText, QListWidget *aParent)
-      : QListWidgetItem (aIcon, aText, aParent) {}
-
-    /* Sort like in the VM selector of the main window */
-    bool operator< (const QListWidgetItem &aOther) const
-    {
-        return text().toLower() < aOther.text().toLower();
-    }
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxExportApplianceWzd
-
-VBoxExportApplianceWzd::VBoxExportApplianceWzd (QWidget *aParent /* = NULL */, const QString& aSelectName /* = QString::null */)
-    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
-{
-    /* Apply UI decorations */
-    Ui::VBoxExportApplianceWzd::setupUi (this);
-
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
-    /* Configure the VM selector widget */
-    mVMListWidget->setAlternatingRowColors (true);
-    mVMListWidget->setSelectionMode (QAbstractItemView::ExtendedSelection);
-
-    /* Validator for the VM selector page */
-    mWValVMSelector = new QIWidgetValidator (mVMSelectPage, this);
-    connect (mWValVMSelector, SIGNAL (validityChanged (const QIWidgetValidator *)),
-             this, SLOT (enableNext (const QIWidgetValidator *)));
-    connect (mWValVMSelector, SIGNAL (isValidRequested (QIWidgetValidator *)),
-             this, SLOT (revalidate (QIWidgetValidator *)));
-    connect (mVMListWidget, SIGNAL (itemSelectionChanged()),
-             mWValVMSelector, SLOT (revalidate()));
-
-    /* Fill the VM selector list */
-    addListViewVMItems (aSelectName);
-    mWValVMSelector->revalidate();
-
-    /* Configure the file selector */
-    mFileSelector->setMode (VBoxFilePathSelectorWidget::Mode_File_Save);
-    mFileSelector->setEditable (true);
-    mFileSelector->setButtonPosition (VBoxEmptyFileSelector::RightPosition);
-    mFileSelector->setFileDialogTitle (tr ("Select a file to export into"));
-    mFileSelector->setFileFilters (tr ("Open Virtualization Format (%1)").arg ("*.ovf"));
-    mFileSelector->setDefaultSaveExt ("ovf");
-    setTabOrder (mLeBucket, mFileSelector);
-
-    /* Connect the restore button with the settings widget */
-    connect (mBtnRestore, SIGNAL (clicked()),
-             mExportSettingsWgt, SLOT (restoreDefaults()));
-
-    /* Validator for the file selector page */
-    mWValFileSelector = new QIWidgetValidator (mTargetOptionsPage, this);
-    connect (mWValFileSelector, SIGNAL (validityChanged (const QIWidgetValidator *)),
-             this, SLOT (enableNext (const QIWidgetValidator *)));
-    connect (mWValFileSelector, SIGNAL (isValidRequested (QIWidgetValidator *)),
-             this, SLOT (revalidate (QIWidgetValidator *)));
-    connect (mFileSelector, SIGNAL (pathChanged (const QString &)),
-             mWValFileSelector, SLOT (revalidate()));
-    connect (mLeUsername, SIGNAL (textChanged (const QString &)),
-             mWValFileSelector, SLOT (revalidate()));
-    connect (mLePassword, SIGNAL (textChanged (const QString &)),
-             mWValFileSelector, SLOT (revalidate()));
-    connect (mLeHostname, SIGNAL (textChanged (const QString &)),
-             mWValFileSelector, SLOT (revalidate()));
-    connect (mLeBucket, SIGNAL (textChanged (const QString &)),
-             mWValFileSelector, SLOT (revalidate()));
-
-//    mLeUsername->setText (vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_Export_Username));
-//    mLeHostname->setText (vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_Export_Hostname));
-//    mLeBucket->setText (vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_Export_Bucket));
-
-    mWValFileSelector->revalidate();
-
-    /* Initialize wizard ftr */
-    initializeWizardFtr();
-
-    retranslateUi();
-
-    /* Type selection is disabled for now */
-    connect (mBtnNext2, SIGNAL (clicked(bool)),
-             mBtnNext3, SLOT (click()));
-    connect (mBtnBack4, SIGNAL (clicked(bool)),
-             mBtnBack3, SLOT (click()));
-
-//    bool ok;
-//    StorageType type = StorageType (vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_Export_StorageType).toInt(&ok));
-//    if (ok)
-//        setCurrentStorageType (type);
-}
-
-void VBoxExportApplianceWzd::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxExportApplianceWzd::retranslateUi (this);
-
-    mDefaultApplianceName = tr("Appliance");
-
-    mExportToFileSystemDesc = tr("Please choose a filename to export the OVF to.");
-    mExportToSunCloudDesc = tr("Please complete the additional fields like the username, password and the bucket, and provide a filename for the OVF target.");
-    mExportToS3Desc = tr("Please complete the additional fields like the username, password, hostname and the bucket, and provide a filename for the OVF target.");
-
-    switch (currentStorageType())
-    {
-        case Filesystem: mTextTargetOptions->setText (mExportToFileSystemDesc); break;
-        case SunCloud: mTextTargetOptions->setText (mExportToSunCloudDesc); break;
-        case S3: mTextTargetOptions->setText (mExportToS3Desc); break;
-    }
-}
-
-void VBoxExportApplianceWzd::revalidate (QIWidgetValidator *aWval)
-{
-    /* Do individual validations for pages */
-    bool valid = aWval->isOtherValid();
-
-    if (aWval == mWValVMSelector)
-        valid = mVMListWidget->selectedItems().size() > 0;
-
-    if (aWval == mWValFileSelector)
-    {
-        valid = mFileSelector->path().toLower().endsWith (".ovf");
-        if (currentStorageType() == SunCloud)
-        {
-            valid &= !mLeUsername->text().isEmpty() &&
-                !mLePassword->text().isEmpty() &&
-                !mLeBucket->text().isEmpty();
-        }
-        else if (currentStorageType() == S3)
-        {
-            valid &= !mLeUsername->text().isEmpty() &&
-                !mLePassword->text().isEmpty() &&
-                !mLeHostname->text().isEmpty() &&
-                !mLeBucket->text().isEmpty();
-        }
-    }
-
-    aWval->setOtherValid (valid);
-}
-
-void VBoxExportApplianceWzd::enableNext (const QIWidgetValidator *aWval)
-{
-    if (aWval == mWValFileSelector)
-        finishButton()->setEnabled (aWval->isValid());
-    else
-        nextButton (aWval->widget())->setEnabled (aWval->isValid());
-}
-
-void VBoxExportApplianceWzd::accept()
-{
-    CAppliance *appliance = mExportSettingsWgt->appliance();
-    QFileInfo fi (mFileSelector->path());
-    QVector<QString> files;
-    files << fi.fileName();
-    /* We need to know every filename which will be created, so that we can
-     * ask the user for confirmation of overwriting. For that we iterating
-     * over all virtual systems & fetch all descriptions of the type
-     * HardDiskImage. */
-    CVirtualSystemDescriptionVector vsds = appliance->GetVirtualSystemDescriptions();
-    for (int i=0; i < vsds.size(); ++i)
-    {
-        QVector<KVirtualSystemDescriptionType> types;
-        QVector<QString> refs, origValues, configValues, extraConfigValues;
-
-        vsds[i].GetDescriptionByType (KVirtualSystemDescriptionType_HardDiskImage, types, refs, origValues, configValues, extraConfigValues);
-        foreach (const QString &s, origValues)
-            files << QString ("%2").arg (s);
-    }
-    CVFSExplorer explorer = appliance->CreateVFSExplorer(uri());
-    CProgress progress = explorer.Update();
-    bool fResult = explorer.isOk();
-    if (fResult)
-    {
-        /* Show some progress, so the user know whats going on */
-        vboxProblem().showModalProgressDialog (progress, tr ("Checking files ..."), this);
-        if (progress.GetCanceled())
-            return;
-        if (!progress.isOk() || progress.GetResultCode() != 0)
-        {
-            vboxProblem().cannotCheckFiles (progress, this);
-            return;
-        }
-    }
-    QVector<QString> exists = explorer.Exists (files);
-    /* Check if the file exists already, if yes get confirmation for
-     * overwriting from the user. */
-    if (!vboxProblem().askForOverridingFiles (exists, this))
-        return;
-    /* Ok all is confirmed so delete all the files which exists */
-    if (!exists.isEmpty())
-    {
-        CProgress progress1 = explorer.Remove (exists);
-        fResult = explorer.isOk();
-        if (fResult)
-        {
-            /* Show some progress, so the user know whats going on */
-            vboxProblem().showModalProgressDialog (progress1, tr ("Removing files ..."), this);
-            if (progress1.GetCanceled())
-                return;
-            if (!progress1.isOk() || progress1.GetResultCode() != 0)
-            {
-                vboxProblem().cannotRemoveFiles (progress1, this);
-                return;
-            }
-        }
-    }
-    /* Export the VMs, on success we are finished */
-    if (exportVMs (*appliance))
-    {
-//        vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_Export_StorageType, QString::number(currentStorageType()));
-//        vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_Export_Username, mLeUsername->text());
-//        vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_Export_Hostname, mLeHostname->text());
-//        vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_Export_Bucket, mLeBucket->text());
-        QIAbstractWizard::accept();
-    }
-}
-
-void VBoxExportApplianceWzd::showNextPage()
-{
-    /* We propose a filename the first time the second page is displayed */
-    if (sender() == mBtnNext1)
-    {
-        prepareSettingsWidget();
-    }
-    else if (sender() == mBtnNext3)
-    {
-        storageTypeChanged();
-        if (mFileSelector->path().isEmpty())
-        {
-            /* Set the default filename */
-            QString name = mDefaultApplianceName;
-            /* If it is one VM only, we use the VM name as file name */
-            if (mVMListWidget->selectedItems().size() == 1)
-                name = mVMListWidget->selectedItems().first()->text();
-
-            name += ".ovf";
-
-            if (currentStorageType() == Filesystem)
-                name = QDir::toNativeSeparators (QString ("%1/%2").arg (vboxGlobal().documentsPath())
-                                                 .arg (name));
-            mFileSelector->setPath (name);
-            mWValFileSelector->revalidate();
-        }
-        mExportSettingsWgt->prepareExport();
-    }
-
-    QIAbstractWizard::showNextPage();
-}
-
-void VBoxExportApplianceWzd::onPageShow()
-{
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mTargetOptionsPage)
-        finishButton()->setDefault (true);
-    else
-        nextButton (page)->setDefault (true);
-}
-
-void VBoxExportApplianceWzd::addListViewVMItems (const QString& aSelectName)
-{
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-    CMachineVector vec = vbox.GetMachines();
-    for (CMachineVector::ConstIterator m = vec.begin();
-         m != vec.end(); ++ m)
-    {
-        QPixmap icon;
-        QString name;
-        QString uuid;
-        bool enabled;
-        if (m->GetAccessible())
-        {
-            icon = vboxGlobal().vmGuestOSTypeIcon (m->GetOSTypeId()).scaled (16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-            name = m->GetName();
-            uuid = m->GetId();
-            enabled = m->GetSessionState() == KSessionState_Closed;
-        }
-        else
-        {
-            QString settingsFile = m->GetSettingsFilePath();
-            QFileInfo fi (settingsFile);
-            name = fi.completeSuffix().toLower() == "xml" ?
-                   fi.completeBaseName() : fi.fileName();
-            icon = QPixmap (":/os_other.png").scaled (16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-            enabled = false;
-        }
-        QListWidgetItem *item = new VMListWidgetItems (icon, name, mVMListWidget);
-        item->setData (Qt::UserRole, uuid);
-        if (!enabled)
-            item->setFlags (0);
-        mVMListWidget->addItem (item);
-    }
-    mVMListWidget->sortItems();
-
-    /* Make sure aSelectName is initial selected in the list */
-    QList<QListWidgetItem *> list = mVMListWidget->findItems (aSelectName, Qt::MatchExactly);
-    if (list.size() > 0)
-        mVMListWidget->setCurrentItem (list.first());
-}
-
-bool VBoxExportApplianceWzd::prepareSettingsWidget()
-{
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-    CAppliance *appliance = mExportSettingsWgt->init();
-    bool fResult = appliance->isOk();
-    if (fResult)
-    {
-        /* Iterate over all selected items */
-        QList<QListWidgetItem *> list = mVMListWidget->selectedItems();
-        foreach (const QListWidgetItem* item, list)
-        {
-            /* The VM uuid can be fetched by the UserRole */
-            QString uuid = item->data (Qt::UserRole).toString();
-            /* Get the machine with the uuid */
-            CMachine m = vbox.GetMachine (uuid);
-            fResult = m.isOk();
-            if (fResult)
-            {
-                /* Add the export description to our appliance object */
-                CVirtualSystemDescription vsd = m.Export (*appliance);
-                fResult = m.isOk();
-                if (!fResult)
-                {
-                    vboxProblem().cannotExportAppliance (m, appliance, this);
-                    return false;
-                }
-                /* Now add some new fields the user may change */
-                vsd.AddDescription (KVirtualSystemDescriptionType_Product, "", "");
-                vsd.AddDescription (KVirtualSystemDescriptionType_ProductUrl, "", "");
-                vsd.AddDescription (KVirtualSystemDescriptionType_Vendor, "", "");
-                vsd.AddDescription (KVirtualSystemDescriptionType_VendorUrl, "", "");
-                vsd.AddDescription (KVirtualSystemDescriptionType_Version, "", "");
-                vsd.AddDescription (KVirtualSystemDescriptionType_License, "", "");
-            }
-            else
-                break;
-        }
-        /* Make sure the settings widget get the new descriptions */
-        mExportSettingsWgt->populate();
-    }
-    if (!fResult)
-        vboxProblem().cannotExportAppliance (appliance, this);
-    return fResult;
-}
-
-bool VBoxExportApplianceWzd::exportVMs (CAppliance &aAppliance)
-{
-    /* Write the appliance */
-    QString version = mSelectOVF09->isChecked() ? "ovf-0.9" : "ovf-1.0";
-    CProgress progress = aAppliance.Write (version, uri());
-    bool fResult = aAppliance.isOk();
-    if (fResult)
-    {
-        /* Show some progress, so the user know whats going on */
-        vboxProblem().showModalProgressDialog (progress, tr ("Exporting Appliance ..."), this);
-        if (progress.GetCanceled())
-            return false;
-        if (!progress.isOk() || progress.GetResultCode() != 0)
-        {
-            vboxProblem().cannotExportAppliance (progress, &aAppliance, this);
-            return false;
-        }
-        else
-            return true;
-    }
-    if (!fResult)
-        vboxProblem().cannotExportAppliance (&aAppliance, this);
-    return false;
-}
-
-QString VBoxExportApplianceWzd::uri() const
-{
-    if (currentStorageType() == Filesystem)
-        return mFileSelector->path();
-    else if (currentStorageType() == SunCloud)
-    {
-        QString uri ("SunCloud://");
-        if (!mLeUsername->text().isEmpty())
-            uri = QString ("%1%2").arg (uri).arg (mLeUsername->text());
-        if (!mLePassword->text().isEmpty())
-            uri = QString ("%1:%2").arg (uri).arg (mLePassword->text());
-        if (!mLeUsername->text().isEmpty() ||
-            !mLePassword->text().isEmpty())
-            uri = QString ("%1@").arg (uri);
-        uri = QString ("%1%2/%3/%4").arg (uri).arg ("object.storage.network.com").arg (mLeBucket->text()).arg (mFileSelector->path());
-        return uri;
-    }
-    else if (currentStorageType() == S3)
-    {
-        QString uri ("S3://");
-        if (!mLeUsername->text().isEmpty())
-            uri = QString ("%1%2").arg (uri).arg (mLeUsername->text());
-        if (!mLePassword->text().isEmpty())
-            uri = QString ("%1:%2").arg (uri).arg (mLePassword->text());
-        if (!mLeUsername->text().isEmpty() ||
-            !mLePassword->text().isEmpty())
-            uri = QString ("%1@").arg (uri);
-        uri = QString ("%1%2/%3/%4").arg (uri).arg (mLeHostname->text()).arg (mLeBucket->text()).arg (mFileSelector->path());
-        return uri;
-    }
-    return "";
-}
-
-VBoxExportApplianceWzd::StorageType VBoxExportApplianceWzd::currentStorageType() const
-{
-    if (mRBtnLocalFileSystem->isChecked())
-        return Filesystem;
-    else if (mRBtnSunCloud->isChecked())
-        return SunCloud;
-    else
-        return S3;
-}
-
-void VBoxExportApplianceWzd::storageTypeChanged()
-{
-    StorageType type = currentStorageType();
-    switch (type)
-    {
-        case Filesystem:
-        {
-            mTextTargetOptions->setText (mExportToFileSystemDesc);
-            mLblUsername->setVisible (false);
-            mLeUsername->setVisible (false);
-            mLblPassword->setVisible (false);
-            mLePassword->setVisible (false);
-            mLblHostname->setVisible (false);
-            mLeHostname->setVisible (false);
-            mLblBucket->setVisible (false);
-            mLeBucket->setVisible (false);
-            mSelectOVF09->setVisible (true);
-            mFileSelector->setChooserVisible (true);
-            mFileSelector->setFocus();
-            break;
-        };
-        case SunCloud:
-        {
-            mTextTargetOptions->setText (mExportToSunCloudDesc);
-            mLblUsername->setVisible (true);
-            mLeUsername->setVisible (true);
-            mLblPassword->setVisible (true);
-            mLePassword->setVisible (true);
-            mLblHostname->setVisible (false);
-            mLeHostname->setVisible (false);
-            mLblBucket->setVisible (true);
-            mLeBucket->setVisible (true);
-            mSelectOVF09->setVisible (false);
-            mSelectOVF09->setChecked (false);
-            mFileSelector->setChooserVisible (false);
-            mLeUsername->setFocus();
-            break;
-        };
-        case S3:
-        {
-            mTextTargetOptions->setText (mExportToS3Desc);
-            mLblUsername->setVisible (true);
-            mLeUsername->setVisible (true);
-            mLblPassword->setVisible (true);
-            mLePassword->setVisible (true);
-            mLblHostname->setVisible (true);
-            mLeHostname->setVisible (true);
-            mLblBucket->setVisible (true);
-            mLeBucket->setVisible (true);
-            mSelectOVF09->setVisible (true);
-            mFileSelector->setChooserVisible (false);
-            mLeUsername->setFocus();
-            break;
-        };
-    }
-
-    if (!mFileSelector->path().isEmpty())
-    {
-        QFileInfo fi (mFileSelector->path());
-        QString name = fi.fileName();
-        if (type == Filesystem)
-            name = QDir::toNativeSeparators (QString ("%1/%2").arg (vboxGlobal().documentsPath())
-                                             .arg (name));
-        mFileSelector->setPath (name);
-    }
-}
-
-void VBoxExportApplianceWzd::setCurrentStorageType (VBoxExportApplianceWzd::StorageType aType)
-{
-    switch (aType)
-    {
-        case Filesystem: mRBtnLocalFileSystem->setChecked(true); mRBtnLocalFileSystem->setFocus(); break;
-        case SunCloud: mRBtnSunCloud->setChecked(true); mRBtnSunCloud->setFocus(); break;
-        case S3: mRBtnS3->setChecked(true); mRBtnS3->setFocus(); break;
-    }
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/VBoxExportApplianceWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/VBoxExportApplianceWzd.h	(revision 26078)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxExportApplianceWzd class declaration
- */
-
-/*
- * Copyright (C) 2009 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __VBoxExportApplianceWzd_h__
-#define __VBoxExportApplianceWzd_h__
-
-#include "VBoxExportApplianceWzd.gen.h"
-#include "QIAbstractWizard.h"
-#include "QIWithRetranslateUI.h"
-
-class QIWidgetValidator;
-class CAppliance;
-
-class VBoxExportApplianceWzd : public QIWithRetranslateUI<QIAbstractWizard>,
-                               public Ui::VBoxExportApplianceWzd
-{
-    Q_OBJECT;
-
-    enum StorageType
-    {
-        Filesystem,
-        SunCloud,
-        S3
-    };
-
-
-public:
-    VBoxExportApplianceWzd (QWidget* aParent = NULL, const QString& aSelectName = QString::null);
-
-protected:
-    void retranslateUi();
-
-private slots:
-    void revalidate (QIWidgetValidator *aWval);
-    void enableNext (const QIWidgetValidator *aWval);
-
-    void accept();
-
-    void showNextPage();
-    void onPageShow();
-
-private:
-    void addListViewVMItems (const QString& aSelectName);
-    bool prepareSettingsWidget();
-    bool exportVMs (CAppliance &aAppliance);
-    QString uri() const;
-    StorageType currentStorageType() const;
-    void setCurrentStorageType(VBoxExportApplianceWzd::StorageType aType);
-
-    void storageTypeChanged();
-
-    /* Private member vars */
-    QString mDefaultApplianceName;
-
-    QIWidgetValidator *mWValVMSelector;
-    QIWidgetValidator *mWValFileSelector;
-
-    QString mExportToFileSystemDesc;
-    QString mExportToSunCloudDesc;
-    QString mExportToS3Desc;
-};
-
-#endif /* __VBoxExportApplianceWzd_h__ */
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/VBoxExportApplianceWzd.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/VBoxExportApplianceWzd.ui	(revision 26078)
+++ 	(revision )
@@ -1,806 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
-
-     Copyright (C) 2009 Sun Microsystems, Inc.
-
-     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.
-
-     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-     Clara, CA 95054 USA or visit http://www.sun.com if you need
-     additional information or have any questions.
- </comment>
- <class>VBoxExportApplianceWzd</class>
- <widget class="QWidget" name="VBoxExportApplianceWzd">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>556</width>
-    <height>452</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Appliance Export Wizard</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QStackedWidget" name="mPageStack">
-     <property name="currentIndex">
-      <number>2</number>
-     </property>
-     <widget class="QWidget" name="mVMSelectPage">
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <widget class="QLabel" name="mPageWelcomeHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Welcome to the Appliance Export Wizard!</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line11">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QGridLayout" name="gridLayout">
-         <item row="0" column="0" rowspan="3">
-          <widget class="QLabel" name="mLogoWelcome">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_ovf_import.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QILabel" name="mTextWelcome">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>300</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body&gt;
-&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This wizard will guide you through the process of exporting an appliance. &lt;/p&gt;
-&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Use the &lt;span style=&quot; font-weight:600;&quot;&gt;Next&lt;/span&gt; button to go the next page of the wizard and the &lt;span style=&quot; font-weight:600;&quot;&gt;Back&lt;/span&gt; button to return to the previous page.&lt;/p&gt;
-&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Please select the virtual machines that you wish to the appliance. You can select more than one. Please note that these machines have to be turned off before they can be exported.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QListWidget" name="mVMListWidget"/>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line12">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="_2">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack1">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext1">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel1">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mVMSettingsPage">
-      <layout class="QVBoxLayout" name="verticalLayout_4">
-       <item>
-        <widget class="QLabel" name="mPageSettingsHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Appliance Export Settings</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21_2">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QGridLayout" name="gridLayout_3">
-         <item row="0" column="0" rowspan="2">
-          <widget class="QLabel" name="mLogoSettings">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_ovf_import.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QILabel" name="mTextSettings">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>300</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>Here you can change additional configuration values of the selected virtual machines. You can modify most of the properties shown by double-clicking on the items.</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="VBoxExportApplianceWgt" name="mExportSettingsWgt" native="true">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="baseSize">
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22_2">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="_4">
-         <item>
-          <widget class="QPushButton" name="mBtnRestore">
-           <property name="text">
-            <string>Restore Defaults</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack2">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext2">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel2">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mTargetSelectPage">
-      <layout class="QVBoxLayout" name="verticalLayout_6">
-       <item>
-        <widget class="QLabel" name="mPageTargetSelectHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Appliance Export Settings</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21_3">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QGridLayout" name="gridLayout_5">
-         <item row="0" column="0" rowspan="2">
-          <widget class="QLabel" name="mLogoTargetSelect">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_ovf_import.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QILabel" name="mTextTargetSelect">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>300</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>Please specify the target for the OVF export. You can choose between a local file system export, uploading the OVF to the Sun Cloud service or an S3 storage server.</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <layout class="QVBoxLayout" name="verticalLayout_5">
-           <item>
-            <widget class="QRadioButton" name="mRBtnLocalFileSystem">
-             <property name="text">
-              <string>&amp;Local Filesystem </string>
-             </property>
-             <property name="checked">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="mRBtnSunCloud">
-             <property name="text">
-              <string>Sun &amp;Cloud</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QRadioButton" name="mRBtnS3">
-             <property name="text">
-              <string>&amp;Simple Storage System (S3)</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="verticalSpacer">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22_3">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="_6">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack3">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext3">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel3">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mTargetOptionsPage">
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QLabel" name="mPageTargetOptionsHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Appliance Export Settings</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QGridLayout" name="gridLayout_4">
-         <item row="0" column="0" rowspan="4">
-          <widget class="QLabel" name="mLogoTargetOptions">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_ovf_import.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QILabel" name="mTextTargetOptions">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>300</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <layout class="QGridLayout" name="gridLayout_2">
-           <item row="0" column="0">
-            <widget class="QLabel" name="mLblUsername">
-             <property name="text">
-              <string>&amp;Username:</string>
-             </property>
-             <property name="buddy">
-              <cstring>mLeUsername</cstring>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="1">
-            <widget class="QLineEdit" name="mLeUsername"/>
-           </item>
-           <item row="1" column="0">
-            <widget class="QLabel" name="mLblPassword">
-             <property name="text">
-              <string>&amp;Password:</string>
-             </property>
-             <property name="buddy">
-              <cstring>mLePassword</cstring>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <widget class="QLineEdit" name="mLePassword">
-             <property name="echoMode">
-              <enum>QLineEdit::Password</enum>
-             </property>
-            </widget>
-           </item>
-           <item row="3" column="1">
-            <widget class="QLineEdit" name="mLeBucket"/>
-           </item>
-           <item row="5" column="0">
-            <widget class="QLabel" name="mLblFile">
-             <property name="text">
-              <string>&amp;File:</string>
-             </property>
-             <property name="buddy">
-              <cstring>mFileSelector</cstring>
-             </property>
-            </widget>
-           </item>
-           <item row="5" column="1">
-            <widget class="VBoxEmptyFileSelector" name="mFileSelector" native="true"/>
-           </item>
-           <item row="3" column="0">
-            <widget class="QLabel" name="mLblBucket">
-             <property name="text">
-              <string>&amp;Bucket:</string>
-             </property>
-             <property name="buddy">
-              <cstring>mLeBucket</cstring>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0">
-            <widget class="QLabel" name="mLblHostname">
-             <property name="text">
-              <string>&amp;Hostname:</string>
-             </property>
-             <property name="buddy">
-              <cstring>mLeHostname</cstring>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="1">
-            <widget class="QLineEdit" name="mLeHostname"/>
-           </item>
-          </layout>
-         </item>
-         <item row="2" column="1">
-          <widget class="QCheckBox" name="mSelectOVF09">
-           <property name="toolTip">
-            <string>Write in legacy OVF 0.9 format for compatibility with other virtualization products.</string>
-           </property>
-           <property name="text">
-            <string>&amp;Write legacy OVF 0.9</string>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="1">
-          <spacer name="spacer">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>415</width>
-             <height>46</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="_3">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack4">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnFinish">
-           <property name="text">
-            <string>&amp;Export &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel4">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxEmptyFileSelector</class>
-   <extends>QWidget</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxExportApplianceWgt</class>
-   <extends>QWidget</extends>
-   <header>VBoxExportApplianceWgt.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>mVMListWidget</tabstop>
-  <tabstop>mBtnBack1</tabstop>
-  <tabstop>mBtnNext1</tabstop>
-  <tabstop>mBtnCancel1</tabstop>
-  <tabstop>mTargetOptionsPage</tabstop>
-  <tabstop>mBtnRestore</tabstop>
-  <tabstop>mBtnBack2</tabstop>
-  <tabstop>mBtnNext2</tabstop>
-  <tabstop>mBtnCancel2</tabstop>
-  <tabstop>mLeUsername</tabstop>
-  <tabstop>mLePassword</tabstop>
-  <tabstop>mLeHostname</tabstop>
-  <tabstop>mLeBucket</tabstop>
-  <tabstop>mFileSelector</tabstop>
-  <tabstop>mSelectOVF09</tabstop>
-  <tabstop>mBtnBack4</tabstop>
-  <tabstop>mBtnFinish</tabstop>
-  <tabstop>mBtnCancel4</tabstop>
- </tabstops>
- <resources>
-  <include location="../VirtualBox1.qrc"/>
- </resources>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp	(revision 26079)
@@ -0,0 +1,324 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIFirstRunWzd class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Local includes */
+#include "UIFirstRunWzd.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "VBoxMediaManagerDlg.h"
+#include "VBoxVMSettingsHD.h"
+
+UIFirstRunWzd::UIFirstRunWzd(QWidget *pParent, const CMachine &machine) : QIWizard(pParent)
+{
+    /* Create & add pages */
+    UIFirstRunWzdPage1 *pPage1 = new UIFirstRunWzdPage1;
+    UIFirstRunWzdPage2 *pPage2 = new UIFirstRunWzdPage2;
+    UIFirstRunWzdPage3 *pPage3 = new UIFirstRunWzdPage3;
+
+    addPage(pPage1);
+    addPage(pPage2);
+    addPage(pPage3);
+
+    /* Set 'machine' field value for page 3 */
+    setField("machine", QVariant::fromValue(machine));
+
+    /* Init pages basing on machine set */
+    pPage1->init();
+    pPage2->init();
+    pPage3->init();
+
+    /* Translate */
+    retranslateUi();
+
+    /* Resize to 'golden ratio' */
+    resizeToGoldenRatio();
+
+    /* Assign watermark */
+    assignWatermark(":/vmw_new_welcome.png");
+}
+
+void UIFirstRunWzd::retranslateUi()
+{
+    /* Wizard title */
+    setWindowTitle(tr("First Run Wizard"));
+}
+
+UIFirstRunWzdPage1::UIFirstRunWzdPage1()
+{
+    /* Decorate page */
+    Ui::UIFirstRunWzdPage1::setupUi(this);
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIFirstRunWzdPage1::init()
+{
+    /* Current machine */
+    CMachine machine = field("machine").value<CMachine>();
+    AssertMsg(!machine.isNull(), ("Field 'machine' must be set!\n"));
+
+    /* Hide unnecessary text labels */
+    CMediumAttachment hda = machine.GetMediumAttachment(VBoxVMSettingsHD::tr("IDE Controller"), 0, 0);
+    m_pPage1Text1Var1->setHidden(hda.isNull());
+    m_pPage1Text1Var2->setHidden(!hda.isNull());
+}
+
+void UIFirstRunWzdPage1::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIFirstRunWzdPage1::retranslateUi(this);
+
+    /* Wizard page 1 title */
+    setTitle(tr("Welcome to the First Run Wizard!"));
+}
+
+UIFirstRunWzdPage2::UIFirstRunWzdPage2()
+{
+    /* Decorate page */
+    Ui::UIFirstRunWzdPage2::setupUi(this);
+
+    /* Register KStorageBus class */
+    qRegisterMetaType<KStorageBus>();
+
+    /* Register 'type', 'description', 'source', 'id' fields! */
+    registerField("bus", this, "bus");
+    registerField("description", this, "description");
+    registerField("source", this, "source");
+    registerField("id", this, "id");
+
+    /* Setup contents */
+    m_pSelectMediaButton->setIcon(VBoxGlobal::iconSet(":/select_file_16px.png", ":/select_file_dis_16px.png"));
+
+    /* Setup connections */
+    connect (m_pTypeCD, SIGNAL(clicked()), this, SLOT(sltMediumChanged()));
+    connect (m_pTypeFD, SIGNAL(clicked()), this, SLOT(sltMediumChanged()));
+    connect (m_pMediaSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(sltMediumChanged()));
+    connect (m_pSelectMediaButton, SIGNAL(clicked()), this, SLOT(sltOpenVirtualMediaManager()));
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIFirstRunWzdPage2::init()
+{
+    /* Current machine */
+    CMachine machine = field("machine").value<CMachine>();
+    AssertMsg(!machine.isNull(), ("Field 'machine' must be set!\n"));
+
+    /* Hide unnecessary text labels */
+    CMediumAttachment hda = machine.GetMediumAttachment(VBoxVMSettingsHD::tr("IDE Controller"), 0, 0);
+    m_pPage2Text1Var1->setHidden(hda.isNull());
+    m_pPage2Text1Var2->setHidden(!hda.isNull());
+    m_pPage2Text2Var1->setHidden(hda.isNull());
+    m_pPage2Text2Var2->setHidden(!hda.isNull());
+
+    /* Assign selector machine */
+    m_pMediaSelector->setMachineId(machine.GetId());
+}
+
+void UIFirstRunWzdPage2::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIFirstRunWzdPage2::retranslateUi(this);
+
+    /* Wizard page 2 title */
+    setTitle(tr("Select Installation Media"));
+}
+
+void UIFirstRunWzdPage2::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Initial choice */
+    m_pTypeCD->click();
+    m_pMediaSelector->setCurrentIndex(0);
+
+    /* CD button should initially have focus */
+    m_pTypeCD->isChecked();
+}
+
+bool UIFirstRunWzdPage2::isComplete() const
+{
+    return !vboxGlobal().findMedium(field("id").toString()).isNull();
+}
+
+void UIFirstRunWzdPage2::sltMediumChanged()
+{
+    /* Update data */
+    if (m_pTypeCD->isChecked())
+    {
+        if (m_pMediaSelector->type() != VBoxDefs::MediumType_DVD)
+        {
+            m_pMediaSelector->setType(VBoxDefs::MediumType_DVD);
+            m_pMediaSelector->repopulate();
+        }
+        m_Bus = KStorageBus_IDE;
+        m_strDescription = VBoxGlobal::removeAccelMark(m_pTypeCD->text());
+        m_strSource = m_pMediaSelector->currentText();
+        m_strId = m_pMediaSelector->id();
+    }
+    else if (m_pTypeFD->isChecked())
+    {
+        if (m_pMediaSelector->type() != VBoxDefs::MediumType_Floppy)
+        {
+            m_pMediaSelector->setType(VBoxDefs::MediumType_Floppy);
+            m_pMediaSelector->repopulate();
+        }
+        m_Bus = KStorageBus_Floppy;
+        m_strDescription = VBoxGlobal::removeAccelMark(m_pTypeFD->text());
+        m_strSource = m_pMediaSelector->currentText();
+        m_strId = m_pMediaSelector->id();
+    }
+    else
+    {
+        m_Bus = KStorageBus_Null;
+        m_strDescription.clear();
+        m_strSource.clear();
+        m_strId.clear();
+    }
+
+    emit completeChanged();
+}
+
+void UIFirstRunWzdPage2::sltOpenVirtualMediaManager()
+{
+    /* Create & open VMM */
+    VBoxMediaManagerDlg dlg(this);
+    dlg.setup(m_pMediaSelector->type(), true /* aDoSelect */);
+    if (dlg.exec() == QDialog::Accepted)
+        m_pMediaSelector->setCurrentItem(dlg.selectedId());
+}
+
+UIFirstRunWzdPage3::UIFirstRunWzdPage3()
+{
+    /* Decorate page */
+    Ui::UIFirstRunWzdPage3::setupUi(this);
+
+    /* Register CMachine class */
+    qRegisterMetaType<CMachine>();
+
+    /* Register 'machine' field */
+    registerField("machine", this, "machine");
+
+    /* Disable the background painting of the summary widget */
+    m_pSummaryText->viewport()->setAutoFillBackground (false);
+    /* Make the summary field read-only */
+    m_pSummaryText->setReadOnly (true);
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIFirstRunWzdPage3::init()
+{
+    /* Current machine */
+    CMachine machine = field("machine").value<CMachine>();
+    AssertMsg(!machine.isNull(), ("Field 'machine' must be set!\n"));
+
+    /* Hide unnecessary text labels */
+    CMediumAttachment hda = machine.GetMediumAttachment(VBoxVMSettingsHD::tr("IDE Controller"), 0, 0);
+    m_pPage3Text1Var1->setHidden(hda.isNull());
+    m_pPage3Text1Var2->setHidden(!hda.isNull());
+    m_pPage3Text2Var1->setHidden(hda.isNull());
+    m_pPage3Text2Var2->setHidden(!hda.isNull());
+}
+
+void UIFirstRunWzdPage3::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIFirstRunWzdPage3::retranslateUi(this);
+
+    /* Wizard page 3 title */
+    setTitle(tr("Summary"));
+
+    /* Compose common summary */
+    QString summary;
+
+    QString description = field("description").toString();
+    QString source = field("source").toString();
+
+    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>"
+    )
+    .arg (tr("Type", "summary"), description)
+    .arg (tr("Source", "summary"), source)
+    ;
+    /* Feat summary to 3 lines */
+    setSummaryFieldLinesNumber(m_pSummaryText, 2);
+
+    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>");
+}
+
+void UIFirstRunWzdPage3::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Summary should initially have focus */
+    m_pSummaryText->setFocus();
+}
+
+void UIFirstRunWzdPage3::cleanupPage()
+{
+    /* Do not call superclass method! */
+}
+
+bool UIFirstRunWzdPage3::validatePage()
+{
+    return insertDevice();
+}
+
+bool UIFirstRunWzdPage3::insertDevice()
+{
+    /* Composing default controller name */
+    KStorageBus bus = field("bus").value<KStorageBus>();
+    QString mediumId = field("id").toString();
+    LONG port = bus == KStorageBus_IDE ? 1 : 0;
+    LONG device = 0;
+    QString name;
+    /* Search for the first controller of the given type */
+    QVector<CStorageController> controllers = m_Machine.GetStorageControllers();
+    foreach (CStorageController controller, controllers)
+    {
+        if (controller.GetBus() == bus)
+        {
+            name = controller.GetName();
+            break;
+        }
+    }
+    Assert (!name.isEmpty());
+
+    /* Mount medium to the predefined port/device */
+    m_Machine.MountMedium(name, port, device, mediumId, false /* force */);
+    if (m_Machine.isOk())
+        return true;
+    else
+    {
+        vboxProblem().cannotRemountMedium(this, m_Machine, vboxGlobal().findMedium(mediumId),
+                                          true /* mount? */, false /* retry? */);
+        return false;
+    }
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.h	(revision 26079)
@@ -0,0 +1,140 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIFirstRunWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __UIFirstRunWzd_h__
+#define __UIFirstRunWzd_h__
+
+/* Local includes */
+#include "QIWizard.h"
+#include "COMDefs.h"
+
+/* Generated includes */
+#include "UIFirstRunWzdPage1.gen.h"
+#include "UIFirstRunWzdPage2.gen.h"
+#include "UIFirstRunWzdPage3.gen.h"
+
+class UIFirstRunWzd : public QIWizard
+{
+    Q_OBJECT;
+
+public:
+
+    UIFirstRunWzd(QWidget *pParent, const CMachine &machine);
+
+protected:
+
+    void retranslateUi();
+};
+
+class UIFirstRunWzdPage1 : public QIWizardPage, public Ui::UIFirstRunWzdPage1
+{
+    Q_OBJECT;
+
+public:
+
+    UIFirstRunWzdPage1();
+
+    void init();
+
+protected:
+
+    void retranslateUi();
+};
+
+class UIFirstRunWzdPage2 : public QIWizardPage, public Ui::UIFirstRunWzdPage2
+{
+    Q_OBJECT;
+    Q_PROPERTY(KStorageBus bus READ bus WRITE setBus);
+    Q_PROPERTY(QString description READ description WRITE setDescription);
+    Q_PROPERTY(QString source READ source WRITE setSource);
+    Q_PROPERTY(QString id READ id WRITE setId);
+
+public:
+
+    UIFirstRunWzdPage2();
+
+    void init();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+
+    bool isComplete() const;
+
+private slots:
+
+    void sltMediumChanged();
+    void sltOpenVirtualMediaManager();
+
+private:
+
+    KStorageBus bus() const { return m_Bus; }
+    void setBus(KStorageBus bus) { m_Bus = bus; }
+    KStorageBus m_Bus;
+
+    QString description() const { return m_strDescription; }
+    void setDescription(const QString &strDescription) { m_strDescription = strDescription; }
+    QString m_strDescription;
+
+    QString source() const { return m_strSource; }
+    void setSource(const QString &strSource) { m_strSource = strSource; }
+    QString m_strSource;
+
+    QString id() const { return m_strId; }
+    void setId(const QString &strId) { m_strId = strId; }
+    QString m_strId;
+};
+
+class UIFirstRunWzdPage3 : public QIWizardPage, public Ui::UIFirstRunWzdPage3
+{
+    Q_OBJECT;
+    Q_PROPERTY(CMachine machine READ machine WRITE setMachine);
+
+public:
+
+    UIFirstRunWzdPage3();
+
+    void init();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+    void cleanupPage();
+
+    bool validatePage();
+
+private:
+
+    bool insertDevice();
+
+    CMachine machine() const { return m_Machine; }
+    void setMachine(CMachine &machine) { m_Machine = machine; }
+    CMachine m_Machine;
+};
+
+Q_DECLARE_METATYPE(CMachine);
+
+#endif // __UIFirstRunWzd_h__
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage1.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage1.ui	(revision 26079)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIFirstRunWzdPage1</class>
+ <widget class="QWidget" name="UIFirstRunWzdPage1">
+  <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_pPage1Text1Var1">
+     <property name="text">
+      <string>&lt;p&gt;You have started a newly created virtual machine for the first time. This wizard will help you to perform the steps necessary for installing an operating system of your choice onto this virtual machine.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go to the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page. You can also press &lt;b&gt;Cancel&lt;/b&gt; if you want to cancel the execution of this wizard.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage1Text1Var2">
+     <property name="text">
+      <string>&lt;p&gt;You have started a newly created virtual machine for the first time. This wizard will help you to perform the steps necessary for booting an operating system of your choice on the virtual machine.&lt;/p&gt;&lt;p&gt;Note that you will not be able to install an operating system into this virtual machine right now because you did not attach any hard disk to it. If this is not what you want, you can cancel the execution of this wizard, select &lt;b&gt;Settings&lt;/b&gt; from the &lt;b&gt;Machine&lt;/b&gt; menu of the main VirtualBox window to access the settings dialog of this machine and change the hard disk configuration.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go to the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page. You can also press &lt;b&gt;Cancel&lt;/b&gt; if you want to cancel the execution of this wizard.&lt;/p&gt;</string>
+     </property>
+     <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/firstrun/UIFirstRunWzdPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage2.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage2.ui	(revision 26079)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIFirstRunWzdPage2</class>
+ <widget class="QWidget" name="UIFirstRunWzdPage2">
+  <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_pPage2Text1Var1">
+     <property name="text">
+      <string>&lt;p&gt;Select the type of media you would like to use for installation.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage2Text1Var2">
+     <property name="text">
+      <string>&lt;p&gt;Select the type of media you would like to use for booting an operating system.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pCntType">
+     <property name="title">
+      <string>Media Type</string>
+     </property>
+     <layout class="QVBoxLayout" name="m_pLayout2">
+      <item>
+       <widget class="QRadioButton" name="m_pTypeCD">
+        <property name="text">
+         <string>&amp;CD/DVD-ROM Device</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="m_pTypeFD">
+        <property name="text">
+         <string>&amp;Floppy Device</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage2Text2Var1">
+     <property name="text">
+      <string>&lt;p&gt;Select the media which contains the setup program of the operating system you want to install. This media must be bootable, otherwise the setup program will not be able to start.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage2Text2Var2">
+     <property name="text">
+      <string>&lt;p&gt;Select the media that contains the operating system you want to work with. This media must be bootable, otherwise the operating system will not be able to start.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pCntSource">
+     <property name="title">
+      <string>Media Source</string>
+     </property>
+     <layout class="QHBoxLayout" name="m_pLayout3">
+      <item>
+       <widget class="VBoxMediaComboBox" name="m_pMediaSelector"/>
+      </item>
+      <item>
+       <widget class="QToolButton" name="m_pSelectMediaButton">
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer1">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>62</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxMediaComboBox</class>
+   <extends>QComboBox</extends>
+   <header>VBoxMediaComboBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage3.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage3.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage3.ui	(revision 26079)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIFirstRunWzdPage3</class>
+ <widget class="QWidget" name="UIFirstRunWzdPage3">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>600</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_pPage3Text1Var1">
+     <property name="text">
+      <string>&lt;p&gt;You have selected the following media to boot from:&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage3Text1Var2">
+     <property name="text">
+      <string>&lt;p&gt;You have selected the following media to boot an operating system from:&lt;/p&gt;</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_pPage3Text2Var1">
+     <property name="text">
+      <string>&lt;p&gt;If the above is correct, press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, the selected media will be temporarily mounted on the virtual machine and the machine will start execution.&lt;/p&gt;&lt;p&gt;Please note that when you close the virtual machine, the specified media will be automatically unmounted and the boot device will be set back to the first hard disk.&lt;/p&gt;&lt;p&gt;Depending on the type of the setup program, you may need to manually unmount (eject) the media after the setup program reboots the virtual machine, to prevent the installation process from starting again. You can do this by selecting the corresponding &lt;b&gt;Unmount...&lt;/b&gt; action in the &lt;b&gt;Devices&lt;/b&gt; menu.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage3Text2Var2">
+     <property name="text">
+      <string>&lt;p&gt;If the above is correct, press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, the selected media will be mounted on the virtual machine and the machine will start execution.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="m_pSpacer1">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>117</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/firstrun/VBoxVMFirstRunWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/VBoxVMFirstRunWzd.cpp	(revision 26078)
+++ 	(revision )
@@ -1,196 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxVMFirstRunWzd class implementation
- */
-
-/*
- * Copyright (C) 2008-2009 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-/* Local includes */
-#include "VBoxVMFirstRunWzd.h"
-#include "VBoxGlobal.h"
-#include "VBoxProblemReporter.h"
-#include "VBoxMediaManagerDlg.h"
-#include "QIWidgetValidator.h"
-
-VBoxVMFirstRunWzd::VBoxVMFirstRunWzd (const CMachine &aMachine, QWidget *aParent)
-    : QIWithRetranslateUI <QIAbstractWizard> (aParent)
-    , mValidator (0)
-    , mMachine (aMachine)
-{
-    /* Apply UI decorations */
-    Ui::VBoxVMFirstRunWzd::setupUi (this);
-
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
-    /* Hide unnecessary text labels */
-    CMediumAttachment hda = mMachine.GetMediumAttachment ("IDE Controller", 0, 0);
-    mTextWelcome1->setHidden (hda.isNull());
-    mTextType1->setHidden (hda.isNull());
-    mTextSource1->setHidden (hda.isNull());
-    mTextSummaryHdr1->setHidden (hda.isNull());
-    mTextSummaryFtr1->setHidden (hda.isNull());
-    mTextWelcome2->setHidden (!hda.isNull());
-    mTextType2->setHidden (!hda.isNull());
-    mTextSource2->setHidden (!hda.isNull());
-    mTextSummaryHdr2->setHidden (!hda.isNull());
-    mTextSummaryFtr2->setHidden (!hda.isNull());
-
-    /* Media page */
-    mCbMedia->setMachineId (mMachine.GetId());
-    mTbVmm->setIcon (VBoxGlobal::iconSet (":/select_file_16px.png", ":/select_file_dis_16px.png"));
-    mValidator = new QIWidgetValidator (mPageMedia, this);
-    connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator *)),
-             this, SLOT (enableNext (const QIWidgetValidator *)));
-    connect (mValidator, SIGNAL (isValidRequested (QIWidgetValidator *)),
-             this, SLOT (revalidate (QIWidgetValidator *)));
-    connect (mRbCdType, SIGNAL (clicked()), this, SLOT (mediaTypeChanged()));
-    connect (mRbFdType, SIGNAL (clicked()), this, SLOT (mediaTypeChanged()));
-    connect (mTbVmm, SIGNAL (clicked()), this, SLOT (openMediaManager()));
-    mRbCdType->animateClick();
-
-    /* Revalidate updated page */
-    mValidator->revalidate();
-
-    /* Initialize wizard ftr */
-    initializeWizardFtr();
-
-    retranslateUi();
-}
-
-void VBoxVMFirstRunWzd::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxVMFirstRunWzd::retranslateUi (this);
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mPageSummary)
-    {
-        /* Compose Summary */
-        QString type = mRbCdType->isChecked() ? tr ("CD/DVD-ROM Device") : tr ("Floppy Device");
-        QString source = mCbMedia->currentText();
-        QString summary = QString ("<table>"
-                                   "<tr><td>%1:&nbsp;</td><td>%2</td></tr>"
-                                   "<tr><td>%3:&nbsp;</td><td>%4</td></tr>"
-                                   "</table>")
-                                   .arg (tr ("Type", "summary"), type)
-                                   .arg (tr ("Source", "summary"), source);
-        mTeSummary->setText (summary);
-    }
-}
-
-void VBoxVMFirstRunWzd::accept()
-{
-    /* Composing default controller name */
-    KStorageBus ctrBus (mRbCdType->isChecked() ? KStorageBus_IDE : KStorageBus_Floppy);
-    LONG ctrPort = mRbCdType->isChecked() ? 1 : 0;
-    LONG ctrDevice = 0;
-    QString ctrName;
-    /* Search for the first controller of the given type */
-    QVector<CStorageController> ctrs = mMachine.GetStorageControllers();
-    foreach (CStorageController ctr, ctrs)
-    {
-        if (ctr.GetBus() == ctrBus)
-        {
-            ctrName = ctr.GetName();
-            break;
-        }
-    }
-    Assert (!ctrName.isEmpty());
-    /* Mount medium to the predefined port/device */
-    mMachine.MountMedium (ctrName, ctrPort, ctrDevice, mCbMedia->id(), false /* force */);
-    if (mMachine.isOk())
-        QIAbstractWizard::accept();
-    else
-        vboxProblem().cannotRemountMedium (this, mMachine, vboxGlobal().findMedium (mCbMedia->id()), true /* mount? */, false /* retry? */);
-}
-
-void VBoxVMFirstRunWzd::revalidate (QIWidgetValidator *aValidator)
-{
-    /* Do individual validations for pages */
-    QWidget *pg = aValidator->widget();
-    bool valid = aValidator->isOtherValid();
-
-    /* Allow to go to Summary only if non-null medium selected */
-    if (pg == mPageMedia)
-        valid = !vboxGlobal().findMedium (mCbMedia->id()).isNull();
-
-    aValidator->setOtherValid (valid);
-}
-
-void VBoxVMFirstRunWzd::mediaTypeChanged()
-{
-    /* CD/DVD media type selected */
-    if (sender() == mRbCdType)
-    {
-        /* Switch media combo-box type to CD/DVD */
-        mCbMedia->setType (VBoxDefs::MediumType_DVD);
-    }
-    /* Floppy media type selected */
-    else if (sender() == mRbFdType)
-    {
-        /* Switch media combo-box type to Floppy */
-        mCbMedia->setType (VBoxDefs::MediumType_Floppy);
-    }
-
-    /* Update the media combo-box */
-    mCbMedia->repopulate();
-
-    /* Revalidate updated page */
-    mValidator->revalidate();
-}
-
-void VBoxVMFirstRunWzd::openMediaManager()
-{
-    /* Create & open VMM */
-    VBoxMediaManagerDlg dlg (this);
-    dlg.setup (mCbMedia->type(), true /* aDoSelect */);
-    if (dlg.exec() == QDialog::Accepted)
-        mCbMedia->setCurrentItem (dlg.selectedId());
-
-    /* Revalidate updated page */
-    mValidator->revalidate();
-}
-
-void VBoxVMFirstRunWzd::enableNext (const QIWidgetValidator *aValidator)
-{
-    nextButton (aValidator->widget())->setEnabled (aValidator->isValid());
-}
-
-void VBoxVMFirstRunWzd::onPageShow()
-{
-    /* Make sure all is properly translated & composed */
-    retranslateUi();
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mPageWelcome)
-        nextButton (page)->setFocus();
-    else if (page == mPageMedia)
-        mRbCdType->isChecked() ? mRbCdType->setFocus() :
-                                 mRbFdType->setFocus();
-    else if (page == mPageSummary)
-        mTeSummary->setFocus();
-
-    if (page == mPageSummary)
-        finishButton()->setDefault (true);
-    else
-        nextButton (page)->setDefault (true);
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/VBoxVMFirstRunWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/VBoxVMFirstRunWzd.h	(revision 26078)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxVMFirstRunWzd class declaration
- */
-
-/*
- * Copyright (C) 2008-2009 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __VBoxVMFirstRunWzd_h__
-#define __VBoxVMFirstRunWzd_h__
-
-/* Local includes */
-#include "QIAbstractWizard.h"
-#include "VBoxVMFirstRunWzd.gen.h"
-#include "COMDefs.h"
-#include "QIWithRetranslateUI.h"
-
-/* Local forwardes */
-class QIWidgetValidator;
-
-class VBoxVMFirstRunWzd : public QIWithRetranslateUI <QIAbstractWizard>,
-                          public Ui::VBoxVMFirstRunWzd
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxVMFirstRunWzd (const CMachine &aMachine, QWidget *aParent = 0);
-
-protected:
-
-    void retranslateUi();
-
-private slots:
-
-    void accept();
-    void revalidate (QIWidgetValidator *aValidator);
-    void mediaTypeChanged();
-    void openMediaManager();
-    void enableNext (const QIWidgetValidator *aValidator);
-    void onPageShow();
-
-private:
-
-    QIWidgetValidator *mValidator;
-    CMachine           mMachine;
-};
-
-#endif // __VBoxVMFirstRunWzd_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/VBoxVMFirstRunWzd.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/VBoxVMFirstRunWzd.ui	(revision 26078)
+++ 	(revision )
@@ -1,831 +1,0 @@
-<ui version="4.0" >
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2008-2009 Sun Microsystems, Inc.
-
-     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.
-
-     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-     Clara, CA 95054 USA or visit http://www.sun.com if you need
-     additional information or have any questions.
- </comment>
- <class>VBoxVMFirstRunWzd</class>
- <widget class="QDialog" name="VBoxVMFirstRunWzd" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>782</width>
-    <height>561</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>First Run Wizard</string>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="leftMargin" >
-    <number>0</number>
-   </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QStackedWidget" name="mPageStack" >
-     <property name="currentIndex" >
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="mPageWelcome" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageWelcomeHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Welcome to the First Run Wizard!</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line11" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoWelcome" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextWelcome1" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>You have started a newly created virtual machine for the first time. This wizard will help you to perform the steps necessary for installing an operating system of your choice onto this virtual machine.&lt;/p>&lt;p>Use the &lt;b>Next&lt;/b> button to go to the next page of the wizard and the &lt;b>Back&lt;/b> button to return to the previous page. You can also press &lt;b>Cancel&lt;/b> if you want to cancel the execution of this wizard.&lt;/p></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextWelcome2" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>You have started a newly created virtual machine for the first time. This wizard will help you to perform the steps necessary for booting an operating system of your choice on the virtual machine.&lt;/p>&lt;p>Note that you will not be able to install an operating system into this virtual machine right now because you did not attach any hard disk to it. If this is not what you want, you can cancel the execution of this wizard, select &lt;b>Settings&lt;/b> from the &lt;b>Machine&lt;/b> menu of the main VirtualBox window to access the settings dialog of this machine and change the hard disk configuration.&lt;/p>&lt;p>Use the &lt;b>Next&lt;/b> button to go to the next page of the wizard and the &lt;b>Back&lt;/b> button to return to the previous page. You can also press &lt;b>Cancel&lt;/b> if you want to cancel the execution of this wizard.&lt;/p></string>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line12" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack1" >
-           <property name="enabled" >
-            <bool>false</bool>
-           </property>
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext1" >
-           <property name="text" >
-            <string>&amp;Next ></string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel1" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageMedia" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageMediaHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Select Installation Media</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoType" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextType1" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>Select the type of media you would like to use for installation.&lt;/p></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextType2" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>Select the type of media you would like to use for booting an operating system.&lt;/p></string>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="mGbType" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title" >
-              <string>Media Type</string>
-             </property>
-             <layout class="QVBoxLayout" >
-              <property name="topMargin" >
-               <number>4</number>
-              </property>
-              <item>
-               <widget class="QRadioButton" name="mRbCdType" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text" >
-                 <string>&amp;CD/DVD-ROM Device</string>
-                </property>
-                <property name="checked" >
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QRadioButton" name="mRbFdType" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text" >
-                 <string>&amp;Floppy Device</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSource1" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>Select the media which contains the setup program of the operating system you want to install. This media must be bootable, otherwise the setup program will not be able to start.&lt;/p></string>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSource2" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>Select the media that contains the operating system you want to work with. This media must be bootable, otherwise the operating system will not be able to start.&lt;/p></string>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="mGbSource" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title" >
-              <string>Media Source</string>
-             </property>
-             <layout class="QHBoxLayout" >
-              <property name="topMargin" >
-               <number>4</number>
-              </property>
-              <item>
-               <widget class="VBoxMediaComboBox" name="mCbMedia" />
-              </item>
-              <item>
-               <widget class="QToolButton" name="mTbVmm" >
-                <property name="icon" >
-                 <iconset resource="../VirtualBox1.qrc" >:/select_file_16px.png</iconset>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack2" >
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext2" >
-           <property name="text" >
-            <string>&amp;Next ></string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel2" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageSummary" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageSummaryHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Summary</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line31" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoSummary" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextSummaryHdr1" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>You have selected the following media to boot from:&lt;/p></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSummaryHdr2" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>You have selected the following media to boot an operating system from:&lt;/p></string>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QITextEdit" name="mTeSummary" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <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="autoFormatting" >
-              <set>QTextEdit::AutoAll</set>
-             </property>
-             <property name="readOnly" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSummaryFtr1" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>If the above is correct, press the &lt;b>Finish&lt;/b> button. Once you press it, the selected media will be temporarily mounted on the virtual machine and the machine will start execution.&lt;/p>&lt;p>Please note that when you close the virtual machine, the specified media will be automatically unmounted and the boot device will be set back to the first hard disk.&lt;/p>&lt;p>Depending on the type of the setup program, you may need to manually unmount (eject) the media after the setup program reboots the virtual machine, to prevent the installation process from starting again. You can do this by selecting the corresponding &lt;b>Unmount...&lt;/b> action in the &lt;b>Devices&lt;/b> menu.&lt;/p></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSummaryFtr2" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>If the above is correct, press the &lt;b>Finish&lt;/b> button. Once you press it, the selected media will be mounted on the virtual machine and the machine will start execution.&lt;/p></string>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeType" >
-              <enum>QSizePolicy::Expanding</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line32" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack4" >
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnFinish" >
-           <property name="text" >
-            <string>&amp;Finish</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel4" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxMediaComboBox</class>
-   <extends>QComboBox</extends>
-   <header>VBoxMediaComboBox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QITextEdit</class>
-   <extends>QTextEdit</extends>
-   <header>QIAbstractWizard.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>mBtnNext1</tabstop>
-  <tabstop>mBtnCancel1</tabstop>
-  <tabstop>mBtnBack2</tabstop>
-  <tabstop>mBtnNext2</tabstop>
-  <tabstop>mBtnCancel2</tabstop>
-  <tabstop>mBtnBack4</tabstop>
-  <tabstop>mBtnFinish</tabstop>
-  <tabstop>mBtnCancel4</tabstop>
- </tabstops>
- <resources>
-  <include location="../VirtualBox1.qrc" />
- </resources>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.cpp	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.cpp	(revision 26079)
@@ -0,0 +1,237 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIImportApplianceWzd class implementation
+ */
+
+/*
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Global includes */
+#include <QDialogButtonBox>
+#include <QFileInfo>
+#include <QPrintDialog>
+#include <QPrinter>
+#include <QPushButton>
+#include <QTextStream>
+
+/* Local includes */
+#include "VBoxGlobal.h"
+#include "UIImportApplianceWzd.h"
+#include "QIFileDialog.h"
+
+UIImportLicenseViewer::UIImportLicenseViewer(QWidget *pParent) : QIDialog(pParent)
+{
+    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
+    pMainLayout->setMargin(12);
+
+    m_pCaption = new QLabel(this);
+    m_pCaption->setWordWrap(true);
+    pMainLayout->addWidget(m_pCaption);
+
+    m_pLicenseText = new QTextEdit(this);
+    m_pLicenseText->setReadOnly(true);
+    pMainLayout->addWidget(m_pLicenseText);
+
+    m_pButtonBox = new QDialogButtonBox(QDialogButtonBox::No | QDialogButtonBox::Yes, Qt::Horizontal, this);
+    m_pPrintButton = new QPushButton(this);
+    m_pButtonBox->addButton(m_pPrintButton, QDialogButtonBox::ActionRole);
+    m_pSaveButton = new QPushButton(this);
+    m_pButtonBox->addButton(m_pSaveButton, QDialogButtonBox::ActionRole);
+    m_pButtonBox->button(QDialogButtonBox::Yes)->setDefault(true);
+    connect(m_pButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+    connect(m_pButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
+    connect(m_pPrintButton, SIGNAL(clicked()), this, SLOT(sltPrint()));
+    connect(m_pSaveButton, SIGNAL(clicked()), this, SLOT(sltSave()));
+    pMainLayout->addWidget(m_pButtonBox);
+
+    retranslateUi();
+}
+
+void UIImportLicenseViewer::setContents(const QString &strName, const QString &strText)
+{
+    m_strName = strName;
+    m_strText = strText;
+    retranslateUi();
+}
+
+void UIImportLicenseViewer::retranslateUi()
+{
+    setWindowTitle(tr("Software License Agreement"));
+    m_pCaption->setText(tr("<b>The virtual system \"%1\" requires that you agree to the terms and conditions "
+                           "of the software license agreement shown below.</b><br /><br />Click <b>Agree</b> "
+                           "to continue or click <b>Disagree</b> to cancel the import.").arg(m_strName));
+    m_pLicenseText->setText(m_strText);
+    m_pButtonBox->button(QDialogButtonBox::No)->setText(tr("&Disagree"));
+    m_pButtonBox->button(QDialogButtonBox::Yes)->setText(tr("&Agree"));
+    m_pPrintButton->setText(tr("&Print..."));
+    m_pSaveButton->setText(tr("&Save..."));
+}
+
+void UIImportLicenseViewer::sltPrint()
+{
+    QPrinter printer;
+    QPrintDialog pd(&printer, this);
+    if (pd.exec() == QDialog::Accepted)
+        m_pLicenseText->print(&printer);
+}
+
+void UIImportLicenseViewer::sltSave()
+{
+    QString fileName = QIFileDialog::getSaveFileName(vboxGlobal().documentsPath(), tr("Text (*.txt)"),
+                                                     this, tr("Save license to file..."));
+    if (!fileName.isEmpty())
+    {
+        QFile file(fileName);
+        if (file.open(QFile::WriteOnly | QFile::Truncate))
+        {
+            QTextStream out(&file);
+            out << m_pLicenseText->toPlainText();
+        }
+    }
+}
+
+UIImportApplianceWzd::UIImportApplianceWzd(QWidget *pParent) : QIWizard(pParent)
+{
+    /* Create & add pages */
+    addPage(new UIImportApplianceWzdPage1);
+    addPage(new UIImportApplianceWzdPage2);
+
+    /* Translate */
+    retranslateUi();
+
+    /* Resize to 'golden ratio' */
+    resizeToGoldenRatio();
+
+    /* Assign watermark */
+    assignWatermark(":/vmw_ovf_import.png");
+
+    /* Configure 'Restore Defaults' button */
+    AssertMsg(!field("applianceWidget").value<ImportAppliancePointer>().isNull(), ("Appliance Widget is not set!\n"));
+    connect(this, SIGNAL(customButtonClicked(int)), field("applianceWidget").value<ImportAppliancePointer>(), SLOT(restoreDefaults()));
+    connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(sltCurrentIdChanged(int)));
+}
+
+void UIImportApplianceWzd::retranslateUi()
+{
+    /* Wizard title */
+    setWindowTitle(tr("Appliance Import Wizard"));
+
+    /* Translate 'Restore Defaults' button */
+    setButtonText(QWizard::CustomButton1, tr("Restore Defaults"));
+}
+
+void UIImportApplianceWzd::sltCurrentIdChanged(int iId)
+{
+    setOption(QWizard::HaveCustomButton1, iId == 1 /* Page #2 */);
+}
+
+UIImportApplianceWzdPage1::UIImportApplianceWzdPage1()
+{
+    /* Decorate page */
+    Ui::UIImportApplianceWzdPage1::setupUi(this);
+
+    /* Setup file selector */
+    m_pFileSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Open);
+    m_pFileSelector->setHomeDir(vboxGlobal().documentsPath());
+
+    /* Setup validation */
+    connect(m_pFileSelector, SIGNAL(pathChanged(const QString &)), this, SIGNAL(completeChanged()));
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIImportApplianceWzdPage1::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIImportApplianceWzdPage1::retranslateUi(this);
+
+    /* Translate the file selector */
+    m_pFileSelector->setFileDialogTitle(tr("Select an appliance to import"));
+    m_pFileSelector->setFileFilters(tr("Open Virtualization Format (%1)").arg("*.ovf"));
+
+    /* Wizard page 1 title */
+    setTitle(tr("Welcome to the Appliance Import Wizard!"));
+}
+
+bool UIImportApplianceWzdPage1::isComplete() const
+{
+    return m_pFileSelector->path().toLower().endsWith(".ovf") && QFileInfo(m_pFileSelector->path()).exists();
+}
+
+bool UIImportApplianceWzdPage1::validatePage()
+{
+    AssertMsg(!field("applianceWidget").value<ImportAppliancePointer>().isNull(), ("Appliance Widget is not set!\n"));
+    VBoxImportApplianceWgt *applianceWidget = field("applianceWidget").value<ImportAppliancePointer>();
+
+    /* Set the file path only if something had changed */
+    if (m_pFileSelector->isModified())
+    {
+        applianceWidget->setFile(m_pFileSelector->path());
+        /* Reset the modified bit afterwards */
+        m_pFileSelector->resetModified();
+    }
+
+    /* If we have a valid ovf proceed to the appliance settings page */
+    return applianceWidget->isValid();
+}
+
+UIImportApplianceWzdPage2::UIImportApplianceWzdPage2()
+{
+    /* Decorate page */
+    Ui::UIImportApplianceWzdPage2::setupUi(this);
+
+    /* Register ImportAppliancePointer class */
+    qRegisterMetaType<ImportAppliancePointer>();
+
+    /* Register 'applianceWidget' field! */
+    registerField("applianceWidget", this, "applianceWidget");
+    m_pApplianceWidget = m_pSettingsCnt;
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIImportApplianceWzdPage2::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIImportApplianceWzdPage2::retranslateUi(this);
+
+    /* Wizard page 2 title */
+    setTitle(tr("Appliance Import Settings"));
+}
+
+bool UIImportApplianceWzdPage2::validatePage()
+{
+    /* Make sure the final values are puted back */
+    m_pSettingsCnt->prepareImport();
+    /* Check if there are license agreements the user must confirm */
+    QList < QPair <QString, QString> > licAgreements = m_pSettingsCnt->licenseAgreements();
+    if (!licAgreements.isEmpty())
+    {
+        UIImportLicenseViewer ilv(this);
+        for (int i = 0; i < licAgreements.size(); ++ i)
+        {
+            const QPair <QString, QString> &lic = licAgreements.at(i);
+            ilv.setContents(lic.first, lic.second);
+            if (ilv.exec() == QDialog::Rejected)
+                return false;
+        }
+    }
+    /* Now import all virtual systems */
+    return m_pSettingsCnt->import();
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.h	(revision 26079)
@@ -0,0 +1,128 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIImportApplianceWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2009-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __UIImportApplianceWzd_h__
+#define __UIImportApplianceWzd_h__
+
+/* Global includes */
+#include <QPointer>
+
+/* Local includes */
+#include "QIDialog.h"
+#include "QIWizard.h"
+
+/* Generated includes */
+#include "UIImportApplianceWzdPage1.gen.h"
+#include "UIImportApplianceWzdPage2.gen.h"
+
+/* Global forwards */
+class QDialogButtonBox;
+
+typedef QPointer<VBoxImportApplianceWgt> ImportAppliancePointer;
+Q_DECLARE_METATYPE(ImportAppliancePointer);
+
+class UIImportLicenseViewer : public QIDialog
+{
+    Q_OBJECT;
+
+public:
+
+    UIImportLicenseViewer(QWidget *pParent);
+
+    void setContents(const QString &strName, const QString &strText);
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void sltPrint();
+    void sltSave();
+
+private:
+
+    QLabel *m_pCaption;
+    QTextEdit *m_pLicenseText;
+    QDialogButtonBox *m_pButtonBox;
+    QPushButton *m_pPrintButton;
+    QPushButton *m_pSaveButton;
+    QString m_strName;
+    QString m_strText;
+};
+
+class UIImportApplianceWzd : public QIWizard
+{
+    Q_OBJECT;
+
+public:
+
+    UIImportApplianceWzd(QWidget *pParent);
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void sltCurrentIdChanged(int iId);
+};
+
+class UIImportApplianceWzdPage1 : public QIWizardPage, public Ui::UIImportApplianceWzdPage1
+{
+    Q_OBJECT;
+
+public:
+
+    UIImportApplianceWzdPage1();
+
+protected:
+
+    void retranslateUi();
+
+    bool isComplete() const;
+    bool validatePage();
+};
+
+class UIImportApplianceWzdPage2 : public QIWizardPage, public Ui::UIImportApplianceWzdPage2
+{
+    Q_OBJECT;
+    Q_PROPERTY(ImportAppliancePointer applianceWidget READ applianceWidget WRITE setApplianceWidget);
+
+public:
+
+    UIImportApplianceWzdPage2();
+
+protected:
+
+    void retranslateUi();
+
+    bool validatePage();
+
+private:
+
+    ImportAppliancePointer applianceWidget() const { return m_pApplianceWidget; }
+    void setApplianceWidget(const ImportAppliancePointer &pApplianceWidget) { m_pApplianceWidget = pApplianceWidget; }
+    ImportAppliancePointer m_pApplianceWidget;
+};
+
+#endif /* __UIImportApplianceWzd_h__ */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzdPage1.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzdPage1.ui	(revision 26079)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIImportApplianceWzdPage1</class>
+ <widget class="QWidget" name="UIImportApplianceWzdPage1">
+  <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="text">
+      <string>&lt;p&gt;This wizard will guide you through importing an appliance.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page.&lt;/p&gt;&lt;p&gt;VirtualBox currently supports importing appliances saved in the Open Virtualization Format (OVF). To continue, select the file to import below:&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="VBoxEmptyFileSelector" name="m_pFileSelector" native="true"/>
+   </item>
+   <item>
+    <spacer name="m_pSpacer1">
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>252</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxEmptyFileSelector</class>
+   <extends>QWidget</extends>
+   <header>VBoxFilePathSelectorWidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzdPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzdPage2.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzdPage2.ui	(revision 26079)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIImportApplianceWzdPage2</class>
+ <widget class="QWidget" name="UIImportApplianceWzdPage2">
+  <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>These are the virtual machines contained in the appliance and the suggested settings of the imported VirtualBox machines. You can change many of the properties shown by double-clicking on the items and disable others using the check boxes below.</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="VBoxImportApplianceWgt" name="m_pSettingsCnt" native="true">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxImportApplianceWgt</class>
+   <extends>QWidget</extends>
+   <header>VBoxImportApplianceWgt.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/VBoxImportApplianceWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/VBoxImportApplianceWzd.cpp	(revision 26078)
+++ 	(revision )
@@ -1,231 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxImportAppliance class implementation
- */
-
-/*
- * Copyright (C) 2009 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-/* VBox includes */
-#include "VBoxGlobal.h"
-#include "VBoxImportApplianceWzd.h"
-#include "VBoxProblemReporter.h"
-#include "QIFileDialog.h"
-#include "QIWidgetValidator.h"
-
-/* Qt includes */
-#include <QDialogButtonBox>
-#include <QFileInfo>
-#include <QPrintDialog>
-#include <QPrinter>
-#include <QTextStream>
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxImportLicenseViewer
-
-VBoxImportLicenseViewer::VBoxImportLicenseViewer (QWidget *aParent /* = NULL */)
-  : QIDialog (aParent)
-{
-    QVBoxLayout *pMainLayout = new QVBoxLayout (this);
-    pMainLayout->setMargin (12);
-
-    mCaption = new QLabel (this);
-    mCaption->setWordWrap (true);
-    pMainLayout->addWidget (mCaption);
-
-    mLicenseText = new QTextEdit (this);
-    mLicenseText->setReadOnly (true);
-    pMainLayout->addWidget (mLicenseText);
-
-    mButtonBox = new QDialogButtonBox (QDialogButtonBox::No | QDialogButtonBox::Yes, Qt::Horizontal, this);
-    mPrintBtn = new QPushButton (this);
-    mButtonBox->addButton (mPrintBtn, QDialogButtonBox::ActionRole);
-    mSaveBtn = new QPushButton (this);
-    mButtonBox->addButton (mSaveBtn, QDialogButtonBox::ActionRole);
-    mButtonBox->button (QDialogButtonBox::Yes)->setDefault (true);
-    connect (mButtonBox, SIGNAL (rejected()),
-             this, SLOT (reject()));
-    connect (mButtonBox, SIGNAL (accepted()),
-             this, SLOT (accept()));
-    connect (mPrintBtn, SIGNAL (clicked()),
-             this, SLOT (print()));
-    connect (mSaveBtn, SIGNAL (clicked()),
-             this, SLOT (save()));
-    pMainLayout->addWidget (mButtonBox);
-
-    retranslateUi();
-}
-
-void VBoxImportLicenseViewer::setContent (const QString &aName, const QString &aText)
-{
-    mName = aName;
-    mText = aText;
-    mCaption->setText (tr ("<b>The virtual system \"%1\" requires that you agree to the terms and conditions of the software license agreement shown below.</b><br /><br />Click <b>Agree</b> to continue or click <b>Disagree</b> to cancel the import.").arg (mName));
-    mLicenseText->setText (mText);
-
-}
-
-void VBoxImportLicenseViewer::retranslateUi()
-{
-    setWindowTitle (tr ("Software License Agreement"));
-    mButtonBox->button (QDialogButtonBox::No)->setText (tr ("&Disagree"));
-    mButtonBox->button (QDialogButtonBox::Yes)->setText (tr ("&Agree"));
-    mPrintBtn->setText (tr ("&Print..."));
-    mSaveBtn->setText (tr ("&Save..."));
-
-    setContent (mName, mText);
-}
-
-void VBoxImportLicenseViewer::print()
-{
-    QPrinter printer;
-    QPrintDialog pd (&printer, this);
-    if (pd.exec() == QDialog::Accepted)
-        mLicenseText->print (&printer);
-}
-
-void VBoxImportLicenseViewer::save()
-{
-    QString fileName = QIFileDialog::getSaveFileName (vboxGlobal().documentsPath(), tr("Text (*.txt)"), this, tr("Save license to file..."));
-    if (!fileName.isEmpty())
-    {
-        QFile file (fileName);
-        if (file.open(QFile::WriteOnly | QFile::Truncate))
-        {
-            QTextStream out (&file);
-            out << mLicenseText->toPlainText();
-        }
-    }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// VBoxImportApplianceWzd
-
-VBoxImportApplianceWzd::VBoxImportApplianceWzd (QWidget *aParent /* = NULL */)
-    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
-{
-    /* Apply UI decorations */
-    Ui::VBoxImportApplianceWzd::setupUi (this);
-
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
-    /* Configure the file selector */
-    mFileSelector->setMode (VBoxFilePathSelectorWidget::Mode_File_Open);
-    mFileSelector->setFileDialogTitle (tr ("Select an appliance to import"));
-    mFileSelector->setFileFilters (tr ("Open Virtualization Format (%1)").arg ("*.ovf"));
-    mFileSelector->setHomeDir (vboxGlobal().documentsPath());
-
-    /* Validator for the file selector page */
-    mWValFileSelector = new QIWidgetValidator (mFileSelectPage, this);
-    connect (mWValFileSelector, SIGNAL (validityChanged (const QIWidgetValidator *)),
-             this, SLOT (enableNext (const QIWidgetValidator *)));
-    connect (mWValFileSelector, SIGNAL (isValidRequested (QIWidgetValidator *)),
-             this, SLOT (revalidate (QIWidgetValidator *)));
-    connect (mFileSelector, SIGNAL (pathChanged (const QString &)),
-             mWValFileSelector, SLOT (revalidate()));
-
-    /* Connect the restore button with the settings widget */
-    connect (mBtnRestore, SIGNAL (clicked()),
-             mImportSettingsWgt, SLOT (restoreDefaults()));
-
-    mWValFileSelector->revalidate();
-
-    /* Initialize wizard ftr */
-    initializeWizardFtr();
-
-    retranslateUi();
-}
-
-void VBoxImportApplianceWzd::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxImportApplianceWzd::retranslateUi (this);
-}
-
-void VBoxImportApplianceWzd::revalidate (QIWidgetValidator *aWval)
-{
-    /* Do individual validations for pages */
-    bool valid = aWval->isOtherValid();
-
-    if (aWval == mWValFileSelector)
-        valid = mFileSelector->path().toLower().endsWith (".ovf") &&
-                QFileInfo (mFileSelector->path()).exists();
-
-    aWval->setOtherValid (valid);
-}
-
-void VBoxImportApplianceWzd::enableNext (const QIWidgetValidator *aWval)
-{
-    nextButton (aWval->widget())->setEnabled (aWval->isValid());
-}
-
-void VBoxImportApplianceWzd::accept()
-{
-    /* Make sure the final values are puted back. */
-    mImportSettingsWgt->prepareImport();
-    /* Check if there are license agreements the user must confirm */
-    QList < QPair <QString, QString> > licAgreements = mImportSettingsWgt->licenseAgreements();
-    if (!licAgreements.isEmpty())
-    {
-        VBoxImportLicenseViewer ilv (this);
-        for (int i=0; i < licAgreements.size(); ++i)
-        {
-            const QPair <QString, QString> &lic = licAgreements.at (i);
-            ilv.setContent (lic.first, lic.second);
-            if (ilv.exec() == QDialog::Rejected)
-                return;
-        }
-    }
-    /* Now import all virtual systems */
-    if (mImportSettingsWgt->import())
-        QIAbstractWizard::accept();
-}
-
-void VBoxImportApplianceWzd::showNextPage()
-{
-    if (sender() == mBtnNext1)
-    {
-        if (mFileSelector->isModified())
-        {
-            /* Set the file path only if something has changed */
-            mImportSettingsWgt->setFile (mFileSelector->path());
-            /* Reset the modified bit afterwards */
-            mFileSelector->resetModified();
-        }
-
-        /* If we have a valid ovf proceed to the appliance settings page */
-        if (mImportSettingsWgt->isValid())
-            QIAbstractWizard::showNextPage();
-    }
-    else
-        QIAbstractWizard::showNextPage();
-}
-
-void VBoxImportApplianceWzd::onPageShow()
-{
-    /* Make sure all is properly translated & composed */
-    retranslateUi();
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mSettingsPage)
-        finishButton()->setDefault (true);
-    else
-        nextButton (page)->setDefault (true);
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/VBoxImportApplianceWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/VBoxImportApplianceWzd.h	(revision 26078)
+++ 	(revision )
@@ -1,87 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxImportApplianceWzd class declaration
- */
-
-/*
- * Copyright (C) 2009 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __VBoxImportApplianceWzd_h__
-#define __VBoxImportApplianceWzd_h__
-
-#include "VBoxImportApplianceWzd.gen.h"
-#include "QIAbstractWizard.h"
-#include "QIWithRetranslateUI.h"
-#include "QIDialog.h"
-
-class QIWidgetValidator;
-
-class QDialogButtonBox;
-
-class VBoxImportLicenseViewer: public QIDialog
-{
-    Q_OBJECT;
-
-public:
-    VBoxImportLicenseViewer (QWidget *aParent = NULL);
-
-    void setContent (const QString &aName, const QString &aText);
-
-protected:
-    void retranslateUi();
-
-private slots:
-    void print();
-    void save();
-
-private:
-    QLabel *mCaption;
-    QTextEdit *mLicenseText;
-    QDialogButtonBox *mButtonBox;
-    QPushButton *mPrintBtn;
-    QPushButton *mSaveBtn;
-    QString mName;
-    QString mText;
-};
-
-class VBoxImportApplianceWzd : public QIWithRetranslateUI<QIAbstractWizard>,
-                               public Ui::VBoxImportApplianceWzd
-{
-    Q_OBJECT;
-
-public:
-    VBoxImportApplianceWzd (QWidget* aParent = NULL);
-
-protected:
-    void retranslateUi();
-
-private slots:
-    void revalidate (QIWidgetValidator *aWval);
-    void enableNext (const QIWidgetValidator *aWval);
-
-    void accept();
-
-    void showNextPage();
-    void onPageShow();
-
-private:
-    /* Private member vars */
-    QIWidgetValidator *mWValFileSelector;
-};
-
-#endif /* __VBoxImportApplianceWzd_h__ */
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/VBoxImportApplianceWzd.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/VBoxImportApplianceWzd.ui	(revision 26078)
+++ 	(revision )
@@ -1,396 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
-
-     Copyright (C) 2009 Sun Microsystems, Inc.
-
-     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.
-
-     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-     Clara, CA 95054 USA or visit http://www.sun.com if you need
-     additional information or have any questions.
- </comment>
- <class>VBoxImportApplianceWzd</class>
- <widget class="QDialog" name="VBoxImportApplianceWzd">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>547</width>
-    <height>430</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Appliance Import Wizard</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QStackedWidget" name="mPageStack">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="mFileSelectPage">
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <widget class="QLabel" name="mPageWelcomeHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Welcome to the Appliance Import Wizard!</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line11">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QGridLayout" name="gridLayout">
-         <item row="0" column="0" rowspan="3">
-          <widget class="QLabel" name="mLogoWelcome">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_ovf_import.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QILabel" name="mTextWelcome">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>300</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body&gt;
-&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This wizard will guide you through importing an appliance. &lt;/p&gt;
-&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Use the &lt;span style=&quot; font-weight:600;&quot;&gt;Next&lt;/span&gt; button to go the next page of the wizard and the &lt;span style=&quot; font-weight:600;&quot;&gt;Back&lt;/span&gt; button to return to the previous page.&lt;/p&gt;
-&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;VirtualBox currently supports importing appliances saved in the Open Virtualization Format (OVF). To continue, select the file to import below:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="VBoxEmptyFileSelector" name="mFileSelector" native="true"/>
-         </item>
-         <item row="2" column="1">
-          <spacer name="spacer">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>406</width>
-             <height>68</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line12">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack1">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext1">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel1">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mSettingsPage">
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QLabel" name="mPageSettingsHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Appliance Import Settings</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QGridLayout" name="gridLayout_2">
-         <item row="0" column="0" rowspan="2">
-          <widget class="QLabel" name="mLogoSettings">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_ovf_import.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QILabel" name="mTextSettings">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>300</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="text">
-               <string>These are the virtual machines contained in the appliance and the suggested settings of the imported VirtualBox machines. You can change many of the properties shown by double-clicking on the items and disable others using the check boxes below.</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="VBoxImportApplianceWgt" name="mImportSettingsWgt" native="true">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="minimumSize">
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-           <property name="baseSize">
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="_3">
-         <item>
-          <widget class="QPushButton" name="mBtnRestore">
-           <property name="text">
-            <string>Restore Defaults</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack2">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnFinish">
-           <property name="text">
-            <string>&amp;Import &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel2">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxImportApplianceWgt</class>
-   <extends>QWidget</extends>
-   <header>VBoxImportApplianceWgt.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>VBoxEmptyFileSelector</class>
-   <extends>QWidget</extends>
-   <header>VBoxFilePathSelectorWidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="../VirtualBox1.qrc"/>
- </resources>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp	(revision 26079)
@@ -0,0 +1,509 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UINewHDWzd class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Global includes */
+#include <QFileDialog>
+#include <QRegExpValidator>
+
+/* Local includes */
+#include "UINewHDWzd.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "iprt/path.h"
+
+UINewHDWzd::UINewHDWzd(QWidget *pParent) : QIWizard(pParent)
+{
+    /* Create & add pages */
+    addPage(new UINewHDWzdPage1);
+    addPage(new UINewHDWzdPage2);
+    addPage(new UINewHDWzdPage3);
+    addPage(new UINewHDWzdPage4);
+
+    /* Translate */
+    retranslateUi();
+
+    /* Resize to 'golden ratio' */
+    resizeToGoldenRatio();
+
+    /* Assign watermark */
+    assignWatermark(":/vmw_new_harddisk.png");
+}
+
+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);
+}
+
+QString UINewHDWzd::composeFullFileName(const QString &strFileName)
+{
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    QString strHomeFolder = vbox.GetHomeFolder();
+    QString strDefaultFolder = vbox.GetSystemProperties().GetDefaultHardDiskFolder();
+
+    QFileInfo fi(strFileName);
+    if (fi.fileName() == strFileName)
+    {
+        /* No path info at all, use strDefaultFolder */
+        fi = QFileInfo(strDefaultFolder, strFileName);
+    }
+    else if (fi.isRelative())
+    {
+        /* Resolve relatively to strHomeFolder */
+        fi = QFileInfo(strHomeFolder, strFileName);
+    }
+
+    return QDir::toNativeSeparators(fi.absoluteFilePath());
+}
+
+void UINewHDWzd::retranslateUi()
+{
+    /* Wizard title */
+    setWindowTitle(tr("Create New Virtual Disk"));
+}
+
+UINewHDWzdPage1::UINewHDWzdPage1()
+{
+    /* Decorate page */
+    Ui::UINewHDWzdPage1::setupUi(this);
+
+    /* Translate */
+    retranslateUi();
+}
+
+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!"));
+}
+
+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()));
+
+    /* Translate */
+    retranslateUi();
+}
+void UINewHDWzdPage2::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UINewHDWzdPage2::retranslateUi(this);
+
+    /* Wizard page 2 title */
+    setTitle(tr("Hard Disk Storage Type"));
+}
+
+void UINewHDWzdPage2::initializePage()
+{
+    /* 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(4)
+    , m_uMaxVDISize(vboxGlobal().virtualBox().GetSystemProperties().GetMaxVDISize())
+    , 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 * _1M));
+    m_pSizeMax->setText(vboxGlobal().formatSize(m_uMaxVDISize * _1M));
+
+    /* Attach button icon */
+    m_pLocationSelector->setIcon(vboxGlobal().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 &)));
+
+    /* Translate */
+    retranslateUi();
+}
+
+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()
+{
+    /* 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 = UINewHDWzd::composeFullFileName(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);
+}
+
+void UINewHDWzdPage3::onSelectLocationButtonClicked()
+{
+    /* Set the first parent directory that exists as the current */
+    QFileInfo fullFilePath(UINewHDWzd::composeFullFileName(m_strLocation));
+    QDir folder = fullFilePath.path();
+    QString fileName = fullFilePath.fileName();
+
+    while (!folder.exists() && !folder.isRoot())
+        folder = QFileInfo(folder.absolutePath()).dir();
+
+    if (!folder.exists() || folder.isRoot())
+    {
+        CVirtualBox vbox = vboxGlobal().virtualBox();
+        folder = vbox.GetSystemProperties().GetDefaultHardDiskFolder();
+        if (!folder.exists())
+            folder = vbox.GetHomeFolder();
+    }
+
+    QString selected = QFileDialog::getSaveFileName(this, tr("Select a file for the new hard disk image file"),
+                                                    folder.absoluteFilePath(fileName), tr("Hard disk images (*.vdi)"));
+
+    if (!selected.isEmpty())
+    {
+        if (QFileInfo(selected).completeSuffix().isEmpty())
+            selected += ".vdi";
+        m_pSizeEditor->setText(QDir::toNativeSeparators(selected));
+        m_pSizeEditor->selectAll();
+        m_pSizeEditor->setFocus();
+    }
+}
+
+void UINewHDWzdPage3::onSizeSliderValueChanged(int iValue)
+{
+    m_uCurrentSize = sliderToSizeMB(iValue, m_iSliderScale);
+    m_pSizeEditor->setText(vboxGlobal().formatSize(m_uCurrentSize * _1M));
+    updateSizeToolTip(m_uCurrentSize * _1M);
+}
+
+void UINewHDWzdPage3::onSizeEditorTextChanged(const QString &strValue)
+{
+    updateSizeToolTip(vboxGlobal().parseSize(strValue));
+    m_uCurrentSize = vboxGlobal().parseSize(strValue) / _1M;
+    m_pSizeSlider->setValue(sizeMBToSlider(m_uCurrentSize, m_iSliderScale));
+}
+
+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);
+
+    /* Translate */
+    retranslateUi();
+}
+
+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 = UINewHDWzd::composeFullFileName(field("location").toString());
+    QString sizeFormatted = VBoxGlobal::formatSize(field("currentSize").toULongLong() * _1M);
+    QString sizeUnformatted = tr("%1 B").arg(field("currentSize").toULongLong() * _1M);
+
+    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>");
+}
+
+void UINewHDWzdPage4::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Summary should have focus initially */
+    m_pSummaryText->setFocus();
+}
+
+bool UINewHDWzdPage4::validatePage()
+{
+    /* Try to construct hard disk */
+    return createHardDisk();
+}
+
+bool UINewHDWzdPage4::createHardDisk()
+{
+    KMediumVariant variant = KMediumVariant_Standard;
+    QString loc = field("location").toString();
+    qulonglong size = field("currentSize").toULongLong();
+    bool isFixed = field("fixed").toBool();
+
+    AssertReturn(!loc.isNull(), false);
+    AssertReturn(size > 0, false);
+
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+
+    CProgress progress;
+
+    CMedium hardDisk = vbox.CreateHardDisk(QString("VDI"), loc);
+
+    if (!vbox.isOk())
+    {
+        vboxProblem().cannotCreateHardDiskStorage(this, vbox, loc, hardDisk, progress);
+        return false;
+    }
+
+    if (isFixed)
+        variant = (KMediumVariant)(KMediumVariant_Standard | KMediumVariant_Fixed);
+
+    progress = hardDisk.CreateBaseStorage(size, variant);
+
+    if (!hardDisk.isOk())
+    {
+        vboxProblem().cannotCreateHardDiskStorage(this, vbox, loc, hardDisk, progress);
+        return false;
+    }
+
+    vboxProblem().showModalProgressDialog(progress, windowTitle(), parentWidget());
+
+    if (progress.GetCanceled())
+        return false;
+
+    if (!progress.isOk() || progress.GetResultCode() != 0)
+    {
+        vboxProblem().cannotCreateHardDiskStorage(this, vbox, loc, 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: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.h	(revision 26079)
@@ -0,0 +1,194 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UINewHDWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#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);
+
+    static QString composeFullFileName(const QString &strFileName);
+
+protected:
+
+    void retranslateUi();
+};
+
+class UINewHDWzdPage1 : public QIWizardPage, public Ui::UINewHDWzdPage1
+{
+    Q_OBJECT;
+
+public:
+
+    UINewHDWzdPage1();
+
+protected:
+
+    void retranslateUi();
+};
+
+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: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage1.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage1.ui	(revision 26079)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </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="text">
+      <string>&lt;p&gt;This wizard will help you to create a new virtual hard disk for your virtual machine.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go to the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page.&lt;/p&gt;</string>
+     </property>
+     <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/newhd/UINewHDWzdPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage2.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage2.ui	(revision 26079)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </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: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage3.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage3.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage3.ui	(revision 26079)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </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="QToolButton" 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>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/UINewHDWzdPage4.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage4.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzdPage4.ui	(revision 26079)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </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="text">
+      <string>If the above settings are correct, press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, a new hard disk will be created.</string>
+     </property>
+     <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/VBoxNewHDWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/VBoxNewHDWzd.cpp	(revision 26078)
+++ 	(revision )
@@ -1,428 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxNewHDWzd class implementation
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#include "VBoxNewHDWzd.h"
-#include "VBoxGlobal.h"
-#include "VBoxProblemReporter.h"
-#include "iprt/path.h"
-
-/* Qt includes */
-#include <QFileDialog>
-#include <QToolTip>
-
-/** Minimum VDI size in MB */
-static const quint64 MinVDISize = 4;
-
-/** Initial VDI size in MB */
-static const quint64 InitialVDISize = 2 * _1K;
-
-/**
- * Composes a file name from the given relative or full file name based on the
- * home directory and the default VDI directory. See IMedum::location for
- * details.
- */
-static QString composeFullFileName (const QString &aName)
-{
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-    QString homeFolder = vbox.GetHomeFolder();
-    QString defaultFolder = vbox.GetSystemProperties().GetDefaultHardDiskFolder();
-
-    /* Note: the logic below must match the logic of the IMedum::location
-     * setter, otherwise the returned path may differ from the path actually
-     * set for the hard disk by the VirtualBox API */
-
-    QFileInfo fi (aName);
-    if (fi.fileName() == aName)
-    {
-        /* no path info at all, use defaultFolder */
-        fi = QFileInfo (defaultFolder, aName);
-    }
-    else if (fi.isRelative())
-    {
-        /* resolve relatively to homeFolder */
-        fi = QFileInfo (homeFolder, aName);
-    }
-
-    return QDir::toNativeSeparators (fi.absoluteFilePath());
-}
-
-static inline int log2i (quint64 val)
-{
-    quint64 n = val;
-    int pow = -1;
-    while (n)
-    {
-        ++ pow;
-        n >>= 1;
-    }
-    return pow;
-}
-
-static inline int sizeMBToSlider (quint64 val, int aSliderScale)
-{
-    int pow = log2i (val);
-    quint64 tickMB = quint64 (1) << pow;
-    quint64 tickMBNext = quint64 (1) << (pow + 1);
-    int step = (val - tickMB) * aSliderScale / (tickMBNext - tickMB);
-    return pow * aSliderScale + step;
-}
-
-static inline quint64 sliderToSizeMB (int val, int aSliderScale)
-{
-    int pow = val / aSliderScale;
-    int step = val % aSliderScale;
-    quint64 tickMB = quint64 (1) << pow;
-    quint64 tickMBNext = quint64 (1) << (pow + 1);
-    return tickMB + (tickMBNext - tickMB) * step / aSliderScale;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-VBoxNewHDWzd::VBoxNewHDWzd (QWidget *aParent)
-    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
-{
-    /* Apply UI decorations */
-    Ui::VBoxNewHDWzd::setupUi (this);
-
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
-    /* Storage type page */
-
-    /* Name and Size page */
-    CSystemProperties sysProps = vboxGlobal().virtualBox().GetSystemProperties();
-    mMaxVDISize = sysProps.GetMaxVDISize();
-    /* Detect how many steps to recognize between adjacent powers of 2
-     * to ensure that the last slider step is exactly mMaxVDISize */
-    mSliderScale = 0;
-    {
-        int pow = log2i (mMaxVDISize);
-        quint64 tickMB = quint64 (1) << pow;
-        if (tickMB < mMaxVDISize)
-        {
-            quint64 tickMBNext = quint64 (1) << (pow + 1);
-            quint64 gap = tickMBNext - mMaxVDISize;
-            mSliderScale = (int) ((tickMBNext - tickMB) / gap);
-        }
-    }
-    mSliderScale = qMax (mSliderScale, 8);
-    mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this));
-    mLeSize->setValidator (new QRegExpValidator (QRegExp (vboxGlobal().sizeRegexp()), this));
-    mLeSize->setAlignment (Qt::AlignRight);
-    mWValNameAndSize = new QIWidgetValidator (mPageNameAndSize, this);
-    connect (mWValNameAndSize, SIGNAL (validityChanged (const QIWidgetValidator *)),
-             this, SLOT (enableNext (const QIWidgetValidator *)));
-    connect (mWValNameAndSize, SIGNAL (isValidRequested (QIWidgetValidator *)),
-             this, SLOT (revalidate (QIWidgetValidator *)));
-    connect (mLeSize, SIGNAL (textChanged (const QString &)),
-             mWValNameAndSize, SLOT (revalidate()));
-    connect (mTbNameSelect, SIGNAL (clicked()), this, SLOT (tbNameSelectClicked()));
-    connect (mSlSize, SIGNAL (valueChanged (int)), this, SLOT (slSizeValueChanged (int)));
-    connect (mLeSize, SIGNAL (textChanged (const QString&)),
-             this, SLOT (leSizeTextChanged (const QString&)));
-
-    /* Summary page */
-
-    /* Image type page */
-
-    /* Name and Size page */
-    /// @todo NEWMEDIA use extension as reported by CMediumFormat
-    static ulong HDNumber = 0;
-    mLeName->setText (QString ("NewHardDisk%1.vdi").arg (++ HDNumber));
-    mSlSize->setFocusPolicy (Qt::StrongFocus);
-    mSlSize->setPageStep (mSliderScale);
-    mSlSize->setSingleStep (mSliderScale / 8);
-    mSlSize->setTickInterval (0);
-    mSlSize->setMinimum (sizeMBToSlider (MinVDISize, mSliderScale));
-    mSlSize->setMaximum (sizeMBToSlider (mMaxVDISize, mSliderScale));
-    mTxSizeMin->setText (vboxGlobal().formatSize (MinVDISize * _1M));
-    mTxSizeMax->setText (vboxGlobal().formatSize (mMaxVDISize * _1M));
-    /* limit the max. size of QILineEdit */
-    mLeSize->setFixedWidthByText ("88888.88 MB");
-    setRecommendedSize (InitialVDISize);
-
-    /* Summary page */
-    /* Update the next button state for pages with validation
-     * (validityChanged() connected to enableNext() will do the job) */
-    mWValNameAndSize->revalidate();
-
-    /* Initialize wizard ftr */
-    initializeWizardFtr();
-
-    retranslateUi();
-}
-
-void VBoxNewHDWzd::setRecommendedFileName (const QString &aName)
-{
-    mLeName->setText (aName);
-}
-
-void VBoxNewHDWzd::setRecommendedSize (quint64 aSize)
-{
-    AssertReturnVoid (aSize >= MinVDISize && aSize <= mMaxVDISize);
-    mCurrentSize = aSize;
-    mSlSize->setValue (sizeMBToSlider (mCurrentSize, mSliderScale));
-    mLeSize->setText (vboxGlobal().formatSize (mCurrentSize * _1M));
-    updateSizeToolTip (mCurrentSize * _1M);
-}
-
-void VBoxNewHDWzd::retranslateUi()
-{
-   /* Translate uic generated strings */
-    Ui::VBoxNewHDWzd::retranslateUi (this);
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mPageSummary)
-    {
-        QString type = mRbDynamicType->isChecked() ? mRbDynamicType->text()
-                                                   : mRbFixedType->text();
-        type = VBoxGlobal::removeAccelMark (type);
-
-        quint64 sizeB = mCurrentSize * _1M;
-
-        /* compose summary */
-        QString summary = QString (
-            "<table>"
-            "<tr><td><nobr>%1:&nbsp;</nobr></td><td><nobr>%2</nobr></td></tr>"
-            "<tr><td><nobr>%3:&nbsp;</nobr></td><td><nobr>%4</nobr></td></tr>"
-            "<tr><td><nobr>%5:&nbsp;</nobr></td><td><nobr>%6&nbsp;(%7&nbsp;%8)</nobr></td></tr>"
-            "</table>"
-        )
-            .arg (tr ("Type", "summary")).arg (type)
-            .arg (tr ("Location", "summary")).arg (composeFullFileName (location()))
-            .arg (tr ("Size", "summary")).arg (VBoxGlobal::formatSize (sizeB))
-            .arg (sizeB).arg (tr ("Bytes", "summary"));
-
-        mTeSummary->setText (summary);
-    }
-}
-
-void VBoxNewHDWzd::accept()
-{
-    /* Try to create the hard disk when the Finish button is pressed.
-     * On failure, the wisard will remain open to give it another try. */
-    if (createHardDisk())
-        QIAbstractWizard::accept();
-}
-
-void VBoxNewHDWzd::slSizeValueChanged (int aVal)
-{
-    if (focusWidget() == mSlSize)
-    {
-        mCurrentSize = sliderToSizeMB (aVal, mSliderScale);
-        mLeSize->setText (vboxGlobal().formatSize (mCurrentSize * _1M));
-        updateSizeToolTip (mCurrentSize * _1M);
-    }
-}
-
-void VBoxNewHDWzd::leSizeTextChanged (const QString &aText)
-{
-    if (focusWidget() == mLeSize)
-    {
-        mCurrentSize = vboxGlobal().parseSize (aText);
-        updateSizeToolTip (mCurrentSize);
-        mCurrentSize /= _1M;
-        mSlSize->setValue (sizeMBToSlider (mCurrentSize, mSliderScale));
-    }
-}
-
-void VBoxNewHDWzd::tbNameSelectClicked()
-{
-    /* set the first parent directory that exists as the current */
-    QFileInfo fld (composeFullFileName (mLeName->text()));
-    do
-    {
-        QString dp = fld.path ();
-        fld = QFileInfo (dp);
-    }
-    while (!fld.exists() && !QDir (fld.absoluteFilePath()).isRoot());
-
-    if (!fld.exists())
-    {
-        CVirtualBox vbox = vboxGlobal().virtualBox();
-        fld = QFileInfo (vbox.GetSystemProperties().GetDefaultHardDiskFolder());
-        if (!fld.exists())
-            fld = vbox.GetHomeFolder();
-    }
-
-    QString selected = QFileDialog::getSaveFileName (
-        this,
-        tr ("Select a file for the new hard disk image file"),
-        fld.absoluteFilePath(),
-        tr ("Hard disk images (*.vdi)"));
-
-    if (!selected.isEmpty())
-    {
-        if (QFileInfo (selected).completeSuffix().isEmpty())
-            selected += ".vdi";
-        mLeName->setText (QDir::toNativeSeparators (selected));
-        mLeName->selectAll();
-        mLeName->setFocus();
-    }
-}
-
-void VBoxNewHDWzd::revalidate (QIWidgetValidator *aWval)
-{
-    /* do individual validations for pages */
-    bool valid = aWval->isOtherValid();
-
-    if (aWval == mWValNameAndSize)
-        valid = mCurrentSize >= MinVDISize && mCurrentSize <= mMaxVDISize;
-
-    aWval->setOtherValid (valid);
-}
-
-void VBoxNewHDWzd::enableNext (const QIWidgetValidator *aWval)
-{
-    nextButton (aWval->widget())->setEnabled (aWval->isValid());
-}
-
-void VBoxNewHDWzd::onPageShow()
-{
-    /* Make sure all is properly translated & composed */
-    retranslateUi();
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mPageWelcome)
-        nextButton (page)->setFocus();
-    else if (page == mPageType)
-        mRbDynamicType->isChecked() ? mRbDynamicType->setFocus() :
-                                      mRbFixedType->setFocus();
-    else if (page == mPageNameAndSize)
-        mLeName->setFocus();
-    else if (page == mPageSummary)
-        mTeSummary->setFocus();
-
-    if (page == mPageSummary)
-        finishButton()->setDefault (true);
-    else
-        nextButton (page)->setDefault (true);
-}
-
-void VBoxNewHDWzd::showNextPage()
-{
-    /* Warn user about already present hard-disk */
-    if (sender() == mBtnNext3 &&
-        QFileInfo (location()).exists())
-    {
-        vboxProblem().sayCannotOverwriteHardDiskStorage (this, location());
-        return;
-    }
-
-    /* Switch to the next page */
-    QIAbstractWizard::showNextPage();
-}
-
-
-QString VBoxNewHDWzd::location()
-{
-    QString name = QDir::toNativeSeparators (mLeName->text());
-
-    /* remove all trailing dots to avoid multiple dots before .vdi */
-    int len;
-    while (len = name.length(), len > 0 && name [len - 1] == '.')
-        name.truncate (len - 1);
-
-    QString ext = QFileInfo (name).completeSuffix();
-
-    if (RTPathCompare (ext.toUtf8(), "vdi") != 0)
-        name += ".vdi";
-
-    return name;
-}
-
-bool VBoxNewHDWzd::isDynamicStorage()
-{
-    return mRbDynamicType->isChecked();
-}
-
-void VBoxNewHDWzd::updateSizeToolTip (quint64 aSizeB)
-{
-    QString tip = tr ("<nobr>%1 Bytes</nobr>").arg (aSizeB);
-    mSlSize->setToolTip (tip);
-    mLeSize->setToolTip (tip);
-}
-
-/**
- * Performs steps necessary to create a hard disk. This method handles all
- * errors and shows the corresponding messages when appropriate.
- *
- * @return Wheter the creation was successful or not.
- */
-bool VBoxNewHDWzd::createHardDisk()
-{
-    KMediumVariant variant = KMediumVariant_Standard;
-    QString loc = location();
-
-    AssertReturn (!loc.isEmpty(), false);
-    AssertReturn (mCurrentSize > 0, false);
-
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-
-    CProgress progress;
-
-    CMedium hd = vbox.CreateHardDisk(QString ("VDI"), loc);
-
-    if (!vbox.isOk())
-    {
-        vboxProblem().cannotCreateHardDiskStorage (this, vbox, loc, hd,
-                                                   progress);
-        return false;
-    }
-
-    if (!isDynamicStorage())
-        variant = (KMediumVariant)(KMediumVariant_Standard | KMediumVariant_Fixed);
-
-    progress = hd.CreateBaseStorage (mCurrentSize, variant);
-
-    if (!hd.isOk())
-    {
-        vboxProblem().cannotCreateHardDiskStorage (this, vbox, loc, hd,
-                                                   progress);
-        return false;
-    }
-
-    vboxProblem().showModalProgressDialog (progress, windowTitle(), parentWidget());
-
-    if (progress.GetCanceled())
-        return false;
-
-    if (!progress.isOk() || progress.GetResultCode() != 0)
-    {
-        vboxProblem().cannotCreateHardDiskStorage (this, vbox, loc, hd,
-                                                   progress);
-        return false;
-    }
-
-    /* Inform everybody there is a new medium */
-    vboxGlobal().addMedium (VBoxMedium (CMedium (hd),
-                                        VBoxDefs::MediumType_HardDisk,
-                                        KMediumState_Created));
-
-    mHD = hd;
-    return true;
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/VBoxNewHDWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/VBoxNewHDWzd.h	(revision 26078)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxNewHDWzd class declaration
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __VBoxNewHDWzd_h__
-#define __VBoxNewHDWzd_h__
-
-#include "QIAbstractWizard.h"
-#include "VBoxNewHDWzd.gen.h"
-#include "COMDefs.h"
-#include "QIWidgetValidator.h"
-#include "QIWithRetranslateUI.h"
-
-class VBoxNewHDWzd : public QIWithRetranslateUI<QIAbstractWizard>,
-                     public Ui::VBoxNewHDWzd
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxNewHDWzd (QWidget *aParent = 0);
-
-    CMedium hardDisk() { return mHD; }
-    void setRecommendedFileName (const QString &aName);
-    void setRecommendedSize (quint64 aSize);
-
-protected:
-
-    void retranslateUi();
-
-private slots:
-
-    void accept();
-    void slSizeValueChanged (int aVal);
-    void leSizeTextChanged (const QString &aText);
-    void tbNameSelectClicked();
-    void revalidate (QIWidgetValidator *aWval);
-    void enableNext (const QIWidgetValidator *aWval);
-    void onPageShow();
-    void showNextPage();
-
-private:
-
-    QString location();
-    bool isDynamicStorage();
-    void updateSizeToolTip (quint64 aSizeB);
-    bool createHardDisk();
-
-    QIWidgetValidator *mWValNameAndSize;
-    CMedium            mHD;
-    int                mSliderScale;
-    quint64            mMaxVDISize;
-    quint64            mCurrentSize;
-};
-
-#endif // __VBoxNewHDWzd_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/VBoxNewHDWzd.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/VBoxNewHDWzd.ui	(revision 26078)
+++ 	(revision )
@@ -1,976 +1,0 @@
-<ui version="4.0" >
- <comment>
- VBox frontends: Qt4 GUI ("VirtualBox"):
-
-     Copyright (C) 2008 Sun Microsystems, Inc.
-
-     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.
-
-     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-     Clara, CA 95054 USA or visit http://www.sun.com if you need
-     additional information or have any questions.
- </comment>
- <class>VBoxNewHDWzd</class>
- <widget class="QDialog" name="VBoxNewHDWzd" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>506</width>
-    <height>413</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Create New Virtual Disk</string>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="leftMargin" >
-    <number>0</number>
-   </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QStackedWidget" name="mPageStack" >
-     <property name="currentIndex" >
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="mPageWelcome" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageWelcomeHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Welcome to the Create New Virtual Disk Wizard!</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line11" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoWelcome" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextWelcome" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>This wizard will help you to create a new virtual hard disk for your virtual machine.&lt;/p>&lt;p>Use the &lt;b>Next&lt;/b> button to go to the next page of the wizard and the &lt;b>Back&lt;/b> button to return to the previous page.&lt;/p></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line12" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack1" >
-           <property name="enabled" >
-            <bool>false</bool>
-           </property>
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext1" >
-           <property name="text" >
-            <string>&amp;Next ></string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel1" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageType" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageTypeHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Hard Disk Storage Type</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoType" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextType" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>Select the type of virtual hard disk you want to create.&lt;/p>&lt;p>A &lt;b>dynamically expanding storage&lt;/b> 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>&lt;p>A &lt;b>fixed-size storage&lt;/b> 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></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="mGbType" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title" >
-              <string>Storage Type</string>
-             </property>
-             <layout class="QVBoxLayout" >
-              <property name="topMargin" >
-               <number>4</number>
-              </property>
-              <item>
-               <widget class="QRadioButton" name="mRbDynamicType" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text" >
-                 <string>&amp;Dynamically expanding storage</string>
-                </property>
-                <property name="checked" >
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QRadioButton" name="mRbFixedType" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text" >
-                 <string>&amp;Fixed-size storage</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack2" >
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext2" >
-           <property name="text" >
-            <string>&amp;Next ></string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel2" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageNameAndSize" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageNameAndSizeHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Virtual Disk Location and Size</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line31" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoNameAndSize" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextNameComment" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>Press the &lt;b>Select&lt;/b> 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></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="mGbName" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title" >
-              <string>&amp;Location</string>
-             </property>
-             <layout class="QHBoxLayout" >
-              <property name="topMargin" >
-               <number>4</number>
-              </property>
-              <item>
-               <widget class="QLineEdit" name="mLeName" />
-              </item>
-              <item>
-               <widget class="QToolButton" name="mTbNameSelect" >
-                <property name="text" >
-                 <string/>
-                </property>
-                <property name="icon" >
-                 <iconset resource="../VirtualBox1.qrc" >:/select_file_16px.png</iconset>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSizeComment" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>&lt;p>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></string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="mGbSize" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title" >
-              <string>&amp;Size</string>
-             </property>
-             <layout class="QGridLayout" >
-              <item row="0" column="0" colspan="3" >
-               <widget class="QSlider" name="mSlSize" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-                  <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="mLeSize" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="0" >
-               <widget class="QLabel" name="mTxSizeMin" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="alignment" >
-                 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="1" >
-               <spacer>
-                <property name="orientation" >
-                 <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeType" >
-                 <enum>QSizePolicy::Expanding</enum>
-                </property>
-                <property name="sizeHint" >
-                 <size>
-                  <width>221</width>
-                  <height>20</height>
-                 </size>
-                </property>
-               </spacer>
-              </item>
-              <item row="1" column="2" >
-               <widget class="QLabel" name="mTxSizeMax" >
-                <property name="sizePolicy" >
-                 <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="alignment" >
-                 <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line32" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack3" >
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext3" >
-           <property name="text" >
-            <string>&amp;Next ></string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel3" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageSummary" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mPageSummaryHdr" >
-         <property name="font" >
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text" >
-          <string>Summary</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line41" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoSummary" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Minimum" hsizetype="Maximum" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground" >
-            <bool>true</bool>
-           </property>
-           <property name="text" >
-            <string/>
-           </property>
-           <property name="pixmap" >
-            <pixmap resource="../VirtualBox1.qrc" >:/vmw_new_harddisk.png</pixmap>
-           </property>
-           <property name="alignment" >
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout" >
-           <property name="spacing" >
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextSummaryHdr" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>You are going to create a new virtual hard disk with the following parameters:</string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QITextEdit" name="mTeSummary" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <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="autoFormatting" >
-              <set>QTextEdit::AutoAll</set>
-             </property>
-             <property name="readOnly" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSummaryFtr" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize" >
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text" >
-              <string>If the above settings are correct, press the &lt;b>Finish&lt;/b> button. Once you press it, a new hard disk will be created.</string>
-             </property>
-             <property name="alignment" >
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-             </property>
-             <property name="wordWrap" >
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeType" >
-              <enum>QSizePolicy::Expanding</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line42" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" >
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>0</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnBack4" >
-           <property name="text" >
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnFinish" >
-           <property name="text" >
-            <string>&amp;Finish</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType" >
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel4" >
-           <property name="text" >
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QITextEdit</class>
-   <extends>QTextEdit</extends>
-   <header>QIAbstractWizard.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QILineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>QILineEdit.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>mBtnNext1</tabstop>
-  <tabstop>mBtnCancel1</tabstop>
-  <tabstop>mBtnBack2</tabstop>
-  <tabstop>mBtnNext2</tabstop>
-  <tabstop>mBtnCancel2</tabstop>
-  <tabstop>mSlSize</tabstop>
-  <tabstop>mLeSize</tabstop>
-  <tabstop>mBtnBack3</tabstop>
-  <tabstop>mBtnNext3</tabstop>
-  <tabstop>mBtnCancel3</tabstop>
-  <tabstop>mBtnBack4</tabstop>
-  <tabstop>mBtnFinish</tabstop>
-  <tabstop>mBtnCancel4</tabstop>
- </tabstops>
- <resources>
-  <include location="../VirtualBox1.qrc" />
- </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 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp	(revision 26079)
@@ -0,0 +1,615 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UINewVMWzd class implementation
+ */
+
+/*
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Local includes */
+#include "UINewVMWzd.h"
+#include "UINewHDWzd.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "VBoxMediaManagerDlg.h"
+#include "VBoxVMSettingsHD.h"
+
+UINewVMWzd::UINewVMWzd(QWidget *pParent) : QIWizard(pParent)
+{
+    /* Create & add pages */
+    addPage(new UINewVMWzdPage1);
+    addPage(new UINewVMWzdPage2);
+    addPage(new UINewVMWzdPage3);
+    addPage(new UINewVMWzdPage4);
+    addPage(new UINewVMWzdPage5);
+
+    /* Translate */
+    retranslateUi();
+
+    /* Resize to 'golden ratio' */
+    resizeToGoldenRatio();
+
+    /* Assign watermark */
+    assignWatermark(":/vmw_new_welcome.png");
+}
+
+const CMachine UINewVMWzd::machine() const
+{
+    /* Use 'machine' field value from page 5 */
+    return field("machine").value<CMachine>();
+}
+
+void UINewVMWzd::retranslateUi()
+{
+    /* Wizard title */
+    setWindowTitle(tr("Create New Virtual Machine"));
+}
+
+UINewVMWzdPage1::UINewVMWzdPage1()
+{
+    /* Decorate page */
+    Ui::UINewVMWzdPage1::setupUi(this);
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UINewVMWzdPage1::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UINewVMWzdPage1::retranslateUi(this);
+
+    /* Wizard page 1 title */
+    setTitle(tr("Welcome to the New Virtual Machine Wizard!"));
+}
+
+UINewVMWzdPage2::UINewVMWzdPage2()
+{
+    /* Decorate page */
+    Ui::UINewVMWzdPage2::setupUi(this);
+
+    /* Register 'name' & 'type' fields */
+    registerField("name*", m_pNameEditor);
+    registerField("type*", m_pTypeSelector, "type", SIGNAL(osTypeChanged()));
+
+    /* Setup contents */
+    m_pTypeSelector->activateLayout();
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UINewVMWzdPage2::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UINewVMWzdPage2::retranslateUi(this);
+
+    /* Wizard page 2 title */
+    setTitle(tr("VM Name and OS Type"));
+}
+
+void UINewVMWzdPage2::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* 'Name' field should have focus initially */
+    m_pNameEditor->setFocus();
+}
+
+UINewVMWzdPage3::UINewVMWzdPage3()
+{
+    /* Decorate page */
+    Ui::UINewVMWzdPage3::setupUi(this);
+
+    /* Register 'ram' field */
+    registerField("ram*", m_pRamSlider, "value", SIGNAL(valueChanged(int)));
+
+    /* Setup contents */
+    m_pRamEditor->setFixedWidthByText("88888");
+    m_pRamEditor->setAlignment(Qt::AlignRight);
+    m_pRamEditor->setValidator(new QIntValidator(m_pRamSlider->minRAM(), m_pRamSlider->maxRAM(), this));
+
+    /* Setup page connections */
+    connect(m_pRamSlider, SIGNAL(valueChanged(int)), this, SLOT(ramSliderValueChanged(int)));
+    connect(m_pRamEditor, SIGNAL(textChanged(const QString &)), this, SLOT(ramEditorTextChanged(const QString &)));
+
+    /* Initialise page connections */
+    ramSliderValueChanged(m_pRamSlider->value());
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UINewVMWzdPage3::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UINewVMWzdPage3::retranslateUi(this);
+
+    /* Wizard page 3 title */
+    setTitle(tr("Memory"));
+
+    /* Translate recommended 'ram' field value */
+    QString strRecommendedRAM = field("type").value<CGuestOSType>().isNull() ? QString() :
+                                QString::number(field("type").value<CGuestOSType>().GetRecommendedRAM());
+    m_pPage3Text2->setText(tr("The recommended base memory size is <b>%1</b> MB.").arg(strRecommendedRAM));
+
+    /* Translate minimum & maximum 'ram' field values */
+    m_pRamMin->setText(QString("%1 %2").arg(m_pRamSlider->minRAM()).arg(tr("MB", "megabytes")));
+    m_pRamMax->setText(QString("%1 %2").arg(m_pRamSlider->maxRAM()).arg(tr("MB", "megabytes")));
+}
+
+void UINewVMWzdPage3::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Assign recommended 'ram' field value */
+    CGuestOSType type = field("type").value<CGuestOSType>();
+    ramSliderValueChanged(type.GetRecommendedRAM());
+
+    /* 'Ram' field should have focus initially */
+    m_pRamSlider->setFocus();
+}
+
+bool UINewVMWzdPage3::isComplete() const
+{
+    /* Check what 'ram' field value feats the bounds */
+    return field("ram").toInt() >= qMax(1, (int)m_pRamSlider->minRAM()) &&
+           field("ram").toInt() <= (int)m_pRamSlider->maxRAM();
+}
+
+void UINewVMWzdPage3::ramSliderValueChanged(int iValue)
+{
+    /* Update 'ram' field editor connected to slider */
+    m_pRamEditor->setText(QString::number(iValue));
+}
+
+void UINewVMWzdPage3::ramEditorTextChanged(const QString &strText)
+{
+    /* Update 'ram' field slider connected to editor */
+    m_pRamSlider->setValue(strText.toInt());
+}
+
+UINewVMWzdPage4::UINewVMWzdPage4()
+{
+    /* Decorate page */
+    Ui::UINewVMWzdPage4::setupUi(this);
+
+    /* Register CMedium class */
+    qRegisterMetaType<CMedium>();
+
+    /* Register all related 'hardDisk*' fields */
+    registerField("hardDisk", this, "hardDisk");
+    registerField("hardDiskId", this, "hardDiskId");
+    registerField("hardDiskName", this, "hardDiskName");
+    registerField("hardDiskLocation", this, "hardDiskLocation");
+
+    /* Insert shifting spacer */
+    QGridLayout *pLayout = qobject_cast<QGridLayout*>(m_pBootHDCnt->layout());
+    Assert(pLayout);
+    QStyleOptionButton options;
+    options.initFrom(m_pDiskCreate);
+    int wid = m_pDiskCreate->style()->subElementRect(QStyle::SE_RadioButtonIndicator, &options, m_pDiskCreate).width() +
+              m_pDiskCreate->style()->pixelMetric(QStyle::PM_RadioButtonLabelSpacing, &options, m_pDiskCreate) -
+              pLayout->spacing() - 1;
+    QSpacerItem *spacer = new QSpacerItem(wid, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
+    pLayout->addItem(spacer, 2, 0);
+
+    /* Initialise medium-combo-box */
+    m_pDiskSelector->setType(VBoxDefs::MediumType_HardDisk);
+    m_pDiskSelector->repopulate();
+
+    /* Setup medium-manager button */
+    m_pVMMButton->setIcon(VBoxGlobal::iconSet(":/select_file_16px.png", ":/select_file_dis_16px.png"));
+
+    /* Setup page connections */
+    connect(m_pBootHDCnt, SIGNAL(toggled(bool)), this, SLOT(hardDiskSourceChanged()));
+    connect(m_pDiskCreate, SIGNAL(toggled(bool)), this, SLOT(hardDiskSourceChanged()));
+    connect(m_pDiskPresent, SIGNAL(toggled(bool)), this, SLOT(hardDiskSourceChanged()));
+    connect(m_pDiskSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(hardDiskSourceChanged()));
+    connect(m_pVMMButton, SIGNAL(clicked()), this, SLOT(getWithMediaManager()));
+
+    /* Initialise page connections */
+    hardDiskSourceChanged();
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UINewVMWzdPage4::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UINewVMWzdPage4::retranslateUi(this);
+
+    /* Wizard page 4 title */
+    setTitle(tr("Virtual Hard Disk"));
+
+    /* Translate recommended 'hdd' field value */
+    QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :
+                                QString::number(field("type").value<CGuestOSType>().GetRecommendedHDD());
+    m_pPage4Text2->setText (tr ("The recommended size of the boot hard disk is <b>%1</b> MB.").arg (strRecommendedHDD));
+}
+
+void UINewVMWzdPage4::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Prepare initial choice */
+    m_pBootHDCnt->setChecked(true);
+    m_pDiskSelector->setCurrentIndex(0);
+    m_pDiskCreate->setChecked(true);
+
+    /* 'Create new hard-disk' should have focus initially */
+    m_pDiskCreate->setFocus();
+}
+
+void UINewVMWzdPage4::cleanupPage()
+{
+    /* Clean medium if present */
+    ensureNewHardDiskDeleted();
+    /* Clean fields of that page */
+    QIWizardPage::cleanupPage();
+}
+
+bool UINewVMWzdPage4::isComplete() const
+{
+    /* Check what 'hardDisk' field value feats the rules */
+    return !m_pBootHDCnt->isChecked() ||
+           !m_pDiskPresent->isChecked() ||
+           !vboxGlobal().findMedium(m_pDiskSelector->id()).isNull();
+}
+
+bool UINewVMWzdPage4::validatePage()
+{
+    /* Ensure unused hard-disk is deleted */
+    if (!m_pBootHDCnt->isChecked() || m_pDiskCreate->isChecked() || (!m_HardDisk.isNull() && m_strHardDiskId != m_HardDisk.GetId()))
+        ensureNewHardDiskDeleted();
+
+    /* Ask user about disk-less machine */
+    if (!m_pBootHDCnt->isChecked() && !vboxProblem().confirmHardDisklessMachine(this))
+        return false;
+
+    /* Show the New Hard Disk wizard */
+    if (m_pBootHDCnt->isChecked() && m_pDiskCreate->isChecked() && !getWithNewHardDiskWizard())
+        return false;
+
+    return true;
+}
+
+void UINewVMWzdPage4::ensureNewHardDiskDeleted()
+{
+    if (m_HardDisk.isNull())
+        return;
+
+    QString id = m_HardDisk.GetId();
+
+    bool success = false;
+
+    CProgress progress = m_HardDisk.DeleteStorage();
+    if (m_HardDisk.isOk())
+    {
+        vboxProblem().showModalProgressDialog(progress, windowTitle(), this);
+        if (progress.isOk() && progress.GetResultCode() == S_OK)
+            success = true;
+    }
+
+    if (success)
+        vboxGlobal().removeMedium(VBoxDefs::MediumType_HardDisk, id);
+    else
+        vboxProblem().cannotDeleteHardDiskStorage(this, m_HardDisk, progress);
+
+    m_HardDisk.detach();
+}
+
+void UINewVMWzdPage4::hardDiskSourceChanged()
+{
+    m_pDiskCreate->setEnabled(m_pBootHDCnt->isChecked());
+    m_pDiskPresent->setEnabled(m_pBootHDCnt->isChecked());
+    m_pDiskSelector->setEnabled(m_pDiskPresent->isEnabled() && m_pDiskPresent->isChecked());
+    m_pVMMButton->setEnabled(m_pDiskPresent->isEnabled() && m_pDiskPresent->isChecked());
+
+    if (m_pBootHDCnt->isChecked() && m_pDiskPresent->isChecked())
+    {
+        m_strHardDiskId = m_pDiskSelector->id();
+        m_strHardDiskName = m_pDiskSelector->currentText();
+        m_strHardDiskLocation = m_pDiskSelector->location();
+    }
+    else
+    {
+        m_strHardDiskId.clear();
+        m_strHardDiskName.clear();
+        m_strHardDiskLocation.clear();
+    }
+
+    emit completeChanged();
+}
+
+void UINewVMWzdPage4::getWithMediaManager()
+{
+    VBoxMediaManagerDlg dlg(this);
+    dlg.setup(VBoxDefs::MediumType_HardDisk, true);
+
+    if (dlg.exec() == QDialog::Accepted)
+    {
+        QString newId = dlg.selectedId();
+        if (m_pDiskSelector->id() != newId)
+            m_pDiskSelector->setCurrentItem(newId);
+    }
+
+    m_pDiskSelector->setFocus();
+}
+
+bool UINewVMWzdPage4::getWithNewHardDiskWizard()
+{
+    UINewHDWzd dlg(this);
+    dlg.setRecommendedName(field("name").toString());
+    dlg.setRecommendedSize(field("type").value<CGuestOSType>().GetRecommendedHDD());
+
+    if (dlg.exec() == QDialog::Accepted)
+    {
+        m_HardDisk = dlg.hardDisk();
+        m_pDiskSelector->setCurrentItem(m_HardDisk.GetId());
+        m_pDiskPresent->click();
+        return true;
+    }
+
+    return false;
+}
+
+CMedium UINewVMWzdPage4::hardDisk() const
+{
+    return m_HardDisk;
+}
+
+void UINewVMWzdPage4::setHardDisk(const CMedium &hardDisk)
+{
+    m_HardDisk = hardDisk;
+}
+
+QString UINewVMWzdPage4::hardDiskId() const
+{
+    return m_strHardDiskId;
+}
+
+void UINewVMWzdPage4::setHardDiskId(const QString &strHardDiskId)
+{
+    m_strHardDiskId = strHardDiskId;
+}
+
+QString UINewVMWzdPage4::hardDiskName() const
+{
+    return m_strHardDiskName;
+}
+
+void UINewVMWzdPage4::setHardDiskName(const QString &strHardDiskName)
+{
+    m_strHardDiskName = strHardDiskName;
+}
+
+QString UINewVMWzdPage4::hardDiskLocation() const
+{
+    return m_strHardDiskLocation;
+}
+
+void UINewVMWzdPage4::setHardDiskLocation(const QString &strHardDiskLocation)
+{
+    m_strHardDiskLocation = strHardDiskLocation;
+}
+
+UINewVMWzdPage5::UINewVMWzdPage5()
+{
+    /* Decorate page */
+    Ui::UINewVMWzdPage5::setupUi(this);
+
+    /* Register CMachine class */
+    qRegisterMetaType<CMachine>();
+
+    /* Register 'machine' field */
+    registerField("machine", this, "machine");
+
+    /* Disable the background painting of the summary widget */
+    m_pSummaryText->viewport()->setAutoFillBackground (false);
+    /* Make the summary field read-only */
+    m_pSummaryText->setReadOnly (true);
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UINewVMWzdPage5::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UINewVMWzdPage5::retranslateUi(this);
+
+    /* Wizard page 5 title */
+    setTitle(tr("Summary"));
+
+    /* Compose common summary */
+    QString summary;
+
+    QString name = field("name").toString();
+    QString type = field("type").value<CGuestOSType>().isNull() ? QString() :
+                   field("type").value<CGuestOSType>().GetDescription();
+    QString ram  = QString::number(field("ram").toInt());
+
+    summary += QString
+    (
+        "<tr><td><nobr>%1: </nobr></td><td>%2</td></tr>"
+        "<tr><td><nobr>%3: </nobr></td><td>%4</td></tr>"
+        "<tr><td><nobr>%5: </nobr></td><td>%6 %7</td></tr>"
+    )
+    .arg(tr("Name", "summary"), name)
+    .arg(tr("OS Type", "summary"), type)
+    .arg(tr("Base Memory", "summary"), ram, tr("MB", "megabytes"))
+    ;
+    /* Feat summary to 3 lines */
+    setSummaryFieldLinesNumber(m_pSummaryText, 3);
+
+    /* Add hard-disk info */
+    if (!field("hardDiskId").toString().isNull())
+    {
+        summary += QString(
+            "<tr><td><nobr>%8: </nobr></td><td><nobr>%9</nobr></td></tr>")
+            .arg(tr("Boot Hard Disk", "summary"), field("hardDiskName").toString());
+        /* Extend summary to 4 lines */
+        setSummaryFieldLinesNumber(m_pSummaryText, 4);
+    }
+
+    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>");
+}
+
+void UINewVMWzdPage5::initializePage()
+{
+    /* Translate */
+    retranslateUi();
+
+    /* Summary should have focus initially */
+    m_pSummaryText->setFocus();
+}
+
+bool UINewVMWzdPage5::validatePage()
+{
+    /* Try to construct machine */
+    return constructMachine();
+}
+
+bool UINewVMWzdPage5::constructMachine()
+{
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+
+    /* OS type */
+    CGuestOSType type = field("type").value<CGuestOSType>();
+    AssertMsg(!type.isNull(), ("GuestOSType must return non-null type"));
+    QString typeId = type.GetId();
+
+    /* Create a machine with the default settings file location */
+    if (m_Machine.isNull())
+    {
+        m_Machine = vbox.CreateMachine(field("name").toString(), typeId, QString::null, QString::null);
+        if (!vbox.isOk())
+        {
+            vboxProblem().cannotCreateMachine(vbox, this);
+            return false;
+        }
+
+        /* The FirstRun wizard is to be shown only when we don't attach any hard disk or attach a new (empty) one.
+         * Selecting an existing hard disk will cancel the wizard. */
+        if (field("hardDiskId").toString().isNull() || !field("hardDisk").value<CMedium>().isNull())
+            m_Machine.SetExtraData(VBoxDefs::GUI_FirstRun, "yes");
+    }
+
+    /* RAM size */
+    m_Machine.SetMemorySize(field("ram").toInt());
+
+    /* VRAM size - select maximum between recommended and minimum for fullscreen */
+    m_Machine.SetVRAMSize (qMax (type.GetRecommendedVRAM(),
+                                (ULONG) (VBoxGlobal::requiredVideoMemory(&m_Machine) / _1M)));
+
+    /* Enabling audio by default */
+    m_Machine.GetAudioAdapter().SetEnabled(true);
+
+    /* Enable the OHCI and EHCI controller by default for new VMs. (new in 2.2) */
+    CUSBController usbController = m_Machine.GetUSBController();
+    if (!usbController.isNull())
+    {
+        usbController.SetEnabled(true);
+        usbController.SetEnabledEhci(true);
+    }
+
+    /* Create default storage controllers */
+    QString ideCtrName = VBoxVMSettingsHD::tr("IDE Controller");
+    QString floppyCtrName = VBoxVMSettingsHD::tr("Floppy Controller");
+    KStorageBus ideBus = KStorageBus_IDE;
+    KStorageBus floppyBus = KStorageBus_Floppy;
+    m_Machine.AddStorageController(ideCtrName, ideBus);
+    m_Machine.AddStorageController(floppyCtrName, floppyBus);
+
+    /* Register the VM prior to attaching hard disks */
+    vbox.RegisterMachine(m_Machine);
+    if (!vbox.isOk())
+    {
+        vboxProblem().cannotCreateMachine(vbox, m_Machine, this);
+        return false;
+    }
+
+    /* Attach default devices */
+    {
+        bool success = false;
+        QString machineId = m_Machine.GetId();
+        CSession session = vboxGlobal().openSession(machineId);
+        if (!session.isNull())
+        {
+            CMachine m = session.GetMachine();
+
+            /* Boot hard disk (IDE Primary Master) */
+            if (!field("hardDiskId").toString().isNull())
+            {
+                m.AttachDevice(ideCtrName, 0, 0, KDeviceType_HardDisk, field("hardDiskId").toString());
+                if (!m.isOk())
+                    vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_HardDisk,
+                                                     field("hardDiskLocation").toString(), ideBus, 0, 0);
+            }
+
+            /* Attach empty CD/DVD ROM Device */
+            m.AttachDevice(ideCtrName, 1, 0, KDeviceType_DVD, QString(""));
+            if (!m.isOk())
+                vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_DVD, QString(), ideBus, 1, 0);
+
+            /* Attach empty Floppy Device */
+            m.AttachDevice(floppyCtrName, 0, 0, KDeviceType_Floppy, QString(""));
+            if (!m.isOk())
+                vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_Floppy, QString(), floppyBus, 0, 0);
+
+            if (m.isOk())
+            {
+                m.SaveSettings();
+                if (m.isOk())
+                    success = true;
+                else
+                    vboxProblem().cannotSaveMachineSettings(m, this);
+            }
+
+            session.Close();
+        }
+        if (!success)
+        {
+            /* Unregister on failure */
+            vbox.UnregisterMachine(machineId);
+            if (vbox.isOk())
+                m_Machine.DeleteSettings();
+            return false;
+        }
+    }
+
+    /* Ensure we don't try to delete a newly created hard disk on success */
+    if (!field("hardDisk").value<CMedium>().isNull())
+        field("hardDisk").value<CMedium>().detach();
+
+    return true;
+}
+
+CMachine UINewVMWzdPage5::machine() const
+{
+    return m_Machine;
+}
+
+void UINewVMWzdPage5::setMachine(const CMachine &machine)
+{
+    m_Machine = machine;
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.h	(revision 26079)
@@ -0,0 +1,181 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UINewVMWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2006-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __UINewVMWzd_h__
+#define __UINewVMWzd_h__
+
+
+/* Local includes */
+#include "QIWizard.h"
+#include "COMDefs.h"
+#include "QIWithRetranslateUI.h"
+
+/* Generated includes */
+#include "UINewVMWzdPage1.gen.h"
+#include "UINewVMWzdPage2.gen.h"
+#include "UINewVMWzdPage3.gen.h"
+#include "UINewVMWzdPage4.gen.h"
+#include "UINewVMWzdPage5.gen.h"
+
+class UINewVMWzd : public QIWizard
+{
+    Q_OBJECT;
+
+public:
+
+    UINewVMWzd(QWidget *pParent);
+
+    const CMachine machine() const;
+
+protected:
+
+    void retranslateUi();
+};
+
+class UINewVMWzdPage1 : public QIWizardPage, public Ui::UINewVMWzdPage1
+{
+    Q_OBJECT;
+
+public:
+
+    UINewVMWzdPage1();
+
+protected:
+
+    void retranslateUi();
+};
+
+class UINewVMWzdPage2 : public QIWizardPage, public Ui::UINewVMWzdPage2
+{
+    Q_OBJECT;
+
+public:
+
+    UINewVMWzdPage2();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+};
+
+class UINewVMWzdPage3 : public QIWizardPage, public Ui::UINewVMWzdPage3
+{
+    Q_OBJECT;
+
+public:
+
+    UINewVMWzdPage3();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+
+    bool isComplete() const;
+
+private slots:
+
+    void ramSliderValueChanged(int iValue);
+    void ramEditorTextChanged(const QString &strText);
+};
+
+class UINewVMWzdPage4 : public QIWizardPage, public Ui::UINewVMWzdPage4
+{
+    Q_OBJECT;
+    Q_PROPERTY(CMedium hardDisk READ hardDisk WRITE setHardDisk);
+    Q_PROPERTY(QString hardDiskId READ hardDiskId WRITE setHardDiskId);
+    Q_PROPERTY(QString hardDiskName READ hardDiskName WRITE setHardDiskName);
+    Q_PROPERTY(QString hardDiskLocation READ hardDiskLocation WRITE setHardDiskLocation);
+
+public:
+
+    UINewVMWzdPage4();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+    void cleanupPage();
+
+    bool isComplete() const;
+    bool validatePage();
+
+private slots:
+
+    void ensureNewHardDiskDeleted();
+    void hardDiskSourceChanged();
+    void getWithMediaManager();
+
+private:
+
+    bool getWithNewHardDiskWizard();
+
+    CMedium hardDisk() const;
+    void setHardDisk(const CMedium &hardDisk);
+    CMedium m_HardDisk;
+
+    QString hardDiskId() const;
+    void setHardDiskId(const QString &strHardDiskId);
+    QString m_strHardDiskId;
+
+    QString hardDiskName() const;
+    void setHardDiskName(const QString &strHardDiskName);
+    QString m_strHardDiskName;
+
+    QString hardDiskLocation() const;
+    void setHardDiskLocation(const QString &strHardDiskLocation);
+    QString m_strHardDiskLocation;
+};
+
+class UINewVMWzdPage5 : public QIWizardPage, public Ui::UINewVMWzdPage5
+{
+    Q_OBJECT;
+    Q_PROPERTY(CMachine machine READ machine WRITE setMachine);
+
+public:
+
+    UINewVMWzdPage5();
+
+protected:
+
+    void retranslateUi();
+
+    void initializePage();
+
+    bool validatePage();
+
+private:
+
+    bool constructMachine();
+
+    CMachine machine() const;
+    void setMachine(const CMachine &machine);
+    CMachine m_Machine;
+};
+
+Q_DECLARE_METATYPE(CMachine);
+
+#endif // __UINewVMWzd_h__
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage1.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage1.ui	(revision 26079)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UINewVMWzdPage1</class>
+ <widget class="QWidget" name="UINewVMWzdPage1">
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <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="text">
+      <string>&lt;p&gt;This wizard will guide you through the steps that are necessary to create a new virtual machine for VirtualBox.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page.&lt;/p&gt;</string>
+     </property>
+     <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/UINewVMWzdPage2.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage2.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage2.ui	(revision 26079)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UINewVMWzdPage2</class>
+ <widget class="QWidget" name="UINewVMWzdPage2">
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <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;Enter a name for the new virtual machine and select the type of the guest operating system you plan to install onto the virtual machine.&lt;/p&gt;&lt;p&gt;The name of the virtual machine usually indicates its software and hardware configuration. It will be used by all VirtualBox components to identify your virtual machine.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pNameEditorCnt">
+     <property name="title">
+      <string>N&amp;ame</string>
+     </property>
+     <layout class="QHBoxLayout" name="m_pLayout2">
+      <item>
+       <widget class="QLineEdit" name="m_pNameEditor"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pTypeSelectorCnt">
+     <property name="title">
+      <string>OS &amp;Type</string>
+     </property>
+     <layout class="QHBoxLayout" name="m_pLayout3">
+      <item>
+       <widget class="VBoxOSTypeSelectorWidget" name="m_pTypeSelector" native="true"/>
+      </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>
+  <customwidget>
+   <class>VBoxOSTypeSelectorWidget</class>
+   <extends>QWidget</extends>
+   <header>VBoxOSTypeSelectorWidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage3.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage3.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage3.ui	(revision 26079)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UINewVMWzdPage3</class>
+ <widget class="QWidget" name="UINewVMWzdPage3">
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <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;Select the amount of base memory (RAM) in megabytes to be allocated to the virtual machine.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage3Text2">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pMemoryCnt">
+     <property name="title">
+      <string>Base &amp;Memory Size</string>
+     </property>
+     <layout class="QGridLayout" name="m_pLayout2">
+      <item row="0" column="0" colspan="3">
+       <widget class="VBoxGuestRAMSlider" name="m_pRamSlider">
+        <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_pRamEditor">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="4">
+       <widget class="QLabel" name="m_pRamUnits">
+        <property name="text">
+         <string>MB</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="m_pRamMin">
+        <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_pRamMax">
+        <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>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QILineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>QILineEdit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>QIAdvancedSlider</class>
+   <extends>QSlider</extends>
+   <header>QIAdvancedSlider.h</header>
+  </customwidget>
+  <customwidget>
+   <class>VBoxGuestRAMSlider</class>
+   <extends>QIAdvancedSlider</extends>
+   <header>VBoxGuestRAMSlider.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage4.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage4.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage4.ui	(revision 26079)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UINewVMWzdPage4</class>
+ <widget class="QWidget" name="UINewVMWzdPage4">
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <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>&lt;p&gt;Select a hard disk image to be used as the boot hard disk of the virtual machine. You can either create a new hard disk using the &lt;b&gt;New&lt;/b&gt; button or select an existing hard disk image from the drop-down list or by pressing the &lt;b&gt;Existing&lt;/b&gt; button (to invoke the Virtual Media Manager dialog).&lt;/p&gt;&lt;p&gt;If you need a more complicated hard disk setup, you can also skip this step and attach hard disks later using the VM Settings dialog.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage4Text2">
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="m_pBootHDCnt">
+     <property name="title">
+      <string>Boot Hard &amp;Disk (Primary Master)</string>
+     </property>
+     <property name="checkable">
+      <bool>true</bool>
+     </property>
+     <layout class="QGridLayout" name="m_pLayout2">
+      <item row="0" column="0" colspan="3">
+       <widget class="QRadioButton" name="m_pDiskCreate">
+        <property name="text">
+         <string>&amp;Create new hard disk</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" colspan="3">
+       <widget class="QRadioButton" name="m_pDiskPresent">
+        <property name="text">
+         <string>&amp;Use existing hard disk</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="VBoxMediaComboBox" name="m_pDiskSelector"/>
+      </item>
+      <item row="2" column="2">
+       <widget class="QToolButton" name="m_pVMMButton">
+        <property name="autoRaise">
+         <bool>true</bool>
+        </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>
+  <customwidget>
+   <class>VBoxMediaComboBox</class>
+   <extends>QComboBox</extends>
+   <header>VBoxMediaComboBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage5.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage5.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage5.ui	(revision 26079)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2009 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UINewVMWzdPage5</class>
+ <widget class="QWidget" name="UINewVMWzdPage5">
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <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_pPage5Text1">
+     <property name="text">
+      <string>&lt;p&gt;You are going to create a new virtual machine with the following parameters:&lt;/p&gt;</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="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="readOnly">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QILabel" name="m_pPage5Text2">
+     <property name="text">
+      <string>&lt;p&gt;If the above is correct press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, a new virtual machine will be created. &lt;/p&gt;&lt;p&gt;Note that you can alter these and all other setting of the created virtual machine at any time using the &lt;b&gt;Settings&lt;/b&gt; dialog accessible through the menu of the main window.&lt;/p&gt;</string>
+     </property>
+     <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/newvm/VBoxNewVMWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/VBoxNewVMWzd.cpp	(revision 26078)
+++ 	(revision )
@@ -1,452 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxNewVMWzd class implementation
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-/* VBox includes */
-#include "VBoxNewVMWzd.h"
-#include "VBoxVMSettingsHD.h"
-#include "VBoxUtils.h"
-#include "VBoxGlobal.h"
-#include "VBoxProblemReporter.h"
-#include "VBoxNewHDWzd.h"
-#include "VBoxMediaManagerDlg.h"
-
-VBoxNewVMWzd::VBoxNewVMWzd (QWidget *aParent)
-    : QIWithRetranslateUI<QIAbstractWizard> (aParent)
-{
-    /* Apply UI decorations */
-    Ui::VBoxNewVMWzd::setupUi (this);
-
-    /* Initialize wizard hdr */
-    initializeWizardHdr();
-
-    /* Name and OS page */
-    mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this));
-
-    mWvalNameAndOS = new QIWidgetValidator (mPageNameAndOS, this);
-    connect (mWvalNameAndOS, SIGNAL (validityChanged (const QIWidgetValidator*)),
-             this, SLOT (enableNext (const QIWidgetValidator*)));
-    connect (mOSTypeSelector, SIGNAL (osTypeChanged()), this, SLOT (onOSTypeChanged()));
-
-    /* Memory page */
-    mLeRAM->setFixedWidthByText ("99999");
-    mLeRAM->setValidator (new QIntValidator (mSlRAM->minRAM(), mSlRAM->maxRAM(), this));
-
-    mWvalMemory = new QIWidgetValidator (mPageMemory, this);
-    connect (mWvalMemory, SIGNAL (validityChanged (const QIWidgetValidator*)),
-             this, SLOT (enableNext (const QIWidgetValidator*)));
-    connect (mWvalMemory, SIGNAL (isValidRequested (QIWidgetValidator*)),
-             this, SLOT (revalidate (QIWidgetValidator*)));
-    connect (mSlRAM, SIGNAL (valueChanged (int)),
-             this, SLOT (slRAMValueChanged (int)));
-    connect (mLeRAM, SIGNAL (textChanged (const QString&)),
-             this, SLOT (leRAMTextChanged (const QString&)));
-
-    /* HDD Images page */
-    QStyleOptionButton options;
-    options.initFrom (mNewVDIRadio);
-    QGridLayout *hdLayout = qobject_cast <QGridLayout*> (mGbHDA->layout());
-    int wid = mNewVDIRadio->style()->subElementRect (QStyle::SE_RadioButtonIndicator, &options, mNewVDIRadio).width() +
-              mNewVDIRadio->style()->pixelMetric (QStyle::PM_RadioButtonLabelSpacing, &options, mNewVDIRadio) -
-              hdLayout->spacing() - 1;
-    QSpacerItem *spacer = new QSpacerItem (wid, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
-    hdLayout->addItem (spacer, 2, 0);
-    mHDCombo->setType (VBoxDefs::MediumType_HardDisk);
-    mHDCombo->repopulate();
-    mTbVmm->setIcon (VBoxGlobal::iconSet (":/select_file_16px.png",
-                                          ":/select_file_dis_16px.png"));
-
-    mWvalHDD = new QIWidgetValidator (mPageHDD, this);
-    connect (mWvalHDD, SIGNAL (validityChanged (const QIWidgetValidator*)),
-             this, SLOT (enableNext (const QIWidgetValidator*)));
-    connect (mWvalHDD, SIGNAL (isValidRequested (QIWidgetValidator*)),
-             this, SLOT (revalidate (QIWidgetValidator*)));
-    connect (mGbHDA, SIGNAL (toggled (bool)), mWvalHDD, SLOT (revalidate()));
-    connect (mNewVDIRadio, SIGNAL (toggled (bool)), this, SLOT (hdTypeChanged()));
-    connect (mExistRadio, SIGNAL (toggled (bool)), this, SLOT (hdTypeChanged()));
-    connect (mHDCombo, SIGNAL (currentIndexChanged (int)),
-             mWvalHDD, SLOT (revalidate()));
-    connect (mTbVmm, SIGNAL (clicked()), this, SLOT (showMediaManager()));
-
-    /* Name and OS page */
-    onOSTypeChanged();
-
-    /* Memory page */
-    slRAMValueChanged (mSlRAM->value());
-
-    /* HDD Images page */
-    hdTypeChanged();
-
-    /* Initial revalidation */
-    mWvalNameAndOS->revalidate();
-    mWvalMemory->revalidate();
-    mWvalHDD->revalidate();
-
-    /* Initialize wizard ftr */
-    initializeWizardFtr();
-
-    retranslateUi();
-}
-
-VBoxNewVMWzd::~VBoxNewVMWzd()
-{
-    ensureNewHardDiskDeleted();
-}
-
-const CMachine& VBoxNewVMWzd::machine() const
-{
-    return mMachine;
-}
-
-void VBoxNewVMWzd::retranslateUi()
-{
-    /* Translate uic generated strings */
-    Ui::VBoxNewVMWzd::retranslateUi (this);
-
-    CGuestOSType type = mOSTypeSelector->type();
-
-    mTextRAMBest->setText (
-        tr ("The recommended base memory size is <b>%1</b> MB.")
-            .arg (type.GetRecommendedRAM()));
-    mTextVDIBest->setText (
-        tr ("The recommended size of the boot hard disk is <b>%1</b> MB.")
-            .arg (type.GetRecommendedHDD()));
-
-    mTxRAMMin->setText (QString ("<qt>%1&nbsp;%2</qt>")
-                        .arg (mSlRAM->minRAM()).arg (tr ("MB", "megabytes")));
-    mTxRAMMax->setText (QString ("<qt>%1&nbsp;%2</qt>")
-                        .arg (mSlRAM->maxRAM()).arg (tr ("MB", "megabytes")));
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mPageSummary)
-    {
-        /* Compose summary */
-        QString summary = QString (
-            "<tr><td><nobr>%1:&nbsp;</nobr></td><td>%2</td></tr>"
-            "<tr><td><nobr>%3:&nbsp;</nobr></td><td>%4</td></tr>"
-            "<tr><td><nobr>%5:&nbsp;</nobr></td><td>%6&nbsp;%7</td></tr>")
-            .arg (tr ("Name", "summary"), mLeName->text())
-            .arg (tr ("OS Type", "summary"), type.GetDescription())
-            .arg (tr ("Base Memory", "summary")).arg (mSlRAM->value())
-            .arg (tr ("MB", "megabytes"));
-
-        if (mGbHDA->isChecked() && !mHDCombo->id().isNull())
-            summary += QString (
-                "<tr><td><nobr>%8:&nbsp;</nobr></td><td><nobr>%9</nobr></td></tr>")
-                .arg (tr ("Boot Hard Disk", "summary"), mHDCombo->currentText());
-
-        mTeSummary->setText ("<table>" + summary + "</table>");
-    }
-}
-
-void VBoxNewVMWzd::accept()
-{
-    /* Try to create the machine when the Finish button is pressed.
-     * On failure, the wisard will remain open to give it another try. */
-    if (constructMachine())
-        QDialog::accept();
-}
-
-void VBoxNewVMWzd::showMediaManager()
-{
-    VBoxMediaManagerDlg dlg (this);
-    dlg.setup (VBoxDefs::MediumType_HardDisk, true);
-
-    if (dlg.exec() == QDialog::Accepted)
-    {
-        QString newId = dlg.selectedId();
-        if (mHDCombo->id() != newId)
-        {
-            ensureNewHardDiskDeleted();
-            mHDCombo->setCurrentItem (newId);
-        }
-    }
-
-    mHDCombo->setFocus();
-}
-
-void VBoxNewVMWzd::onOSTypeChanged()
-{
-    slRAMValueChanged (mOSTypeSelector->type().GetRecommendedRAM());
-}
-
-void VBoxNewVMWzd::slRAMValueChanged (int aValue)
-{
-    mLeRAM->setText (QString().setNum (aValue));
-}
-
-void VBoxNewVMWzd::leRAMTextChanged (const QString &aText)
-{
-    mSlRAM->setValue (aText.toInt());
-}
-
-void VBoxNewVMWzd::hdTypeChanged()
-{
-    mHDCombo->setEnabled (mExistRadio->isChecked());
-    mTbVmm->setEnabled (mExistRadio->isChecked());
-    if (mExistRadio->isChecked())
-        mHDCombo->setFocus();
-
-    mWvalHDD->revalidate();
-}
-
-void VBoxNewVMWzd::revalidate (QIWidgetValidator *aWval)
-{
-    /* Get common result of validators */
-    bool valid = aWval->isOtherValid();
-
-    /* Do individual validations for pages */
-    if (aWval->widget() == mPageMemory)
-    {
-        valid = true;
-        if (mSlRAM->value() > (int)mSlRAM->maxRAMAlw())
-            valid = false;
-    }
-    else if (aWval->widget() == mPageHDD)
-    {
-        valid = true;
-        if (    (mGbHDA->isChecked())
-            &&  (vboxGlobal().findMedium (mHDCombo->id()).isNull())
-            &&  (mExistRadio->isChecked()))
-        {
-            valid = false;
-        }
-    }
-
-    aWval->setOtherValid (valid);
-}
-
-void VBoxNewVMWzd::enableNext (const QIWidgetValidator *aWval)
-{
-    nextButton (aWval->widget())->setEnabled (aWval->isValid());
-}
-
-void VBoxNewVMWzd::onPageShow()
-{
-    /* Make sure all is properly translated & composed */
-    retranslateUi();
-
-    QWidget *page = mPageStack->currentWidget();
-
-    if (page == mPageWelcome)
-        nextButton (page)->setFocus();
-    else if (page == mPageNameAndOS)
-        mLeName->setFocus();
-    else if (page == mPageMemory)
-        mSlRAM->setFocus();
-    else if (page == mPageHDD)
-        mHDCombo->setFocus();
-    else if (page == mPageSummary)
-        mTeSummary->setFocus();
-
-    if (page == mPageSummary)
-        finishButton()->setDefault (true);
-    else
-        nextButton (page)->setDefault (true);
-}
-
-void VBoxNewVMWzd::showBackPage()
-{
-    /* Delete temporary HD if present */
-    if (sender() == mBtnBack5)
-        ensureNewHardDiskDeleted();
-
-    /* Switch to the back page */
-    QIAbstractWizard::showBackPage();
-}
-
-void VBoxNewVMWzd::showNextPage()
-{
-    /* Ask user about disk-less machine */
-    if (sender() == mBtnNext4 && !mGbHDA->isChecked() &&
-        !vboxProblem().confirmHardDisklessMachine (this))
-        return;
-
-    /* Show the New Hard Disk wizard */
-    if (sender() == mBtnNext4 && mGbHDA->isChecked() &&
-        mNewVDIRadio->isChecked() && !showNewHDWizard())
-        return;
-
-    /* Switch to the next page */
-    QIAbstractWizard::showNextPage();
-}
-
-
-bool VBoxNewVMWzd::showNewHDWizard()
-{
-    VBoxNewHDWzd dlg (this);
-
-    dlg.setRecommendedFileName (mLeName->text());
-    dlg.setRecommendedSize (mOSTypeSelector->type().GetRecommendedHDD());
-
-    if (dlg.exec() == QDialog::Accepted)
-    {
-        ensureNewHardDiskDeleted();
-        mHardDisk = dlg.hardDisk();
-        mHDCombo->setCurrentItem (mHardDisk.GetId());
-        return true;
-    }
-
-    return false;
-}
-
-bool VBoxNewVMWzd::constructMachine()
-{
-    CVirtualBox vbox = vboxGlobal().virtualBox();
-
-    /* OS type */
-    CGuestOSType type = mOSTypeSelector->type();
-    AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
-    QString typeId = type.GetId();
-
-    /* Create a machine with the default settings file location */
-    if (mMachine.isNull())
-    {
-        mMachine = vbox.CreateMachine (mLeName->text(), typeId, QString::null, QString::null);
-        if (!vbox.isOk())
-        {
-            vboxProblem().cannotCreateMachine (vbox, this);
-            return false;
-        }
-
-        /* The FirstRun wizard is to be shown only when we don't attach any hard
-         * disk or attach a new (empty) one. Selecting an existing hard disk
-         * will cancel the wizard. */
-        if (!mGbHDA->isChecked() || !mHardDisk.isNull())
-            mMachine.SetExtraData (VBoxDefs::GUI_FirstRun, "yes");
-    }
-
-    /* RAM size */
-    mMachine.SetMemorySize (mSlRAM->value());
-
-    /* VRAM size - select maximum between recommended and minimum for fullscreen */
-    mMachine.SetVRAMSize (qMax (type.GetRecommendedVRAM(),
-                                (ULONG) (VBoxGlobal::requiredVideoMemory(&mMachine) / _1M)));
-
-    /* Enabling audio by default */
-    mMachine.GetAudioAdapter().SetEnabled (true);
-
-    /* Enable the OHCI and EHCI controller by default for new VMs. (new in 2.2) */
-    CUSBController usbController = mMachine.GetUSBController();
-    if (!usbController.isNull())
-    {
-        usbController.SetEnabled (true);
-        usbController.SetEnabledEhci (true);
-    }
-
-    /* Create default storage controllers */
-    QString ideCtrName = VBoxVMSettingsHD::tr ("IDE Controller");
-    QString floppyCtrName = VBoxVMSettingsHD::tr ("Floppy Controller");
-    KStorageBus ideBus = KStorageBus_IDE;
-    KStorageBus floppyBus = KStorageBus_Floppy;
-    mMachine.AddStorageController (ideCtrName, ideBus);
-    mMachine.AddStorageController (floppyCtrName, floppyBus);
-
-    /* Register the VM prior to attaching hard disks */
-    vbox.RegisterMachine (mMachine);
-    if (!vbox.isOk())
-    {
-        vboxProblem().cannotCreateMachine (vbox, mMachine, this);
-        return false;
-    }
-
-    /* Attach default devices */
-    {
-        bool success = false;
-        QString machineId = mMachine.GetId();
-        CSession session = vboxGlobal().openSession (machineId);
-        if (!session.isNull())
-        {
-            CMachine m = session.GetMachine();
-
-            /* Boot hard disk (IDE Primary Master) */
-            if (mGbHDA->isChecked())
-            {
-                m.AttachDevice (ideCtrName, 0, 0, KDeviceType_HardDisk, mHDCombo->id());
-                if (!m.isOk())
-                    vboxProblem().cannotAttachDevice (this, m, VBoxDefs::MediumType_HardDisk, mHDCombo->location(), ideBus, 0, 0);
-            }
-
-            /* Attach empty CD/DVD ROM Device */
-            m.AttachDevice (ideCtrName, 1, 0, KDeviceType_DVD, QString(""));
-            if (!m.isOk())
-                vboxProblem().cannotAttachDevice (this, m, VBoxDefs::MediumType_DVD, QString(), ideBus, 1, 0);
-
-            /* Attach empty Floppy Device */
-            m.AttachDevice (floppyCtrName, 0, 0, KDeviceType_Floppy, QString(""));
-            if (!m.isOk())
-                vboxProblem().cannotAttachDevice (this, m, VBoxDefs::MediumType_Floppy, QString(), floppyBus, 0, 0);
-
-            if (m.isOk())
-            {
-                m.SaveSettings();
-                if (m.isOk())
-                    success = true;
-                else
-                    vboxProblem().cannotSaveMachineSettings (m, this);
-            }
-
-            session.Close();
-        }
-        if (!success)
-        {
-            /* Unregister on failure */
-            vbox.UnregisterMachine (machineId);
-            if (vbox.isOk())
-                mMachine.DeleteSettings();
-            return false;
-        }
-    }
-
-    /* Ensure we don't try to delete a newly created hard disk on success */
-    mHardDisk.detach();
-
-    return true;
-}
-
-void VBoxNewVMWzd::ensureNewHardDiskDeleted()
-{
-    if (!mHardDisk.isNull())
-    {
-        /* Remember ID as it may be lost after the deletion */
-        QString id = mHardDisk.GetId();
-
-        bool success = false;
-
-        CProgress progress = mHardDisk.DeleteStorage();
-        if (mHardDisk.isOk())
-        {
-            vboxProblem().showModalProgressDialog (progress, windowTitle(),
-                                                   parentWidget());
-            if (progress.isOk() && progress.GetResultCode() == S_OK)
-                success = true;
-        }
-
-        if (success)
-            vboxGlobal().removeMedium (VBoxDefs::MediumType_HardDisk, id);
-        else
-            vboxProblem().cannotDeleteHardDiskStorage (this, mHardDisk,
-                                                       progress);
-        mHardDisk.detach();
-    }
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/VBoxNewVMWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/VBoxNewVMWzd.h	(revision 26078)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt4 GUI ("VirtualBox"):
- * VBoxNewVMWzd class declaration
- */
-
-/*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
- *
- * 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.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-#ifndef __VBoxNewVMWzd_h__
-#define __VBoxNewVMWzd_h__
-
-#include "QIAbstractWizard.h"
-#include "VBoxNewVMWzd.gen.h"
-#include "COMDefs.h"
-#include "QIWidgetValidator.h"
-#include "QIWithRetranslateUI.h"
-
-class VBoxNewVMWzd : public QIWithRetranslateUI<QIAbstractWizard>,
-                     public Ui::VBoxNewVMWzd
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxNewVMWzd (QWidget *aParent = 0);
-   ~VBoxNewVMWzd();
-
-    const CMachine& machine() const;
-
-protected:
-
-    void retranslateUi();
-
-private slots:
-
-    void accept();
-    void showMediaManager();
-    void onOSTypeChanged();
-    void slRAMValueChanged (int aValue);
-    void leRAMTextChanged (const QString &aTtext);
-    void hdTypeChanged();
-    void revalidate (QIWidgetValidator *aWval);
-    void enableNext (const QIWidgetValidator *aWval);
-    void onPageShow();
-    void showBackPage();
-    void showNextPage();
-
-private:
-
-    bool showNewHDWizard();
-    bool constructMachine();
-    void ensureNewHardDiskDeleted();
-
-    QIWidgetValidator *mWvalNameAndOS;
-    QIWidgetValidator *mWvalMemory;
-    QIWidgetValidator *mWvalHDD;
-    CMedium mHardDisk;
-    CMachine mMachine;
-};
-
-#endif // __VBoxNewVMWzd_h__
-
Index: unk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/VBoxNewVMWzd.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/VBoxNewVMWzd.ui	(revision 26078)
+++ 	(revision )
@@ -1,1212 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <comment>
- VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
-
-     Copyright (C) 2008 Sun Microsystems, Inc.
-
-     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.
-
-     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-     Clara, CA 95054 USA or visit http://www.sun.com if you need
-     additional information or have any questions.
- </comment>
- <class>VBoxNewVMWzd</class>
- <widget class="QDialog" name="VBoxNewVMWzd">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>516</width>
-    <height>498</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Create New Virtual Machine</string>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QStackedWidget" name="mPageStack">
-     <property name="currentIndex">
-      <number>2</number>
-     </property>
-     <widget class="QWidget" name="mPageWelcome">
-      <layout class="QVBoxLayout">
-       <item>
-        <widget class="QLabel" name="mPageWelcomeHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Welcome to the New Virtual Machine Wizard!</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line11">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <property name="spacing">
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoWelcome">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_new_welcome.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout">
-           <property name="spacing">
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextWelcome">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>&lt;p&gt;This wizard will guide you through the steps that are necessary to create a new virtual machine for VirtualBox.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page.&lt;/p&gt;</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line12">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack1">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext1">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel1">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageNameAndOS">
-      <layout class="QVBoxLayout">
-       <item>
-        <widget class="QLabel" name="mPageNameAndOSHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>VM Name and OS Type</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line21">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <property name="spacing">
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoNameAndOS">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_new_welcome.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout">
-           <property name="spacing">
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextNameAndOS">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>&lt;p&gt;Enter a name for the new virtual machine and select the type of the guest operating system you plan to install onto the virtual machine.&lt;/p&gt;&lt;p&gt;The name of the virtual machine usually indicates its software and hardware configuration. It will be used by all VirtualBox components to identify your virtual machine.&lt;/p&gt;</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="gbName">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title">
-              <string>N&amp;ame</string>
-             </property>
-             <layout class="QHBoxLayout">
-              <property name="spacing">
-               <number>0</number>
-              </property>
-              <property name="leftMargin">
-               <number>9</number>
-              </property>
-              <property name="topMargin">
-               <number>4</number>
-              </property>
-              <property name="rightMargin">
-               <number>9</number>
-              </property>
-              <property name="bottomMargin">
-               <number>9</number>
-              </property>
-              <item>
-               <widget class="QLineEdit" name="mLeName"/>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="gbOSType">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title">
-              <string>OS &amp;Type</string>
-             </property>
-             <layout class="QHBoxLayout">
-              <property name="topMargin">
-               <number>4</number>
-              </property>
-              <item>
-               <widget class="VBoxOSTypeSelectorWidget" name="mOSTypeSelector" native="true"/>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line22">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack2">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext2">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel2">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageMemory">
-      <layout class="QVBoxLayout">
-       <item>
-        <widget class="QLabel" name="mPageMemoryHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Memory</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line31">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <property name="spacing">
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoMemory">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_new_welcome.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout">
-           <property name="spacing">
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextMemory">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>&lt;p&gt;Select the amount of base memory (RAM) in megabytes to be allocated to the virtual machine.&lt;/p&gt;</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextRAMBest">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string/>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="gbMemory">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title">
-              <string>Base &amp;Memory Size</string>
-             </property>
-             <layout class="QGridLayout">
-              <property name="topMargin">
-               <number>4</number>
-              </property>
-              <item row="0" column="0" colspan="3">
-               <widget class="VBoxGuestRAMSlider" name="mSlRAM">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="minimumSize">
-                 <size>
-                  <width>0</width>
-                  <height>0</height>
-                 </size>
-                </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="mLeRAM">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-               </widget>
-              </item>
-              <item row="0" column="4">
-               <widget class="QLabel" name="txRAM">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text">
-                 <string>MB</string>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="0">
-               <widget class="QLabel" name="mTxRAMMin">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text">
-                 <string/>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="2">
-               <widget class="QLabel" name="mTxRAMMax">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="text">
-                 <string/>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="1">
-               <spacer>
-                <property name="orientation">
-                 <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeHint" stdset="0">
-                 <size>
-                  <width>40</width>
-                  <height>5</height>
-                 </size>
-                </property>
-               </spacer>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line32">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack3">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext3">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel3">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageHDD">
-      <layout class="QVBoxLayout">
-       <item>
-        <widget class="QLabel" name="mPageHDDHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Virtual Hard Disk</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line41">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <property name="spacing">
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoHDD">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_new_welcome.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout">
-           <property name="spacing">
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextVDI">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>&lt;p&gt;Select a hard disk image to be used as the boot hard disk of the virtual machine. You can either create a new hard disk using the &lt;b&gt;New&lt;/b&gt; button or select an existing hard disk image from the drop-down list or by pressing the &lt;b&gt;Existing&lt;/b&gt; button (to invoke the Virtual Media Manager dialog).&lt;/p&gt;&lt;p&gt;If you need a more complicated hard disk setup, you can also skip this step and attach hard disks later using the VM Settings dialog.&lt;/p&gt;</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextVDIBest">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string/>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QGroupBox" name="mGbHDA">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title">
-              <string>Boot Hard &amp;Disk (Primary Master)</string>
-             </property>
-             <property name="checkable">
-              <bool>true</bool>
-             </property>
-             <layout class="QGridLayout">
-              <item row="0" column="0" colspan="3">
-               <widget class="QRadioButton" name="mNewVDIRadio">
-                <property name="text">
-                 <string>&amp;Create new hard disk</string>
-                </property>
-                <property name="checked">
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="0" colspan="3">
-               <widget class="QRadioButton" name="mExistRadio">
-                <property name="text">
-                 <string>&amp;Use existing hard disk</string>
-                </property>
-               </widget>
-              </item>
-              <item row="2" column="1">
-               <widget class="VBoxMediaComboBox" name="mHDCombo">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-               </widget>
-              </item>
-              <item row="2" column="2">
-               <widget class="QToolButton" name="mTbVmm">
-                <property name="autoRaise">
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line42">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack4">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnNext4">
-           <property name="text">
-            <string>&amp;Next &gt;</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel4">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="mPageSummary">
-      <layout class="QVBoxLayout">
-       <item>
-        <widget class="QLabel" name="mPageSummaryHdr">
-         <property name="font">
-          <font>
-           <family>Arial</family>
-           <pointsize>12</pointsize>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Summary</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="Line" name="line51">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <property name="spacing">
-          <number>10</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLogoSummary">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="autoFillBackground">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="pixmap">
-            <pixmap resource="../VirtualBox1.qrc">:/vmw_new_welcome.png</pixmap>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <layout class="QVBoxLayout">
-           <property name="spacing">
-            <number>10</number>
-           </property>
-           <item>
-            <widget class="QILabel" name="mTextSummaryHdr">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>&lt;p&gt;You are going to create a new virtual machine with the following parameters:&lt;/p&gt;</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QITextEdit" name="mTeSummary">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <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="autoFormatting">
-              <set>QTextEdit::AutoAll</set>
-             </property>
-             <property name="readOnly">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QILabel" name="mTextSummaryFtr">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>300</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>&lt;p&gt;If the above is correct press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, a new virtual machine will be created. &lt;/p&gt;&lt;p&gt;Note that you can alter these and all other setting of the created virtual machine at any time using the &lt;b&gt;Settings&lt;/b&gt; dialog accessible through the menu of the main window.&lt;/p&gt;</string>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeType">
-              <enum>QSizePolicy::Expanding</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>0</width>
-               <height>0</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line52">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout">
-         <item>
-          <spacer>
-           <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>
-          <widget class="QPushButton" name="mBtnBack5">
-           <property name="text">
-            <string>&lt; &amp;Back</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnFinish">
-           <property name="text">
-            <string>&amp;Finish</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>5</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="mBtnCancel5">
-           <property name="text">
-            <string>Cancel</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QILabel</class>
-   <extends>QLabel</extends>
-   <header>QILabel.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxOSTypeSelectorWidget</class>
-   <extends>QWidget</extends>
-   <header>VBoxOSTypeSelectorWidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxMediaComboBox</class>
-   <extends>QComboBox</extends>
-   <header>VBoxMediaComboBox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QITextEdit</class>
-   <extends>QTextEdit</extends>
-   <header>QIAbstractWizard.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QILineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>QILineEdit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QIAdvancedSlider</class>
-   <extends>QSlider</extends>
-   <header>QIAdvancedSlider.h</header>
-  </customwidget>
-  <customwidget>
-   <class>VBoxGuestRAMSlider</class>
-   <extends>QIAdvancedSlider</extends>
-   <header>VBoxGuestRAMSlider.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>mBtnNext1</tabstop>
-  <tabstop>mBtnCancel1</tabstop>
-  <tabstop>mLeName</tabstop>
-  <tabstop>mOSTypeSelector</tabstop>
-  <tabstop>mBtnBack2</tabstop>
-  <tabstop>mBtnNext2</tabstop>
-  <tabstop>mBtnCancel2</tabstop>
-  <tabstop>mSlRAM</tabstop>
-  <tabstop>mLeRAM</tabstop>
-  <tabstop>mBtnBack3</tabstop>
-  <tabstop>mBtnNext3</tabstop>
-  <tabstop>mBtnCancel3</tabstop>
-  <tabstop>mNewVDIRadio</tabstop>
-  <tabstop>mExistRadio</tabstop>
-  <tabstop>mHDCombo</tabstop>
-  <tabstop>mTbVmm</tabstop>
-  <tabstop>mBtnBack4</tabstop>
-  <tabstop>mBtnNext4</tabstop>
-  <tabstop>mBtnCancel4</tabstop>
-  <tabstop>mBtnBack5</tabstop>
-  <tabstop>mBtnFinish</tabstop>
-  <tabstop>mBtnCancel5</tabstop>
- </tabstops>
- <resources>
-  <include location="../VirtualBox1.qrc"/>
- </resources>
- <connections/>
-</ui>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.cpp	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.cpp	(revision 26079)
@@ -0,0 +1,886 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIRegistrationWzd class implementation
+ */
+
+/*
+ * Copyright (C) 2008-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/* Global includes */
+#include <QTimer>
+#include <QUrl>
+
+/* Local includes */
+#include "UIRegistrationWzd.h"
+#include "VBoxGlobal.h"
+#include "VBoxProblemReporter.h"
+#include "QIHttp.h"
+
+/**
+ *  This class is used to encode/decode the registration data.
+ */
+class RegistrationData
+{
+public:
+
+    RegistrationData(const QString &strData, bool bEncode)
+        : m_bValid(bEncode)
+        , m_bRegistered(bEncode)
+        , m_cTriesLeft(3 /* the initial tries value */)
+    {
+        bEncode ? encode(strData) : decode(strData);
+    }
+
+    bool isValid() const { return m_bValid; }
+    bool isRegistered() const { return m_bRegistered; }
+
+    const QString &data() const { return m_strData; }
+    const QString &account() const { return m_strAccount; }
+
+    uint triesLeft() const { return m_cTriesLeft; }
+
+private:
+
+    void decode(const QString &strData)
+    {
+        if (strData.isEmpty())
+            return;
+
+        m_strData = strData;
+
+        /* Decoding number of left tries */
+        if (m_strData.startsWith("triesLeft="))
+        {
+            bool ok = false;
+            uint cTriesLeft = m_strData.section('=', 1, 1).toUInt(&ok);
+            if (!ok)
+                return;
+            m_cTriesLeft = cTriesLeft;
+            m_bValid = true;
+            return;
+        }
+
+        /* Decoding CRC32 */
+        QString strDataCopy = m_strData;
+        QString strCrcData = strDataCopy.right(2 * sizeof(ulong));
+        ulong uCrcNeed = 0;
+        for (long i = 0; i < strCrcData.length(); i += 2)
+        {
+            uCrcNeed <<= 8;
+            uchar uCurByte = (uchar)strCrcData.mid(i, 2).toUShort(0, 16);
+            uCrcNeed += uCurByte;
+        }
+        strDataCopy.truncate(strDataCopy.length() - 2 * sizeof(ulong));
+
+        /* Decoding data */
+        QString strResult;
+        for (long i = 0; i < strDataCopy.length(); i += 4)
+            strResult += QChar(strDataCopy.mid(i, 4).toUShort(0, 16));
+        ulong uCrcNow = crc32((uchar*)strResult.toAscii().constData(), strResult.length());
+
+        /* Check the CRC32 */
+        if (uCrcNeed != uCrcNow)
+            return;
+
+        /* Split values list */
+        QStringList list(strResult.split('|'));
+
+        /* Ignore the old format */
+        if (list.size() > 1)
+            return;
+
+        /* Result value */
+        m_bValid = true;
+        m_bRegistered = true;
+        m_strAccount = list[0];
+    }
+
+    void encode(const QString &strAccount)
+    {
+        if (strAccount.isEmpty())
+            return;
+
+        m_strAccount = strAccount;
+
+        /* Encoding data */
+        QString strData = m_strAccount;
+        m_strData = QString::null;
+        for (long i = 0; i < strData.length(); ++ i)
+        {
+            QString strCurPair = QString::number(strData.at(i).unicode(), 16);
+            while (strCurPair.length() < 4)
+                strCurPair.prepend('0');
+            m_strData += strCurPair;
+        }
+
+        /* Enconding CRC32 */
+        ulong uCrcNow = crc32((uchar*)strData.toAscii().constData(), strData.length());
+        QString strCrcData;
+        for (ulong i = 0; i < sizeof(ulong); ++ i)
+        {
+            ushort uCurByte = uCrcNow & 0xFF;
+            QString strCurPair = QString::number(uCurByte, 16);
+            if (strCurPair.length() == 1)
+                strCurPair.prepend('0');
+            strCrcData = strCurPair + strCrcData;
+            uCrcNow >>= 8;
+        }
+
+        m_strData += strCrcData;
+    }
+
+    ulong crc32(unsigned char *strBufer, int iSize)
+    {
+        /* Filling CRC32 table */
+        ulong uCrc32;
+        ulong aCrcTable[256];
+        ulong uTemp;
+        for (int i = 0; i < 256; ++ i)
+        {
+            uTemp = i;
+            for (int j = 8; j > 0; -- j)
+            {
+                if (uTemp & 1)
+                    uTemp = (uTemp >> 1) ^ 0xedb88320;
+                else
+                    uTemp >>= 1;
+            };
+            aCrcTable[i] = uTemp;
+        }
+
+        /* CRC32 calculation */
+        uCrc32 = 0xffffffff;
+        for (int i = 0; i < iSize; ++ i)
+        {
+            uCrc32 = aCrcTable[(uCrc32 ^ (*strBufer ++)) & 0xff] ^ (uCrc32 >> 8);
+        }
+        uCrc32 = uCrc32 ^ 0xffffffff;
+        return uCrc32;
+    };
+
+    bool m_bValid : 1;
+    bool m_bRegistered : 1;
+
+    uint m_cTriesLeft;
+
+    QString m_strAccount;
+    QString m_strData;
+};
+
+/**
+ *  This class is used to perform the registration actions.
+ */
+class RegistrationEngine : public QEventLoop
+{
+    Q_OBJECT;
+
+public:
+
+    RegistrationEngine(QWidget *pParent) : QEventLoop(pParent)
+    {
+        /* Registration address */
+        m_Url = QUrl("http://registration.virtualbox.org/register763.php");
+
+        /* HTTP Engine */
+        m_pHttp = new QIHttp(this, m_Url.host());
+
+        /* Initial values */
+        m_bPresent = false;
+        m_bResult = false;
+    }
+
+    void setOldData(const QString &strVersion, const QString &strPlatform,
+                    const QString &strOldEmail, const QString &strOldPassword)
+    {
+        /* Case for present account */
+        resetFields();
+        m_bPresent = true;
+        m_strVersion = strVersion;
+        m_strPlatform = strPlatform;
+        m_strOldEmail = strOldEmail;
+        m_strOldPassword = strOldPassword;
+    }
+
+    void setNewData(const QString &strVersion, const QString &strPlatform,
+                    const QString &strNewEmail, const QString &strNewPassword,
+                    const QString &strNewFirstName, const QString &strNewLastName,
+                    const QString &strNewCompany, const QString &strNewCountry)
+    {
+        /* Case for account creation */
+        resetFields();
+        m_bPresent = false;
+        m_strVersion = strVersion;
+        m_strPlatform = strPlatform;
+        m_strNewEmail = strNewEmail;
+        m_strNewPassword = strNewPassword;
+        m_strNewFirstName = strNewFirstName;
+        m_strNewLastName = strNewLastName;
+        m_strNewCompany = strNewCompany;
+        m_strNewCountry = strNewCountry;
+    }
+
+    int start()
+    {
+        /* Request handshake */
+        QTimer::singleShot(0, this, SLOT(sltHandshakeStart()));
+        return QEventLoop::exec(QEventLoop::AllEvents);
+    }
+
+    bool result() const
+    {
+        return m_bResult;
+    }
+
+private slots:
+
+    void sltHandshakeStart()
+    {
+        /* Compose query */
+        QUrl url(m_Url);
+        url.addQueryItem("version", m_strVersion);
+
+        /* Handshake */
+        connect(m_pHttp, SIGNAL(allIsDone(bool)), this, SLOT(sltHandshakeResponse(bool)));
+        m_pHttp->post(url.toEncoded());
+    }
+
+    void sltHandshakeResponse(bool bError)
+    {
+        /* Block all the other incoming signals */
+        m_pHttp->disconnect(this);
+
+        /* Process error if present */
+        if (bError)
+            return abortRequest(m_pHttp->errorString());
+
+        /* Read received key */
+        m_strKey = m_pHttp->readAll();
+
+        /* Verifying key correctness */
+        if (QString(m_strKey).indexOf(QRegExp("^[a-zA-Z0-9]{32}$")))
+            return abortRequest(tr("Could not perform connection handshake."));
+
+        /* Request registration */
+        QTimer::singleShot(0, this, SLOT(sltRegistrationStart()));
+    }
+
+    void sltRegistrationStart()
+    {
+        /* Compose query */
+        QUrl url(m_Url);
+
+        /* Basic set */
+        url.addQueryItem("version", m_strVersion);
+        url.addQueryItem("key", m_strKey);
+        url.addQueryItem("platform", m_strPlatform);
+
+        if (m_bPresent)
+        {
+            /* Set for present account */
+            url.addQueryItem("email", m_strOldEmail);
+            url.addQueryItem("password", m_strOldPassword);
+        }
+        else
+        {
+            /* Set for account creation */
+            url.addQueryItem("email", m_strNewEmail);
+            url.addQueryItem("password", m_strNewPassword);
+            url.addQueryItem("firstname", m_strNewFirstName);
+            url.addQueryItem("lastname", m_strNewLastName);
+            url.addQueryItem("company", m_strNewCompany);
+            url.addQueryItem("country", m_strNewCountry);
+        }
+
+        /* Registration */
+        connect(m_pHttp, SIGNAL(allIsDone(bool)), this, SLOT(sltRegistrationResponse(bool)));
+        m_pHttp->post(url.toEncoded());
+    }
+
+    void sltRegistrationResponse(bool bError)
+    {
+        /* Block all the other incoming signals */
+        m_pHttp->disconnect(this);
+
+        /* Process error if present */
+        if (bError)
+            return abortRequest(m_pHttp->errorString());
+
+        /* Read received result */
+        m_strData = m_pHttp->readAll();
+
+        /* Show registration result */
+        vboxProblem().showRegisterResult(qobject_cast<QWidget*>(parent()), m_strData);
+
+        /* Set result */
+        m_bResult = m_strData == "OK";
+
+        /* Allows all the queued events to be processed before leaving loop */
+        QTimer::singleShot(0, this, SLOT(quit()));
+    }
+
+private:
+
+    void resetFields()
+    {
+        m_bResult = false;
+        m_bPresent = false;
+        m_strVersion = QString();
+        m_strKey = QString();
+        m_strPlatform = QString();
+        m_strOldEmail = QString();
+        m_strOldPassword = QString();
+        m_strNewEmail = QString();
+        m_strNewPassword = QString();
+        m_strNewFirstName = QString();
+        m_strNewLastName = QString();
+        m_strNewCompany = QString();
+        m_strNewCountry = QString();
+        m_strData = QString();
+    }
+
+    void abortRequest(const QString &strReason)
+    {
+        /* Show reason if present */
+        if (!strReason.isNull())
+            vboxProblem().cannotConnectRegister(qobject_cast<QWidget*>(parent()), m_Url.toString(), strReason);
+
+        /* Result = FAILED */
+        m_bResult = false;
+
+        /* Allows all the queued events to be processed before leaving loop */
+        QTimer::singleShot(0, this, SLOT(quit()));
+    }
+
+    QUrl m_Url;
+    QIHttp *m_pHttp;
+
+    bool m_bResult;
+    bool m_bPresent;
+
+    QString m_strVersion;
+    QString m_strKey;
+    QString m_strPlatform;
+    QString m_strOldEmail;
+    QString m_strOldPassword;
+    QString m_strNewEmail;
+    QString m_strNewPassword;
+    QString m_strNewFirstName;
+    QString m_strNewLastName;
+    QString m_strNewCompany;
+    QString m_strNewCountry;
+    QString m_strData;
+};
+
+/* Check if registration dialog necessary */
+bool UIRegistrationWzd::hasToBeShown()
+{
+    RegistrationData data(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_RegistrationData), false);
+    return (!data.isValid()) || (!data.isRegistered() && data.triesLeft() > 0);
+}
+
+UIRegistrationWzd::UIRegistrationWzd(UIRegistrationWzd **ppSelf)
+    : QIWizard(0)
+    , m_ppThis(ppSelf)
+{
+    /* Store external pointer to this dialog */
+    *m_ppThis = this;
+
+    /* Apply window icons */
+    setWindowIcon(vboxGlobal().iconSetFull(QSize(32, 32), QSize(16, 16),
+                                           ":/register_32px.png", ":/register_16px.png"));
+
+    /* Create & add page */
+    addPage(new UIRegistrationWzdPage1);
+
+    /* Translate */
+    retranslateUi();
+
+    /* Resize to 'golden ratio' */
+    resizeToGoldenRatio();
+
+    /* Assign watermark */
+    assignWatermark(":/vmw_new_user.png");
+
+    /* Setup connections */
+    connect(vboxGlobal().mainWindow(), SIGNAL(closing()), this, SLOT(reject()));
+}
+
+UIRegistrationWzd::~UIRegistrationWzd()
+{
+    /* Erase dialog handle in config file */
+    vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_RegistrationDlgWinID, QString::null);
+
+    /* Erase external pointer to this dialog */
+    *m_ppThis = 0;
+}
+
+void UIRegistrationWzd::retranslateUi()
+{
+    /* Wizard title */
+    setWindowTitle(tr("VirtualBox Registration Dialog"));
+}
+
+void UIRegistrationWzd::reject()
+{
+    /* Decrement the triesLeft */
+    RegistrationData data(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_RegistrationData), false);
+    if (!data.isValid() || !data.isRegistered())
+    {
+        uint cTriesLeft = data.triesLeft();
+        if (cTriesLeft)
+        {
+            -- cTriesLeft;
+            vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_RegistrationData, QString("triesLeft=%1").arg(cTriesLeft));
+        }
+    }
+    /* And close the dialog */
+    QWizard::reject();
+}
+
+UIRegistrationWzdPage1::UIRegistrationWzdPage1()
+{
+    /* Decorate page */
+    Ui::UIRegistrationWzdPage1::setupUi(this);
+
+    /* Setup fields validations */
+    QRegExp nameExp ("[\\S\\s]+");
+    /* E-mail address is validated according to RFC2821, RFC2822,
+     * see http://en.wikipedia.org/wiki/E-mail_address */
+    QRegExp emailExp ("(([a-zA-Z0-9_\\-\\.!#$%\\*/?|^{}`~&'\\+=]*"
+                        "[a-zA-Z0-9_\\-!#$%\\*/?|^{}`~&'\\+=])|"
+                      "(\"([\\x0001-\\x0008,\\x000B,\\x000C,\\x000E-\\x0019,\\x007F,"
+                            "\\x0021,\\x0023-\\x005B,\\x005D-\\x007E,"
+                            "\\x0009,\\x0020]|"
+                          "(\\\\[\\x0001-\\x0009,\\x000B,\\x000C,"
+                                "\\x000E-\\x007F]))*\"))"
+                      "@"
+                      "[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)*");
+    QRegExp passwordExp ("[a-zA-Z0-9_\\-\\+=`~!@#$%^&\\*\\(\\)?\\[\\]:;,\\./]+");
+
+    m_pLeOldEmail->setMaxLength(50);
+    /* New accounts *must* have a valid email as user name. Thats not the case
+     * for old existing accounts. So we don't force the email format, so that
+     * old accounts could be used for registration also. */
+    m_pLeOldEmail->setValidator(new QRegExpValidator(nameExp, this));
+
+    m_pLeOldPassword->setMaxLength(20);
+    m_pLeOldPassword->setValidator(new QRegExpValidator(passwordExp, this));
+
+    m_pLeNewFirstName->setMaxLength(50);
+    m_pLeNewFirstName->setValidator(new QRegExpValidator (nameExp, this));
+
+    m_pLeNewLastName->setMaxLength(50);
+    m_pLeNewLastName->setValidator(new QRegExpValidator(nameExp, this));
+
+    m_pLeNewCompany->setMaxLength(50);
+    m_pLeNewCompany->setValidator(new QRegExpValidator(nameExp, this));
+
+    m_pLeNewEmail->setMaxLength(50);
+    m_pLeNewEmail->setValidator(new QRegExpValidator(emailExp, this));
+
+    m_pLeNewPassword->setMaxLength(20);
+    m_pLeNewPassword->setValidator(new QRegExpValidator(passwordExp, this));
+
+    m_pLeNewConfirmPassword->setMaxLength(20);
+    m_pLeNewConfirmPassword->setValidator(new QRegExpValidator(passwordExp, this));
+
+    /* Populate countries list */
+    populateCountries();
+
+    /* Setup connections */
+    connect(m_pRbPresent, SIGNAL(toggled(bool)), this, SLOT(sltAccountTypeChanged()));
+    connect(m_pRbCreate, SIGNAL(toggled(bool)), this, SLOT(sltAccountTypeChanged()));
+    connect(m_pLeOldEmail, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeOldPassword, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeNewFirstName, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeNewLastName, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeNewCompany, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pCbNewCountry, SIGNAL(currentIndexChanged(int)), this, SIGNAL(completeChanged()));
+    connect(m_pLeNewEmail, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeNewPassword, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+    connect(m_pLeNewConfirmPassword, SIGNAL(textEdited(const QString &)), this, SIGNAL(completeChanged()));
+
+    /* Initial values */
+    m_pRbPresent->click();
+    RegistrationData data(vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_RegistrationData), false);
+    m_pLeOldEmail->setText(data.account());
+    m_pLeOldEmail->setFocus();
+
+    /* Translate */
+    retranslateUi();
+}
+
+void UIRegistrationWzdPage1::retranslateUi()
+{
+    /* Translate uic generated strings */
+    Ui::UIRegistrationWzdPage1::retranslateUi(this);
+
+    /* Wizard page 1 title */
+    setTitle(tr("Welcome to the VirtualBox Registration Form!"));
+
+    /* Translate the first element of countries list */
+    m_pCbNewCountry->setItemText(0, tr("Select Country/Territory"));
+}
+
+bool UIRegistrationWzdPage1::isComplete() const
+{
+    if (m_pRbPresent->isChecked())
+    {
+        /* Check for fields correctness */
+        if (!isFieldValid(m_pLeOldEmail) || !isFieldValid(m_pLeOldPassword))
+            return false;
+    }
+    if (m_pRbCreate->isChecked())
+    {
+        /* Check for fields correctness */
+        if (!isFieldValid (m_pLeNewFirstName) || !isFieldValid (m_pLeNewLastName) ||
+            !isFieldValid (m_pLeNewCompany) || !isFieldValid (m_pCbNewCountry) ||
+            !isFieldValid (m_pLeNewEmail) ||
+            !isFieldValid (m_pLeNewPassword) || !isFieldValid (m_pLeNewConfirmPassword))
+            return false;
+
+        /* Check for password correctness */
+        if (m_pLeNewPassword->text() != m_pLeNewConfirmPassword->text())
+            return false;
+    }
+    return true;
+}
+
+bool UIRegistrationWzdPage1::validatePage()
+{
+    /* Create registration engine */
+    RegistrationEngine engine(this);
+
+    /* Initialize registration engine */
+    if (m_pRbPresent->isChecked())
+    {
+        engine.setOldData(vboxGlobal().virtualBox().GetVersion(), vboxGlobal().platformInfo(),
+                          m_pLeOldEmail->text(), m_pLeOldPassword->text());
+    }
+    if (m_pRbCreate->isChecked())
+    {
+        engine.setNewData(vboxGlobal().virtualBox().GetVersion(), vboxGlobal().platformInfo(),
+                          m_pLeNewEmail->text(), m_pLeNewPassword->text(),
+                          m_pLeNewFirstName->text(), m_pLeNewLastName->text(),
+                          m_pLeNewCompany->text(), m_pCbNewCountry->currentText());
+    }
+
+    /* Disable wizard */
+    wizard()->setEnabled(false);
+
+    /* Set busy cursor */
+    setCursor(QCursor(Qt::BusyCursor));
+
+    /* Perform registration routine */
+    engine.start();
+
+    /* Restore cursor */
+    unsetCursor();
+
+    /* Enable wizard */
+    wizard()->setEnabled(true);
+
+    /* Save accepted account name */
+    if (engine.result())
+    {
+        /* Store registration data */
+        QString strAccount = m_pRbPresent->isChecked() ? m_pLeOldEmail->text() :
+                             m_pRbCreate->isChecked() ? m_pLeNewEmail->text() : QString();
+        RegistrationData data(strAccount, true);
+        vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_RegistrationData, data.data());
+    }
+
+    return engine.result();
+}
+
+void UIRegistrationWzdPage1::sltAccountTypeChanged()
+{
+    bool bPresentChosen = m_pRbPresent->isChecked();
+    bool bCreateChosen = m_pRbCreate->isChecked();
+
+    m_pLeOldEmail->setEnabled(bPresentChosen);
+    m_pLeOldPassword->setEnabled(bPresentChosen);
+    m_pLeNewFirstName->setEnabled(bCreateChosen);
+    m_pLeNewLastName->setEnabled(bCreateChosen);
+    m_pLeNewCompany->setEnabled(bCreateChosen);
+    m_pCbNewCountry->setEnabled(bCreateChosen);
+    m_pLeNewEmail->setEnabled(bCreateChosen);
+    m_pLeNewPassword->setEnabled(bCreateChosen);
+    m_pLeNewConfirmPassword->setEnabled(bCreateChosen);
+
+    emit completeChanged();
+}
+
+void UIRegistrationWzdPage1::populateCountries()
+{
+    QStringList list("Empty");
+    list << "Afghanistan"
+         << "Albania"
+         << "Algeria"
+         << "American Samoa"
+         << "Andorra"
+         << "Angola"
+         << "Anguilla"
+         << "Antartica"
+         << "Antigua & Barbuda"
+         << "Argentina"
+         << "Armenia"
+         << "Aruba"
+         << "Ascension Island"
+         << "Australia"
+         << "Austria"
+         << "Azerbaijan"
+         << "Bahamas"
+         << "Bahrain"
+         << "Bangladesh"
+         << "Barbados"
+         << "Belarus"
+         << "Belgium"
+         << "Belize"
+         << "Benin"
+         << "Bermuda"
+         << "Bhutan"
+         << "Bolivia"
+         << "Bosnia and Herzegovina"
+         << "Botswana"
+         << "Bouvet Island"
+         << "Brazil"
+         << "British Indian Ocean Territory"
+         << "Brunei Darussalam"
+         << "Bulgaria"
+         << "Burkina Faso"
+         << "Burundi"
+         << "Cambodia"
+         << "Cameroon"
+         << "Canada"
+         << "Cape Verde"
+         << "Cayman Islands"
+         << "Central African Republic"
+         << "Chad"
+         << "Chile"
+         << "China"
+         << "Christmas Island"
+         << "Cocos (Keeling) Islands"
+         << "Colombia"
+         << "Comoros"
+         << "Congo, Democratic People's Republic"
+         << "Congo, Republic of"
+         << "Cook Islands"
+         << "Costa Rica"
+         << "Cote d'Ivoire"
+         << "Croatia/Hrvatska"
+         << "Cyprus"
+         << "Czech Republic"
+         << "Denmark"
+         << "Djibouti"
+         << "Dominica"
+         << "Dominican Republic"
+         << "East Timor"
+         << "Ecuador"
+         << "Egypt"
+         << "El Salvador"
+         << "Equatorial Guinea"
+         << "Eritrea"
+         << "Estonia"
+         << "Ethiopia"
+         << "Falkland Islands (Malvina)"
+         << "Faroe Islands"
+         << "Fiji"
+         << "Finland"
+         << "France"
+         << "French Guiana"
+         << "French Polynesia"
+         << "French Southern Territories"
+         << "Gabon"
+         << "Gambia"
+         << "Georgia"
+         << "Germany"
+         << "Ghana"
+         << "Gibraltar"
+         << "Greece"
+         << "Greenland"
+         << "Grenada"
+         << "Guadeloupe"
+         << "Guam"
+         << "Guatemala"
+         << "Guernsey"
+         << "Guinea"
+         << "Guinea-Bissau"
+         << "Guyana"
+         << "Haiti"
+         << "Heard and McDonald Islands"
+         << "Holy See (City Vatican State)"
+         << "Honduras"
+         << "Hong Kong"
+         << "Hungary"
+         << "Iceland"
+         << "India"
+         << "Indonesia"
+         << "Iraq"
+         << "Ireland"
+         << "Isle of Man"
+         << "Israel"
+         << "Italy"
+         << "Jamaica"
+         << "Japan"
+         << "Jersey"
+         << "Jordan"
+         << "Kazakhstan"
+         << "Kenya"
+         << "Kiribati"
+         << "Korea, Republic of"
+         << "Kuwait"
+         << "Kyrgyzstan"
+         << "Lao People's Democratic Republic"
+         << "Latvia"
+         << "Lebanon"
+         << "Lesotho"
+         << "Liberia"
+         << "Libyan Arab Jamahiriya"
+         << "Liechtenstein"
+         << "Lithuania"
+         << "Luxembourg"
+         << "Macau"
+         << "Macedonia, Former Yugoslav Republic"
+         << "Madagascar"
+         << "Malawi"
+         << "Malaysia"
+         << "Maldives"
+         << "Mali"
+         << "Malta"
+         << "Marshall Islands"
+         << "Martinique"
+         << "Mauritania"
+         << "Mauritius"
+         << "Mayotte"
+         << "Mexico"
+         << "Micronesia, Federal State of"
+         << "Moldova, Republic of"
+         << "Monaco"
+         << "Mongolia"
+         << "Montenegro"
+         << "Montserrat"
+         << "Morocco"
+         << "Mozambique"
+         << "Namibia"
+         << "Nauru"
+         << "Nepal"
+         << "Netherlands"
+         << "Netherlands Antilles"
+         << "New Caledonia"
+         << "New Zealand"
+         << "Nicaragua"
+         << "Niger"
+         << "Nigeria"
+         << "Niue"
+         << "Norfolk Island"
+         << "Northern Mariana Island"
+         << "Norway"
+         << "Oman"
+         << "Pakistan"
+         << "Palau"
+         << "Panama"
+         << "Papua New Guinea"
+         << "Paraguay"
+         << "Peru"
+         << "Philippines"
+         << "Pitcairn Island"
+         << "Poland"
+         << "Portugal"
+         << "Puerto Rico"
+         << "Qatar"
+         << "Reunion Island"
+         << "Romania"
+         << "Russian Federation"
+         << "Rwanda"
+         << "Saint Kitts and Nevis"
+         << "Saint Lucia"
+         << "Saint Vincent and the Grenadines"
+         << "San Marino"
+         << "Sao Tome & Principe"
+         << "Saudi Arabia"
+         << "Senegal"
+         << "Serbia"
+         << "Seychelles"
+         << "Sierra Leone"
+         << "Singapore"
+         << "Slovak Republic"
+         << "Slovenia"
+         << "Solomon Islands"
+         << "Somalia"
+         << "South Africa"
+         << "South Georgia and the South Sandwich Islands"
+         << "Spain"
+         << "Sri Lanka"
+         << "St Pierre and Miquelon"
+         << "St. Helena"
+         << "Suriname"
+         << "Svalbard And Jan Mayen Island"
+         << "Swaziland"
+         << "Sweden"
+         << "Switzerland"
+         << "Taiwan"
+         << "Tajikistan"
+         << "Tanzania"
+         << "Thailand"
+         << "Togo"
+         << "Tokelau"
+         << "Tonga"
+         << "Trinidad and Tobago"
+         << "Tunisia"
+         << "Turkey"
+         << "Turkmenistan"
+         << "Turks and Ciacos Islands"
+         << "Tuvalu"
+         << "US Minor Outlying Islands"
+         << "Uganda"
+         << "Ukraine"
+         << "United Arab Emirates"
+         << "United Kingdom"
+         << "United States"
+         << "Uruguay"
+         << "Uzbekistan"
+         << "Vanuatu"
+         << "Venezuela"
+         << "Vietnam"
+         << "Virgin Island (British)"
+         << "Virgin Islands (USA)"
+         << "Wallis And Futuna Islands"
+         << "Western Sahara"
+         << "Western Samoa"
+         << "Yemen"
+         << "Zambia"
+         << "Zimbabwe";
+    m_pCbNewCountry->addItems(list);
+}
+
+bool UIRegistrationWzdPage1::isFieldValid(QWidget *pWidget) const
+{
+    if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pWidget))
+    {
+        QString strText(pLineEdit->text());
+        int iPosition;
+        return pLineEdit->validator()->validate(strText, iPosition) == QValidator::Acceptable;
+    }
+    else if (QComboBox *pComboBox = qobject_cast<QComboBox*>(pWidget))
+    {
+        return pComboBox->currentIndex() > 0;
+    }
+    return false;
+}
+
+#include "UIRegistrationWzd.moc"
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.h	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzd.h	(revision 26079)
@@ -0,0 +1,82 @@
+/** @file
+ *
+ * VBox frontends: Qt4 GUI ("VirtualBox"):
+ * UIRegistrationWzd class declaration
+ */
+
+/*
+ * Copyright (C) 2008-2010 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef __UIRegistrationWzd_h__
+#define __UIRegistrationWzd_h__
+
+/* Local includes */
+#include "QIWizard.h"
+
+/* Generated includes */
+#include "UIRegistrationWzdPage1.gen.h"
+
+class UIRegistrationWzd : public QIWizard
+{
+    Q_OBJECT;
+
+public:
+
+    static bool hasToBeShown();
+
+    UIRegistrationWzd(UIRegistrationWzd **ppThis);
+   ~UIRegistrationWzd();
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void reject();
+
+private:
+
+    UIRegistrationWzd **m_ppThis;
+};
+
+class UIRegistrationWzdPage1 : public QIWizardPage, public Ui::UIRegistrationWzdPage1
+{
+    Q_OBJECT;
+
+public:
+
+    UIRegistrationWzdPage1();
+
+protected:
+
+    void retranslateUi();
+
+    bool isComplete() const;
+    bool validatePage();
+
+private slots:
+
+    void sltAccountTypeChanged();
+
+private:
+
+    void populateCountries();
+
+    bool isFieldValid(QWidget *pWidget) const;
+};
+
+#endif // __UIRegistrationWzd_h__
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzdPage1.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzdPage1.ui	(revision 26079)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/registration/UIRegistrationWzdPage1.ui	(revision 26079)
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>
+ VBox frontends: Qt4 GUI ("VirtualBox"):
+
+     Copyright (C) 2008-2010 Sun Microsystems, Inc.
+
+     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.
+
+     Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+     Clara, CA 95054 USA or visit http://www.sun.com if you need
+     additional information or have any questions.
+ </comment>
+ <class>UIRegistrationWzdPage1</class>
+ <widget class="QWidget" name="UIRegistrationWzdPage1">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QGridLayout" name="m_pLayout1">
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <item row="1" column="0" colspan="3">
+    <widget class="Line" name="m_pLine1">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" colspan="3">
+    <widget class="QRadioButton" name="m_pRbPresent">
+     <property name="text">
+      <string>I &amp;already have a Sun Online account:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" rowspan="2">
+    <spacer name="m_pSpacer1">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>17</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="3" column="1">
+    <widget class="QLabel" name="m_pLbOldEmail">
+     <property name="text">
+      <string>&amp;E-mail:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeOldEmail</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <widget class="QLineEdit" name="m_pLeOldEmail">
+     <property name="whatsThis">
+      <string>Enter your e-mail address. Please use a valid address here.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="QLabel" name="m_pLbOldPassword">
+     <property name="text">
+      <string>&amp;Password:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeOldPassword</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="2">
+    <widget class="QLineEdit" name="m_pLeOldPassword">
+     <property name="whatsThis">
+      <string>Enter your e-mail address. Please use a valid address here.</string>
+     </property>
+     <property name="echoMode">
+      <enum>QLineEdit::Password</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0" colspan="3">
+    <widget class="Line" name="m_pLine2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="0" colspan="3">
+    <widget class="QRadioButton" name="m_pRbCreate">
+     <property name="text">
+      <string>I &amp;would like to create a new Sun Online account:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0" rowspan="8">
+    <spacer name="m_pSpacer2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>17</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="7" column="1">
+    <widget class="QLabel" name="m_pLbNewFirstName">
+     <property name="text">
+      <string>&amp;First Name:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeNewFirstName</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="2">
+    <widget class="QLineEdit" name="m_pLeNewFirstName">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="1">
+    <widget class="QLabel" name="m_pLbNewLastName">
+     <property name="text">
+      <string>&amp;Last Name:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeNewLastName</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="2">
+    <widget class="QLineEdit" name="m_pLeNewLastName">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="9" column="1">
+    <widget class="QLabel" name="m_pLbNewCompany">
+     <property name="text">
+      <string>&amp;Company:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeNewCompany</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="9" column="2">
+    <widget class="QLineEdit" name="m_pLeNewCompany">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="10" column="1">
+    <widget class="QLabel" name="m_pLbNewCountry">
+     <property name="text">
+      <string>Co&amp;untry:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pCbNewCountry</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="10" column="2">
+    <widget class="QComboBox" name="m_pCbNewCountry">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="11" column="1" colspan="2">
+    <spacer name="m_pSpacer3">
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="12" column="1">
+    <widget class="QLabel" name="m_pLbNewEmail">
+     <property name="text">
+      <string>E-&amp;mail:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeNewEmail</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="12" column="2">
+    <widget class="QLineEdit" name="m_pLeNewEmail">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+    </widget>
+   </item>
+   <item row="13" column="1">
+    <widget class="QLabel" name="m_pLbNewPassword">
+     <property name="text">
+      <string>P&amp;assword:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeNewPassword</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="13" column="2">
+    <widget class="QLineEdit" name="m_pLeNewPassword">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+     <property name="echoMode">
+      <enum>QLineEdit::Password</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="14" column="1">
+    <widget class="QLabel" name="m_pLbNewConfirmPassword">
+     <property name="text">
+      <string>Co&amp;nfirm Password:</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+     <property name="buddy">
+      <cstring>m_pLeNewConfirmPassword</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="14" column="2">
+    <widget class="QLineEdit" name="m_pLeNewConfirmPassword">
+     <property name="whatsThis">
+      <string>Enter your full name using Latin characters.</string>
+     </property>
+     <property name="echoMode">
+      <enum>QLineEdit::Password</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="15" column="0" colspan="3">
+    <spacer name="m_pSpacer4">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="0" column="0" colspan="3">
+    <widget class="QILabel" name="m_pPage1Text1">
+     <property name="text">
+      <string>&lt;p&gt;Please fill out this registration form to let us know that you use VirtualBox and, optionally, to keep you informed about VirtualBox news and updates.&lt;/p&gt;&lt;p&gt;Please use Latin characters only to fill in  the fields below. Sun Microsystems will use this information only to gather product usage statistics and to send you VirtualBox newsletters. In particular, Sun Microsystems will never pass your data to third parties. Detailed information about how we use your personal data can be found in the &lt;b&gt;Privacy Policy&lt;/b&gt; section of the VirtualBox Manual or on the &lt;a href=http://www.virtualbox.org/wiki/PrivacyPolicy&gt;Privacy Policy&lt;/a&gt; page of the VirtualBox web-site.&lt;/p&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
