#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/input/kmousedlg.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kmousedlg.h"

#include <qvariant.h>
#include <kdialog.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qframe.h>
#include <qslider.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

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

    handedBox = new QButtonGroup( this, "handedBox" );
    handedBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)4, 0, 0, handedBox->sizePolicy().hasHeightForWidth() ) );
    handedBox->setFrameShape( QButtonGroup::GroupBoxPanel );
    handedBox->setFrameShadow( QButtonGroup::Sunken );
    handedBox->setExclusive( TRUE );
    handedBox->setRadioButtonExclusive( TRUE );
    handedBox->setColumnLayout(0, Qt::Vertical );
    handedBox->layout()->setSpacing( KDialog::spacingHint() );
    handedBox->layout()->setMargin( KDialog::marginHint() );
    handedBoxLayout = new QGridLayout( handedBox->layout() );
    handedBoxLayout->setAlignment( Qt::AlignTop );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    handedBoxLayout->addItem( Spacer1, 2, 2 );
    Spacer53 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    handedBoxLayout->addItem( Spacer53, 2, 0 );

    rightHanded = new QRadioButton( handedBox, "rightHanded" );
    rightHanded->setChecked( TRUE );

    handedBoxLayout->addWidget( rightHanded, 0, 0 );

    leftHanded = new QRadioButton( handedBox, "leftHanded" );

    handedBoxLayout->addWidget( leftHanded, 1, 0 );

    mousePix = new QLabel( handedBox, "mousePix" );
    mousePix->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, mousePix->sizePolicy().hasHeightForWidth() ) );
    mousePix->setMaximumSize( QSize( 150, 115 ) );
    mousePix->setScaledContents( TRUE );

    handedBoxLayout->addMultiCellWidget( mousePix, 0, 2, 1, 1 );
    KMouseDlgLayout->addWidget( handedBox );

    cbScrollPolarity = new QCheckBox( this, "cbScrollPolarity" );
    KMouseDlgLayout->addWidget( cbScrollPolarity );

    GroupBox1 = new QGroupBox( this, "GroupBox1" );
    GroupBox1->setColumnLayout(0, Qt::Vertical );
    GroupBox1->layout()->setSpacing( KDialog::spacingHint() );
    GroupBox1->layout()->setMargin( KDialog::marginHint() );
    GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
    GroupBox1Layout->setAlignment( Qt::AlignTop );

    doubleClick = new QRadioButton( GroupBox1, "doubleClick" );
    doubleClick->setChecked( FALSE );

    GroupBox1Layout->addMultiCellWidget( doubleClick, 0, 0, 0, 2 );

    Line1 = new QFrame( GroupBox1, "Line1" );
    Line1->setFrameShape( QFrame::HLine );
    Line1->setFrameShadow( QFrame::Sunken );
    Line1->setFrameShape( QFrame::HLine );

    GroupBox1Layout->addMultiCellWidget( Line1, 5, 5, 0, 2 );

    cbVisualActivate = new QCheckBox( GroupBox1, "cbVisualActivate" );

    GroupBox1Layout->addMultiCellWidget( cbVisualActivate, 6, 6, 0, 2 );

    cb_pointershape = new QCheckBox( GroupBox1, "cb_pointershape" );
    cb_pointershape->setChecked( TRUE );

    GroupBox1Layout->addMultiCellWidget( cb_pointershape, 2, 2, 1, 2 );

    cbAutoSelect = new QCheckBox( GroupBox1, "cbAutoSelect" );

    GroupBox1Layout->addMultiCellWidget( cbAutoSelect, 3, 3, 1, 2 );
    Spacer6 = new QSpacerItem( 20, 60, QSizePolicy::Fixed, QSizePolicy::Minimum );
    GroupBox1Layout->addMultiCell( Spacer6, 2, 4, 0, 0 );

    layout7 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout7"); 

    lb_short = new QLabel( GroupBox1, "lb_short" );

    layout7->addWidget( lb_short, 1, 1 );

    slAutoSelect = new QSlider( GroupBox1, "slAutoSelect" );
    slAutoSelect->setMinimumSize( QSize( 250, 0 ) );
    slAutoSelect->setMaxValue( 2000 );
    slAutoSelect->setOrientation( QSlider::Horizontal );

    layout7->addMultiCellWidget( slAutoSelect, 0, 0, 1, 2 );
    Spacer8 = new QSpacerItem( 230, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addMultiCell( Spacer8, 0, 1, 3, 3 );

    lDelay = new QLabel( GroupBox1, "lDelay" );

    layout7->addWidget( lDelay, 0, 0 );

    lb_long = new QLabel( GroupBox1, "lb_long" );
    lb_long->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    layout7->addWidget( lb_long, 1, 2 );

    GroupBox1Layout->addLayout( layout7, 4, 2 );
    Spacer3 = new QSpacerItem( 20, 21, QSizePolicy::Fixed, QSizePolicy::Minimum );
    GroupBox1Layout->addItem( Spacer3, 4, 1 );

    singleClick = new QRadioButton( GroupBox1, "singleClick" );
    singleClick->setChecked( TRUE );

    GroupBox1Layout->addMultiCellWidget( singleClick, 1, 1, 0, 2 );
    KMouseDlgLayout->addWidget( GroupBox1 );
    Spacer7 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
    KMouseDlgLayout->addItem( Spacer7 );
    languageChange();
    resize( QSize(568, 434).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( singleClick, SIGNAL( toggled(bool) ), cb_pointershape, SLOT( setEnabled(bool) ) );
    connect( singleClick, SIGNAL( toggled(bool) ), cbAutoSelect, SLOT( setEnabled(bool) ) );
    connect( cbAutoSelect, SIGNAL( toggled(bool) ), slAutoSelect, SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( rightHanded, leftHanded );
    setTabOrder( leftHanded, singleClick );
    setTabOrder( singleClick, cb_pointershape );
    setTabOrder( cb_pointershape, cbAutoSelect );
    setTabOrder( cbAutoSelect, slAutoSelect );
    setTabOrder( slAutoSelect, doubleClick );
    setTabOrder( doubleClick, cbVisualActivate );

    // buddies
    lDelay->setBuddy( slAutoSelect );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KMouseDlg::languageChange()
{
    handedBox->setTitle( tr2i18n( "Button Order" ) );
    rightHanded->setText( tr2i18n( "Righ&t handed" ) );
    leftHanded->setText( tr2i18n( "Le&ft handed" ) );
    cbScrollPolarity->setText( tr2i18n( "Re&verse scroll direction" ) );
    QWhatsThis::add( cbScrollPolarity, tr2i18n( "Change the direction of scrolling for the mouse wheel or the 4th and 5th mouse buttons." ) );
    GroupBox1->setTitle( tr2i18n( "Icons" ) );
    doubleClick->setText( tr2i18n( "Dou&ble-click to open files and folders (select icons on first click)" ) );
    cbVisualActivate->setText( tr2i18n( "Visual f&eedback on activation" ) );
    cb_pointershape->setText( tr2i18n( "Cha&nge pointer shape over icons" ) );
    cbAutoSelect->setText( tr2i18n( "A&utomatically select icons" ) );
    lb_short->setText( tr2i18n( "Short" ) );
    lDelay->setText( tr2i18n( "Dela&y:" ) );
    lb_long->setText( tr2i18n( "Long" ) );
    singleClick->setText( tr2i18n( "&Single-click to open files and folders" ) );
}

#include "kmousedlg.moc"
