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

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

#include "emailclientconfig_ui.h"

#include <ntqvariant.h>
#include <ntqbuttongroup.h>
#include <ntqlineedit.h>
#include <ntqtoolbutton.h>
#include <ntqcheckbox.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kdialog.h"

/*
 *  Constructs a EmailClientConfig_UI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
EmailClientConfig_UI::EmailClientConfig_UI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "EmailClientConfig_UI" );
    setEnabled( true );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    EmailClientConfig_UILayout = new TQVBoxLayout( this, 0, KDialog::spacingHint(), "EmailClientConfig_UILayout"); 

    ButtonGroup2 = new TQButtonGroup( this, "ButtonGroup2" );
    ButtonGroup2->setFrameShape( TQButtonGroup::NoFrame );
    ButtonGroup2->setLineWidth( 0 );
    ButtonGroup2->setColumnLayout(0, TQt::Vertical );
    ButtonGroup2->layout()->setSpacing( KDialog::spacingHint() );
    ButtonGroup2->layout()->setMargin( 0 );
    ButtonGroup2Layout = new TQGridLayout( ButtonGroup2->layout() );
    ButtonGroup2Layout->setAlignment( TQt::AlignTop );

    Layout4 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout4"); 

    txtEMailClient = new TQLineEdit( ButtonGroup2, "txtEMailClient" );
    txtEMailClient->setEnabled( false );
    txtEMailClient->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, txtEMailClient->sizePolicy().hasHeightForWidth() ) );
    txtEMailClient->setMinimumSize( TQSize( 0, 0 ) );
    Layout4->addWidget( txtEMailClient );

    btnSelectEmail = new TQToolButton( ButtonGroup2, "btnSelectEmail" );
    btnSelectEmail->setEnabled( false );
    Layout4->addWidget( btnSelectEmail );

    ButtonGroup2Layout->addLayout( Layout4, 2, 1 );

    chkRunTerminal = new TQCheckBox( ButtonGroup2, "chkRunTerminal" );
    chkRunTerminal->setEnabled( false );

    ButtonGroup2Layout->addWidget( chkRunTerminal, 3, 1 );
    Spacer2 = new TQSpacerItem( 0, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ButtonGroup2Layout->addItem( Spacer2, 4, 1 );

    kmailCB = new TQRadioButton( ButtonGroup2, "kmailCB" );

    ButtonGroup2Layout->addMultiCellWidget( kmailCB, 0, 0, 0, 1 );

    otherCB = new TQRadioButton( ButtonGroup2, "otherCB" );

    ButtonGroup2Layout->addMultiCellWidget( otherCB, 1, 1, 0, 1 );
    Spacer16 = new TQSpacerItem( 30, 16, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    ButtonGroup2Layout->addItem( Spacer16, 2, 0 );
    Spacer16_2 = new TQSpacerItem( 30, 16, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    ButtonGroup2Layout->addItem( Spacer16_2, 3, 0 );
    EmailClientConfig_UILayout->addWidget( ButtonGroup2 );
    languageChange();
    resize( TQSize(388, 267).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( otherCB, TQ_SIGNAL( toggled(bool) ), chkRunTerminal, TQ_SLOT( setEnabled(bool) ) );
    connect( otherCB, TQ_SIGNAL( toggled(bool) ), txtEMailClient, TQ_SLOT( setEnabled(bool) ) );
    connect( otherCB, TQ_SIGNAL( toggled(bool) ), btnSelectEmail, TQ_SLOT( setEnabled(bool) ) );
    connect( btnSelectEmail, TQ_SIGNAL( clicked() ), this, TQ_SLOT( selectEmailClient() ) );

    // tab order
    setTabOrder( kmailCB, otherCB );
    setTabOrder( otherCB, txtEMailClient );
    setTabOrder( txtEMailClient, chkRunTerminal );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EmailClientConfig_UI::languageChange()
{
    ButtonGroup2->setTitle( TQString::null );
    TQToolTip::add( txtEMailClient, tr2i18n( "<ul> <li>%t: Recipient's address</li> <li>%s: Subject</li> <li>%c: Carbon Copy (CC)</li> <li>%b: Blind Carbon Copy (BCC)</li> <li>%B: Template body text</li> <li>%A: Attachment </li> </ul>" ) );
    TQWhatsThis::add( txtEMailClient, tr2i18n( "Press this button to select your favorite email client. Please note that the file you select has to have the executable attribute set in order to be accepted.<br> You can also use several placeholders which will be replaced with the actual values when the email client is called:<ul> <li>%t: Recipient's address</li> <li>%s: Subject</li> <li>%c: Carbon Copy (CC)</li> <li>%b: Blind Carbon Copy (BCC)</li> <li>%B: Template body text</li> <li>%A: Attachment </li> </ul>" ) );
    btnSelectEmail->setText( tr2i18n( "..." ) );
    TQWhatsThis::add( btnSelectEmail, tr2i18n( "Click here to browse for the mail program file." ) );
    chkRunTerminal->setText( tr2i18n( "&Run in terminal" ) );
    TQWhatsThis::add( chkRunTerminal, tr2i18n( "Activate this option if you want the selected email client to be executed in a terminal (e.g. <em>Konsole</em>)." ) );
    kmailCB->setText( tr2i18n( "&Use KMail as preferred email client" ) );
    TQWhatsThis::add( kmailCB, tr2i18n( "Kmail is the standard Mail program for the TDE desktop." ) );
    otherCB->setText( tr2i18n( "Use a different &email client:" ) );
    TQWhatsThis::add( otherCB, tr2i18n( "Select this option if you want to use any other mail program." ) );
}

void EmailClientConfig_UI::selectEmailClient()
{
    tqWarning( "EmailClientConfig_UI::selectEmailClient(): Not implemented yet" );
}

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

TQMetaObject *EmailClientConfig_UI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_EmailClientConfig_UI( "EmailClientConfig_UI", &EmailClientConfig_UI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* EmailClientConfig_UI::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 TQUMethod slot_1 = {"selectEmailClient", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "selectEmailClient()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"EmailClientConfig_UI", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_EmailClientConfig_UI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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