#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdebase3/kdebase3-3.5.10-11.i686/src/kdebase-3.5.10/kcontrol/knotify/playersettings.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "playersettings.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qframe.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qslider.h>
#include <kurlrequester.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kurlrequester.h"
#include "klineedit.h"
#include "kpushbutton.h"

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

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

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

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

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

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

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

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

    layout5 = new QGridLayout( 0, 1, 1, 0, 6, "layout5"); 
    spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout5->addItem( spacer4, 1, 0 );

    layout4 = new QGridLayout( 0, 1, 1, 0, 0, "layout4"); 
    spacer1 = new QSpacerItem( 233, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout4->addItem( spacer1, 1, 1 );

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

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

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

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

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

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

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

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

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

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

    cbArts = new QRadioButton( grpPlayers, "cbArts" );
    cbArts->setChecked( TRUE );

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

    textLabel5 = new QLabel( grpPlayers, "textLabel5" );
    textLabel5->setEnabled( FALSE );

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

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

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

    // signals and slots connections
    connect( cbArts, SIGNAL( toggled(bool) ), textLabel4, SLOT( setEnabled(bool) ) );
    connect( cbArts, SIGNAL( toggled(bool) ), textLabel2, SLOT( setEnabled(bool) ) );
    connect( cbArts, SIGNAL( toggled(bool) ), volumeSlider, SLOT( setEnabled(bool) ) );
    connect( cbArts, SIGNAL( toggled(bool) ), textLabel3, SLOT( setEnabled(bool) ) );
    connect( cbExternal, SIGNAL( toggled(bool) ), textLabel5, SLOT( setEnabled(bool) ) );
    connect( cbExternal, SIGNAL( toggled(bool) ), reqExternal, 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, Qt 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( QString::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 &KDE sound system" ) );
    textLabel5->setText( tr2i18n( "&Player:" ) );
}

#include "playersettings.moc"
