#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdebase3/kdebase3-3.5.10-11.i686/src/kdebase-3.5.10/kcontrol/componentchooser/emailclientconfig_ui.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "emailclientconfig_ui.h"

#include <qvariant.h>
#include <qbuttongroup.h>
#include <qlineedit.h>
#include <qtoolbutton.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.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( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "EmailClientConfig_UI" );
    setEnabled( TRUE );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    EmailClientConfig_UILayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "EmailClientConfig_UILayout"); 

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

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

    txtEMailClient = new QLineEdit( ButtonGroup2, "txtEMailClient" );
    txtEMailClient->setEnabled( FALSE );
    txtEMailClient->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 1, 0, txtEMailClient->sizePolicy().hasHeightForWidth() ) );
    txtEMailClient->setMinimumSize( QSize( 0, 0 ) );
    Layout4->addWidget( txtEMailClient );

    btnSelectEmail = new QToolButton( ButtonGroup2, "btnSelectEmail" );
    btnSelectEmail->setEnabled( FALSE );
    Layout4->addWidget( btnSelectEmail );

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

    chkRunTerminal = new QCheckBox( ButtonGroup2, "chkRunTerminal" );
    chkRunTerminal->setEnabled( FALSE );

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

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

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

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

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

    // signals and slots connections
    connect( otherCB, SIGNAL( toggled(bool) ), chkRunTerminal, SLOT( setEnabled(bool) ) );
    connect( otherCB, SIGNAL( toggled(bool) ), txtEMailClient, SLOT( setEnabled(bool) ) );
    connect( otherCB, SIGNAL( toggled(bool) ), btnSelectEmail, SLOT( setEnabled(bool) ) );
    connect( btnSelectEmail, SIGNAL( clicked() ), this, 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, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EmailClientConfig_UI::languageChange()
{
    ButtonGroup2->setTitle( QString::null );
    QToolTip::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>" ) );
    QWhatsThis::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( "..." ) );
    QWhatsThis::add( btnSelectEmail, tr2i18n( "Click here to browse for the mail program file." ) );
    chkRunTerminal->setText( tr2i18n( "&Run in terminal" ) );
    QWhatsThis::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" ) );
    QWhatsThis::add( kmailCB, tr2i18n( "Kmail is the standard Mail program for the KDE desktop." ) );
    otherCB->setText( tr2i18n( "Use a different &email client:" ) );
    QWhatsThis::add( otherCB, tr2i18n( "Select this option if you want to use any other mail program." ) );
}

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

#include "emailclientconfig_ui.moc"
