Index: /trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk	(revision 7486)
+++ /trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk	(revision 7487)
@@ -272,4 +272,7 @@
 VirtualBox_QT_UISRCS4 += ui/VBoxVMFirstRunWzd.ui
 
+VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS3))
+VirtualBox_QT_UISRCS4 += ui/VBoxRegistrationDlg.ui
+
 
 #
@@ -408,5 +411,6 @@
 	include/VBoxNewVMWzd.h \
 	include/VBoxNewHDWzd.h \
-	include/VBoxVMFirstRunWzd.h
+	include/VBoxVMFirstRunWzd.h \
+	include/VBoxRegistrationDlg.h
 
 # Sources containing local definitions of classes that use the Q_OBJECT macro
@@ -480,5 +484,6 @@
 	src/VBoxNewVMWzd.cpp \
 	src/VBoxNewHDWzd.cpp \
-	src/VBoxVMFirstRunWzd.cpp
+	src/VBoxVMFirstRunWzd.cpp \
+	src/VBoxRegistrationDlg.cpp
 
 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNetworkFramework.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNetworkFramework.h	(revision 7486)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNetworkFramework.h	(revision 7487)
@@ -42,5 +42,9 @@
         , mNetworkThread (0) {}
 
-    ~VBoxNetworkFramework() { delete mNetworkThread; }
+    ~VBoxNetworkFramework()
+    {
+        mNetworkThread->wait (1000);
+        delete mNetworkThread;
+    }
 
     void postRequest (const QString &aHost, const QString &aUrl);
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp	(revision 7486)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp	(revision 7487)
@@ -3772,10 +3772,8 @@
         {
             /* We've got the "mutex", create a new registration dialog */
-#warning port me
-//            VBoxRegistrationDlg *dlg =
-//                new VBoxRegistrationDlg (0, 0, false, Qt::WDestructiveClose);
-//            dlg->setup (&mRegDlg);
-//            Assert (dlg == mRegDlg);
-//            mRegDlg->show();
+            VBoxRegistrationDlg *dlg =
+                new VBoxRegistrationDlg (&mRegDlg, 0, Qt::WDestructiveClose);
+            Assert (dlg == mRegDlg);
+            mRegDlg->show();
         }
     }
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNetworkFramework.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNetworkFramework.cpp	(revision 7486)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNetworkFramework.cpp	(revision 7487)
@@ -169,4 +169,6 @@
     };
 
+    if (mNetworkThread)
+        mNetworkThread->wait (1000);
     delete mNetworkThread;
     mNetworkThread = new Thread (this, aHost, aUrl);
