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

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

#include "kopeteawayconfigbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcheckbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    groupBox2 = new TQGroupBox( this, "groupBox2" );
    groupBox2->setFrameShape( TQGroupBox::GroupBoxPanel );
    groupBox2->setFrameShadow( TQGroupBox::Sunken );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new TQGridLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    textLabel1 = new TQLabel( groupBox2, "textLabel1" );

    groupBox2Layout->addWidget( textLabel1, 1, 0 );

    rememberedMessages = new TQSpinBox( groupBox2, "rememberedMessages" );
    rememberedMessages->setMinValue( 1 );
    rememberedMessages->setValue( 5 );

    groupBox2Layout->addWidget( rememberedMessages, 1, 1 );
    spacer6 = new TQSpacerItem( 61, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox2Layout->addItem( spacer6, 1, 2 );
    KopeteAwayConfigBaseUILayout->addWidget( groupBox2 );

    groupBox3 = new TQGroupBox( this, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQVBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    mUseAutoAway = new TQCheckBox( groupBox3, "mUseAutoAway" );
    groupBox3Layout->addWidget( mUseAutoAway );

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

    TextLabel2 = new TQLabel( groupBox3, "TextLabel2" );
    TextLabel2->setEnabled( false );
    layout3->addWidget( TextLabel2 );

    mAutoAwayTimeout = new TQSpinBox( groupBox3, "mAutoAwayTimeout" );
    mAutoAwayTimeout->setEnabled( false );
    mAutoAwayTimeout->setMaxValue( 999 );
    mAutoAwayTimeout->setMinValue( 1 );
    layout3->addWidget( mAutoAwayTimeout );

    TextLabel3 = new TQLabel( groupBox3, "TextLabel3" );
    TextLabel3->setEnabled( false );
    layout3->addWidget( TextLabel3 );
    spacer7 = new TQSpacerItem( 81, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer7 );
    groupBox3Layout->addLayout( layout3 );

    mGoAvailable = new TQCheckBox( groupBox3, "mGoAvailable" );
    mGoAvailable->setEnabled( false );
    groupBox3Layout->addWidget( mGoAvailable );
    KopeteAwayConfigBaseUILayout->addWidget( groupBox3 );

    autoAwayMessageGroup = new TQButtonGroup( this, "autoAwayMessageGroup" );
    autoAwayMessageGroup->setEnabled( false );
    autoAwayMessageGroup->setColumnLayout(0, TQt::Vertical );
    autoAwayMessageGroup->layout()->setSpacing( 6 );
    autoAwayMessageGroup->layout()->setMargin( 11 );
    autoAwayMessageGroupLayout = new TQVBoxLayout( autoAwayMessageGroup->layout() );
    autoAwayMessageGroupLayout->setAlignment( TQt::AlignTop );

    mDisplayLastAwayMessage = new TQRadioButton( autoAwayMessageGroup, "mDisplayLastAwayMessage" );
    mDisplayLastAwayMessage->setEnabled( false );
    mDisplayLastAwayMessage->setChecked( true );
    autoAwayMessageGroupLayout->addWidget( mDisplayLastAwayMessage );

    mDisplayCustomAwayMessage = new TQRadioButton( autoAwayMessageGroup, "mDisplayCustomAwayMessage" );
    mDisplayCustomAwayMessage->setEnabled( false );
    autoAwayMessageGroupLayout->addWidget( mDisplayCustomAwayMessage );

    layout3_2 = new TQHBoxLayout( 0, 0, 6, "layout3_2"); 
    spacer5_2_2 = new TQSpacerItem( 16, 16, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout3_2->addItem( spacer5_2_2 );

    mAutoAwayMessageEdit = new KLineEdit( autoAwayMessageGroup, "mAutoAwayMessageEdit" );
    mAutoAwayMessageEdit->setEnabled( false );
    mAutoAwayMessageEdit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, mAutoAwayMessageEdit->sizePolicy().hasHeightForWidth() ) );
    mAutoAwayMessageEdit->setMinimumSize( TQSize( 300, 0 ) );
    layout3_2->addWidget( mAutoAwayMessageEdit );
    autoAwayMessageGroupLayout->addLayout( layout3_2 );
    KopeteAwayConfigBaseUILayout->addWidget( autoAwayMessageGroup );
    spacer5 = new TQSpacerItem( 20, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KopeteAwayConfigBaseUILayout->addItem( spacer5 );
    languageChange();
    resize( TQSize(471, 266).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), TextLabel2, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), mAutoAwayTimeout, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), TextLabel3, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), mGoAvailable, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), mDisplayLastAwayMessage, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), mDisplayCustomAwayMessage, TQ_SLOT( setEnabled(bool) ) );
    connect( mDisplayCustomAwayMessage, TQ_SIGNAL( toggled(bool) ), mAutoAwayMessageEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseAutoAway, TQ_SIGNAL( toggled(bool) ), autoAwayMessageGroup, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( mUseAutoAway, mAutoAwayTimeout );
    setTabOrder( mAutoAwayTimeout, mGoAvailable );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KopeteAwayConfigBaseUI::languageChange()
{
    setCaption( tr2i18n( "Away Configuration" ) );
    groupBox2->setTitle( tr2i18n( "General" ) );
    textLabel1->setText( tr2i18n( "Number of away messages to remember:" ) );
    TQToolTip::add( textLabel1, tr2i18n( "Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed." ) );
    TQWhatsThis::add( textLabel1, tr2i18n( "Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed." ) );
    TQToolTip::add( rememberedMessages, tr2i18n( "Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed." ) );
    TQWhatsThis::add( rememberedMessages, tr2i18n( "Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed." ) );
    groupBox3->setTitle( tr2i18n( "Auto Away" ) );
    TQWhatsThis::add( groupBox3, tr2i18n( "<p>If you check the <i>Use auto away</i> checkbox, Kopete will automaticaly set you globally away when the TDE screen saver starts, or after the selected minutes of user inactivity (i.e no mouse move, or key pressed)</p>\n"
"<p>Kopete will set you available again when you come back if you checked <i>Become available when detecting activity again</i></p>" ) );
    mUseAutoAway->setText( tr2i18n( "&Use auto away" ) );
    TextLabel2->setText( tr2i18n( "Become away after" ) );
    TextLabel3->setText( tr2i18n( "minutes of user inactivity" ) );
    mGoAvailable->setText( tr2i18n( "Become available when detecting activity again" ) );
    autoAwayMessageGroup->setTitle( tr2i18n( "Auto Away Message" ) );
    mDisplayLastAwayMessage->setText( tr2i18n( "Display the last away message used" ) );
    mDisplayCustomAwayMessage->setText( tr2i18n( "Display the following away message:" ) );
}

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

TQMetaObject *KopeteAwayConfigBaseUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KopeteAwayConfigBaseUI( "KopeteAwayConfigBaseUI", &KopeteAwayConfigBaseUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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