#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'dlgjabberregisteraccount.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "dlgjabberregisteraccount.h"

#include <ntqvariant.h>
#include <knuminput.h>
#include <kpassdlg.h>
#include <kpushbutton.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a DlgJabberRegisterAccount as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
DlgJabberRegisterAccount::DlgJabberRegisterAccount( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "DlgJabberRegisterAccount" );
    setMinimumSize( TQSize( 300, 350 ) );
    DlgJabberRegisterAccountLayout = new TQGridLayout( this, 1, 1, 11, 6, "DlgJabberRegisterAccountLayout"); 

    lblJID = new TQLabel( this, "lblJID" );

    DlgJabberRegisterAccountLayout->addWidget( lblJID, 1, 1 );

    pixPasswordVerify = new TQLabel( this, "pixPasswordVerify" );
    pixPasswordVerify->setMinimumSize( TQSize( 16, 16 ) );
    pixPasswordVerify->setMaximumSize( TQSize( 32767, 32767 ) );

    DlgJabberRegisterAccountLayout->addWidget( pixPasswordVerify, 3, 0 );

    layoutServerEntry = new TQHBoxLayout( 0, 0, 6, "layoutServerEntry"); 

    leServer = new TQLineEdit( this, "leServer" );
    layoutServerEntry->addWidget( leServer );

    btnChooseServer = new KPushButton( this, "btnChooseServer" );
    layoutServerEntry->addWidget( btnChooseServer );

    DlgJabberRegisterAccountLayout->addLayout( layoutServerEntry, 0, 2 );

    lblPassword = new TQLabel( this, "lblPassword" );

    DlgJabberRegisterAccountLayout->addWidget( lblPassword, 2, 1 );

    sbPort = new KIntSpinBox( this, "sbPort" );
    sbPort->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, sbPort->sizePolicy().hasHeightForWidth() ) );
    sbPort->setMaxValue( 65535 );

    DlgJabberRegisterAccountLayout->addWidget( sbPort, 4, 2 );

    cbUseSSL = new TQCheckBox( this, "cbUseSSL" );
    cbUseSSL->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, cbUseSSL->sizePolicy().hasHeightForWidth() ) );
    cbUseSSL->setChecked( true );

    DlgJabberRegisterAccountLayout->addMultiCellWidget( cbUseSSL, 5, 5, 1, 2 );

    pixJID = new TQLabel( this, "pixJID" );
    pixJID->setMinimumSize( TQSize( 16, 16 ) );
    pixJID->setMaximumSize( TQSize( 32767, 32767 ) );

    DlgJabberRegisterAccountLayout->addWidget( pixJID, 1, 0 );

    lblPort = new TQLabel( this, "lblPort" );

    DlgJabberRegisterAccountLayout->addWidget( lblPort, 4, 1 );

    lblPasswordVerify = new TQLabel( this, "lblPasswordVerify" );
    lblPasswordVerify->setEnabled( true );

    DlgJabberRegisterAccountLayout->addWidget( lblPasswordVerify, 3, 1 );

    lePassword = new KPasswordEdit( this, "lePassword" );
    lePassword->setEchoMode( KPasswordEdit::Password );

    DlgJabberRegisterAccountLayout->addWidget( lePassword, 2, 2 );

    pixServer = new TQLabel( this, "pixServer" );
    pixServer->setMinimumSize( TQSize( 16, 16 ) );
    pixServer->setMaximumSize( TQSize( 32767, 32767 ) );

    DlgJabberRegisterAccountLayout->addWidget( pixServer, 0, 0 );

    lblServer = new TQLabel( this, "lblServer" );

    DlgJabberRegisterAccountLayout->addWidget( lblServer, 0, 1 );

    pixPassword = new TQLabel( this, "pixPassword" );
    pixPassword->setMinimumSize( TQSize( 16, 16 ) );
    pixPassword->setMaximumSize( TQSize( 32767, 32767 ) );

    DlgJabberRegisterAccountLayout->addWidget( pixPassword, 2, 0 );

    lePasswordVerify = new KPasswordEdit( this, "lePasswordVerify" );
    lePasswordVerify->setEnabled( true );
    lePasswordVerify->setEchoMode( KPasswordEdit::Password );

    DlgJabberRegisterAccountLayout->addWidget( lePasswordVerify, 3, 2 );

    leJID = new TQLineEdit( this, "leJID" );

    DlgJabberRegisterAccountLayout->addWidget( leJID, 1, 2 );

    layout3 = new TQVBoxLayout( 0, 0, 6, "layout3"); 

    lblJIDInformation = new TQLabel( this, "lblJIDInformation" );
    lblJIDInformation->setMinimumSize( TQSize( 0, 100 ) );
    lblJIDInformation->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
    layout3->addWidget( lblJIDInformation );
    spacerMiddle = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout3->addItem( spacerMiddle );

    lblStatusMessage = new TQLabel( this, "lblStatusMessage" );
    lblStatusMessage->setAlignment( int( TQLabel::AlignCenter ) );
    layout3->addWidget( lblStatusMessage );

    DlgJabberRegisterAccountLayout->addMultiCellLayout( layout3, 6, 6, 0, 2 );
    languageChange();
    resize( TQSize(346, 376).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( leServer, btnChooseServer );
    setTabOrder( btnChooseServer, leJID );
    setTabOrder( leJID, lePassword );
    setTabOrder( lePassword, lePasswordVerify );

    // buddies
    lblJID->setBuddy( leJID );
    lblPassword->setBuddy( lePassword );
    lblPort->setBuddy( sbPort );
    lblPasswordVerify->setBuddy( lePasswordVerify );
    lblServer->setBuddy( leServer );
}