Index: /trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui	(revision 7486)
+++ /trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui	(revision 7487)
@@ -1,257 +1,251 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>VBoxRegistrationDlg</class>
-<comment>
-
-:mode=html:tabSize=4:indentSize=4:noTabs=true:
-:folding=explicit:collapseFolds=1:
-
-     Copyright (C) 2007 innotek GmbH
-    
-     This file is part of VirtualBox Open Source Edition (OSE), as
-     available from http://www.virtualbox.org. This file is free software;
-     you can redistribute it and/or modify it under the terms of the GNU
-     General Public License (GPL) as published by the Free Software
-     Foundation, in version 2 as it comes in the "COPYING" file of the
-     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-</comment>
-<widget class="QWizard">
-    <property name="name">
-        <cstring>VBoxRegistrationDlg</cstring>
-    </property>
-    <property name="geometry">
-        <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>600</width>
-            <height>450</height>
-        </rect>
-    </property>
-    <property name="caption">
-        <string>VirtualBox Registration Dialog</string>
-    </property>
-    <property name="icon">
-        <pixmap>:/register_16px.png</pixmap>
-    </property>
-    <property name="titleFont">
-        <font>
-            <family>Arial</family>
-            <pointsize>12</pointsize>
-            <bold>1</bold>
-        </font>
-    </property>
-    <widget class="QWidget">
-        <property name="name">
-            <cstring>pageReg</cstring>
-        </property>
-        <attribute name="title">
-            <string>Welcome to the VirtualBox Registration Form!</string>
-        </attribute>
-        <hbox>
-            <property name="name">
-                <cstring>unnamed</cstring>
-            </property>
-            <property name="spacing">
-                <number>10</number>
-            </property>
-            <property name="resizeMode">
-                <enum>Minimum</enum>
-            </property>
-            <widget class="QLabel">
-                <property name="name">
-                    <cstring>pictureLabel</cstring>
-                </property>
-                <property name="sizePolicy">
-                    <sizepolicy>
-                        <hsizetype>4</hsizetype>
-                        <vsizetype>5</vsizetype>
-                        <horstretch>0</horstretch>
-                        <verstretch>0</verstretch>
-                    </sizepolicy>
-                </property>
-                <property name="pixmap">
-                    <pixmap>:/vmw_new_user.png</pixmap>
-                </property>
-                <property name="alignment">
-                    <set>AlignTop</set>
-                </property>
+<ui version="4.0" >
+ <class>VBoxRegistrationDlg</class>
+ <widget class="QDialog" name="VBoxRegistrationDlg" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>564</width>
+    <height>394</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>VirtualBox Registration Dialog</string>
+  </property>
+  <property name="windowIcon" >
+   <iconset resource="../VirtualBox.qrc" >:/register_16px.png</iconset>
+  </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="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>Welcome to the VirtualBox Registration Form!</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line11" >
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" >
+         <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="pixmap" >
+            <pixmap resource="../VirtualBox.qrc" >:/vmw_new_user.png</pixmap>
+           </property>
+           <property name="alignment" >
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" >
+           <item>
+            <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>300</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text" >
+              <string>&lt;p>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>&lt;p>Enter your full name using Latin characters and your e-mail address to the fields below. Please note that innotek will use this information only to gather product usage statistics and to send you VirtualBox newsletters. In particular, innotek will never pass your data to third parties. Detailed information about how we use your personal data can be found in the &lt;b>Privacy Policy&lt;/b> section of the VirtualBox Manual or on the &lt;ahref=http://www.virtualbox.org/wiki/PrivacyPolicy>Privacy Policy&lt;/a> page of the VirtualBox web-site.&lt;/p></string>
+             </property>
+             <property name="wordWrap" >
+              <bool>true</bool>
+             </property>
             </widget>
