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

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

#include "logitechmouse_base.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqprogressbar.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

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

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

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

    resolutionSelector = new TQButtonGroup( this, "resolutionSelector" );
    resolutionSelector->setEnabled( false );
    resolutionSelector->setRadioButtonExclusive( true );
    resolutionSelector->setColumnLayout(0, TQt::Vertical );
    resolutionSelector->layout()->setSpacing( 6 );
    resolutionSelector->layout()->setMargin( 11 );
    resolutionSelectorLayout = new TQHBoxLayout( resolutionSelector->layout() );
    resolutionSelectorLayout->setAlignment( TQt::AlignTop );

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

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

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

    batteryBox = new TQGroupBox( this, "batteryBox" );
    batteryBox->setEnabled( false );
    batteryBox->setColumnLayout(0, TQt::Vertical );
    batteryBox->layout()->setSpacing( 6 );
    batteryBox->layout()->setMargin( 11 );
    batteryBoxLayout = new TQHBoxLayout( batteryBox->layout() );
    batteryBoxLayout->setAlignment( TQt::AlignTop );

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

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

    channelSelector = new TQButtonGroup( this, "channelSelector" );
    channelSelector->setEnabled( false );
    channelSelector->setExclusive( true );
    channelSelector->setColumnLayout(0, TQt::Vertical );
    channelSelector->layout()->setSpacing( 6 );
    channelSelector->layout()->setMargin( 11 );
    channelSelectorLayout = new TQHBoxLayout( channelSelector->layout() );
    channelSelectorLayout->setAlignment( TQt::AlignTop );

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

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

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

/*
 *  Destroys the object and frees any allocated resources
 */
LogitechMouseBase::~LogitechMouseBase()
{
    // no need to delete child widgets, TQt 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" ) );
}

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

TQMetaObject *LogitechMouseBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_LogitechMouseBase( "LogitechMouseBase", &LogitechMouseBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* LogitechMouseBase::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"LogitechMouseBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_LogitechMouseBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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