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

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

#include "configpower.h"

#include <ntqvariant.h>
#include <knuminput.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "configpower.ui.h"

/*
 *  Constructs a ConfigPower as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ConfigPower::ConfigPower( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "ConfigPower" );
    ConfigPowerLayout = new TQGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "ConfigPowerLayout"); 

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

    ConfigPowerLayout->addWidget( lb_sleepTimeout, 0, 0 );

    sb_sleepTimeout = new KIntNumInput( this, "sb_sleepTimeout" );
    sb_sleepTimeout->setEnabled( true );
    sb_sleepTimeout->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, sb_sleepTimeout->sizePolicy().hasHeightForWidth() ) );
    sb_sleepTimeout->setMinValue( 0 );
    sb_sleepTimeout->setMaxValue( 60 );

    ConfigPowerLayout->addWidget( sb_sleepTimeout, 0, 1 );

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

    ConfigPowerLayout->addWidget( lb_wakeupPeriod, 1, 0 );

    bg_packets = new TQButtonGroup( this, "bg_packets" );
    bg_packets->setColumnLayout(0, TQt::Vertical );
    bg_packets->layout()->setSpacing( KDialog::spacingHint() );
    bg_packets->layout()->setMargin( KDialog::marginHint() );
    bg_packetsLayout = new TQVBoxLayout( bg_packets->layout() );
    bg_packetsLayout->setAlignment( TQt::AlignTop );

    bg_allPackets = new TQRadioButton( bg_packets, "bg_allPackets" );
    bg_packetsLayout->addWidget( bg_allPackets );

    rb_unicastOnly = new TQRadioButton( bg_packets, "rb_unicastOnly" );
    bg_packetsLayout->addWidget( rb_unicastOnly );

    rb_multicastOnly = new TQRadioButton( bg_packets, "rb_multicastOnly" );
    bg_packetsLayout->addWidget( rb_multicastOnly );

    ConfigPowerLayout->addMultiCellWidget( bg_packets, 2, 2, 0, 1 );

    sb_wakeupPeriod = new KIntNumInput( this, "sb_wakeupPeriod" );
    sb_wakeupPeriod->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, sb_wakeupPeriod->sizePolicy().hasHeightForWidth() ) );
    sb_wakeupPeriod->setMinValue( 0 );
    sb_wakeupPeriod->setMaxValue( 60 );

    ConfigPowerLayout->addWidget( sb_wakeupPeriod, 1, 1 );
    languageChange();
    resize( TQSize(318, 186).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConfigPower::languageChange()
{
    lb_sleepTimeout->setText( tr2i18n( "Sleep timeout:" ) );
    TQToolTip::add( lb_sleepTimeout, tr2i18n( "Sets how long the card will be offline before looking for new packages again." ) );
    sb_sleepTimeout->setSuffix( tr2i18n( " sec" ) );
    lb_wakeupPeriod->setText( tr2i18n( "Wakeup period:" ) );
    TQToolTip::add( lb_wakeupPeriod, tr2i18n( "Sets how long the card will be online and looking for new packages before it falls asleep." ) );
    bg_packets->setTitle( tr2i18n( "Receive Packets" ) );
    TQToolTip::add( bg_packets, tr2i18n( "Sets which sort of packets to listen to." ) );
    bg_allPackets->setText( tr2i18n( "All" ) );
    TQToolTip::add( bg_allPackets, tr2i18n( "Listen to all packet types." ) );
    rb_unicastOnly->setText( tr2i18n( "Unicast only" ) );
    TQToolTip::add( rb_unicastOnly, tr2i18n( "Listen to Unicast packets only." ) );
    rb_multicastOnly->setText( tr2i18n( "Multicast/Broadcast only" ) );
    TQToolTip::add( rb_multicastOnly, tr2i18n( "Listen to Multicast and Broadcast packets only." ) );
    sb_wakeupPeriod->setSuffix( tr2i18n( " sec" ) );
}

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

TQMetaObject *ConfigPower::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ConfigPower( "ConfigPower", &ConfigPower::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ConfigPower::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 = TQWidget::staticMetaObject();
    static const TQUParameter param_slot_0[] = {
	{ "ifconfig", &static_QUType_ptr, "IfConfig", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"load", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "ifconfig", &static_QUType_ptr, "IfConfig", TQUParameter::InOut }
    };
    static const TQUMethod slot_1 = {"save", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "load(const IfConfig&)", &slot_0, TQMetaData::Public },
	{ "save(IfConfig&)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ConfigPower", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ConfigPower.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ConfigPower::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: load((const IfConfig&)*((const IfConfig*)static_QUType_ptr.get(_o+1))); break;
    case 1: save((IfConfig&)*((IfConfig*)static_QUType_ptr.get(_o+1))); break;
    case 2: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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