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

#include "terminalemulatorconfig_ui.h"

#include <qvariant.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kdialog.h"

/*
 *  Constructs a TerminalEmulatorConfig_UI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
TerminalEmulatorConfig_UI::TerminalEmulatorConfig_UI( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "TerminalEmulatorConfig_UI" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    TerminalEmulatorConfig_UILayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "TerminalEmulatorConfig_UILayout"); 

    ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" );
    ButtonGroup1->setFrameShape( QButtonGroup::NoFrame );
    ButtonGroup1->setLineWidth( 0 );
    ButtonGroup1->setColumnLayout(0, Qt::Vertical );
    ButtonGroup1->layout()->setSpacing( KDialog::spacingHint() );
    ButtonGroup1->layout()->setMargin( 0 );
    ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
    ButtonGroup1Layout->setAlignment( Qt::AlignTop );
    Spacer4 = new QSpacerItem( 0, 87, QSizePolicy::Minimum, QSizePolicy::Expanding );
    ButtonGroup1Layout->addItem( Spacer4, 3, 1 );

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

    ButtonGroup1Layout->addMultiCellWidget( otherCB, 1, 1, 0, 1 );
    Spacer15 = new QSpacerItem( 31, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    ButtonGroup1Layout->addItem( Spacer15, 2, 0 );

    terminalCB = new QRadioButton( ButtonGroup1, "terminalCB" );

    ButtonGroup1Layout->addMultiCellWidget( terminalCB, 0, 0, 0, 1 );

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

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

    btnSelectTerminal = new QToolButton( ButtonGroup1, "btnSelectTerminal" );
    btnSelectTerminal->setEnabled( FALSE );
    btnSelectTerminal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, btnSelectTerminal->sizePolicy().hasHeightForWidth() ) );
    Layout4->addWidget( btnSelectTerminal );

    ButtonGroup1Layout->addLayout( Layout4, 2, 1 );
    TerminalEmulatorConfig_UILayout->addWidget( ButtonGroup1 );
    languageChange();
    resize( QSize(263, 188).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( otherCB, SIGNAL( toggled(bool) ), terminalLE, SLOT( setEnabled(bool) ) );
    connect( otherCB, SIGNAL( toggled(bool) ), btnSelectTerminal, SLOT( setEnabled(bool) ) );
    connect( btnSelectTerminal, SIGNAL( clicked() ), this, SLOT( selectTerminalApp() ) );

    // tab order
    setTabOrder( terminalCB, otherCB );
    setTabOrder( otherCB, terminalLE );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TerminalEmulatorConfig_UI::languageChange()
{
    ButtonGroup1->setTitle( QString::null );
    otherCB->setText( tr2i18n( "Use a different &terminal program:" ) );
    terminalCB->setText( tr2i18n( "&Use Konsole as terminal application" ) );
    QWhatsThis::add( terminalLE, tr2i18n( "Press this button to select your favorite terminal client. Please note that the file you select has to have the executable attribute set in order to be accepted.<br> Also note that some programs that utilize Terminal Emulator will not work if you add command line arguments (Example: konsole -ls)." ) );
    btnSelectTerminal->setText( tr2i18n( "..." ) );
    QWhatsThis::add( btnSelectTerminal, tr2i18n( "Click here to browse for terminal program." ) );
}

void TerminalEmulatorConfig_UI::selectTerminalApp()
{
    qWarning( "TerminalEmulatorConfig_UI::selectTerminalApp(): Not implemented yet" );
}

#include "terminalemulatorconfig_ui.moc"
