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

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

#include "diffdialogbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlabel.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a DiffDialogBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
DiffDialogBase::DiffDialogBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "DiffDialog" );
    setSizeGripEnabled( true );
    DiffDialogLayout = new TQVBoxLayout( this, 11, 6, "DiffDialogLayout"); 

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQGridLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 

    diffLocalOtherRadio = new TQRadioButton( buttonGroup1, "diffLocalOtherRadio" );
    layout3->addWidget( diffLocalOtherRadio );

    revOtherEdit = new KLineEdit( buttonGroup1, "revOtherEdit" );
    revOtherEdit->setEnabled( false );
    layout3->addWidget( revOtherEdit );

    buttonGroup1Layout->addLayout( layout3, 2, 0 );

    diffArbitraryRevRadio = new TQRadioButton( buttonGroup1, "diffArbitraryRevRadio" );

    buttonGroup1Layout->addWidget( diffArbitraryRevRadio, 3, 0 );

    layout3_2 = new TQGridLayout( 0, 1, 1, 0, 6, "layout3_2"); 

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

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

    revbEdit = new KLineEdit( buttonGroup1, "revbEdit" );
    revbEdit->setEnabled( false );

    layout3_2->addWidget( revbEdit, 1, 1 );

    revaEdit = new KLineEdit( buttonGroup1, "revaEdit" );
    revaEdit->setEnabled( false );

    layout3_2->addWidget( revaEdit, 1, 0 );

    textLabel2 = new TQLabel( buttonGroup1, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );

    layout3_2->addWidget( textLabel2, 0, 1 );

    buttonGroup1Layout->addLayout( layout3_2, 4, 0 );

    diffLocalHeadRadio = new TQRadioButton( buttonGroup1, "diffLocalHeadRadio" );

    buttonGroup1Layout->addWidget( diffLocalHeadRadio, 1, 0 );

    diffLocalBaseRadio = new TQRadioButton( buttonGroup1, "diffLocalBaseRadio" );
    diffLocalBaseRadio->setChecked( true );

    buttonGroup1Layout->addWidget( diffLocalBaseRadio, 0, 0 );
    DiffDialogLayout->addWidget( buttonGroup1 );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );
    DiffDialogLayout->addWidget( line1 );

    layout2 = new TQHBoxLayout( 0, 0, 6, "layout2"); 
    Horizontal_Spacing2 = new TQSpacerItem( 130, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    layout2->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    layout2->addWidget( buttonCancel );
    DiffDialogLayout->addLayout( layout2 );
    languageChange();
    resize( TQSize(519, 246).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( diffArbitraryRevRadio, TQ_SIGNAL( toggled(bool) ), revaEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( diffArbitraryRevRadio, TQ_SIGNAL( toggled(bool) ), revbEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( diffLocalOtherRadio, TQ_SIGNAL( toggled(bool) ), revOtherEdit, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( diffLocalBaseRadio, diffLocalHeadRadio );
    setTabOrder( diffLocalHeadRadio, diffLocalOtherRadio );
    setTabOrder( diffLocalOtherRadio, revOtherEdit );
    setTabOrder( revOtherEdit, revaEdit );
    setTabOrder( revaEdit, revbEdit );
    setTabOrder( revbEdit, buttonOk );
    setTabOrder( buttonOk, buttonCancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DiffDialogBase::languageChange()
{
    setCaption( tr2i18n( "Choose Revisions to Diff" ) );
    buttonGroup1->setTitle( tr2i18n( "Build Difference Between" ) );
    diffLocalOtherRadio->setText( tr2i18n( "Local copy and an arbitrary &revision:" ) );
    diffArbitraryRevRadio->setText( tr2i18n( "&Two arbitrary revisions/tags:" ) );
    textLabel1->setText( tr2i18n( "Revision A:" ) );
    revbEdit->setText( TQString::null );
    TQToolTip::add( revbEdit, tr2i18n( "Second revision to compare (leave empty to diff against HEAD)" ) );
    TQToolTip::add( revaEdit, tr2i18n( "First revision to compare" ) );
    textLabel2->setText( tr2i18n( "Revision B:" ) );
    diffLocalHeadRadio->setText( tr2i18n( "Local cop&y and HEAD" ) );
    diffLocalBaseRadio->setText( tr2i18n( "Local copy a&nd BASE" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
}

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

TQMetaObject *DiffDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DiffDialogBase( "DiffDialogBase", &DiffDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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