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

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

#include "kopeteidentityconfigbase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqtabwidget.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kcfg_EnableGlobalIdentity = new TQCheckBox( this, "kcfg_EnableGlobalIdentity" );
    KopeteIdentityConfigBaseLayout->addWidget( kcfg_EnableGlobalIdentity );

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

    textLabel1 = new TQLabel( this, "textLabel1" );
    layout6->addWidget( textLabel1 );

    comboSelectIdentity = new KComboBox( false, this, "comboSelectIdentity" );
    comboSelectIdentity->setEnabled( false );
    comboSelectIdentity->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, comboSelectIdentity->sizePolicy().hasHeightForWidth() ) );
    layout6->addWidget( comboSelectIdentity );
    KopeteIdentityConfigBaseLayout->addLayout( layout6 );

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

    buttonNewIdentity = new KPushButton( this, "buttonNewIdentity" );
    layout7->addWidget( buttonNewIdentity );

    buttonCopyIdentity = new KPushButton( this, "buttonCopyIdentity" );
    layout7->addWidget( buttonCopyIdentity );

    buttonRenameIdentity = new KPushButton( this, "buttonRenameIdentity" );
    layout7->addWidget( buttonRenameIdentity );

    buttonRemoveIdentity = new KPushButton( this, "buttonRemoveIdentity" );
    layout7->addWidget( buttonRemoveIdentity );
    KopeteIdentityConfigBaseLayout->addLayout( layout7 );

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

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

    nicknameButtonGroup = new TQButtonGroup( tab, "nicknameButtonGroup" );
    nicknameButtonGroup->setEnabled( false );
    nicknameButtonGroup->setFrameShape( TQButtonGroup::NoFrame );
    nicknameButtonGroup->setLineWidth( 0 );
    nicknameButtonGroup->setColumnLayout(0, TQt::Vertical );
    nicknameButtonGroup->layout()->setSpacing( 6 );
    nicknameButtonGroup->layout()->setMargin( 11 );
    nicknameButtonGroupLayout = new TQGridLayout( nicknameButtonGroup->layout() );
    nicknameButtonGroupLayout->setAlignment( TQt::AlignTop );

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

    radioNicknameCustom = new TQRadioButton( nicknameButtonGroup, "radioNicknameCustom" );
    layout12->addWidget( radioNicknameCustom );

    lineNickname = new TQLineEdit( nicknameButtonGroup, "lineNickname" );
    layout12->addWidget( lineNickname );

    radioNicknameKABC = new TQRadioButton( nicknameButtonGroup, "radioNicknameKABC" );
    layout12->addWidget( radioNicknameKABC );

    radioNicknameContact = new TQRadioButton( nicknameButtonGroup, "radioNicknameContact" );
    layout12->addWidget( radioNicknameContact );

    comboNameContact = new TQComboBox( false, nicknameButtonGroup, "comboNameContact" );
    comboNameContact->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, comboNameContact->sizePolicy().hasHeightForWidth() ) );
    layout12->addWidget( comboNameContact );

    nicknameButtonGroupLayout->addLayout( layout12, 0, 0 );
    tabLayout->addWidget( nicknameButtonGroup );
    spacer7_2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer7_2 );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 

    photoButtonGroup = new TQButtonGroup( tab_2, "photoButtonGroup" );
    photoButtonGroup->setEnabled( false );
    photoButtonGroup->setLineWidth( 0 );
    photoButtonGroup->setColumnLayout(0, TQt::Vertical );
    photoButtonGroup->layout()->setSpacing( 6 );
    photoButtonGroup->layout()->setMargin( 11 );
    photoButtonGroupLayout = new TQHBoxLayout( photoButtonGroup->layout() );
    photoButtonGroupLayout->setAlignment( TQt::AlignTop );

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

    comboPhotoURL = new KURLComboRequester( photoButtonGroup, "comboPhotoURL" );

    layout7_2->addWidget( comboPhotoURL, 1, 0 );

    buttonClearPhoto = new KPushButton( photoButtonGroup, "buttonClearPhoto" );
    buttonClearPhoto->setMaximumSize( TQSize( 32, 3232 ) );

    layout7_2->addWidget( buttonClearPhoto, 1, 1 );

    checkSyncPhotoKABC = new TQCheckBox( photoButtonGroup, "checkSyncPhotoKABC" );

    layout7_2->addMultiCellWidget( checkSyncPhotoKABC, 5, 5, 0, 1 );

    comboPhotoContact = new TQComboBox( false, photoButtonGroup, "comboPhotoContact" );
    comboPhotoContact->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, comboPhotoContact->sizePolicy().hasHeightForWidth() ) );

    layout7_2->addMultiCellWidget( comboPhotoContact, 4, 4, 0, 1 );

    radioPhotoCustom = new TQRadioButton( photoButtonGroup, "radioPhotoCustom" );

    layout7_2->addMultiCellWidget( radioPhotoCustom, 0, 0, 0, 1 );

    radioPhotoContact = new TQRadioButton( photoButtonGroup, "radioPhotoContact" );

    layout7_2->addMultiCellWidget( radioPhotoContact, 3, 3, 0, 1 );

    radioPhotoKABC = new TQRadioButton( photoButtonGroup, "radioPhotoKABC" );

    layout7_2->addMultiCellWidget( radioPhotoKABC, 2, 2, 0, 1 );
    photoButtonGroupLayout->addLayout( layout7_2 );

    layout11 = new TQVBoxLayout( 0, 0, 6, "layout11"); 
    spacer6 = new TQSpacerItem( 20, 36, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout11->addItem( spacer6 );

    labelPhoto = new TQLabel( photoButtonGroup, "labelPhoto" );
    labelPhoto->setMinimumSize( TQSize( 64, 92 ) );
    labelPhoto->setMaximumSize( TQSize( 64, 32767 ) );
    labelPhoto->setFrameShape( TQLabel::Box );
    labelPhoto->setLineWidth( 1 );
    labelPhoto->setTextFormat( TQLabel::RichText );
    labelPhoto->setScaledContents( false );
    layout11->addWidget( labelPhoto );
    spacer7 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout11->addItem( spacer7 );
    photoButtonGroupLayout->addLayout( layout11 );
    tabLayout_2->addWidget( photoButtonGroup );
    spacer5 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer5 );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );

    TabPage = new TQWidget( tabWidget2, "TabPage" );
    TabPageLayout = new TQVBoxLayout( TabPage, 11, 6, "TabPageLayout"); 

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

    lineAddressee = new KLineEdit( TabPage, "lineAddressee" );
    lineAddressee->setReadOnly( true );
    layout7_3->addWidget( lineAddressee );

    buttonChangeAddressee = new TQPushButton( TabPage, "buttonChangeAddressee" );
    buttonChangeAddressee->setEnabled( false );
    layout7_3->addWidget( buttonChangeAddressee );
    TabPageLayout->addLayout( layout7_3 );

    textLabel1_2 = new TQLabel( TabPage, "textLabel1_2" );
    TabPageLayout->addWidget( textLabel1_2 );
    spacer4_2 = new TQSpacerItem( 20, 100, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    TabPageLayout->addItem( spacer4_2 );
    tabWidget2->insertTab( TabPage, TQString::fromLatin1("") );
    KopeteIdentityConfigBaseLayout->addWidget( tabWidget2 );
    spacer4 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KopeteIdentityConfigBaseLayout->addItem( spacer4 );
    languageChange();
    resize( TQSize(633, 447).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_EnableGlobalIdentity, TQ_SIGNAL( toggled(bool) ), nicknameButtonGroup, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_EnableGlobalIdentity, TQ_SIGNAL( toggled(bool) ), photoButtonGroup, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_EnableGlobalIdentity, TQ_SIGNAL( toggled(bool) ), comboSelectIdentity, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_EnableGlobalIdentity, TQ_SIGNAL( toggled(bool) ), buttonChangeAddressee, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KopeteIdentityConfigBase::languageChange()
{
    kcfg_EnableGlobalIdentity->setText( tr2i18n( "Enable &global identity" ) );
    textLabel1->setText( tr2i18n( "Identity:" ) );
    buttonNewIdentity->setText( tr2i18n( "Ne&w Identity..." ) );
    buttonCopyIdentity->setText( tr2i18n( "Cop&y Identity..." ) );
    buttonRenameIdentity->setText( tr2i18n( "Rename I&dentity..." ) );
    buttonRemoveIdentity->setText( tr2i18n( "Remo&ve Identity" ) );
    nicknameButtonGroup->setTitle( TQString::null );
    radioNicknameCustom->setText( tr2i18n( "Cu&stom:" ) );
    radioNicknameKABC->setText( tr2i18n( "Use address boo&k name (need address book link)" ) );
    radioNicknameContact->setText( tr2i18n( "Use nickname from con&tact for global nickname:" ) );
    TQToolTip::add( comboNameContact, tr2i18n( "Contact to synchronize the displayname with." ) );
    tabWidget2->changeTab( tab, tr2i18n( "&Nickname" ) );
    photoButtonGroup->setTitle( TQString::null );
    buttonClearPhoto->setText( TQString::null );
    checkSyncPhotoKABC->setText( tr2i18n( "S&ync address book photo with global photo" ) );
    radioPhotoCustom->setText( tr2i18n( "Cus&tom:" ) );
    radioPhotoContact->setText( tr2i18n( "U&se photo from contact for global photo:" ) );
    radioPhotoKABC->setText( tr2i18n( "Use a&ddress book photo (needs address book link)" ) );
    labelPhoto->setText( tr2i18n( "<center>Photo</center>" ) );
    tabWidget2->changeTab( tab_2, tr2i18n( "P&hoto" ) );
    buttonChangeAddressee->setText( tr2i18n( "C&hange..." ) );
    textLabel1_2->setText( tr2i18n( "<b>Note:</b> The address book link uses KAddressBook's \n"
"current user contact." ) );
    tabWidget2->changeTab( TabPage, tr2i18n( "Address &Book Link" ) );
}

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

TQMetaObject *KopeteIdentityConfigBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KopeteIdentityConfigBase( "KopeteIdentityConfigBase", &KopeteIdentityConfigBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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