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

#include "generaltab.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qslider.h>
#include <qlabel.h>
#include <knuminput.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "knuminput.h"
#include "krichtextlabel.h"

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

    startServer = new QCheckBox( this, "startServer" );
    QFont startServer_font(  startServer->font() );
    startServer_font.setBold( TRUE );
    startServer->setFont( startServer_font ); 
    startServer->setChecked( TRUE );
    generalTabLayout->addWidget( startServer );

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

    networkedSoundGroupBox = new QGroupBox( this, "networkedSoundGroupBox" );
    networkedSoundGroupBox->setEnabled( TRUE );
    networkedSoundGroupBox->setColumnLayout(0, Qt::Vertical );
    networkedSoundGroupBox->layout()->setSpacing( 6 );
    networkedSoundGroupBox->layout()->setMargin( 11 );
    networkedSoundGroupBoxLayout = new QVBoxLayout( networkedSoundGroupBox->layout() );
    networkedSoundGroupBoxLayout->setAlignment( Qt::AlignTop );

    textLabel1_2 = new KRichTextLabel( networkedSoundGroupBox, "textLabel1_2" );
    networkedSoundGroupBoxLayout->addWidget( textLabel1_2 );

    networkTransparent = new QCheckBox( networkedSoundGroupBox, "networkTransparent" );
    networkedSoundGroupBoxLayout->addWidget( networkTransparent );
    generalTabLayout->addWidget( networkedSoundGroupBox );

    realtimeGroupBox = new QGroupBox( this, "realtimeGroupBox" );
    realtimeGroupBox->setColumnLayout(0, Qt::Vertical );
    realtimeGroupBox->layout()->setSpacing( 6 );
    realtimeGroupBox->layout()->setMargin( 11 );
    realtimeGroupBoxLayout = new QGridLayout( realtimeGroupBox->layout() );
    realtimeGroupBoxLayout->setAlignment( Qt::AlignTop );

    textLabel1 = new KRichTextLabel( realtimeGroupBox, "textLabel1" );

    realtimeGroupBoxLayout->addMultiCellWidget( textLabel1, 0, 0, 0, 1 );

    startRealtime = new QCheckBox( realtimeGroupBox, "startRealtime" );
    startRealtime->setChecked( TRUE );

    realtimeGroupBoxLayout->addMultiCellWidget( startRealtime, 1, 1, 0, 1 );

    latencySlider = new QSlider( realtimeGroupBox, "latencySlider" );
    latencySlider->setMinValue( 10 );
    latencySlider->setMaxValue( 500 );
    latencySlider->setValue( 150 );
    latencySlider->setOrientation( QSlider::Horizontal );
    latencySlider->setTickmarks( QSlider::NoMarks );
    latencySlider->setTickInterval( 50 );

    realtimeGroupBoxLayout->addWidget( latencySlider, 2, 1 );

    textLabel5 = new QLabel( realtimeGroupBox, "textLabel5" );

    realtimeGroupBoxLayout->addWidget( textLabel5, 2, 0 );

    latencyLabel = new QLabel( realtimeGroupBox, "latencyLabel" );

    realtimeGroupBoxLayout->addWidget( latencyLabel, 3, 1 );
    generalTabLayout->addWidget( realtimeGroupBox );

    autoSuspendGroupBox = new QGroupBox( this, "autoSuspendGroupBox" );
    autoSuspendGroupBox->setColumnLayout(0, Qt::Vertical );
    autoSuspendGroupBox->layout()->setSpacing( 6 );
    autoSuspendGroupBox->layout()->setMargin( 11 );
    autoSuspendGroupBoxLayout = new QVBoxLayout( autoSuspendGroupBox->layout() );
    autoSuspendGroupBoxLayout->setAlignment( Qt::AlignTop );

    textLabel5_2 = new KRichTextLabel( autoSuspendGroupBox, "textLabel5_2" );
    autoSuspendGroupBoxLayout->addWidget( textLabel5_2 );

    layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 

    autoSuspend = new QCheckBox( autoSuspendGroupBox, "autoSuspend" );
    autoSuspend->setEnabled( TRUE );
    autoSuspend->setChecked( TRUE );
    layout7->addWidget( autoSuspend );

    suspendTime = new KIntNumInput( autoSuspendGroupBox, "suspendTime" );
    layout7->addWidget( suspendTime );
    spacer17_2 = new QSpacerItem( 173, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer17_2 );
    autoSuspendGroupBoxLayout->addLayout( layout7 );
    generalTabLayout->addWidget( autoSuspendGroupBox );

    layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); 
    spacer3_2_2 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout3->addItem( spacer3_2_2 );

    testSound = new QPushButton( this, "testSound" );
    testSound->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, testSound->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( testSound );
    spacer3 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout3->addItem( spacer3 );
    generalTabLayout->addLayout( layout3 );
    spacer5 = new QSpacerItem( 20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
    generalTabLayout->addItem( spacer5 );
    languageChange();
    resize( QSize(637, 613).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // buddies
    textLabel5->setBuddy( latencySlider );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void generalTab::languageChange()
{
    startServer->setText( tr2i18n( "&Enable the sound system" ) );
    QWhatsThis::add( startServer, tr2i18n( "If this option is enabled, the sound system will be loaded on KDE startup.\n"
"Recommended if you want sound." ) );
    networkedSoundGroupBox->setTitle( tr2i18n( "Networked Sound" ) );
    textLabel1_2->setText( tr2i18n( "<i>Enable this option if you want to play sound on a remote computer or you want to be able to control sound on this system from another computer.</i>" ) );
    networkTransparent->setText( tr2i18n( "Enable &networked sound" ) );
    QWhatsThis::add( networkTransparent, tr2i18n( "This option allows sound requests coming in from over the network to be accepted, instead of just limiting the server to the local computer." ) );
    realtimeGroupBox->setTitle( tr2i18n( "Skip Prevention" ) );
    textLabel1->setText( tr2i18n( "<i>If your sound is skipping during playback, enable running with highest possible priority. Increasing your sound buffer might also help.</i>" ) );
    startRealtime->setText( tr2i18n( "&Run with the highest possible priority (realtime priority)" ) );
    QWhatsThis::add( startRealtime, tr2i18n( "On systems which support realtime scheduling, if you have sufficient permissions, this option will enable a very high priority for processing sound requests." ) );
    textLabel5->setText( tr2i18n( "Sound &buffer:" ) );
    latencyLabel->setText( tr2i18n( "<p align=\"right\"><b>Huge</b> buffer, for <b>low-end</b> machines, <b>less skipping</b></p>" ) );
    autoSuspendGroupBox->setTitle( tr2i18n( "Auto-Suspend" ) );
    textLabel5_2->setText( tr2i18n( "<i>The KDE sound system takes exclusive control over your audio hardware, blocking programs that may wish to use it directly. If the KDE sound system sits idle it can give up this exclusive control.</i>" ) );
    autoSuspend->setText( tr2i18n( "&Auto-suspend if idle after:" ) );
    QWhatsThis::add( autoSuspend, tr2i18n( "The sound server will suspend itself if idle for this period of time." ) );
    suspendTime->setSuffix( tr2i18n( " seconds" ) );
    testSound->setText( tr2i18n( "Test &Sound" ) );
}

#include "generaltab.moc"
