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

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

#include "osd_preferencesui.h"

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

/*
 *  Constructs a OSD_ConfigUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
OSD_ConfigUI::OSD_ConfigUI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "OSD_ConfigUI" );
    OSD_ConfigUILayout = new TQGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "OSD_ConfigUILayout"); 
    spacer1 = new TQSpacerItem( 21, 10, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    OSD_ConfigUILayout->addItem( spacer1, 5, 0 );

    kcfg_UseOSD = new TQCheckBox( this, "kcfg_UseOSD" );

    OSD_ConfigUILayout->addWidget( kcfg_UseOSD, 0, 0 );

    groupBox2 = new TQGroupBox( this, "groupBox2" );
    groupBox2->setEnabled( false );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( KDialog::spacingHint() );
    groupBox2->layout()->setMargin( KDialog::marginHint() );
    groupBox2Layout = new TQGridLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    kcfg_OSDDrawShadow = new TQCheckBox( groupBox2, "kcfg_OSDDrawShadow" );
    kcfg_OSDDrawShadow->setEnabled( false );

    groupBox2Layout->addMultiCellWidget( kcfg_OSDDrawShadow, 0, 0, 0, 1 );

    textLabel1 = new TQLabel( groupBox2, "textLabel1" );
    textLabel1->setEnabled( false );
    textLabel1->setFrameShadow( TQLabel::Sunken );

    groupBox2Layout->addWidget( textLabel1, 1, 0 );

    kcfg_OSDFont = new TDEFontRequester( groupBox2, "kcfg_OSDFont" );
    kcfg_OSDFont->setEnabled( false );

    groupBox2Layout->addWidget( kcfg_OSDFont, 1, 1 );

    kcfg_OSDOffsetX = new TQSpinBox( groupBox2, "kcfg_OSDOffsetX" );
    kcfg_OSDOffsetX->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)4, 0, 0, kcfg_OSDOffsetX->sizePolicy().hasHeightForWidth() ) );
    kcfg_OSDOffsetX->setMaxValue( 2048 );
    kcfg_OSDOffsetX->setMinValue( -2048 );

    groupBox2Layout->addWidget( kcfg_OSDOffsetX, 0, 2 );

    kcfg_OSDOffsetY = new TQSpinBox( groupBox2, "kcfg_OSDOffsetY" );
    kcfg_OSDOffsetY->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)4, 0, 0, kcfg_OSDOffsetY->sizePolicy().hasHeightForWidth() ) );
    kcfg_OSDOffsetY->setMaxValue( 2048 );
    kcfg_OSDOffsetY->setMinValue( -2048 );

    groupBox2Layout->addWidget( kcfg_OSDOffsetY, 0, 3 );

    kcfg_OSDAlignment = new TQSpinBox( groupBox2, "kcfg_OSDAlignment" );
    kcfg_OSDAlignment->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)4, 0, 0, kcfg_OSDAlignment->sizePolicy().hasHeightForWidth() ) );

    groupBox2Layout->addWidget( kcfg_OSDAlignment, 0, 4 );

    OSD_ConfigUILayout->addWidget( groupBox2, 1, 0 );

    groupBox3 = new TQGroupBox( this, "groupBox3" );
    groupBox3->setEnabled( false );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( KDialog::spacingHint() );
    groupBox3->layout()->setMargin( KDialog::marginHint() );
    groupBox3Layout = new TQGridLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    kcfg_OSDShowOwnNick = new TQCheckBox( groupBox3, "kcfg_OSDShowOwnNick" );

    groupBox3Layout->addWidget( kcfg_OSDShowOwnNick, 0, 0 );

    kcfg_OSDShowChannel = new TQCheckBox( groupBox3, "kcfg_OSDShowChannel" );

    groupBox3Layout->addWidget( kcfg_OSDShowChannel, 1, 0 );

    kcfg_OSDShowQuery = new TQCheckBox( groupBox3, "kcfg_OSDShowQuery" );

    groupBox3Layout->addWidget( kcfg_OSDShowQuery, 2, 0 );

    kcfg_OSDShowChannelEvent = new TQCheckBox( groupBox3, "kcfg_OSDShowChannelEvent" );

    groupBox3Layout->addWidget( kcfg_OSDShowChannelEvent, 3, 0 );

    OSD_ConfigUILayout->addWidget( groupBox3, 2, 0 );

    kcfg_OSDUseCustomColors = new TQGroupBox( this, "kcfg_OSDUseCustomColors" );
    kcfg_OSDUseCustomColors->setEnabled( false );
    kcfg_OSDUseCustomColors->setCheckable( true );
    kcfg_OSDUseCustomColors->setChecked( false );
    kcfg_OSDUseCustomColors->setColumnLayout(0, TQt::Vertical );
    kcfg_OSDUseCustomColors->layout()->setSpacing( KDialog::spacingHint() );
    kcfg_OSDUseCustomColors->layout()->setMargin( KDialog::marginHint() );
    kcfg_OSDUseCustomColorsLayout = new TQGridLayout( kcfg_OSDUseCustomColors->layout() );
    kcfg_OSDUseCustomColorsLayout->setAlignment( TQt::AlignTop );

    textLabel2 = new TQLabel( kcfg_OSDUseCustomColors, "textLabel2" );

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

    textLabel3 = new TQLabel( kcfg_OSDUseCustomColors, "textLabel3" );

    kcfg_OSDUseCustomColorsLayout->addWidget( textLabel3, 2, 0 );

    kcfg_OSDBackgroundColor = new KColorButton( kcfg_OSDUseCustomColors, "kcfg_OSDBackgroundColor" );

    kcfg_OSDUseCustomColorsLayout->addWidget( kcfg_OSDBackgroundColor, 2, 1 );

    kcfg_OSDTextColor = new KColorButton( kcfg_OSDUseCustomColors, "kcfg_OSDTextColor" );

    kcfg_OSDUseCustomColorsLayout->addWidget( kcfg_OSDTextColor, 1, 1 );
    spacer2 = new TQSpacerItem( 50, 31, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    kcfg_OSDUseCustomColorsLayout->addMultiCell( spacer2, 1, 2, 2, 2 );

    OSD_ConfigUILayout->addWidget( kcfg_OSDUseCustomColors, 3, 0 );

    groupBox4 = new TQGroupBox( this, "groupBox4" );
    groupBox4->setEnabled( false );
    groupBox4->setColumnLayout(0, TQt::Vertical );
    groupBox4->layout()->setSpacing( KDialog::spacingHint() );
    groupBox4->layout()->setMargin( KDialog::marginHint() );
    groupBox4Layout = new TQGridLayout( groupBox4->layout() );
    groupBox4Layout->setAlignment( TQt::AlignTop );

    textLabel1_2 = new TQLabel( groupBox4, "textLabel1_2" );

    groupBox4Layout->addWidget( textLabel1_2, 0, 0 );

    textLabel2_2 = new TQLabel( groupBox4, "textLabel2_2" );

    groupBox4Layout->addWidget( textLabel2_2, 1, 0 );

    kcfg_OSDDuration = new TQSpinBox( groupBox4, "kcfg_OSDDuration" );
    kcfg_OSDDuration->setMaxValue( 10000 );
    kcfg_OSDDuration->setMinValue( 500 );
    kcfg_OSDDuration->setLineStep( 100 );

    groupBox4Layout->addWidget( kcfg_OSDDuration, 0, 1 );

    kcfg_OSDScreen = new KComboBox( false, groupBox4, "kcfg_OSDScreen" );

    groupBox4Layout->addWidget( kcfg_OSDScreen, 1, 1 );
    spacer3 = new TQSpacerItem( 50, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox4Layout->addMultiCell( spacer3, 0, 1, 2, 2 );

    OSD_ConfigUILayout->addWidget( groupBox4, 4, 0 );
    languageChange();
    resize( TQSize(444, 442).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), kcfg_OSDDrawShadow, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), groupBox3, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), kcfg_OSDUseCustomColors, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), groupBox4, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), textLabel1, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), kcfg_OSDFont, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseOSD, TQ_SIGNAL( toggled(bool) ), groupBox2, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_UseOSD, kcfg_OSDDrawShadow );
    setTabOrder( kcfg_OSDDrawShadow, kcfg_OSDFont );
    setTabOrder( kcfg_OSDFont, kcfg_OSDOffsetX );
    setTabOrder( kcfg_OSDOffsetX, kcfg_OSDOffsetY );
    setTabOrder( kcfg_OSDOffsetY, kcfg_OSDAlignment );
    setTabOrder( kcfg_OSDAlignment, kcfg_OSDShowOwnNick );
    setTabOrder( kcfg_OSDShowOwnNick, kcfg_OSDShowChannel );
    setTabOrder( kcfg_OSDShowChannel, kcfg_OSDShowQuery );
    setTabOrder( kcfg_OSDShowQuery, kcfg_OSDShowChannelEvent );
    setTabOrder( kcfg_OSDShowChannelEvent, kcfg_OSDUseCustomColors );
    setTabOrder( kcfg_OSDUseCustomColors, kcfg_OSDTextColor );
    setTabOrder( kcfg_OSDTextColor, kcfg_OSDBackgroundColor );
    setTabOrder( kcfg_OSDBackgroundColor, kcfg_OSDDuration );
    setTabOrder( kcfg_OSDDuration, kcfg_OSDScreen );
    setTabOrder( kcfg_OSDScreen, kcfg_OSDUseCustomColors );

    // buddies
    textLabel2->setBuddy( kcfg_OSDTextColor );
    textLabel3->setBuddy( kcfg_OSDBackgroundColor );
    textLabel1_2->setBuddy( kcfg_OSDDuration );
    textLabel2_2->setBuddy( kcfg_OSDScreen );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void OSD_ConfigUI::languageChange()
{
    kcfg_UseOSD->setText( tr2i18n( "&Enable On Screen Display" ) );
    groupBox2->setTitle( tr2i18n( "On &Screen Display" ) );
    kcfg_OSDDrawShadow->setText( tr2i18n( "&Draw shadows" ) );
    textLabel1->setText( tr2i18n( "OSD font:" ) );
    groupBox3->setTitle( tr2i18n( "Show &OSD Message" ) );
    kcfg_OSDShowOwnNick->setText( tr2i18n( "&If own nick appears in channel message" ) );
    kcfg_OSDShowChannel->setText( tr2i18n( "On an&y channel message" ) );
    kcfg_OSDShowQuery->setText( tr2i18n( "On &query activity" ) );
    kcfg_OSDShowChannelEvent->setText( tr2i18n( "On &Join/Part events" ) );
    kcfg_OSDUseCustomColors->setTitle( tr2i18n( "Enable Custom Colors" ) );
    textLabel2->setText( tr2i18n( "Te&xt color:" ) );
    textLabel3->setText( tr2i18n( "&Background color:" ) );
    kcfg_OSDBackgroundColor->setText( TQString::null );
    kcfg_OSDTextColor->setText( TQString::null );
    groupBox4->setTitle( tr2i18n( "O&ther Settings" ) );
    textLabel1_2->setText( tr2i18n( "&Duration:" ) );
    textLabel2_2->setText( tr2i18n( "S&creen:" ) );
    kcfg_OSDDuration->setSuffix( tr2i18n( " ms" ) );
}

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

TQMetaObject *OSD_ConfigUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_OSD_ConfigUI( "OSD_ConfigUI", &OSD_ConfigUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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