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

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

#include "colorwidget.h"

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

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

    customColors = new TQCheckBox( this, "customColors" );
    ColorWidgetLayout->addWidget( customColors );

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

    activeBack = new KColorButton( activeColors, "activeBack" );
    activeBack->setEnabled( true );

    activeColorsLayout->addWidget( activeBack, 2, 1 );

    TextLabel3 = new TQLabel( activeColors, "TextLabel3" );
    TextLabel3->setEnabled( true );

    activeColorsLayout->addWidget( TextLabel3, 1, 0 );

    activeLow = new KColorButton( activeColors, "activeLow" );
    activeLow->setEnabled( true );

    activeColorsLayout->addWidget( activeLow, 1, 1 );

    activeHigh = new KColorButton( activeColors, "activeHigh" );
    activeHigh->setEnabled( true );
    activeHigh->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, activeHigh->sizePolicy().hasHeightForWidth() ) );

    activeColorsLayout->addWidget( activeHigh, 0, 1 );

    labelLoad = new TQLabel( activeColors, "labelLoad" );
    labelLoad->setEnabled( true );

    activeColorsLayout->addWidget( labelLoad, 0, 0 );

    TextLabel4 = new TQLabel( activeColors, "TextLabel4" );
    TextLabel4->setEnabled( true );

    activeColorsLayout->addWidget( TextLabel4, 2, 0 );
    ColorWidgetLayout->addWidget( activeColors );

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

    TextLabel6 = new TQLabel( mutedColors, "TextLabel6" );
    TextLabel6->setEnabled( true );

    mutedColorsLayout->addWidget( TextLabel6, 0, 0 );

    TextLabel8 = new TQLabel( mutedColors, "TextLabel8" );
    TextLabel8->setEnabled( true );

    mutedColorsLayout->addWidget( TextLabel8, 2, 0 );

    TextLabel7 = new TQLabel( mutedColors, "TextLabel7" );
    TextLabel7->setEnabled( true );

    mutedColorsLayout->addWidget( TextLabel7, 1, 0 );

    mutedHigh = new KColorButton( mutedColors, "mutedHigh" );
    mutedHigh->setEnabled( true );
    mutedHigh->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, mutedHigh->sizePolicy().hasHeightForWidth() ) );

    mutedColorsLayout->addWidget( mutedHigh, 0, 1 );

    mutedLow = new KColorButton( mutedColors, "mutedLow" );
    mutedLow->setEnabled( true );

    mutedColorsLayout->addWidget( mutedLow, 1, 1 );

    mutedBack = new KColorButton( mutedColors, "mutedBack" );
    mutedBack->setEnabled( true );

    mutedColorsLayout->addWidget( mutedBack, 2, 1 );
    ColorWidgetLayout->addWidget( mutedColors );
    spacer5 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ColorWidgetLayout->addItem( spacer5 );
    languageChange();
    resize( TQSize(272, 305).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( customColors, TQ_SIGNAL( toggled(bool) ), activeColors, TQ_SLOT( setEnabled(bool) ) );
    connect( customColors, TQ_SIGNAL( toggled(bool) ), mutedColors, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( customColors, activeHigh );
    setTabOrder( activeHigh, activeLow );
    setTabOrder( activeLow, activeBack );
    setTabOrder( activeBack, mutedHigh );
    setTabOrder( mutedHigh, mutedLow );
    setTabOrder( mutedLow, mutedBack );

    // buddies
    TextLabel3->setBuddy( activeLow );
    labelLoad->setBuddy( activeHigh );
    TextLabel4->setBuddy( activeBack );
    TextLabel6->setBuddy( mutedHigh );
    TextLabel8->setBuddy( mutedBack );
    TextLabel7->setBuddy( mutedLow );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ColorWidget::languageChange()
{
    customColors->setText( tr2i18n( "&Use custom colors" ) );
    activeColors->setTitle( tr2i18n( "Active" ) );
    activeBack->setText( TQString::null );
    TextLabel3->setText( tr2i18n( "&Silent:" ) );
    activeLow->setText( TQString::null );
    activeHigh->setText( TQString::null );
    labelLoad->setText( tr2i18n( "&Loud:" ) );
    TextLabel4->setText( tr2i18n( "&Background:" ) );
    mutedColors->setTitle( tr2i18n( "Muted" ) );
    TextLabel6->setText( tr2i18n( "Lou&d:" ) );
    TextLabel8->setText( tr2i18n( "Backgrou&nd:" ) );
    TextLabel7->setText( tr2i18n( "Silen&t:" ) );
    mutedHigh->setText( TQString::null );
    mutedLow->setText( TQString::null );
    mutedBack->setText( TQString::null );
}

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

TQMetaObject *ColorWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ColorWidget( "ColorWidget", &ColorWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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