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

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

#include "historyprefsui.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <knuminput.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    grpChatHistory = new TQGroupBox( this, "grpChatHistory" );
    grpChatHistory->setColumnLayout(0, TQt::Vertical );
    grpChatHistory->layout()->setSpacing( 6 );
    grpChatHistory->layout()->setMargin( 11 );
    grpChatHistoryLayout = new TQGridLayout( grpChatHistory->layout() );
    grpChatHistoryLayout->setAlignment( TQt::AlignTop );

    lblNoLinesPerPage = new TQLabel( grpChatHistory, "lblNoLinesPerPage" );

    grpChatHistoryLayout->addWidget( lblNoLinesPerPage, 3, 0 );

    Number_ChatWindow = new KIntSpinBox( grpChatHistory, "Number_ChatWindow" );
    Number_ChatWindow->setMaxValue( 32768 );
    Number_ChatWindow->setMinValue( 1 );
    Number_ChatWindow->setValue( 10 );

    grpChatHistoryLayout->addWidget( Number_ChatWindow, 3, 1 );

    colorLabel = new TQLabel( grpChatHistory, "colorLabel" );

    grpChatHistoryLayout->addWidget( colorLabel, 2, 0 );

    History_color = new KColorButton( grpChatHistory, "History_color" );
    History_color->setColor( TQColor( 170, 170, 127 ) );

    grpChatHistoryLayout->addWidget( History_color, 2, 1 );

    Number_Auto_chatwindow = new KIntSpinBox( grpChatHistory, "Number_Auto_chatwindow" );
    Number_Auto_chatwindow->setMaxValue( 32768 );
    Number_Auto_chatwindow->setMinValue( 1 );
    Number_Auto_chatwindow->setValue( 7 );

    grpChatHistoryLayout->addWidget( Number_Auto_chatwindow, 1, 1 );

    numberLabel = new TQLabel( grpChatHistory, "numberLabel" );

    grpChatHistoryLayout->addWidget( numberLabel, 1, 0 );

    chkShowPrevious = new TQCheckBox( grpChatHistory, "chkShowPrevious" );
    chkShowPrevious->setChecked( true );

    grpChatHistoryLayout->addMultiCellWidget( chkShowPrevious, 0, 0, 0, 1 );
    HistoryPrefsWidgetLayout->addWidget( grpChatHistory );
    spacer2 = new TQSpacerItem( 31, 90, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    HistoryPrefsWidgetLayout->addItem( spacer2 );
    languageChange();
    resize( TQSize(363, 212).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( chkShowPrevious, TQ_SIGNAL( toggled(bool) ), numberLabel, TQ_SLOT( setEnabled(bool) ) );
    connect( chkShowPrevious, TQ_SIGNAL( toggled(bool) ), Number_Auto_chatwindow, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( chkShowPrevious, Number_Auto_chatwindow );
    setTabOrder( Number_Auto_chatwindow, History_color );

    // buddies
    colorLabel->setBuddy( History_color );
    numberLabel->setBuddy( Number_Auto_chatwindow );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void HistoryPrefsUI::languageChange()
{
    setCaption( tr2i18n( "HistoryPrefsWidget" ) );
    grpChatHistory->setTitle( tr2i18n( "Chat History" ) );
    lblNoLinesPerPage->setText( tr2i18n( "Number of messages per page:" ) );
    TQWhatsThis::add( lblNoLinesPerPage, tr2i18n( "The number of messages that are shown when browsing history in the chat window" ) );
    TQWhatsThis::add( Number_ChatWindow, tr2i18n( "The number of message that are shown when borwsing history in the chat window" ) );
    colorLabel->setText( tr2i18n( "Color of messages:" ) );
    TQWhatsThis::add( colorLabel, tr2i18n( "Color of history messages in the chat window" ) );
    History_color->setText( TQString::null );
    TQWhatsThis::add( History_color, tr2i18n( "Color of history messages in the chat window" ) );
    TQWhatsThis::add( Number_Auto_chatwindow, tr2i18n( "This is the number of messages that will be added automatically in the chat window when opening a new chat." ) );
    numberLabel->setText( tr2i18n( "Number of messages to show:" ) );
    TQWhatsThis::add( numberLabel, tr2i18n( "This is the number of messages that will be added automatically in the chat window when opening a new chat." ) );
    chkShowPrevious->setText( tr2i18n( "Show chat history in new chats" ) );
    TQWhatsThis::add( chkShowPrevious, tr2i18n( "When a new chat is opened, automatically add the last few messages between you and that contact." ) );
}

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

TQMetaObject *HistoryPrefsUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_HistoryPrefsUI( "HistoryPrefsUI", &HistoryPrefsUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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