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

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

#include "diffpreferences.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "diffpreferences.ui.h"

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

    kcfg_UseDBForDiff = new TQButtonGroup( this, "kcfg_UseDBForDiff" );
    kcfg_UseDBForDiff->setColumnLayout(0, TQt::Vertical );
    kcfg_UseDBForDiff->layout()->setSpacing( 6 );
    kcfg_UseDBForDiff->layout()->setMargin( 11 );
    kcfg_UseDBForDiffLayout = new TQVBoxLayout( kcfg_UseDBForDiff->layout() );
    kcfg_UseDBForDiffLayout->setAlignment( TQt::AlignTop );

    radioButton1 = new TQRadioButton( kcfg_UseDBForDiff, "radioButton1" );
    kcfg_UseDBForDiffLayout->addWidget( radioButton1 );

    radioButton2 = new TQRadioButton( kcfg_UseDBForDiff, "radioButton2" );
    kcfg_UseDBForDiffLayout->addWidget( radioButton2 );

    radioButton3 = new TQRadioButton( kcfg_UseDBForDiff, "radioButton3" );
    kcfg_UseDBForDiffLayout->addWidget( radioButton3 );
    DiffPreferencesLayout->addWidget( kcfg_UseDBForDiff );

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

    textLabel1 = new TQLabel( this, "textLabel1" );
    layout1->addWidget( textLabel1 );

    kcfg_DiffBaseDir = new KURLRequester( this, "kcfg_DiffBaseDir" );
    layout1->addWidget( kcfg_DiffBaseDir );
    DiffPreferencesLayout->addLayout( layout1 );
    spacer1 = new TQSpacerItem( 20, 31, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    DiffPreferencesLayout->addItem( spacer1 );
    languageChange();
    resize( TQSize(538, 462).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // buddies
    textLabel1->setBuddy( kcfg_DiffBaseDir );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DiffPreferences::languageChange()
{
    kcfg_UseDBForDiff->setTitle( tr2i18n( "Diff Source" ) );
    TQWhatsThis::add( kcfg_UseDBForDiff, tr2i18n( "<qt><p><b>Source for difference lookup</b></p>\n"
"<p>Here you can select a source, which should be used\n"
"for finding a difference.</p>\n"
"<p>You can select file, translation database or\n"
"corresponding msgstr.</p>\n"
"<p>If you choose the translation database, the messages to diff with are\n"
"taken from the Translation Database; to be useful, you have\n"
"to enable <i>Auto add entry to database</i> in its\n"
"preferences dialog.</p>\n"
"<p>The last option is useful for those using PO-files\n"
"for proofreading.</p>\n"
"<p>You can temporarily diff with messages from a file\n"
"by choosing <i>Tools->Diff->Open file for diff</i>\n"
"in KBabel's main window.</p></qt>" ) );
    radioButton1->setText( tr2i18n( "Use &file" ) );
    radioButton2->setText( tr2i18n( "Use messages from &translation database" ) );
    radioButton3->setText( tr2i18n( "Use &msgstr from the same file" ) );
    textLabel1->setText( tr2i18n( "Base folder for diff files:" ) );
    TQWhatsThis::add( kcfg_DiffBaseDir, tr2i18n( "<qt><q><b>Base folder for diff files</b></q>\n"
"<p>Here you can define a folder in which the files to\n"
"diff with are stored. If the files are stored at the same\n"
"place beneath this folder as the original files beneath\n"
"their base folder, KBabel can automatically open the correct\n"
"file to diff with.</p>\n"
"<p>Note that this option has no effect if messages from\n"
"the database are used for diffing.</p></qt>" ) );
}

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

TQMetaObject *DiffPreferences::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DiffPreferences( "DiffPreferences", &DiffPreferences::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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