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

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

#include "choosetargetdlgbase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <kdialog.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a ChooseTargetDlgBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ChooseTargetDlgBase::ChooseTargetDlgBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "ChooseTargetDlgBase" );
    setMinimumSize( TQSize( 444, 306 ) );
    ChooseTargetDlgBaseLayout = new TQVBoxLayout( this, 11, 6, "ChooseTargetDlgBaseLayout"); 

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setFrameShape( TQButtonGroup::NoFrame );
    buttonGroup1->setFrameShadow( TQButtonGroup::Plain );
    buttonGroup1->setLineWidth( 1 );
    buttonGroup1->setFlat( false );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 0 );
    buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    activeTargetRadioButton = new TQRadioButton( buttonGroup1, "activeTargetRadioButton" );
    activeTargetRadioButton->setChecked( true );
    buttonGroup1Layout->addWidget( activeTargetRadioButton );

    chooseTargetRadioButton = new TQRadioButton( buttonGroup1, "chooseTargetRadioButton" );
    buttonGroup1Layout->addWidget( chooseTargetRadioButton );
    ChooseTargetDlgBaseLayout->addWidget( buttonGroup1 );

    chosenTargetGroupBox = new TQGroupBox( this, "chosenTargetGroupBox" );
    chosenTargetGroupBox->setEnabled( false );
    chosenTargetGroupBox->setColumnLayout(0, TQt::Vertical );
    chosenTargetGroupBox->layout()->setSpacing( 6 );
    chosenTargetGroupBox->layout()->setMargin( 11 );
    chosenTargetGroupBoxLayout = new TQGridLayout( chosenTargetGroupBox->layout() );
    chosenTargetGroupBoxLayout->setAlignment( TQt::AlignTop );

    subprojectComboBox = new KHistoryCombo( chosenTargetGroupBox, "subprojectComboBox" );
    subprojectComboBox->setDuplicatesEnabled( false );

    chosenTargetGroupBoxLayout->addMultiCellWidget( subprojectComboBox, 0, 0, 0, 1 );

    targetComboBox = new KHistoryCombo( chosenTargetGroupBox, "targetComboBox" );
    targetComboBox->setDuplicatesEnabled( true );

    chosenTargetGroupBoxLayout->addMultiCellWidget( targetComboBox, 1, 1, 0, 1 );

    targetStaticLabel = new TQLabel( chosenTargetGroupBox, "targetStaticLabel" );
    TQFont targetStaticLabel_font(  targetStaticLabel->font() );
    targetStaticLabel->setFont( targetStaticLabel_font ); 

    chosenTargetGroupBoxLayout->addWidget( targetStaticLabel, 2, 0 );

    chosenTargetLabel = new TQLabel( chosenTargetGroupBox, "chosenTargetLabel" );
    chosenTargetLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, chosenTargetLabel->sizePolicy().hasHeightForWidth() ) );

    chosenTargetGroupBoxLayout->addWidget( chosenTargetLabel, 2, 1 );
    ChooseTargetDlgBaseLayout->addWidget( chosenTargetGroupBox );

    groupBox1 = new TQGroupBox( this, "groupBox1" );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );

    newFileList = new TDEListView( groupBox1, "newFileList" );
    newFileList->setAllColumnsShowFocus( true );
    groupBox1Layout->addWidget( newFileList );

    cancelNoticeLabel = new TQLabel( groupBox1, "cancelNoticeLabel" );
    cancelNoticeLabel->setAlignment( int( TQLabel::AlignVCenter ) );
    groupBox1Layout->addWidget( cancelNoticeLabel );
    ChooseTargetDlgBaseLayout->addWidget( groupBox1 );

    neverAskAgainCheckbox = new TQCheckBox( this, "neverAskAgainCheckbox" );
    ChooseTargetDlgBaseLayout->addWidget( neverAskAgainCheckbox );
    languageChange();
    resize( TQSize(444, 306).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( activeTargetRadioButton, TQ_SIGNAL( toggled(bool) ), chosenTargetGroupBox, TQ_SLOT( setDisabled(bool) ) );
    connect( activeTargetRadioButton, TQ_SIGNAL( toggled(bool) ), subprojectComboBox, TQ_SLOT( setDisabled(bool) ) );
    connect( activeTargetRadioButton, TQ_SIGNAL( toggled(bool) ), targetComboBox, TQ_SLOT( setDisabled(bool) ) );

    // tab order
    setTabOrder( activeTargetRadioButton, chooseTargetRadioButton );
    setTabOrder( chooseTargetRadioButton, subprojectComboBox );
    setTabOrder( subprojectComboBox, targetComboBox );
    setTabOrder( targetComboBox, newFileList );
    setTabOrder( newFileList, neverAskAgainCheckbox );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ChooseTargetDlgBase::languageChange()
{
    setCaption( tr2i18n( "Automake Manager - Choose Target" ) );
    buttonGroup1->setTitle( TQString::null );
    activeTargetRadioButton->setText( tr2i18n( "Add new files to m&y active target" ) );
    chooseTargetRadioButton->setText( tr2i18n( "Choose &another target" ) );
    chosenTargetGroupBox->setTitle( tr2i18n( "Choose &Target" ) );
    targetStaticLabel->setText( tr2i18n( "Target:" ) );
    chosenTargetLabel->setText( tr2i18n( "[TARGET]" ) );
    groupBox1->setTitle( tr2i18n( "&New Files" ) );
    cancelNoticeLabel->setText( tr2i18n( "<qt><b>Note:</b> If you cancel, your files will be created but will <b>not</b> be added to the project.</qt>" ) );
    neverAskAgainCheckbox->setText( tr2i18n( "Do &not ask me again and use always my active target" ) );
}

void ChooseTargetDlgBase::slotActiveTargetToggled(bool)
{
    tqWarning( "ChooseTargetDlgBase::slotActiveTargetToggled(bool): Not implemented yet" );
}

void ChooseTargetDlgBase::slotChooseTargetToggled(bool)
{
    tqWarning( "ChooseTargetDlgBase::slotChooseTargetToggled(bool): Not implemented yet" );
}

void ChooseTargetDlgBase::slotSubprojectChanged(const TQString&)
{
    tqWarning( "ChooseTargetDlgBase::slotSubprojectChanged(const TQString&): Not implemented yet" );
}

void ChooseTargetDlgBase::slotTargetChanged(const TQString&)
{
    tqWarning( "ChooseTargetDlgBase::slotTargetChanged(const TQString&): Not implemented yet" );
}

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

TQMetaObject *ChooseTargetDlgBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ChooseTargetDlgBase( "ChooseTargetDlgBase", &ChooseTargetDlgBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ChooseTargetDlgBase::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 TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"slotActiveTargetToggled", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"slotChooseTargetToggled", 1, param_slot_2 };
    static const TQUParameter param_slot_3[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"slotSubprojectChanged", 1, param_slot_3 };
    static const TQUParameter param_slot_4[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"slotTargetChanged", 1, param_slot_4 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotActiveTargetToggled(bool)", &slot_1, TQMetaData::Protected },
	{ "slotChooseTargetToggled(bool)", &slot_2, TQMetaData::Protected },
	{ "slotSubprojectChanged(const TQString&)", &slot_3, TQMetaData::Private },
	{ "slotTargetChanged(const TQString&)", &slot_4, TQMetaData::Private }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ChooseTargetDlgBase", parentObject,
	slot_tbl, 5,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ChooseTargetDlgBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ChooseTargetDlgBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: slotActiveTargetToggled((bool)static_QUType_bool.get(_o+1)); break;
    case 2: slotChooseTargetToggled((bool)static_QUType_bool.get(_o+1)); break;
    case 3: slotSubprojectChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 4: slotTargetChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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