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

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

#include "behaviorconfig_general.h"

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

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

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

    mShowTrayChk = new TQCheckBox( buttonGroup2, "mShowTrayChk" );
    buttonGroup2Layout->addWidget( mShowTrayChk );

    mStartDockedChk = new TQCheckBox( buttonGroup2, "mStartDockedChk" );
    mStartDockedChk->setEnabled( false );
    buttonGroup2Layout->addWidget( mStartDockedChk );
    BehaviorConfig_GeneralLayout->addWidget( buttonGroup2 );

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

    mInstantMessageOpeningChk = new TQRadioButton( buttonGroup1, "mInstantMessageOpeningChk" );
    buttonGroup1Layout->addWidget( mInstantMessageOpeningChk );

    mUseQueueChk = new TQRadioButton( buttonGroup1, "mUseQueueChk" );
    buttonGroup1Layout->addWidget( mUseQueueChk );

    mUseStackChk = new TQRadioButton( buttonGroup1, "mUseStackChk" );
    buttonGroup1Layout->addWidget( mUseStackChk );

    mQueueUnreadMessagesChk = new TQCheckBox( buttonGroup1, "mQueueUnreadMessagesChk" );
    mQueueUnreadMessagesChk->setEnabled( false );
    buttonGroup1Layout->addWidget( mQueueUnreadMessagesChk );
    BehaviorConfig_GeneralLayout->addWidget( buttonGroup1 );

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

    mAutoConnect = new TQCheckBox( groupBox2, "mAutoConnect" );
    groupBox2Layout->addWidget( mAutoConnect );
    BehaviorConfig_GeneralLayout->addWidget( groupBox2 );
    spacer1 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    BehaviorConfig_GeneralLayout->addItem( spacer1 );
    languageChange();
    resize( TQSize(348, 302).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mShowTrayChk, TQ_SIGNAL( toggled(bool) ), mStartDockedChk, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseQueueChk, TQ_SIGNAL( toggled(bool) ), mQueueUnreadMessagesChk, TQ_SLOT( setEnabled(bool) ) );
    connect( mUseStackChk, TQ_SIGNAL( toggled(bool) ), mQueueUnreadMessagesChk, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( mShowTrayChk, mStartDockedChk );
    setTabOrder( mStartDockedChk, mUseQueueChk );
    setTabOrder( mUseQueueChk, mAutoConnect );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void BehaviorConfig_General::languageChange()
{
    setCaption( tr2i18n( "General" ) );
    buttonGroup2->setTitle( tr2i18n( "System Tray" ) );
    mShowTrayChk->setText( tr2i18n( "Show system tray &icon" ) );
    TQToolTip::add( mShowTrayChk, tr2i18n( "Show the icon in the system tray" ) );
    TQWhatsThis::add( mShowTrayChk, tr2i18n( "By default, the system tray icon indicates new incoming messages by flashing and showing a bubble. A left or middle mouse click on the icon will open the message in a new chat window. Pressing the \"View\" button in the bubble has the same effect." ) );
    mStartDockedChk->setText( tr2i18n( "Start with hidden &main window" ) );
    TQToolTip::add( mStartDockedChk, tr2i18n( "Start with the main window minimized to the system tray" ) );
    TQWhatsThis::add( mStartDockedChk, tr2i18n( "Start with the main window hidden. The only visible item is the system tray icon." ) );
    buttonGroup1->setTitle( tr2i18n( "Message Handling" ) );
    mInstantMessageOpeningChk->setText( tr2i18n( "Open messages instantl&y" ) );
    TQToolTip::add( mInstantMessageOpeningChk, tr2i18n( "Instantly open incoming messages" ) );
    TQWhatsThis::add( mInstantMessageOpeningChk, tr2i18n( "If there is no existing chat window a new window will be opened when a new message comes in. If there is already a chat window opened for the sender of the message it will be displayed there instantly." ) );
    mUseQueueChk->setText( tr2i18n( "Use message &queue" ) );
    TQToolTip::add( mUseQueueChk, tr2i18n( "Use a message queue to store incoming messages" ) );
    TQWhatsThis::add( mUseQueueChk, tr2i18n( "Store new incoming messages in a message queue. New messages are messages that cannot be displayed in an already open chat window. Only queued or stacked messages trigger notification via bubble, a flashing tray icon, or both.." ) );
    mUseStackChk->setText( tr2i18n( "Use message stac&k" ) );
    TQToolTip::add( mUseStackChk, tr2i18n( "Use a message stack to store incoming messages" ) );
    TQWhatsThis::add( mUseStackChk, tr2i18n( "Store new incoming messages in a message stack. New messages are messages that cannot be displayed in an already open chat window. Only queued or stacked messages trigger notification via bubble and flashing tray." ) );
    mQueueUnreadMessagesChk->setText( tr2i18n( "Queue/stack &unread messages" ) );
    TQToolTip::add( mQueueUnreadMessagesChk, tr2i18n( "Also add unread messages to queue/stack" ) );
    TQWhatsThis::add( mQueueUnreadMessagesChk, tr2i18n( "Unread messages are messages that will be displayed in an already opened but inactive chat window. Only incoming queued messages trigger notification via the bubble, the flashing tray icon, or both. With this option disabled only new incoming messages are queued, i.e. messages that cannot be displayed in an already open chat window." ) );
    groupBox2->setTitle( tr2i18n( "Miscellaneous" ) );
    mAutoConnect->setText( tr2i18n( "Connect automatically at &startup" ) );
    TQToolTip::add( mAutoConnect, tr2i18n( "Connect all your accounts automatically when starting Kopete" ) );
    TQWhatsThis::add( mAutoConnect, tr2i18n( "When starting Kopete all your accounts will be connected automatically. Note: You can exclude accounts individually in their properties." ) );
}

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

TQMetaObject *BehaviorConfig_General::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_BehaviorConfig_General( "BehaviorConfig_General", &BehaviorConfig_General::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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