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

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

#include "rubyconfigwidgetbase.h"

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

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

    layout3 = new TQGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout3"); 

    programArgsEdit = new KLineEdit( this, "programArgsEdit" );

    layout3->addWidget( programArgsEdit, 3, 1 );

    mainProgramEdit = new KLineEdit( this, "mainProgramEdit" );

    layout3->addWidget( mainProgramEdit, 2, 1 );

    textLabel1_2 = new TQLabel( this, "textLabel1_2" );
    textLabel1_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( textLabel1_2, 1, 0 );

    interpreterEdit = new KLineEdit( this, "interpreterEdit" );

    layout3->addWidget( interpreterEdit, 0, 1 );

    textLabel1_2_3_2 = new TQLabel( this, "textLabel1_2_3_2" );
    textLabel1_2_3_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_2_3_2->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( textLabel1_2_3_2, 3, 0 );

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( textLabel1, 0, 0 );

    textLabel1_2_3 = new TQLabel( this, "textLabel1_2_3" );
    textLabel1_2_3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_2_3->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( textLabel1_2_3, 2, 0 );

    shellEdit = new KLineEdit( this, "shellEdit" );

    layout3->addWidget( shellEdit, 1, 1 );

    textLabel1_3 = new TQLabel( this, "textLabel1_3" );

    layout3->addWidget( textLabel1_3, 4, 0 );

    workingDir = new KURLRequester( this, "workingDir" );

    layout3->addWidget( workingDir, 4, 1 );
    RubyConfigWidgetBaseLayout->addLayout( layout3 );
    spacer3 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    RubyConfigWidgetBaseLayout->addItem( spacer3 );

    runRadioBox = new TQButtonGroup( this, "runRadioBox" );
    runRadioBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, runRadioBox->sizePolicy().hasHeightForWidth() ) );
    runRadioBox->setColumnLayout(0, TQt::Vertical );
    runRadioBox->layout()->setSpacing( KDialog::spacingHint() );
    runRadioBox->layout()->setMargin( KDialog::marginHint() );
    runRadioBoxLayout = new TQGridLayout( runRadioBox->layout() );
    runRadioBoxLayout->setAlignment( TQt::AlignTop );

    mainProgramRadio = new TQRadioButton( runRadioBox, "mainProgramRadio" );

    runRadioBoxLayout->addWidget( mainProgramRadio, 0, 0 );

    selectedWindowRadio = new TQRadioButton( runRadioBox, "selectedWindowRadio" );

    runRadioBoxLayout->addWidget( selectedWindowRadio, 1, 0 );
    RubyConfigWidgetBaseLayout->addWidget( runRadioBox );

    terminalCheckbox = new TQCheckBox( this, "terminalCheckbox" );
    RubyConfigWidgetBaseLayout->addWidget( terminalCheckbox );

    enableFloatingToolBarBox = new TQCheckBox( this, "enableFloatingToolBarBox" );
    RubyConfigWidgetBaseLayout->addWidget( enableFloatingToolBarBox );

    showConstants = new TQCheckBox( this, "showConstants" );
    RubyConfigWidgetBaseLayout->addWidget( showConstants );

    traceIntoRuby = new TQCheckBox( this, "traceIntoRuby" );
    RubyConfigWidgetBaseLayout->addWidget( traceIntoRuby );

    characterCodingRadioBox = new TQButtonGroup( this, "characterCodingRadioBox" );
    characterCodingRadioBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, characterCodingRadioBox->sizePolicy().hasHeightForWidth() ) );
    characterCodingRadioBox->setColumnLayout(0, TQt::Vertical );
    characterCodingRadioBox->layout()->setSpacing( KDialog::spacingHint() );
    characterCodingRadioBox->layout()->setMargin( KDialog::marginHint() );
    characterCodingRadioBoxLayout = new TQVBoxLayout( characterCodingRadioBox->layout() );
    characterCodingRadioBoxLayout->setAlignment( TQt::AlignTop );

    asciiOption = new TQRadioButton( characterCodingRadioBox, "asciiOption" );
    characterCodingRadioBox->insert( asciiOption, 0 );
    characterCodingRadioBoxLayout->addWidget( asciiOption );

    eucOption = new TQRadioButton( characterCodingRadioBox, "eucOption" );
    characterCodingRadioBox->insert( eucOption, 1 );
    characterCodingRadioBoxLayout->addWidget( eucOption );

    sjisOption = new TQRadioButton( characterCodingRadioBox, "sjisOption" );
    characterCodingRadioBox->insert( sjisOption, 2 );
    characterCodingRadioBoxLayout->addWidget( sjisOption );

    utf8Option = new TQRadioButton( characterCodingRadioBox, "utf8Option" );
    characterCodingRadioBox->insert( utf8Option, 3 );
    characterCodingRadioBoxLayout->addWidget( utf8Option );
    RubyConfigWidgetBaseLayout->addWidget( characterCodingRadioBox );
    spacer1 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    RubyConfigWidgetBaseLayout->addItem( spacer1 );
    languageChange();
    resize( TQSize(485, 582).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( interpreterEdit, shellEdit );
    setTabOrder( shellEdit, mainProgramEdit );
    setTabOrder( mainProgramEdit, programArgsEdit );
    setTabOrder( programArgsEdit, mainProgramRadio );
    setTabOrder( mainProgramRadio, selectedWindowRadio );
    setTabOrder( selectedWindowRadio, terminalCheckbox );
    setTabOrder( terminalCheckbox, enableFloatingToolBarBox );
    setTabOrder( enableFloatingToolBarBox, showConstants );
    setTabOrder( showConstants, traceIntoRuby );
    setTabOrder( traceIntoRuby, asciiOption );
    setTabOrder( asciiOption, eucOption );
    setTabOrder( eucOption, sjisOption );
    setTabOrder( sjisOption, utf8Option );

    // buddies
    textLabel1_2->setBuddy( mainProgramEdit );
    textLabel1_2_3_2->setBuddy( programArgsEdit );
    textLabel1->setBuddy( interpreterEdit );
    textLabel1_2_3->setBuddy( programArgsEdit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void RubyConfigWidgetBase::languageChange()
{
    textLabel1_2->setText( tr2i18n( "Ru&by shell:" ) );
    TQWhatsThis::add( textLabel1_2, tr2i18n( "This is the path (or just name, if in $PATH) to the Ruby shell. Defaults to \"irb\". Add this line to your .irbrc file:\n"
"def cd(dir) Dir.chdir dir end" ) );
    textLabel1_2_3_2->setText( tr2i18n( "Program &arguments:" ) );
    TQWhatsThis::add( textLabel1_2_3_2, tr2i18n( "These are the arguments passed to the Ruby interpreter" ) );
    textLabel1->setText( tr2i18n( "&Ruby interpreter:" ) );
    TQWhatsThis::add( textLabel1, tr2i18n( "This is the path (or just name, if in $PATH) to the Ruby interpreter. Defaults to \"ruby\"" ) );
    textLabel1_2_3->setText( tr2i18n( "&Main program:" ) );
    TQWhatsThis::add( textLabel1_2_3, tr2i18n( "This is the name of the main program source file" ) );
    textLabel1_3->setText( tr2i18n( "Working Directory:" ) );
    runRadioBox->setTitle( tr2i18n( "Run" ) );
    mainProgramRadio->setText( tr2i18n( "Main pr&ogram" ) );
    selectedWindowRadio->setText( tr2i18n( "Selected wi&ndow" ) );
    terminalCheckbox->setText( tr2i18n( "R&un applications in terminal" ) );
    TQWhatsThis::add( terminalCheckbox, tr2i18n( "Check this if you want your applications to be opened in terminal window." ) );
    enableFloatingToolBarBox->setText( tr2i18n( "Enable &debugger floating toolbar" ) );
    TQWhatsThis::add( enableFloatingToolBarBox, tr2i18n( "Check this if you want to control the debugger via a floating toolbar." ) );
    showConstants->setText( tr2i18n( "Show &constants in the debugger" ) );
    TQWhatsThis::add( showConstants, tr2i18n( "Check this if you want the debugger to show constants (with many constants this may be slow)." ) );
    traceIntoRuby->setText( tr2i18n( "Trace &into Ruby libraries" ) );
    TQWhatsThis::add( traceIntoRuby, tr2i18n( "Trace through the Ruby code installed under sitedir in the debugger" ) );
    characterCodingRadioBox->setTitle( tr2i18n( "Character Coding" ) );
    asciiOption->setText( tr2i18n( "ASCII" ) );
    eucOption->setText( tr2i18n( "EUC" ) );
    sjisOption->setText( tr2i18n( "S&JIS" ) );
    utf8Option->setText( tr2i18n( "UTF-&8" ) );
}

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

TQMetaObject *RubyConfigWidgetBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_RubyConfigWidgetBase( "RubyConfigWidgetBase", &RubyConfigWidgetBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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