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

#include "logitechmouse_base.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qgroupbox.h>
#include <qprogressbar.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a LogitechMouseBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
LogitechMouseBase::LogitechMouseBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "LogitechMouseBase" );
    LogitechMouseBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "LogitechMouseBaseLayout"); 

    cordlessNameLabel = new QLabel( this, "cordlessNameLabel" );

    LogitechMouseBaseLayout->addWidget( cordlessNameLabel, 0, 0 );

    permissionProblemText = new QLabel( this, "permissionProblemText" );
    permissionProblemText->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );

    LogitechMouseBaseLayout->addWidget( permissionProblemText, 4, 0 );

    resolutionSelector = new QButtonGroup( this, "resolutionSelector" );
    resolutionSelector->setEnabled( FALSE );
    resolutionSelector->setRadioButtonExclusive( TRUE );
    resolutionSelector->setColumnLayout(0, Qt::Vertical );
    resolutionSelector->layout()->setSpacing( 6 );
    resolutionSelector->layout()->setMargin( 11 );
    resolutionSelectorLayout = new QHBoxLayout( resolutionSelector->layout() );
    resolutionSelectorLayout->setAlignment( Qt::AlignTop );

    button400cpi = new QRadioButton( resolutionSelector, "button400cpi" );
    resolutionSelector->insert( button400cpi, 1 );
    resolutionSelectorLayout->addWidget( button400cpi );

    button800cpi = new QRadioButton( resolutionSelector, "button800cpi" );
    resolutionSelector->insert( button800cpi, 1 );
    resolutionSelectorLayout->addWidget( button800cpi );

    LogitechMouseBaseLayout->addWidget( resolutionSelector, 1, 0 );

    batteryBox = new QGroupBox( this, "batteryBox" );
    batteryBox->setEnabled( FALSE );
    batteryBox->setColumnLayout(0, Qt::Vertical );
    batteryBox->layout()->setSpacing( 6 );
    batteryBox->layout()->setMargin( 11 );
    batteryBoxLayout = new QHBoxLayout( batteryBox->layout() );
    batteryBoxLayout->setAlignment( Qt::AlignTop );

    batteryBar = new QProgressBar( batteryBox, "batteryBar" );
    batteryBar->setTotalSteps( 7 );
    batteryBoxLayout->addWidget( batteryBar );

    LogitechMouseBaseLayout->addWidget( batteryBox, 2, 0 );

    channelSelector = new QButtonGroup( this, "channelSelector" );
    channelSelector->setEnabled( FALSE );
    channelSelector->setExclusive( TRUE );
    channelSelector->setColumnLayout(0, Qt::Vertical );
    channelSelector->layout()->setSpacing( 6 );
    channelSelector->layout()->setMargin( 11 );
    channelSelectorLayout = new QHBoxLayout( channelSelector->layout() );
    channelSelectorLayout->setAlignment( Qt::AlignTop );

    channel1 = new QRadioButton( channelSelector, "channel1" );
    channel1->setChecked( TRUE );
    channelSelector->insert( channel1, 3 );
    channelSelectorLayout->addWidget( channel1 );

    channel2 = new QRadioButton( channelSelector, "channel2" );
    channel2->setEnabled( FALSE );
    channelSelector->insert( channel2, 3 );
    channelSelectorLayout->addWidget( channel2 );

    LogitechMouseBaseLayout->addWidget( channelSelector, 3, 0 );
    languageChange();
    resize( QSize(458, 383).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void LogitechMouseBase::languageChange()
{
    cordlessNameLabel->setText( tr2i18n( "Cordless Name" ) );
    permissionProblemText->setText( tr2i18n( "You have a Logitech Mouse connected, and libusb was found at compile time, but it was not possible to access this mouse. This is probably caused by a permissions problem - you should consult the manual on how to fix this." ) );
    resolutionSelector->setTitle( tr2i18n( "Sensor Resolution" ) );
    button400cpi->setText( tr2i18n( "400 counts per inch" ) );
    button800cpi->setText( tr2i18n( "800 counts per inch" ) );
    batteryBox->setTitle( tr2i18n( "Battery Level" ) );
    channelSelector->setTitle( tr2i18n( "RF Channel" ) );
    channel1->setText( tr2i18n( "Channel 1" ) );
    channel2->setText( tr2i18n( "Channel 2" ) );
}

#include "logitechmouse_base.moc"