-            <widget class="QLayoutWidget">
-                <property name="name">
-                    <cstring>layout9</cstring>
-                </property>
-                <vbox>
-                    <property name="name">
-                        <cstring>unnamed</cstring>
-                    </property>
-                    <widget class="QIRichLabel">
-                        <property name="name">
-                            <cstring>mTextLabel</cstring>
-                        </property>
-                        <property name="text" stdset="0">
-                            <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;Enter your full name using Latin characters and your e-mail address to the fields below. Please note that innotek will use this information only to gather product usage statistics and to send you VirtualBox newsletters. In particular, innotek 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>
-                    </widget>
-                    <spacer>
-                        <property name="name">
-                            <cstring>spWelcome</cstring>
-                        </property>
-                        <property name="orientation">
-                            <enum>Vertical</enum>
-                        </property>
-                        <property name="sizeType">
-                            <enum>Expanding</enum>
-                        </property>
-                        <property name="sizeHint">
-                            <size>
-                                <width>20</width>
-                                <height>160</height>
-                            </size>
-                        </property>
-                    </spacer>
-                    <spacer>
-                        <property name="name">
-                            <cstring>widthSpacer</cstring>
-                        </property>
-                        <property name="orientation">
-                            <enum>Horizontal</enum>
-                        </property>
-                        <property name="sizeType">
-                            <enum>MinimumExpanding</enum>
-                        </property>
-                        <property name="sizeHint">
-                            <size>
-                                <width>400</width>
-                                <height>0</height>
-                            </size>
-                        </property>
-                    </spacer>
-                    <widget class="QLayoutWidget">
-                        <property name="name">
-                            <cstring>layout7</cstring>
-                        </property>
-                        <grid>
-                            <property name="name">
-                                <cstring>unnamed</cstring>
-                            </property>
-                            <widget class="QLabel" row="0" column="0">
-                                <property name="name">
-                                    <cstring>mNameLabel</cstring>
-                                </property>
-                                <property name="text">
-                                    <string>&amp;Name</string>
-                                </property>
-                                <property name="buddy" stdset="0">
-                                    <cstring>mNameEdit</cstring>
-                                </property>
-                            </widget>
-                            <widget class="QLineEdit" row="0" column="1">
-                                <property name="name">
-                                    <cstring>mNameEdit</cstring>
-                                </property>
-                                <property name="whatsThis" stdset="0">
-                                    <string>Enter your full name using Latin characters.</string>
-                                </property>
-                            </widget>
-                            <widget class="QLabel" row="1" column="0">
-                                <property name="name">
-                                    <cstring>mEmailLabel</cstring>
-                                </property>
-                                <property name="text">
-                                    <string>&amp;E-mail</string>
-                                </property>
-                                <property name="buddy" stdset="0">
-                                    <cstring>mEmailEdit</cstring>
-                                </property>
-                            </widget>
-                            <widget class="QLineEdit" row="1" column="1">
-                                <property name="name">
-                                    <cstring>mEmailEdit</cstring>
-                                </property>
-                                <property name="whatsThis" stdset="0">
-                                    <string>Enter your valid e-mail address.</string>
-                                </property>
-                            </widget>
-                            <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
-                                <property name="name">
-                                    <cstring>mUseCheckBox</cstring>
-                                </property>
-                                <property name="text">
-                                    <string>&amp;Please do not use this information to contact me</string>
-                                </property>
-                                <property name="whatsThis" stdset="0">
-                                    <string>Check this box if you do not want to receive mail from innotek at the e-mail address specified above.</string>
-                                </property>
-                            </widget>
-                        </grid>
-                    </widget>
-                </vbox>
-            </widget>
-        </hbox>
+           </item>
+           <item>
+            <spacer>
+             <property name="orientation" >
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeType" >
+              <enum>QSizePolicy::Expanding</enum>
+             </property>
+             <property name="sizeHint" >
+              <size>
+               <width>10</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <layout class="QGridLayout" >
+             <item row="0" column="0" >
+              <widget class="QLabel" name="mTxName" >
+               <property name="text" >
+                <string>&amp;Name</string>
+               </property>
+               <property name="buddy" >
+                <cstring>mLeName</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="0" column="1" >
+              <widget class="QLineEdit" name="mLeName" >
+               <property name="whatsThis" >
+                <string>Enter your full name using Latin characters.</string>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="0" >
+              <widget class="QLabel" name="mTxEmail" >
+               <property name="text" >
+                <string>&amp;E-mail</string>
+               </property>
+               <property name="buddy" >
+                <cstring>mLeEmail</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="1" >
+              <widget class="QLineEdit" name="mLeEmail" >
+               <property name="whatsThis" >
+                <string>Enter your valid e-mail address.</string>
+               </property>
+              </widget>
+             </item>
+             <item row="2" column="0" colspan="2" >
+              <widget class="QCheckBox" name="mCbUse" >
+               <property name="whatsThis" >
+                <string>Check this box if you do not want to receive mail from innotek at the e-mail address specified above.</string>
+               </property>
+               <property name="text" >
+                <string>&amp;Please do not use this information to contact me</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </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="mBtnFinish" >
+           <property name="text" >
+            <string>C&amp;onfirm</string>
+           </property>
+           <property name="default" >
+            <bool>true</bool>
+           </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>&amp;Cancel</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
     </widget>
