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

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

#include "ifconfigpagebase.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    layout16 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout16"); 

    lb_netName = new TQLabel( this, "lb_netName" );
    layout16->addWidget( lb_netName );

    le_networkName = new KLineEdit( this, "le_networkName" );
    layout16->addWidget( le_networkName );

    lb_ifName = new TQLabel( this, "lb_ifName" );
    layout16->addWidget( lb_ifName );

    le_interface = new TQLineEdit( this, "le_interface" );
    le_interface->setEnabled( false );
    layout16->addWidget( le_interface );

    cb_Autodetect = new TQCheckBox( this, "cb_Autodetect" );
    cb_Autodetect->setChecked( true );
    layout16->addWidget( cb_Autodetect );
    spacer16 = new TQSpacerItem( 226, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout16->addItem( spacer16 );

    IfConfigPageBaseLayout->addLayout( layout16, 0, 0 );

    layout13 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout13"); 

    lb_connectScript = new TQLabel( this, "lb_connectScript" );
    layout13->addWidget( lb_connectScript );

    url_connectScript = new KURLRequester( this, "url_connectScript" );
    url_connectScript->setEnabled( false );
    layout13->addWidget( url_connectScript );
    spacer18 = new TQSpacerItem( 196, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout13->addItem( spacer18 );

    IfConfigPageBaseLayout->addLayout( layout13, 4, 0 );

    layout11 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout11"); 

    cb_pmEnabled = new TQCheckBox( this, "cb_pmEnabled" );
    layout11->addWidget( cb_pmEnabled );

    pb_setupPower = new TQPushButton( this, "pb_setupPower" );
    pb_setupPower->setEnabled( false );
    layout11->addWidget( pb_setupPower );
    spacer4 = new TQSpacerItem( 285, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout11->addItem( spacer4 );

    IfConfigPageBaseLayout->addLayout( layout11, 5, 0 );

    layout6 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout6"); 

    textLabel2 = new TQLabel( this, "textLabel2" );
    layout6->addWidget( textLabel2 );

    cmb_speed = new TQComboBox( false, this, "cmb_speed" );
    layout6->addWidget( cmb_speed );
    spacer6 = new TQSpacerItem( 190, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout6->addItem( spacer6 );

    IfConfigPageBaseLayout->addLayout( layout6, 2, 0 );

    layout5 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout5"); 

    lb_opMode = new TQLabel( this, "lb_opMode" );
    layout5->addWidget( lb_opMode );

    cmb_wifiMode = new TQComboBox( false, this, "cmb_wifiMode" );
    layout5->addWidget( cmb_wifiMode );
    spacer5_2 = new TQSpacerItem( 413, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer5_2 );

    IfConfigPageBaseLayout->addLayout( layout5, 1, 0 );

    layout14 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout14"); 

    cb_runScript = new TQCheckBox( this, "cb_runScript" );
    layout14->addWidget( cb_runScript );
    spacer19 = new TQSpacerItem( 131, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout14->addItem( spacer19 );

    IfConfigPageBaseLayout->addLayout( layout14, 3, 0 );

    layout17 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout17"); 

    cb_useCrypto = new TQCheckBox( this, "cb_useCrypto" );
    layout17->addWidget( cb_useCrypto );

    pb_setupCrypto = new TQPushButton( this, "pb_setupCrypto" );
    pb_setupCrypto->setEnabled( false );
    layout17->addWidget( pb_setupCrypto );
    spacer5 = new TQSpacerItem( 396, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout17->addItem( spacer5 );

    IfConfigPageBaseLayout->addLayout( layout17, 6, 0 );
    languageChange();
    resize( TQSize(626, 242).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cb_Autodetect, TQ_SIGNAL( toggled(bool) ), le_interface, TQ_SLOT( setDisabled(bool) ) );
    connect( cb_runScript, TQ_SIGNAL( toggled(bool) ), lb_connectScript, TQ_SLOT( setDisabled(bool) ) );
    connect( cb_runScript, TQ_SIGNAL( toggled(bool) ), url_connectScript, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( le_networkName, cmb_wifiMode );
    setTabOrder( cmb_wifiMode, cmb_speed );
    setTabOrder( cmb_speed, cb_runScript );
    setTabOrder( cb_runScript, url_connectScript );
    setTabOrder( url_connectScript, cb_pmEnabled );
    setTabOrder( cb_pmEnabled, pb_setupPower );
    setTabOrder( pb_setupPower, cb_useCrypto );
    setTabOrder( cb_useCrypto, pb_setupCrypto );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void IfConfigPageBase::languageChange()
{
    lb_netName->setText( tr2i18n( "Network name:" ) );
    TQToolTip::add( lb_netName, tr2i18n( "SSID of the network to connect to. \"any\" means \"arbitrary available network\"." ) );
    lb_ifName->setText( tr2i18n( "Interface:" ) );
    TQToolTip::add( lb_ifName, tr2i18n( "SSID of the network to connect to. \"any\" means \"arbitrary available network\"." ) );
    cb_Autodetect->setText( tr2i18n( "Autodetect" ) );
    lb_connectScript->setText( tr2i18n( "Script:" ) );
    TQToolTip::add( lb_connectScript, tr2i18n( "Command to perform after the connection is established, e.g. for obtaining a DHCP lease." ) );
    cb_pmEnabled->setText( tr2i18n( "Enable power management" ) );
    TQToolTip::add( cb_pmEnabled, tr2i18n( "Enables advanced power management settings." ) );
    pb_setupPower->setText( tr2i18n( "Configure..." ) );
    TQToolTip::add( pb_setupPower, tr2i18n( "Clicking this button opens the Power Management menu." ) );
    textLabel2->setText( tr2i18n( "Speed:" ) );
    TQToolTip::add( textLabel2, tr2i18n( "Sets the connection speed. Not all cards support this." ) );
    cmb_speed->clear();
    cmb_speed->insertItem( tr2i18n( "Auto" ) );
    cmb_speed->insertItem( tr2i18n( "1 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "2 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "5.5 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "6 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "9 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "11 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "12 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "18 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "24 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "36 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "48 Mb/s" ) );
    cmb_speed->insertItem( tr2i18n( "54 Mb/s" ) );
    lb_opMode->setText( tr2i18n( "Operation mode:" ) );
    TQToolTip::add( lb_opMode, tr2i18n( "Operation mode of the card. For standard infrastructure networks, \"Managed\" is appropriate." ) );
    cmb_wifiMode->clear();
    cmb_wifiMode->insertItem( tr2i18n( "Ad-Hoc" ) );
    cmb_wifiMode->insertItem( tr2i18n( "Managed" ) );
    cmb_wifiMode->insertItem( tr2i18n( "Repeater" ) );
    cmb_wifiMode->insertItem( tr2i18n( "Master" ) );
    cmb_wifiMode->insertItem( tr2i18n( "Secondary" ) );
    cb_runScript->setText( tr2i18n( "Execute script on connect" ) );
    TQToolTip::add( cb_runScript, tr2i18n( "Activates a script to perform arbitrary operations after associating with the network." ) );
    cb_useCrypto->setText( tr2i18n( "Use encryption" ) );
    TQToolTip::add( cb_useCrypto, tr2i18n( "Enables WEP encryption." ) );
    pb_setupCrypto->setText( tr2i18n( "Configure..." ) );
    TQToolTip::add( pb_setupCrypto, tr2i18n( "Clicking this button opens the Encryption menu." ) );
}

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

TQMetaObject *IfConfigPageBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_IfConfigPageBase( "IfConfigPageBase", &IfConfigPageBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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