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

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

#include "fontappearance_preferences.h"

#include <ntqvariant.h>
#include <tdefontrequester.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    FontAppearance_ConfigLayout->addMultiCellWidget( kcfg_FixedMOTD, 3, 3, 0, 1 );

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

    FontAppearance_ConfigLayout->addMultiCellWidget( kcfg_UseBoldNicks, 4, 4, 0, 1 );
    spacer89 = new TQSpacerItem( 20, 161, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    FontAppearance_ConfigLayout->addItem( spacer89, 5, 1 );

    kcfg_CustomTextFont = new TQCheckBox( this, "kcfg_CustomTextFont" );
    kcfg_CustomTextFont->setEnabled( true );

    FontAppearance_ConfigLayout->addWidget( kcfg_CustomTextFont, 0, 0 );

    kcfg_TextFont = new TDEFontRequester( this, "kcfg_TextFont" );
    kcfg_TextFont->setEnabled( false );

    FontAppearance_ConfigLayout->addWidget( kcfg_TextFont, 0, 1 );

    kcfg_ListFont = new TDEFontRequester( this, "kcfg_ListFont" );
    kcfg_ListFont->setEnabled( false );

    FontAppearance_ConfigLayout->addWidget( kcfg_ListFont, 1, 1 );

    kcfg_TabFont = new TDEFontRequester( this, "kcfg_TabFont" );
    kcfg_TabFont->setEnabled( false );

    FontAppearance_ConfigLayout->addWidget( kcfg_TabFont, 2, 1 );

    kcfg_CustomListFont = new TQCheckBox( this, "kcfg_CustomListFont" );
    kcfg_CustomListFont->setEnabled( true );

    FontAppearance_ConfigLayout->addWidget( kcfg_CustomListFont, 1, 0 );

    kcfg_CustomTabFont = new TQCheckBox( this, "kcfg_CustomTabFont" );
    kcfg_CustomTabFont->setEnabled( true );

    FontAppearance_ConfigLayout->addWidget( kcfg_CustomTabFont, 2, 0 );
    languageChange();
    resize( TQSize(454, 213).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_CustomTextFont, TQ_SIGNAL( toggled(bool) ), kcfg_TextFont, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_CustomListFont, TQ_SIGNAL( toggled(bool) ), kcfg_ListFont, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_CustomTabFont, TQ_SIGNAL( toggled(bool) ), kcfg_TabFont, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_CustomTextFont, kcfg_TextFont );
    setTabOrder( kcfg_TextFont, kcfg_CustomListFont );
    setTabOrder( kcfg_CustomListFont, kcfg_ListFont );
    setTabOrder( kcfg_ListFont, kcfg_CustomTabFont );
    setTabOrder( kcfg_CustomTabFont, kcfg_TabFont );
    setTabOrder( kcfg_TabFont, kcfg_FixedMOTD );
    setTabOrder( kcfg_FixedMOTD, kcfg_UseBoldNicks );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FontAppearance_Config::languageChange()
{
    kcfg_FixedMOTD->setText( tr2i18n( "Enable fi&xed font for MOTD messages" ) );
    TQWhatsThis::add( kcfg_FixedMOTD, tr2i18n( "Show MOTD (Message Of The Day) message in fixed font" ) );
    kcfg_UseBoldNicks->setText( tr2i18n( "Show sender nicknames &bold in the chat view" ) );
    kcfg_CustomTextFont->setText( tr2i18n( "Chat text:" ) );
    kcfg_CustomListFont->setText( tr2i18n( "Nickname list:" ) );
    kcfg_CustomTabFont->setText( tr2i18n( "Tab bar:" ) );
}

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

TQMetaObject *FontAppearance_Config::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_FontAppearance_Config( "FontAppearance_Config", &FontAppearance_Config::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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