-</widget>
-<customwidgets>
-    <customwidget>
-        <class>QIRichLabel</class>
-        <header location="local">QIRichLabel.h</header>
-        <sizehint>
-            <width>80</width>
-            <height>20</height>
-        </sizehint>
-        <container>0</container>
-        <sizepolicy>
-            <hordata>5</hordata>
-            <verdata>5</verdata>
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-        </sizepolicy>
-        <pixmap>image0</pixmap>
-        <property type="String">text</property>
-    </customwidget>
-</customwidgets>
-<includes>
-    <include location="local" impldecl="in implementation">VBoxGlobal.h</include>
-    <include location="local" impldecl="in implementation">VBoxNetworkFramework.h</include>
-    <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>
-    <include location="global" impldecl="in declaration">qurl.h</include>
-    <include location="global" impldecl="in implementation">qpushbutton.h</include>
-    <include location="global" impldecl="in implementation">qtimer.h</include>
-    <include location="global" impldecl="in implementation">qvalidator.h</include>
-    <include location="global" impldecl="in implementation">qprocess.h</include>
-</includes>
-<forwards>
-	<forward>class VBoxNetworkFramework</forward>
-</forwards>
-<variables>
-    <variable access="private">VBoxRegistrationDlg **mSelf;</variable>
-    <variable access="private">QUrl mUrl;</variable>
-    <variable access="private">QTimer *mTimeout;</variable>
-    <variable access="private">bool mSuicide;</variable>
-    <variable access="private">bool mHandshake;</variable>
-    <variable access="private">VBoxNetworkFramework *mNetfw;</variable>
-</variables>
-<slots>
-    <slot access="private">registration()</slot>
-    <slot access="private">processTimeout()</slot>
-    <slot access="private">onNetBegin( int )</slot>
-    <slot access="private">onNetData( const QByteArray &amp; )</slot>
-    <slot access="private">onNetEnd( const QByteArray &amp; )</slot>
-    <slot access="private">onNetError( const QString &amp; )</slot>
-    <slot access="private">accept()</slot>
-    <slot access="private">reject()</slot>
-    <slot access="private">validate()</slot>
-</slots>
-<functions>
-    <function specifier="static" returnType="bool">hasToBeShown()</function>
-    <function access="private">init()</function>
-    <function access="private">destroy()</function>
-    <function>setup( VBoxRegistrationDlg ** )</function>
-    <function access="private">languageChangeImp()</function>
-    <function access="private">postRequest( const QString &amp; , const QString &amp; )</function>
-    <function access="private" returnType="QString">getPlatform()</function>
-    <function>abortRegisterRequest( const QString &amp; )</function>
-    <function access="private">showEvent( QShowEvent* )</function>
-</functions>
-<pixmapinproject/>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QIAbstractWizard.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>mBtnFinish</tabstop>
+  <tabstop>mBtnCancel4</tabstop>
+ </tabstops>
+ <resources>
+  <include location="../VirtualBox.qrc" />
+ </resources>
+ <connections/>
+</ui>
Index: unk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui.h	(revision 7486)
+++ 	(revision )
@@ -1,571 +1,0 @@
-/**
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * VBoxRegistrationDlg UI include (Qt Designer)
- */
-
-/*
- * Copyright (C) 2007 innotek GmbH
- *
- * 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.
- */
-
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you want to add, delete, or rename functions or slots, use
-** Qt Designer to update this file, preserving your code.
-**
-** You should not define a constructor or destructor in this file.
-** Instead, write your code in functions called init() and destroy().
-** These will automatically be called by the form's constructor and
-** destructor.
-*****************************************************************************/
-
-#include <iprt/assert.h>
-#include <iprt/err.h>
-#include <iprt/param.h>
-#include <iprt/path.h>
-//Added by qt3to4:
-#include <QShowEvent>
-
-/**
- *  This class is used to encode/decode the registration data.
- */
-class VBoxRegistrationData
-{
-public:
-
-    VBoxRegistrationData (const QString &aData)
-        : mIsValid (false), mIsRegistered (false)
-        , mData (aData)
-        , mTriesLeft (3 /* the initial tries value! */)
-    {
-        decode (aData);
-    }
-
-    VBoxRegistrationData (const QString &aName, const QString &aEmail,
-                          const QString &aPrivate)
-        : mIsValid (true), mIsRegistered (true)
-        , mName (aName), mEmail (aEmail), mPrivate (aPrivate)
-        , mTriesLeft (0)
-    {
-        encode (aName, aEmail, aPrivate);
-    }
-
-    bool isValid() const                { return mIsValid; }
-    bool isRegistered() const           { return mIsRegistered; }
-
-    const QString &data() const         { return mData; }
-    const QString &name() const         { return mName; }
-    const QString &email() const        { return mEmail; }
-    const QString &isPrivate() const    { return mPrivate; }
-
-    uint triesLeft() const              { return mTriesLeft; }
-
-private:
-
-    void decode (const QString &aData)
-    {
-        mIsValid = mIsRegistered = false;
-
-        if (aData.isEmpty())
-            return;
-
-        if (aData.startsWith ("triesLeft="))
-        {
-            bool ok = false;
-            uint triesLeft = aData.section ('=', 1, 1).toUInt (&ok);
-            if (!ok)
-                return;
-            mTriesLeft = triesLeft;
-            mIsValid = true;
-            return;
-        }
-
-        /* Decoding CRC32 */
-        QString data = aData;
-        QString crcData = data.right (2 * sizeof (ulong));
-        ulong crcNeed = 0;
-        for (ulong i = 0; i < crcData.length(); i += 2)
-        {
-            crcNeed <<= 8;
-            uchar curByte = (uchar) crcData.mid (i, 2).toUShort (0, 16);
-            crcNeed += curByte;
-        }
-        data.truncate (data.length() - 2 * sizeof (ulong));
-
-        /* Decoding data */
-        QString result;
-        for (ulong i = 0; i < data.length(); i += 4)
-            result += QChar (data.mid (i, 4).toUShort (0, 16));
-        ulong crcNow = crc32 ((uchar*)result.ascii(), result.length());
-
-        /* Check the CRC32 */
-        if (crcNeed != crcNow)
-            return;
-
-        /* Initialize values */
-        QStringList dataList = QStringList::split ("|", result);
-        mName = dataList [0];
-        mEmail = dataList [1];
-        mPrivate = dataList [2];
-
-        mIsValid = true;
-        mIsRegistered = true;
-    }
-
-    void encode (const QString &aName, const QString &aEmail,
-                 const QString &aPrivate)
-    {
-        /* Encoding data */
-        QString data = QString ("%1|%2|%3")
-            .arg (aName).arg (aEmail).arg (aPrivate);
-        mData = QString::null;
-        for (ulong i = 0; i < data.length(); ++ i)
-        {
-            QString curPair = QString::number (data.at (i).unicode(), 16);
-            while (curPair.length() < 4)
-                curPair.prepend ('0');
-            mData += curPair;
-        }
-
-        /* Enconding CRC32 */
-        ulong crcNow = crc32 ((uchar*)data.ascii(), data.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;
-
-    QString mData;
-    QString mName;
-    QString mEmail;
-    QString mPrivate;
-
-    uint mTriesLeft;
-};
-
-/* static */
-bool VBoxRegistrationDlg::hasToBeShown()
-{
-    VBoxRegistrationData regData (vboxGlobal().virtualBox().
-        GetExtraData (VBoxDefs::GUI_RegistrationData));
-
-    return !regData.isValid() ||
-        (!regData.isRegistered() && regData.triesLeft() > 0);
-}
-
-/* Default constructor initialization. */
-void VBoxRegistrationDlg::init()
-{
-    /* Hide unnecessary buttons */
-    helpButton()->setShown (false);
-    cancelButton()->setShown (false);
-    backButton()->setShown (false);
-
-    /* Confirm button initially disabled */
-    finishButton()->setEnabled (false);
-    finishButton()->setAutoDefault (true);
-    finishButton()->setDefault (true);
-
-    /* Setup the label colors for nice scaling */
-    VBoxGlobal::adoptLabelPixmap (pictureLabel);
-
-    /* Adjust text label size */
-#warning port me
-//    mTextLabel->setMinimumWidth (widthSpacer->minimumSize().width());
-
-    /* Setup validations and maximum text-edit text length */
-    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\\-]+)*");
-    mNameEdit->setValidator (new QRegExpValidator (nameExp, this));
-    mEmailEdit->setValidator (new QRegExpValidator (emailExp, this));
-    mNameEdit->setMaxLength (50);
-    mEmailEdit->setMaxLength (50);
-
-    /* Create connection-timeout timer */
-    mTimeout = new QTimer (this);
-
-    /* Load language constraints */
-    languageChangeImp();
-
-    /* Set required boolean flags */
-    mSuicide = false;
-    mHandshake = true;
-
-    /* Network framework */
-    mNetfw = 0;
-
-    /* Setup connections */
-    disconnect (finishButton(), SIGNAL (clicked()), 0, 0);
-    connect (finishButton(), SIGNAL (clicked()), SLOT (registration()));
-    connect (mTimeout, SIGNAL (timeout()), this, SLOT (processTimeout()));
-    connect (mNameEdit, SIGNAL (textChanged (const QString&)), this, SLOT (validate()));
-    connect (mEmailEdit, SIGNAL (textChanged (const QString&)), this, SLOT (validate()));
-    connect (mTextLabel, SIGNAL (clickedOnLink (const QString &)),
-             &vboxGlobal(), SLOT (openURL (const QString &)));
-
-    /* Resize the dialog initially to minimum size */
-    resize (minimumSize());
-}
-
-/* Default destructor cleanup. */
-void VBoxRegistrationDlg::destroy()
-{
-    delete mNetfw;
-    *mSelf = 0;
-}
-
-/* Setup necessary dialog parameters. */
-void VBoxRegistrationDlg::setup (VBoxRegistrationDlg **aSelf)
-{
-    mSelf = aSelf;
-    *mSelf = this;
-    mUrl = "http://www.innotek.de/register762.php";
-
-    VBoxRegistrationData regData (vboxGlobal().virtualBox().
-        GetExtraData (VBoxDefs::GUI_RegistrationData));
-
-    mNameEdit->setText (regData.name());
-    mEmailEdit->setText (regData.email());
-    mUseCheckBox->setChecked (regData.isPrivate() == "yes");
-}
-
-/* String constants initializer. */
-void VBoxRegistrationDlg::languageChangeImp()
-{
-    finishButton()->setText (tr ("&Confirm"));
-}
-
-void VBoxRegistrationDlg::postRequest (const QString &aHost,
-                                       const QString &aUrl)
-{
-    delete mNetfw;
-    mNetfw = new VBoxNetworkFramework();
-    connect (mNetfw, SIGNAL (netBegin (int)),
-             SLOT (onNetBegin (int)));
-    connect (mNetfw, SIGNAL (netData (const QByteArray&)),
-             SLOT (onNetData (const QByteArray&)));
-    connect (mNetfw, SIGNAL (netEnd (const QByteArray&)),
-             SLOT (onNetEnd (const QByteArray&)));
-    connect (mNetfw, SIGNAL (netError (const QString&)),
-             SLOT (onNetError (const QString&)));
-
-    mNetfw->postRequest (aHost, aUrl);
-}
-
-
-/* Post the handshake request into the innotek register site. */
-void VBoxRegistrationDlg::registration()
-{
-    /* Disable control elements */
-    mNameEdit->setEnabled (false);
-    mEmailEdit->setEnabled (false);
-    mUseCheckBox->setEnabled (false);
-    finishButton()->setEnabled (false);
-
-    /* Handshake arguments initializing */
-    QString version = vboxGlobal().virtualBox().GetVersion();
-    Q3Url::encode (version);
-
-    /* Handshake */
-    QString argument = QString ("?version=%1").arg (version);
-    mTimeout->start (20000, true);
-    postRequest (mUrl.host(), mUrl.path() + argument);
-}
-
-/* This slot is used to control the connection timeout. */
-void VBoxRegistrationDlg::processTimeout()
-{
-    abortRegisterRequest (tr ("Connection timed out."));
-}
-
-/* Handles the network request begining. */
-void VBoxRegistrationDlg::onNetBegin (int aStatus)
-{
-    if (aStatus == 404)
-        abortRegisterRequest (tr ("Could not locate the registration form on "
-            "the server (response: %1).").arg (aStatus));
-    else
-        mTimeout->start (20000, true);
-}
-
-/* Handles the network request data incoming. */
-void VBoxRegistrationDlg::onNetData (const QByteArray&)
-{
-    if (!mSuicide)
-        mTimeout->start (20000, true);
-}
-
-/* Handles the network request end. */
-void VBoxRegistrationDlg::onNetEnd (const QByteArray &aTotalData)
-{
-    if (mSuicide)
-        return;
-
-    mTimeout->stop();
-    if (mHandshake)
-    {
-        /* Verifying key correctness */
-        if (QString (aTotalData).find (QRegExp ("^[a-zA-Z0-9]{32}$")))
-        {
-            abortRegisterRequest (tr ("Could not perform connection handshake."));
-            return;
-        }
-
-        /* Registration arguments initializing */
-        QString version = vboxGlobal().virtualBox().GetVersion();
-        QString key (aTotalData);
-        QString platform = getPlatform();
-        QString name = mNameEdit->text();
-        QString email = mEmailEdit->text();
-        QString prvt = mUseCheckBox->isChecked() ? "1" : "0";
-        Q3Url::encode (version);
-        Q3Url::encode (platform);
-        Q3Url::encode (name);
-        Q3Url::encode (email);
-
-        /* Registration */
-        QString argument;
-        argument += QString ("?version=%1").arg (version);
-        argument += QString ("&key=%1").arg (key);
-        argument += QString ("&platform=%1").arg (platform);
-        argument += QString ("&name=%1").arg (name);
-        argument += QString ("&email=%1").arg (email);
-        argument += QString ("&private=%1").arg (prvt);
-
-        mHandshake = false;
-        mTimeout->start (20000, true);
-        postRequest (mUrl.host(), mUrl.path() + argument);
-    }
-    else
-    {
-        /* Show registration result */
-        QString result (aTotalData);
-        vboxProblem().showRegisterResult (this, result);
-
-        /* Close the dialog */
-        result == "OK" ? accept() : reject();
-    }
-}
-
-void VBoxRegistrationDlg::onNetError (const QString &aError)
-{
-    abortRegisterRequest (aError);
-}
-
-/* SLOT: QDialog accept slot reimplementation. */
-void VBoxRegistrationDlg::accept()
-{
-    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID,
-                                            QString::null);
-
-    VBoxRegistrationData regData (mNameEdit->text(), mEmailEdit->text(),
-        mUseCheckBox->isChecked() ? "yes" : "no");
-    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationData,
-                                            regData.data());
-
-    QDialog::accept();
-}
-
-/* SLOT: QDialog reject slot reimplementation. */
-void VBoxRegistrationDlg::reject()
-{
-    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID,
-                                            QString::null);
-
-    /* Decrement the triesLeft. */
-    VBoxRegistrationData regData (vboxGlobal().virtualBox().
-                                  GetExtraData (VBoxDefs::GUI_RegistrationData));
-    if (!regData.isValid() || !regData.isRegistered())
-    {
-        uint triesLeft = regData.triesLeft();
-        if (triesLeft)
-        {
-            -- triesLeft;
-            vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_RegistrationData,
-                                                    QString ("triesLeft=%1")
-                                                    .arg (triesLeft));
-        }
-    }
-
-    QDialog::reject();
-}
-
-void VBoxRegistrationDlg::validate()
-{
-    int pos = 0;
-    QString name = mNameEdit->text();
-    QString email = mEmailEdit->text();
-    finishButton()->setEnabled (
-        mNameEdit->validator()->validate (name, pos) == QValidator::Acceptable &&
-        mEmailEdit->validator()->validate (email, pos) == QValidator::Acceptable);
-}
-
-QString VBoxRegistrationDlg::getPlatform()
-{
-    QString platform;
-
-#if defined (Q_OS_WIN)
-    platform = "win";
-#elif defined (Q_OS_LINUX)
-    platform = "linux";
-#elif defined (Q_OS_MACX)
-    platform = "macosx";
-#elif defined (Q_OS_OS2)
-    platform = "os2";
-#elif defined (Q_OS_FREEBSD)
-    platform = "freebsd";
-#elif defined (Q_OS_SOLARIS)
-    platform = "solaris";
-#else
-    platform = "unknown";
-#endif
-
-    /* the format is <system>.<bitness> */
-    platform += QString (".%1").arg (ARCH_BITS);
-
-    /* add more system information */
-#if defined (Q_OS_WIN)
-    OSVERSIONINFO versionInfo;
-    ZeroMemory (&versionInfo, sizeof (OSVERSIONINFO));
-    versionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
-    GetVersionEx (&versionInfo);
-    int major = versionInfo.dwMajorVersion;
-    int minor = versionInfo.dwMinorVersion;
-    int build = versionInfo.dwBuildNumber;
-    QString sp = QString::fromUcs2 ((ushort*)versionInfo.szCSDVersion);
-
-    QString distrib;
-    if (major == 6)
-        distrib = QString ("Windows Vista %1");
-    else if (major == 5)
-    {
-        if (minor == 2)
-            distrib = QString ("Windows Server 2003 %1");
-        else if (minor == 1)
-            distrib = QString ("Windows XP %1");
-        else if (minor == 0)
-            distrib = QString ("Windows 2000 %1");
-        else
-            distrib = QString ("Unknown %1");
-    }
-    else if (major == 4)
-    {
-        if (minor == 90)
-            distrib = QString ("Windows Me %1");
-        else if (minor == 10)
-            distrib = QString ("Windows 98 %1");
-        else if (minor == 0)
-            distrib = QString ("Windows 95 %1");
-        else
-            distrib = QString ("Unknown %1");
-    }
-    else
-        distrib = QString ("Unknown %1");
-    distrib = distrib.arg (sp);
-    QString version = QString ("%1.%2").arg (major).arg (minor);
-    QString kernel = QString ("%1").arg (build);
-    platform += QString (" [Distribution: %1 | Version: %2 | Build: %3]")
-        .arg (distrib).arg (version).arg (kernel);
-#elif defined (Q_OS_OS2)
-    // TODO: add sys info for os2 if any...
-#elif defined (Q_OS_LINUX) || defined (Q_OS_MACX) || defined (Q_OS_FREEBSD) || defined (Q_OS_SOLARIS)
-    char szAppPrivPath [RTPATH_MAX];
-    int rc;
-
-    rc = RTPathAppPrivateNoArch (szAppPrivPath, sizeof (szAppPrivPath));
-    Assert (RT_SUCCESS (rc));
-    Q3Process infoScript (QString ("./VBoxSysInfo.sh"), this, "infoScript");
-    infoScript.setWorkingDirectory (QString (szAppPrivPath));
-    if (infoScript.start())
-    {
-        while (infoScript.isRunning()) {}
-        if (infoScript.normalExit())
-            platform += QString (" [%1]").arg (QString(infoScript.readStdout()));
-    }
-#endif
-
-    return platform;
-}
-
-/* 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 is dismissed, the downloader signals
- * to close itself on the next event loop iteration. */
-void VBoxRegistrationDlg::abortRegisterRequest (const QString &aReason)
-{
-    /* Protect against double kill request. */
-    if (mSuicide)
-        return;
-    mSuicide = true;
-
-    if (!aReason.isNull())
-        vboxProblem().cannotConnectRegister (this, mUrl.toString(), aReason);
-
-    /* Allows all the queued signals to be processed before quit. */
-    QTimer::singleShot (0, this, SLOT (reject()));
-}
-
-void VBoxRegistrationDlg::showEvent (QShowEvent *aEvent)
-{
-    validate();
-    Q3Wizard::showEvent (aEvent);
-}