/*
 *  Destroys the object and frees any allocated resources
 */
DlgJabberRegisterAccount::~DlgJabberRegisterAccount()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DlgJabberRegisterAccount::languageChange()
{
    setCaption( tr2i18n( "Register Account - Jabber" ) );
    lblJID->setText( tr2i18n( "Desired Jabber &ID:" ) );
    leServer->setText( TQString::null );
    btnChooseServer->setText( tr2i18n( "C&hoose..." ) );
    lblPassword->setText( tr2i18n( "Pass&word:" ) );
    cbUseSSL->setText( tr2i18n( "Use old style SSL encr&yption protocol (not recommended)" ) );
    TQToolTip::add( cbUseSSL, tr2i18n( "Check this box to enable the old style SSL encrypted communication with the server. This is not recommended and only works on very old servers." ) );
    TQWhatsThis::add( cbUseSSL, tr2i18n( "Check this box to enable the old style SSL encrypted communication with the server. Note that this is not end-to-end encryption, but rather encrypted communication with the server. This is not recommended and only works on very old servers." ) );
    lblPort->setText( tr2i18n( "&Port:" ) );
    lblPasswordVerify->setText( tr2i18n( "&Repeat password:" ) );
    lblServer->setText( tr2i18n( "Jabber &server:" ) );
    leJID->setText( TQString::null );
    lblJIDInformation->setText( TQString::null );
    lblStatusMessage->setText( TQString::null );
}

/****************************************************************************
** DlgJabberRegisterAccount meta object code from reading C++ file 'dlgjabberregisteraccount.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "dlgjabberregisteraccount.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *DlgJabberRegisterAccount::className() const
{
    return "DlgJabberRegisterAccount";
}

TQMetaObject *DlgJabberRegisterAccount::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DlgJabberRegisterAccount( "DlgJabberRegisterAccount", &DlgJabberRegisterAccount::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString DlgJabberRegisterAccount::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "DlgJabberRegisterAccount", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString DlgJabberRegisterAccount::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "DlgJabberRegisterAccount", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* DlgJabberRegisterAccount::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"DlgJabberRegisterAccount", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_DlgJabberRegisterAccount.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* DlgJabberRegisterAccount::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "DlgJabberRegisterAccount" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool DlgJabberRegisterAccount::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool DlgJabberRegisterAccount::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool DlgJabberRegisterAccount::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool DlgJabberRegisterAccount::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
