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

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

#include "runoptionswidgetbase.h"

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

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

    mainProgramGroupBox = new TQGroupBox( this, "mainProgramGroupBox" );
    mainProgramGroupBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, mainProgramGroupBox->sizePolicy().hasHeightForWidth() ) );
    mainProgramGroupBox->setCheckable( false );
    mainProgramGroupBox->setChecked( false );
    mainProgramGroupBox->setColumnLayout(0, TQt::Vertical );
    mainProgramGroupBox->layout()->setSpacing( KDialog::spacingHint() );
    mainProgramGroupBox->layout()->setMargin( KDialog::marginHint() );
    mainProgramGroupBoxLayout = new TQGridLayout( mainProgramGroupBox->layout() );
    mainProgramGroupBoxLayout->setAlignment( TQt::AlignTop );

    notelabel = new TQLabel( mainProgramGroupBox, "notelabel" );
    notelabel->setAlignment( int( TQLabel::AlignVCenter ) );

    mainProgramGroupBoxLayout->addMultiCellWidget( notelabel, 0, 0, 0, 1 );

    runargs_edit = new KLineEdit( mainProgramGroupBox, "runargs_edit" );

    mainProgramGroupBoxLayout->addWidget( runargs_edit, 2, 1 );

    mainprogram_label_2 = new TQLabel( mainProgramGroupBox, "mainprogram_label_2" );

    mainProgramGroupBoxLayout->addWidget( mainprogram_label_2, 2, 0 );

    mainprogram_label = new TQLabel( mainProgramGroupBox, "mainprogram_label" );

    mainProgramGroupBoxLayout->addWidget( mainprogram_label, 1, 0 );

    mainprogram_edit = new KURLRequester( mainProgramGroupBox, "mainprogram_edit" );

    mainProgramGroupBoxLayout->addWidget( mainprogram_edit, 1, 1 );

    mainprogram_label_3 = new TQLabel( mainProgramGroupBox, "mainprogram_label_3" );

    mainProgramGroupBoxLayout->addWidget( mainprogram_label_3, 3, 0 );

    debugargs_edit = new KLineEdit( mainProgramGroupBox, "debugargs_edit" );

    mainProgramGroupBoxLayout->addWidget( debugargs_edit, 3, 1 );

    mainprogram_label_3_2 = new TQLabel( mainProgramGroupBox, "mainprogram_label_3_2" );

    mainProgramGroupBoxLayout->addWidget( mainprogram_label_3_2, 4, 0 );

    cwd_edit = new KURLRequester( mainProgramGroupBox, "cwd_edit" );

    mainProgramGroupBoxLayout->addWidget( cwd_edit, 4, 1 );
    run_options_widgetLayout->addWidget( mainProgramGroupBox );

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

    autocompile_box = new TQCheckBox( groupBox2, "autocompile_box" );
    groupBox2Layout->addWidget( autocompile_box );

    autoinstall_box = new TQCheckBox( groupBox2, "autoinstall_box" );
    groupBox2Layout->addWidget( autoinstall_box );

    autotdesu_box = new TQCheckBox( groupBox2, "autotdesu_box" );
    groupBox2Layout->addWidget( autotdesu_box );

    startinterminal_box = new TQCheckBox( groupBox2, "startinterminal_box" );
    groupBox2Layout->addWidget( startinterminal_box );
    run_options_widgetLayout->addWidget( groupBox2 );

    env_var_group = new TQGroupBox( this, "env_var_group" );
    run_options_widgetLayout->addWidget( env_var_group );
    languageChange();
    resize( TQSize(500, 506).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mainprogram_edit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( mainProgramChanged() ) );
    connect( mainprogram_edit, TQ_SIGNAL( urlSelected(const TQString&) ), this, TQ_SLOT( mainProgramChanged() ) );
    connect( mainProgramGroupBox, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( mainProgramChanged() ) );

    // tab order
    setTabOrder( startinterminal_box, autocompile_box );

    // buddies
    mainprogram_label_2->setBuddy( mainprogram_edit );
    mainprogram_label->setBuddy( mainprogram_edit );
    mainprogram_label_3->setBuddy( mainprogram_edit );
    mainprogram_label_3_2->setBuddy( mainprogram_edit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void RunOptionsWidgetBase::languageChange()
{
    setCaption( tr2i18n( "Run Options" ) );
    mainProgramGroupBox->setTitle( tr2i18n( "Main Program" ) );
    notelabel->setText( tr2i18n( "Note: These options override target specific settings." ) );
    TQWhatsThis::add( notelabel, tr2i18n( "For Automake and QMake type projects, the proper way to set these options are per target in the <b>Automake Manager</b> and <b>QMake Manager</b>, respectively." ) );
    TQToolTip::add( runargs_edit, tr2i18n( "The command line arguments passed to the main program when run" ) );
    mainprogram_label_2->setText( tr2i18n( "Run Arg&uments:" ) );
    mainprogram_label->setText( tr2i18n( "Executa&ble:" ) );
    TQToolTip::add( mainprogram_edit, tr2i18n( "Full path to the executable" ) );
    mainprogram_label_3->setText( tr2i18n( "Debug Ar&guments:" ) );
    TQToolTip::add( debugargs_edit, tr2i18n( "The command line arguments passed to the main program when debugged" ) );
    mainprogram_label_3_2->setText( tr2i18n( "Working &Directory:" ) );
    TQToolTip::add( cwd_edit, tr2i18n( "Sets the current working directory for the launched process" ) );
    groupBox2->setTitle( tr2i18n( "Options" ) );
    autocompile_box->setText( tr2i18n( "Automaticall&y compile before execution" ) );
    TQToolTip::add( autocompile_box, tr2i18n( "If the program is not up-to-date with the source code, compile it before starting its execution" ) );
    autoinstall_box->setText( tr2i18n( "&Automatically install before execution" ) );
    TQToolTip::add( autoinstall_box, TQString::null );
    autotdesu_box->setText( tr2i18n( "Use &tdesu when installing" ) );
    TQToolTip::add( autotdesu_box, TQString::null );
    startinterminal_box->setText( tr2i18n( "Start in e&xternal terminal" ) );
    TQToolTip::add( startinterminal_box, tr2i18n( "Start the main program in an external terminal" ) );
    env_var_group->setTitle( tr2i18n( "Environment &Variables" ) );
}

void RunOptionsWidgetBase::mainProgramChanged()
{
    tqWarning( "RunOptionsWidgetBase::mainProgramChanged(): Not implemented yet" );
}

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

TQMetaObject *RunOptionsWidgetBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_RunOptionsWidgetBase( "RunOptionsWidgetBase", &RunOptionsWidgetBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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