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

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

#include "aimeditaccountui.h"

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

/*
 *  Constructs a aimEditAccountUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
aimEditAccountUI::aimEditAccountUI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "aimEditAccountUI" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    aimEditAccountUILayout = new TQGridLayout( this, 1, 1, 0, 0, "aimEditAccountUILayout"); 

    labelStatusMessage = new TQLabel( this, "labelStatusMessage" );
    labelStatusMessage->setAlignment( int( TQLabel::AlignCenter ) );

    aimEditAccountUILayout->addWidget( labelStatusMessage, 1, 0 );

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

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

    groupBox72 = new TQGroupBox( tab, "groupBox72" );
    groupBox72->setColumnLayout(0, TQt::Vertical );
    groupBox72->layout()->setSpacing( 6 );
    groupBox72->layout()->setMargin( 11 );
    groupBox72Layout = new TQGridLayout( groupBox72->layout() );
    groupBox72Layout->setAlignment( TQt::AlignTop );

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

    lblAccountId = new TQLabel( groupBox72, "lblAccountId" );
    layout4->addWidget( lblAccountId );

    edtAccountId = new TQLineEdit( groupBox72, "edtAccountId" );
    layout4->addWidget( edtAccountId );

    groupBox72Layout->addLayout( layout4, 0, 0 );

    mPasswordWidget = new Kopete::UI::PasswordWidget( groupBox72, "mPasswordWidget" );

    groupBox72Layout->addWidget( mPasswordWidget, 1, 0 );

    mGlobalIdentity = new TQCheckBox( groupBox72, "mGlobalIdentity" );

    groupBox72Layout->addWidget( mGlobalIdentity, 3, 0 );

    mAutoLogon = new TQCheckBox( groupBox72, "mAutoLogon" );

    groupBox72Layout->addWidget( mAutoLogon, 2, 0 );
    tabLayout->addWidget( groupBox72 );

    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 );
    spacer7 = new TQSpacerItem( 20, 90, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer7 );
    tabWidget6->insertTab( tab, TQString::fromLatin1("") );

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

    groupBox73 = new TQGroupBox( tab_2, "groupBox73" );
    groupBox73->setColumnLayout(0, TQt::Vertical );
    groupBox73->layout()->setSpacing( 6 );
    groupBox73->layout()->setMargin( 11 );
    groupBox73Layout = new TQVBoxLayout( groupBox73->layout() );
    groupBox73Layout->setAlignment( TQt::AlignTop );

    optionOverrideServer = new TQCheckBox( groupBox73, "optionOverrideServer" );
    optionOverrideServer->setChecked( false );
    groupBox73Layout->addWidget( optionOverrideServer );

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

    lblServer = new TQLabel( groupBox73, "lblServer" );
    lblServer->setEnabled( false );
    layout58->addWidget( lblServer );

    edtServerAddress = new TQLineEdit( groupBox73, "edtServerAddress" );
    edtServerAddress->setEnabled( false );
    layout58->addWidget( edtServerAddress );

    lblPort = new TQLabel( groupBox73, "lblPort" );
    lblPort->setEnabled( false );
    layout58->addWidget( lblPort );

    sbxServerPort = new TQSpinBox( groupBox73, "sbxServerPort" );
    sbxServerPort->setEnabled( false );
    sbxServerPort->setMaxValue( 65534 );
    sbxServerPort->setMinValue( 1 );
    sbxServerPort->setValue( 5190 );
    layout58->addWidget( sbxServerPort );
    groupBox73Layout->addLayout( layout58 );

    tabLayout_2->addMultiCellWidget( groupBox73, 0, 0, 0, 1 );
    spacer21 = new TQSpacerItem( 20, 200, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer21, 2, 0 );

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

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

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

    tabLayout_2->addWidget( textLabel1, 1, 0 );
    tabWidget6->insertTab( tab_2, TQString::fromLatin1("") );

    tab_3 = new TQWidget( tabWidget6, "tab_3" );
    tabLayout_3 = new TQGridLayout( tab_3, 1, 1, 11, 6, "tabLayout_3"); 

    buttonGroup1 = new TQButtonGroup( tab_3, "buttonGroup1" );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQGridLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    rbAllowPerimtList = new TQRadioButton( buttonGroup1, "rbAllowPerimtList" );

    buttonGroup1Layout->addWidget( rbAllowPerimtList, 2, 0 );

    rbBlockAll = new TQRadioButton( buttonGroup1, "rbBlockAll" );

    buttonGroup1Layout->addWidget( rbBlockAll, 0, 1 );

    rbBlockAIM = new TQRadioButton( buttonGroup1, "rbBlockAIM" );

    buttonGroup1Layout->addWidget( rbBlockAIM, 1, 1 );

    rbBlockDenyList = new TQRadioButton( buttonGroup1, "rbBlockDenyList" );

    buttonGroup1Layout->addWidget( rbBlockDenyList, 2, 1 );

    rbAllowAll = new TQRadioButton( buttonGroup1, "rbAllowAll" );

    buttonGroup1Layout->addWidget( rbAllowAll, 0, 0 );

    rbAllowMyContacts = new TQRadioButton( buttonGroup1, "rbAllowMyContacts" );

    buttonGroup1Layout->addWidget( rbAllowMyContacts, 1, 0 );

    tabLayout_3->addWidget( buttonGroup1, 0, 0 );
    spacer3 = new TQSpacerItem( 31, 225, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_3->addItem( spacer3, 1, 0 );
    tabWidget6->insertTab( tab_3, TQString::fromLatin1("") );

    aimEditAccountUILayout->addWidget( tabWidget6, 0, 0 );
    languageChange();
    resize( TQSize(560, 583).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) ), lblPort, TQ_SLOT( setEnabled(bool) ) );
    connect( optionOverrideServer, TQ_SIGNAL( toggled(bool) ), edtServerAddress, TQ_SLOT( setEnabled(bool) ) );
    connect( optionOverrideServer, TQ_SIGNAL( toggled(bool) ), sbxServerPort, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( tabWidget6, edtAccountId );
    setTabOrder( edtAccountId, mAutoLogon );
    setTabOrder( mAutoLogon, buttonRegister );
    setTabOrder( buttonRegister, optionOverrideServer );
    setTabOrder( optionOverrideServer, edtServerAddress );
    setTabOrder( edtServerAddress, sbxServerPort );
    setTabOrder( sbxServerPort, encodingCombo );
    setTabOrder( encodingCombo, rbAllowAll );
    setTabOrder( rbAllowAll, rbAllowMyContacts );
    setTabOrder( rbAllowMyContacts, rbAllowPerimtList );
    setTabOrder( rbAllowPerimtList, rbBlockAll );
    setTabOrder( rbBlockAll, rbBlockAIM );
    setTabOrder( rbBlockAIM, rbBlockDenyList );

    // buddies
    lblAccountId->setBuddy( edtAccountId );
    lblServer->setBuddy( edtServerAddress );
    lblPort->setBuddy( sbxServerPort );
    textLabel1->setBuddy( encodingCombo );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void aimEditAccountUI::languageChange()
{
    setCaption( tr2i18n( "Account Preferences - AIM" ) );
    labelStatusMessage->setText( TQString::null );
    groupBox72->setTitle( tr2i18n( "Account Information" ) );
    lblAccountId->setText( tr2i18n( "AIM &screen name:" ) );
    TQToolTip::add( lblAccountId, tr2i18n( "The screen name of your AIM account." ) );
    TQWhatsThis::add( lblAccountId, tr2i18n( "The screen name of your AIM account.  This should be in the form of an alphanumeric string (spaces allowed, not case sensitive)." ) );
    TQToolTip::add( edtAccountId, tr2i18n( "The screen name of your AIM account." ) );
    TQWhatsThis::add( edtAccountId, tr2i18n( "The screen name of your AIM account.  This should be in the form of an alphanumeric string (spaces allowed, not case sensitive)." ) );
    mGlobalIdentity->setText( tr2i18n( "Exclu&de from Global Identity" ) );
    mAutoLogon->setText( tr2i18n( "E&xclude from connect all" ) );
    TQWhatsThis::add( mAutoLogon, 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" ) );
    groupBox5->setTitle( tr2i18n( "Registration" ) );
    textLabel6->setText( tr2i18n( "To connect to the AOL Instant Messaging network, you will need to use a screen name from AIM, AOL, or .Mac.<br><br>If you do not currently have an AIM screen name, please click the button to create one." ) );
    buttonRegister->setText( tr2i18n( "Re&gister New Account" ) );
    tabWidget6->changeTab( tab, tr2i18n( "&Basic Setup" ) );
    groupBox73->setTitle( tr2i18n( "Connection Preferences" ) );
    optionOverrideServer->setText( tr2i18n( "&Override default server information" ) );
    lblServer->setText( tr2i18n( "Ser&ver:" ) );
    TQToolTip::add( lblServer, tr2i18n( "The IP address or hostmask of the AIM server you wish to connect to." ) );
    TQWhatsThis::add( lblServer, tr2i18n( "The IP address or hostmask of the AIM server you wish to connect to.  Normally you will want the default (iwarg.ddns.net)." ) );
    edtServerAddress->setText( tr2i18n( "iwarg.ddns.net" ) );
    TQToolTip::add( edtServerAddress, tr2i18n( "The IP address or hostmask of the AIM server you wish to connect to." ) );
    TQWhatsThis::add( edtServerAddress, tr2i18n( "The IP address or hostmask of the AIM server you wish to connect to.  Normally you will want the default (iwarg.ddns.net)." ) );
    lblPort->setText( tr2i18n( "Po&rt:" ) );
    TQToolTip::add( lblPort, tr2i18n( "The port on the AIM server that you would like to connect to." ) );
    TQWhatsThis::add( lblPort, tr2i18n( "The port on the AIM server that you would like to connect to.  Normally this is 5190." ) );
    TQToolTip::add( sbxServerPort, tr2i18n( "The port on the AIM server that you would like to connect to." ) );
    TQWhatsThis::add( sbxServerPort, tr2i18n( "The port on the AIM server that you would like to connect to.  Normally this is 5190." ) );
    textLabel1->setText( tr2i18n( "Default to the following &encoding for messages:" ) );
    tabWidget6->changeTab( tab_2, tr2i18n( "Accou&nt Preferences" ) );
    buttonGroup1->setTitle( tr2i18n( "Visibility settings" ) );
    rbAllowPerimtList->setText( tr2i18n( "Allow only from visible list" ) );
    rbBlockAll->setText( tr2i18n( "Block all users" ) );
    rbBlockAIM->setText( tr2i18n( "Block AIM users" ) );
    rbBlockDenyList->setText( tr2i18n( "Block only from invisible list" ) );
    rbAllowAll->setText( tr2i18n( "Allow all users" ) );
    rbAllowMyContacts->setText( tr2i18n( "Allow only contact list's users" ) );
    tabWidget6->changeTab( tab_3, tr2i18n( "Pri&vacy" ) );
}

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

TQMetaObject *aimEditAccountUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_aimEditAccountUI( "aimEditAccountUI", &aimEditAccountUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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