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

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

#include "icqeditaccountui.h"

#include <ntqvariant.h>
#include <kopetepasswordwidget.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqspinbox.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kopetepasswordwidget.h"

/*
 *  Constructs a ICQEditAccountUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ICQEditAccountUI::ICQEditAccountUI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "ICQEditAccountUI" );
    ICQEditAccountUILayout = new TQVBoxLayout( this, 0, 0, "ICQEditAccountUILayout"); 

    tabWidget7 = new TQTabWidget( this, "tabWidget7" );

    tab = new TQWidget( tabWidget7, "tab" );
    tabLayout = new TQVBoxLayout( tab, 11, 6, "tabLayout"); 

    groupBox3 = new TQGroupBox( tab, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQVBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

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

    lblAccountId = new TQLabel( groupBox3, "lblAccountId" );
    layout5->addWidget( lblAccountId );

    edtAccountId = new TQLineEdit( groupBox3, "edtAccountId" );
    layout5->addWidget( edtAccountId );
    groupBox3Layout->addLayout( layout5 );

    mPasswordWidget = new Kopete::UI::PasswordWidget( groupBox3, "mPasswordWidget" );
    groupBox3Layout->addWidget( mPasswordWidget );

    chkAutoLogin = new TQCheckBox( groupBox3, "chkAutoLogin" );
    chkAutoLogin->setEnabled( true );
    groupBox3Layout->addWidget( chkAutoLogin );

    chkGlobalIdentity = new TQCheckBox( groupBox3, "chkGlobalIdentity" );
    groupBox3Layout->addWidget( chkGlobalIdentity );
    tabLayout->addWidget( groupBox3 );

    groupBox5 = new TQGroupBox( tab, "groupBox5" );
    groupBox5->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)1, 0, 0, groupBox5->sizePolicy().hasHeightForWidth() ) );
    groupBox5->setColumnLayout(0, TQt::Vertical );
    groupBox5->layout()->setSpacing( 6 );
    groupBox5->layout()->setMargin( 11 );
    groupBox5Layout = new TQHBoxLayout( groupBox5->layout() );
    groupBox5Layout->setAlignment( TQt::AlignTop );

    textLabel6 = new TQLabel( groupBox5, "textLabel6" );
    textLabel6->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)1, 0, 0, textLabel6->sizePolicy().hasHeightForWidth() ) );
    textLabel6->setMinimumSize( TQSize( 0, 0 ) );
    textLabel6->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
    groupBox5Layout->addWidget( textLabel6 );

    buttonRegister = new TQPushButton( groupBox5, "buttonRegister" );
    groupBox5Layout->addWidget( buttonRegister );
    tabLayout->addWidget( groupBox5 );
    spacerBasicSetup = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacerBasicSetup );
    tabWidget7->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget7, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    groupBox2 = new TQGroupBox( tab_2, "groupBox2" );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new TQGridLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    edtServerPort = new TQSpinBox( groupBox2, "edtServerPort" );
    edtServerPort->setEnabled( false );
    edtServerPort->setMaxValue( 65534 );
    edtServerPort->setMinValue( 1 );
    edtServerPort->setValue( 5190 );

    groupBox2Layout->addWidget( edtServerPort, 1, 3 );

    edtServerAddress = new TQLineEdit( groupBox2, "edtServerAddress" );
    edtServerAddress->setEnabled( false );

    groupBox2Layout->addWidget( edtServerAddress, 1, 2 );

    lblServerPort = new TQLabel( groupBox2, "lblServerPort" );
    lblServerPort->setEnabled( false );

    groupBox2Layout->addWidget( lblServerPort, 1, 1 );

    lblServer = new TQLabel( groupBox2, "lblServer" );
    lblServer->setEnabled( false );

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

    optionOverrideServer = new TQCheckBox( groupBox2, "optionOverrideServer" );

    groupBox2Layout->addMultiCellWidget( optionOverrideServer, 0, 0, 0, 3 );

    tabLayout_2->addMultiCellWidget( groupBox2, 0, 0, 0, 1 );

    groupBox65 = new TQGroupBox( tab_2, "groupBox65" );
    groupBox65->setColumnLayout(0, TQt::Vertical );
    groupBox65->layout()->setSpacing( 6 );
    groupBox65->layout()->setMargin( 11 );
    groupBox65Layout = new TQGridLayout( groupBox65->layout() );
    groupBox65Layout->setAlignment( TQt::AlignTop );

    chkRequireAuth = new TQCheckBox( groupBox65, "chkRequireAuth" );

    groupBox65Layout->addWidget( chkRequireAuth, 0, 0 );

    chkHideIP = new TQCheckBox( groupBox65, "chkHideIP" );

    groupBox65Layout->addWidget( chkHideIP, 1, 0 );

    chkWebAware = new TQCheckBox( groupBox65, "chkWebAware" );
    chkWebAware->setChecked( false );

    groupBox65Layout->addWidget( chkWebAware, 2, 0 );

    tabLayout_2->addMultiCellWidget( groupBox65, 1, 1, 0, 1 );
    spacerPreferences = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacerPreferences, 3, 0 );

    encodingCombo = new TQComboBox( false, tab_2, "encodingCombo" );
    encodingCombo->setEnabled( true );

    tabLayout_2->addWidget( encodingCombo, 2, 1 );

    textLabel1 = new TQLabel( tab_2, "textLabel1" );
    textLabel1->setEnabled( true );

    tabLayout_2->addWidget( textLabel1, 2, 0 );
    tabWidget7->insertTab( tab_2, TQString::fromLatin1("") );
    ICQEditAccountUILayout->addWidget( tabWidget7 );

    labelStatusMessage = new TQLabel( this, "labelStatusMessage" );
    labelStatusMessage->setAlignment( int( TQLabel::AlignCenter ) );
    ICQEditAccountUILayout->addWidget( labelStatusMessage );
    languageChange();
    resize( TQSize(592, 404).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( optionOverrideServer, TQ_SIGNAL( toggled(bool) ), lblServer, TQ_SLOT( setEnabled(bool) ) );
    connect( optionOverrideServer, TQ_SIGNAL( toggled(bool) ), lblServerPort, TQ_SLOT( setEnabled(bool) ) );
    connect( optionOverrideServer, TQ_SIGNAL( toggled(bool) ), edtServerAddress, TQ_SLOT( setEnabled(bool) ) );
    connect( optionOverrideServer, TQ_SIGNAL( toggled(bool) ), edtServerPort, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( tabWidget7, edtAccountId );
    setTabOrder( edtAccountId, chkAutoLogin );
    setTabOrder( chkAutoLogin, buttonRegister );
    setTabOrder( buttonRegister, optionOverrideServer );
    setTabOrder( optionOverrideServer, edtServerAddress );
    setTabOrder( edtServerAddress, edtServerPort );
    setTabOrder( edtServerPort, chkRequireAuth );
    setTabOrder( chkRequireAuth, chkHideIP );
    setTabOrder( chkHideIP, chkWebAware );

    // buddies
    lblAccountId->setBuddy( edtAccountId );
    lblServerPort->setBuddy( edtServerPort );
    lblServer->setBuddy( edtServerAddress );
    textLabel1->setBuddy( encodingCombo );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ICQEditAccountUI::languageChange()
{
    setCaption( tr2i18n( "Account Preferences - ICQ" ) );
    groupBox3->setTitle( tr2i18n( "Account Preferences" ) );
    lblAccountId->setText( tr2i18n( "IC&Q UIN:" ) );
    TQToolTip::add( lblAccountId, tr2i18n( "The user ID of your ICQ account." ) );
    TQWhatsThis::add( lblAccountId, tr2i18n( "The user ID of your ICQ account.  This should be in the form of a number (no decimals, no spaces)." ) );
    TQToolTip::add( edtAccountId, tr2i18n( "The user ID of your ICQ account." ) );
    TQWhatsThis::add( edtAccountId, tr2i18n( "The user ID of your ICQ account.  This should be in the form of a number (no decimals, no spaces)." ) );
    chkAutoLogin->setText( tr2i18n( "E&xclude from connect all" ) );
    TQWhatsThis::add( chkAutoLogin, tr2i18n( "If you check that case, the account will not be connected when you press the \"Connect All\" button, or at startup even if you selected to automatically connect at startup" ) );
    chkGlobalIdentity->setText( tr2i18n( "Exclu&de from Global Identity" ) );
    groupBox5->setTitle( tr2i18n( "Registration" ) );
    textLabel6->setText( tr2i18n( "To connect to the ICQ network, you will need an ICQ account.<br><br>\n"
"If you do not currently have an ICQ account, please click the button to create one." ) );
    buttonRegister->setText( tr2i18n( "Re&gister New Account" ) );
    tabWidget7->changeTab( tab, tr2i18n( "&Basic Setup" ) );
    groupBox2->setTitle( tr2i18n( "Connection Preferences" ) );
    TQToolTip::add( edtServerPort, tr2i18n( "The port on the ICQ server that you would like to connect to." ) );
    TQWhatsThis::add( edtServerPort, tr2i18n( "The port on the ICQ server that you would like to connect to.  Normally this is 5190." ) );
    edtServerAddress->setText( tr2i18n( "login.icq.com" ) );
    TQToolTip::add( edtServerAddress, tr2i18n( "The IP address or hostmask of the ICQ server you wish to connect to." ) );
    TQWhatsThis::add( edtServerAddress, tr2i18n( "The IP address or hostmask of the ICQ server you wish to connect to.  Normally you will want the default (login.icq.com)." ) );
    lblServerPort->setText( tr2i18n( "Po&rt:" ) );
    TQToolTip::add( lblServerPort, tr2i18n( "The port on the ICQ server that you would like to connect to." ) );
    TQWhatsThis::add( lblServerPort, tr2i18n( "The port on the ICQ server that you would like to connect to.  Normally this is 5190." ) );
    lblServer->setText( tr2i18n( "Ser&ver /" ) );
    TQToolTip::add( lblServer, tr2i18n( "The IP address or hostmask of the ICQ server you wish to connect to." ) );
    TQWhatsThis::add( lblServer, tr2i18n( "The IP address or hostmask of the ICQ server you wish to connect to.  Normally you will want the default (login.icq.com)." ) );
    optionOverrideServer->setText( tr2i18n( "&Override default server information" ) );
    groupBox65->setTitle( tr2i18n( "Privacy Options" ) );
    chkRequireAuth->setText( tr2i18n( "&Require authorization before someone can add you to their contact list" ) );
    TQToolTip::add( chkRequireAuth, tr2i18n( "Enable authorization requirement, which will not allow users to add you to their contact list without authorization from you." ) );
    TQWhatsThis::add( chkRequireAuth, tr2i18n( "Enable authorization requirement, which will not allow users to add you to their contact list without authorization from you.  Check this box, and you will have to confirm any users who add you to their list before they may see your online status." ) );
    chkHideIP->setText( tr2i18n( "Hide &IP address" ) );
    TQToolTip::add( chkHideIP, tr2i18n( "Check this to hide your IP address from people when they view your user info" ) );
    TQWhatsThis::add( chkHideIP, tr2i18n( "Checking this box will not allow people to see what your IP address if they view your ICQ user details such as name, address, or age." ) );
    chkWebAware->setText( tr2i18n( "Make my status available via &ICQ's unified messaging center" ) );
    TQToolTip::add( chkWebAware, tr2i18n( "Check this box to enable Web Aware functionality." ) );
    TQWhatsThis::add( chkWebAware, tr2i18n( "Check this box to enable ICQ's Web Aware functionality, which allows people to see your online status from ICQ's web page, and send you a message without necessarily having ICQ themselves." ) );
    textLabel1->setText( tr2i18n( "Default to the following &encoding for messages:" ) );
    tabWidget7->changeTab( tab_2, tr2i18n( "Accou&nt Preferences" ) );
    labelStatusMessage->setText( TQString::null );
}

/****************************************************************************
** ICQEditAccountUI meta object code from reading C++ file 'icqeditaccountui.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 "icqeditaccountui.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 *ICQEditAccountUI::className() const
{
    return "ICQEditAccountUI";
}

TQMetaObject *ICQEditAccountUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ICQEditAccountUI( "ICQEditAccountUI", &ICQEditAccountUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ICQEditAccountUI::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(
	"ICQEditAccountUI", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ICQEditAccountUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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