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

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

#include "playersettings.h"

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

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

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

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

    grpPlayers = new TQButtonGroup( this, "grpPlayers" );
    grpPlayers->setFrameShape( TQButtonGroup::NoFrame );
    grpPlayers->setColumnLayout(0, TQt::Vertical );
    grpPlayers->layout()->setSpacing( 6 );
    grpPlayers->layout()->setMargin( 0 );
    grpPlayersLayout = new TQGridLayout( grpPlayers->layout() );
    grpPlayersLayout->setAlignment( TQt::AlignTop );

    cbNone = new TQRadioButton( grpPlayers, "cbNone" );

    grpPlayersLayout->addMultiCellWidget( cbNone, 4, 4, 0, 2 );

    cbExternal = new TQRadioButton( grpPlayers, "cbExternal" );

    grpPlayersLayout->addMultiCellWidget( cbExternal, 2, 2, 0, 2 );
    spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    grpPlayersLayout->addItem( spacer2, 1, 0 );

    layout5 = new TQGridLayout( 0, 1, 1, 0, 6, "layout5"); 
    spacer4 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout5->addItem( spacer4, 1, 0 );

    layout4 = new TQGridLayout( 0, 1, 1, 0, 0, "layout4"); 
    spacer1 = new TQSpacerItem( 233, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout4->addItem( spacer1, 1, 1 );

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

    layout4->addWidget( textLabel3, 1, 2 );

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

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

    volumeSlider = new TQSlider( grpPlayers, "volumeSlider" );
    volumeSlider->setMaxValue( 100 );
    volumeSlider->setLineStep( 10 );
    volumeSlider->setValue( 100 );
    volumeSlider->setOrientation( TQSlider::Horizontal );

    layout4->addMultiCellWidget( volumeSlider, 0, 0, 0, 2 );

    layout5->addMultiCellLayout( layout4, 0, 1, 1, 1 );

    textLabel4 = new TQLabel( grpPlayers, "textLabel4" );

    layout5->addWidget( textLabel4, 0, 0 );

    grpPlayersLayout->addMultiCellLayout( layout5, 1, 1, 1, 2 );
    spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    grpPlayersLayout->addItem( spacer3, 3, 0 );

    cbArts = new TQRadioButton( grpPlayers, "cbArts" );
    cbArts->setChecked( true );

    grpPlayersLayout->addMultiCellWidget( cbArts, 0, 0, 0, 3 );

    textLabel5 = new TQLabel( grpPlayers, "textLabel5" );
    textLabel5->setEnabled( false );

    grpPlayersLayout->addWidget( textLabel5, 3, 1 );

    reqExternal = new KURLRequester( grpPlayers, "reqExternal" );
    reqExternal->setEnabled( false );
    reqExternal->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 10, 0, reqExternal->sizePolicy().hasHeightForWidth() ) );

    grpPlayersLayout->addWidget( reqExternal, 3, 2 );
    PlayerSettingsUILayout->addWidget( grpPlayers );
    spacer5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    PlayerSettingsUILayout->addItem( spacer5 );
    languageChange();
    resize( TQSize(387, 207).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cbArts, TQ_SIGNAL( toggled(bool) ), textLabel4, TQ_SLOT( setEnabled(bool) ) );
    connect( cbArts, TQ_SIGNAL( toggled(bool) ), textLabel2, TQ_SLOT( setEnabled(bool) ) );
    connect( cbArts, TQ_SIGNAL( toggled(bool) ), volumeSlider, TQ_SLOT( setEnabled(bool) ) );
    connect( cbArts, TQ_SIGNAL( toggled(bool) ), textLabel3, TQ_SLOT( setEnabled(bool) ) );
    connect( cbExternal, TQ_SIGNAL( toggled(bool) ), textLabel5, TQ_SLOT( setEnabled(bool) ) );
    connect( cbExternal, TQ_SIGNAL( toggled(bool) ), reqExternal, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( cbArts, volumeSlider );
    setTabOrder( volumeSlider, reqExternal );
    setTabOrder( reqExternal, cbExternal );
    setTabOrder( cbExternal, cbNone );

    // buddies
    textLabel4->setBuddy( volumeSlider );
    textLabel5->setBuddy( reqExternal );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PlayerSettingsUI::languageChange()
{
    textLabel1->setText( tr2i18n( "<b>Audio Player Settings</b>" ) );
    grpPlayers->setTitle( TQString::null );
    cbNone->setText( tr2i18n( "&No audio output" ) );
    cbExternal->setText( tr2i18n( "&Use an external player" ) );
    textLabel3->setText( tr2i18n( "100%" ) );
    textLabel2->setText( tr2i18n( "0%" ) );
    textLabel4->setText( tr2i18n( "&Volume:" ) );
    cbArts->setText( tr2i18n( "Use the &TDE sound system" ) );
    textLabel5->setText( tr2i18n( "&Player:" ) );
}

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

TQMetaObject *PlayerSettingsUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PlayerSettingsUI( "PlayerSettingsUI", &PlayerSettingsUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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