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

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

#include "viewoptionsbase.h"

#include <ntqvariant.h>
#include <tdefontrequester.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqgroupbox.h>
#include <kcolorbutton.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    kcfg_TableFont = new TDEFontRequester( this, "kcfg_TableFont" );

    ViewOptionsBaseLayout->addWidget( kcfg_TableFont, 0, 1 );

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

    ViewOptionsBaseLayout->addWidget( TableFontLabel, 0, 0 );

    kcfg_IPAFont = new TDEFontRequester( this, "kcfg_IPAFont" );

    ViewOptionsBaseLayout->addWidget( kcfg_IPAFont, 1, 1 );

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

    ViewOptionsBaseLayout->addWidget( IPAFontLabel, 1, 0 );

    gradegroup = new TQGroupBox( this, "gradegroup" );
    gradegroup->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, gradegroup->sizePolicy().hasHeightForWidth() ) );
    gradegroup->setColumnLayout(0, TQt::Vertical );
    gradegroup->layout()->setSpacing( 6 );
    gradegroup->layout()->setMargin( 11 );
    gradegroupLayout = new TQGridLayout( gradegroup->layout() );
    gradegroupLayout->setAlignment( TQt::AlignTop );

    l_lev4 = new TQLabel( gradegroup, "l_lev4" );
    l_lev4->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev4->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev4, 4, 0 );

    l_lev5 = new TQLabel( gradegroup, "l_lev5" );
    l_lev5->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev5->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev5, 3, 0 );

    l_lev7 = new TQLabel( gradegroup, "l_lev7" );
    l_lev7->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev7->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev7, 1, 0 );

    l_lev6 = new TQLabel( gradegroup, "l_lev6" );
    l_lev6->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev6->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev6, 2, 0 );

    kcfg_GradeCol0 = new KColorButton( gradegroup, "kcfg_GradeCol0" );
    kcfg_GradeCol0->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol0->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol0, 8, 1 );

    l_lev0 = new TQLabel( gradegroup, "l_lev0" );
    l_lev0->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev0->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev0, 8, 0 );

    kcfg_GradeCol1 = new KColorButton( gradegroup, "kcfg_GradeCol1" );
    kcfg_GradeCol1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol1->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol1, 7, 1 );

    l_lev1 = new TQLabel( gradegroup, "l_lev1" );
    l_lev1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev1->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev1, 7, 0 );

    l_lev2 = new TQLabel( gradegroup, "l_lev2" );
    l_lev2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev2->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev2, 6, 0 );

    kcfg_GradeCol2 = new KColorButton( gradegroup, "kcfg_GradeCol2" );
    kcfg_GradeCol2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol2->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol2, 6, 1 );

    l_lev3 = new TQLabel( gradegroup, "l_lev3" );
    l_lev3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, l_lev3->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( l_lev3, 5, 0 );

    kcfg_GradeCol3 = new KColorButton( gradegroup, "kcfg_GradeCol3" );
    kcfg_GradeCol3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol3->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol3, 5, 1 );

    kcfg_GradeCol4 = new KColorButton( gradegroup, "kcfg_GradeCol4" );
    kcfg_GradeCol4->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol4->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol4, 4, 1 );

    kcfg_GradeCol5 = new KColorButton( gradegroup, "kcfg_GradeCol5" );
    kcfg_GradeCol5->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol5->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol5, 3, 1 );

    kcfg_GradeCol6 = new KColorButton( gradegroup, "kcfg_GradeCol6" );
    kcfg_GradeCol6->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol6->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol6, 2, 1 );

    kcfg_GradeCol7 = new KColorButton( gradegroup, "kcfg_GradeCol7" );
    kcfg_GradeCol7->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_GradeCol7->sizePolicy().hasHeightForWidth() ) );

    gradegroupLayout->addWidget( kcfg_GradeCol7, 1, 1 );

    kcfg_UseGradeCol = new TQCheckBox( gradegroup, "kcfg_UseGradeCol" );

    gradegroupLayout->addMultiCellWidget( kcfg_UseGradeCol, 0, 0, 0, 1 );

    ViewOptionsBaseLayout->addMultiCellWidget( gradegroup, 2, 2, 0, 1 );
    spacer9 = new TQSpacerItem( 61, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ViewOptionsBaseLayout->addMultiCell( spacer9, 3, 3, 0, 1 );
    languageChange();
    resize( TQSize(592, 412).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol7, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol6, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol5, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol4, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol3, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol2, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol1, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseGradeCol, TQ_SIGNAL( toggled(bool) ), kcfg_GradeCol0, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_GradeCol0, kcfg_GradeCol7 );
    setTabOrder( kcfg_GradeCol7, kcfg_GradeCol6 );
    setTabOrder( kcfg_GradeCol6, kcfg_GradeCol5 );
    setTabOrder( kcfg_GradeCol5, kcfg_GradeCol4 );
    setTabOrder( kcfg_GradeCol4, kcfg_GradeCol3 );
    setTabOrder( kcfg_GradeCol3, kcfg_GradeCol2 );
    setTabOrder( kcfg_GradeCol2, kcfg_GradeCol1 );

    // buddies
    TableFontLabel->setBuddy( kcfg_TableFont );
    IPAFontLabel->setBuddy( kcfg_IPAFont );
    l_lev4->setBuddy( kcfg_GradeCol4 );
    l_lev5->setBuddy( kcfg_GradeCol5 );
    l_lev7->setBuddy( kcfg_GradeCol7 );
    l_lev6->setBuddy( kcfg_GradeCol6 );
    l_lev0->setBuddy( kcfg_GradeCol0 );
    l_lev1->setBuddy( kcfg_GradeCol1 );
    l_lev2->setBuddy( kcfg_GradeCol2 );
    l_lev3->setBuddy( kcfg_GradeCol3 );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ViewOptionsBase::languageChange()
{
    TableFontLabel->setText( tr2i18n( "&Table font:" ) );
    IPAFontLabel->setText( tr2i18n( "&IPA font:" ) );
    gradegroup->setTitle( tr2i18n( "Grade Colors" ) );
    l_lev4->setText( tr2i18n( "Level &4:" ) );
    l_lev5->setText( tr2i18n( "Level &5:" ) );
    l_lev7->setText( tr2i18n( "Level &7:" ) );
    l_lev6->setText( tr2i18n( "Level &6:" ) );
    kcfg_GradeCol0->setText( tr2i18n( "&N" ) );
    l_lev0->setText( tr2i18n( "Not &queried:" ) );
    kcfg_GradeCol1->setText( tr2i18n( "&1" ) );
    TQToolTip::add( kcfg_GradeCol1, tr2i18n( "Color for the grade 1" ) );
    TQWhatsThis::add( kcfg_GradeCol1, tr2i18n( "Click here to change the color for grade 1." ) );
    l_lev1->setText( tr2i18n( "Level &1:" ) );
    l_lev2->setText( tr2i18n( "Level &2:" ) );
    kcfg_GradeCol2->setText( tr2i18n( "&2" ) );
    TQToolTip::add( kcfg_GradeCol2, tr2i18n( "Color for the grade 2" ) );
    TQWhatsThis::add( kcfg_GradeCol2, tr2i18n( "Click here to change the color for grade 2." ) );
    l_lev3->setText( tr2i18n( "Level &3:" ) );
    kcfg_GradeCol3->setText( tr2i18n( "&3" ) );
    TQToolTip::add( kcfg_GradeCol3, tr2i18n( "Color for the grade 3" ) );
    TQWhatsThis::add( kcfg_GradeCol3, tr2i18n( "Click here to change the color for grade 3." ) );
    kcfg_GradeCol4->setText( tr2i18n( "&4" ) );
    TQToolTip::add( kcfg_GradeCol4, tr2i18n( "Color for the grade 4" ) );
    TQWhatsThis::add( kcfg_GradeCol4, tr2i18n( "Click here to change the color for grade 4." ) );
    kcfg_GradeCol5->setText( tr2i18n( "&5" ) );
    TQToolTip::add( kcfg_GradeCol5, tr2i18n( "Color for the grade 5" ) );
    TQWhatsThis::add( kcfg_GradeCol5, tr2i18n( "Click here to change the color for grade 5." ) );
    kcfg_GradeCol6->setText( tr2i18n( "&6" ) );
    TQToolTip::add( kcfg_GradeCol6, tr2i18n( "Color for the grade 6" ) );
    TQWhatsThis::add( kcfg_GradeCol6, tr2i18n( "Click here to change the color for grade 6." ) );
    kcfg_GradeCol7->setText( tr2i18n( "&7" ) );
    TQToolTip::add( kcfg_GradeCol7, tr2i18n( "Color for the grade 7" ) );
    TQWhatsThis::add( kcfg_GradeCol7, tr2i18n( "Click here to change the color for grade 7." ) );
    kcfg_UseGradeCol->setText( tr2i18n( "&Use colors" ) );
    TQToolTip::add( kcfg_UseGradeCol, tr2i18n( "If it is unchecked, you will just have black on white for the grades; if it is checked, the colors below will be chosen." ) );
    TQWhatsThis::add( kcfg_UseGradeCol, tr2i18n( "If it is unchecked, you will just have black on white for the grades; if it is checked, the colors below will be chosen." ) );
}

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

TQMetaObject *ViewOptionsBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ViewOptionsBase( "ViewOptionsBase", &ViewOptionsBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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