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

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

#include "kopeteaccountconfigbase.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    mButtonNew = new TQPushButton( this, "mButtonNew" );

    KopeteAccountConfigBaseLayout->addMultiCellWidget( mButtonNew, 0, 0, 1, 2 );

    mButtonEdit = new TQPushButton( this, "mButtonEdit" );

    KopeteAccountConfigBaseLayout->addMultiCellWidget( mButtonEdit, 1, 1, 1, 2 );

    mButtonRemove = new TQPushButton( this, "mButtonRemove" );

    KopeteAccountConfigBaseLayout->addMultiCellWidget( mButtonRemove, 2, 2, 1, 2 );

    mAccountList = new TDEListView( this, "mAccountList" );
    mAccountList->addColumn( tr2i18n( "Protocol" ) );
    mAccountList->addColumn( tr2i18n( "Account" ) );
    mAccountList->setAllColumnsShowFocus( true );

    KopeteAccountConfigBaseLayout->addMultiCellWidget( mAccountList, 0, 7, 0, 0 );

    mUseColor = new TQCheckBox( this, "mUseColor" );

    KopeteAccountConfigBaseLayout->addMultiCellWidget( mUseColor, 4, 4, 1, 2 );

    mColorButton = new KColorButton( this, "mColorButton" );

    KopeteAccountConfigBaseLayout->addWidget( mColorButton, 5, 2 );
    spacer3_2 = new TQSpacerItem( 16, 16, TQSizePolicy::Minimum, TQSizePolicy::Minimum );
    KopeteAccountConfigBaseLayout->addItem( spacer3_2, 5, 1 );

    layout27 = new TQGridLayout( 0, 1, 1, 0, 6, "layout27"); 

    mButtonUp = new KPushButton( this, "mButtonUp" );
    mButtonUp->setMinimumSize( TQSize( 60, 10 ) );

    layout27->addWidget( mButtonUp, 0, 0 );
    spacer41 = new TQSpacerItem( 20, 40, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout27->addMultiCell( spacer41, 0, 1, 1, 1 );

    mButtonDown = new KPushButton( this, "mButtonDown" );
    mButtonDown->setMinimumSize( TQSize( 60, 10 ) );

    layout27->addWidget( mButtonDown, 1, 0 );

    KopeteAccountConfigBaseLayout->addMultiCellLayout( layout27, 7, 7, 1, 2 );
    spacer1 = new TQSpacerItem( 70, 50, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KopeteAccountConfigBaseLayout->addMultiCell( spacer1, 6, 6, 1, 2 );
    spacer3 = new TQSpacerItem( 70, 20, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    KopeteAccountConfigBaseLayout->addMultiCell( spacer3, 3, 3, 1, 2 );
    languageChange();
    resize( TQSize(477, 316).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mUseColor, TQ_SIGNAL( toggled(bool) ), mColorButton, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( mAccountList, mButtonNew );
    setTabOrder( mButtonNew, mButtonEdit );
    setTabOrder( mButtonEdit, mButtonRemove );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KopeteAccountConfigBase::languageChange()
{
    setCaption( tr2i18n( "Manage Accounts" ) );
    mButtonNew->setText( tr2i18n( "&New..." ) );
    TQToolTip::add( mButtonNew, tr2i18n( "Add new account" ) );
    mButtonEdit->setText( tr2i18n( "&Modify..." ) );
    TQToolTip::add( mButtonEdit, tr2i18n( "Modify selected account" ) );
    TQWhatsThis::add( mButtonEdit, tr2i18n( "Let you edit the account's properties." ) );
    mButtonRemove->setText( tr2i18n( "&Remove" ) );
    TQToolTip::add( mButtonRemove, tr2i18n( "Remove selected account" ) );
    TQWhatsThis::add( mButtonRemove, tr2i18n( "Remove selected account" ) );
    mAccountList->header()->setLabel( 0, tr2i18n( "Protocol" ) );
    mAccountList->header()->setLabel( 1, tr2i18n( "Account" ) );
    mUseColor->setText( tr2i18n( "Use &custom color" ) );
    TQToolTip::add( mUseColor, tr2i18n( "Use custom color for account" ) );
    TQWhatsThis::add( mUseColor, tr2i18n( "Allows you to set a custom color for this account" ) );
    mColorButton->setText( TQString::null );
    TQToolTip::add( mColorButton, tr2i18n( "Account custom color selector" ) );
    TQWhatsThis::add( mColorButton, tr2i18n( "Allows you to set a custom color for this account.\n"
"The icon of every contact of this account will be coloured with this color. Useful if you have several accounts of the same protocol" ) );
    mButtonUp->setText( TQString::null );
    TQToolTip::add( mButtonUp, tr2i18n( "Increase the priority" ) );
    TQWhatsThis::add( mButtonUp, tr2i18n( "Uses these buttons to increase or decrease the priority.\n"
"The priority is used to determine which contact to use when you click on a metacontact: Kopete will use the contact of the account with the greatest priority (if all contacts have the same online status.)" ) );
    mButtonDown->setText( TQString::null );
    TQToolTip::add( mButtonDown, tr2i18n( "Decrease the priority" ) );
    TQWhatsThis::add( mButtonDown, tr2i18n( "Uses these buttons to increase or decrease the priority.\n"
"The priority is used to determine which contact to use when you click on a metacontact: Kopete will use the contact of the account with the greatest priority (if all contacts have the same online status.)" ) );
}

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

TQMetaObject *KopeteAccountConfigBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KopeteAccountConfigBase( "KopeteAccountConfigBase", &KopeteAccountConfigBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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