VBoxRegistrationDlg.ui.h revision 4221f9473058429ba32c6275a05cb320b87de7bb
/**
*
* 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;
* General Public License 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.
*****************************************************************************/
/**
*/
{
: mIsValid (false), mIsRegistered (false)
{
}
: mIsValid (true), mIsRegistered (true)
, mTriesLeft (0)
{
}
bool isRegistered() const { return mIsRegistered; }
{
mIsValid = mIsRegistered = false;
return;
{
bool ok = false;
if (!ok)
return;
mIsValid = true;
return;
}
/* Decoding CRC32 */
{
crcNeed <<= 8;
}
/* Decoding data */
/* Check the CRC32 */
return;
/* Initialize values */
mIsValid = true;
mIsRegistered = true;
}
{
/* Encoding data */
{
}
/* Enconding CRC32 */
{
crcNow >>= 8;
}
}
{
/* Filling CRC32 table */
for (int i = 0; i < 256; ++ i)
{
temp = i;
for (int j = 8; j > 0; -- j)
{
if (temp & 1)
else
temp >>= 1;
};
}
/* CRC32 calculation */
crc32 = 0xffffffff;
for (int i = 0; i < aSize; ++ i)
{
}
return crc32;
};
bool mIsValid : 1;
bool mIsRegistered : 1;
};
/* static */
bool VBoxRegistrationDlg::hasToBeShown()
{
}
/* 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 */
/* Adjust text label size */
/* Setup validations and maximum text-edit text length */
/* Create connection-timeout timer */
/* Load language constraints */
/* Set required boolean flags */
mSuicide = false;
mHandshake = true;
/* Network framework */
mNetfw = 0;
/* Setup connections */
/* Resize the dialog initially to minimum size */
resize (minimumSize());
}
/* Default destructor cleanup. */
void VBoxRegistrationDlg::destroy()
{
*mSelf = 0;
}
/* Setup necessary dialog parameters. */
{
}
/* String constants initializer. */
void VBoxRegistrationDlg::languageChangeImp()
{
}
{
SLOT (onNetBegin (int)));
}
/* 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 */
/* Handshake */
}
/* This slot is used to control the connection timeout. */
void VBoxRegistrationDlg::processTimeout()
{
}
/* Handles the network request begining. */
{
if (aStatus == 404)
else
}
/* Handles the network request data incoming. */
{
if (!mSuicide)
}
/* Handles the network request end. */
{
if (mSuicide)
return;
if (mHandshake)
{
/* Registration arguments initializing */
/* Registration */
mHandshake = false;
}
else
{
/* Show registration result */
/* Close the dialog */
}
}
{
}
/* SLOT: QDialog accept slot reimplementation. */
void VBoxRegistrationDlg::accept()
{
}
/* SLOT: QDialog reject slot reimplementation. */
void VBoxRegistrationDlg::reject()
{
/* Decrement the triesLeft. */
{
if (triesLeft)
{
-- triesLeft;
QString ("triesLeft=%1")
}
}
}
void VBoxRegistrationDlg::validate()
{
int pos = 0;
finishButton()->setEnabled (
}
{
#if defined (Q_OS_WIN)
platform = "win";
#elif defined (Q_OS_LINUX)
platform = "linux";
platform = "macosx";
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> */
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. */
{
/* Protect against double kill request. */
if (mSuicide)
return;
mSuicide = true;
/* Allows all the queued signals to be processed before quit. */
}
{
validate();
}