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

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

#include "dlgconnectionbase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <kdialog.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    gb_reconnect = new TQGroupBox( this, "gb_reconnect" );
    gb_reconnect->setColumnLayout(0, TQt::Vertical );
    gb_reconnect->layout()->setSpacing( KDialog::spacingHint() );
    gb_reconnect->layout()->setMargin( KDialog::marginHint() );
    gb_reconnectLayout = new TQGridLayout( gb_reconnect->layout() );
    gb_reconnectLayout->setAlignment( TQt::AlignTop );

    cb_onerror = new TQCheckBox( gb_reconnect, "cb_onerror" );

    gb_reconnectLayout->addMultiCellWidget( cb_onerror, 1, 1, 0, 1 );

    lb_after = new TQLabel( gb_reconnect, "lb_after" );

    gb_reconnectLayout->addWidget( lb_after, 2, 1 );

    lb_retries = new TQLabel( gb_reconnect, "lb_retries" );

    gb_reconnectLayout->addWidget( lb_retries, 0, 0 );

    le_after = new KIntSpinBox( gb_reconnect, "le_after" );
    le_after->setMaxValue( 3600 );
    le_after->setMinValue( 1 );

    gb_reconnectLayout->addWidget( le_after, 2, 2 );

    le_retries = new KIntSpinBox( gb_reconnect, "le_retries" );
    le_retries->setMinValue( 1 );

    gb_reconnectLayout->addWidget( le_retries, 0, 2 );

    cb_onbroken = new TQCheckBox( gb_reconnect, "cb_onbroken" );

    gb_reconnectLayout->addMultiCellWidget( cb_onbroken, 3, 3, 0, 1 );
    spacer2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    gb_reconnectLayout->addItem( spacer2, 0, 1 );
    spacer3 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    gb_reconnectLayout->addItem( spacer3, 2, 0 );
    DlgConnectionBaseLayout->addWidget( gb_reconnect );

    gb_timeout = new TQGroupBox( this, "gb_timeout" );
    gb_timeout->setColumnLayout(0, TQt::Vertical );
    gb_timeout->layout()->setSpacing( KDialog::spacingHint() );
    gb_timeout->layout()->setMargin( KDialog::marginHint() );
    gb_timeoutLayout = new TQGridLayout( gb_timeout->layout() );
    gb_timeoutLayout->setAlignment( TQt::AlignTop );
    spacer3_2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    gb_timeoutLayout->addMultiCell( spacer3_2, 0, 0, 1, 2 );

    lb_nodata = new TQLabel( gb_timeout, "lb_nodata" );

    gb_timeoutLayout->addWidget( lb_nodata, 0, 0 );

    lb_cannot = new TQLabel( gb_timeout, "lb_cannot" );

    gb_timeoutLayout->addMultiCellWidget( lb_cannot, 2, 2, 0, 1 );
    spacer4 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    gb_timeoutLayout->addItem( spacer4, 2, 2 );

    le_noresume = new KIntSpinBox( gb_timeout, "le_noresume" );
    le_noresume->setMaxValue( 3600 );
    le_noresume->setMinValue( 1 );

    gb_timeoutLayout->addWidget( le_noresume, 2, 3 );

    lb_or = new TQLabel( gb_timeout, "lb_or" );

    gb_timeoutLayout->addMultiCellWidget( lb_or, 1, 1, 0, 2 );

    le_nodata = new KIntSpinBox( gb_timeout, "le_nodata" );
    le_nodata->setMaxValue( 3600 );
    le_nodata->setMinValue( 1 );

    gb_timeoutLayout->addWidget( le_nodata, 0, 3 );
    DlgConnectionBaseLayout->addWidget( gb_timeout );

    gb_type = new TQGroupBox( this, "gb_type" );
    gb_type->setColumnLayout(0, TQt::Vertical );
    gb_type->layout()->setSpacing( KDialog::spacingHint() );
    gb_type->layout()->setMargin( KDialog::marginHint() );
    gb_typeLayout = new TQGridLayout( gb_type->layout() );
    gb_typeLayout->setAlignment( TQt::AlignTop );

    cmb_type = new KComboBox( false, gb_type, "cmb_type" );

    gb_typeLayout->addWidget( cmb_type, 0, 0 );

    cb_offlinemode = new TQCheckBox( gb_type, "cb_offlinemode" );

    gb_typeLayout->addWidget( cb_offlinemode, 1, 0 );
    spacer5 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    gb_typeLayout->addItem( spacer5, 0, 1 );

    lb_linknum = new TQLabel( gb_type, "lb_linknum" );

    gb_typeLayout->addWidget( lb_linknum, 0, 2 );

    le_linknum = new KIntSpinBox( gb_type, "le_linknum" );
    le_linknum->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, le_linknum->sizePolicy().hasHeightForWidth() ) );

    gb_typeLayout->addWidget( le_linknum, 0, 3 );
    DlgConnectionBaseLayout->addWidget( gb_type );
    languageChange();
    resize( TQSize(319, 355).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cb_onerror, TQ_SIGNAL( toggled(bool) ), lb_after, TQ_SLOT( setEnabled(bool) ) );
    connect( cb_onerror, TQ_SIGNAL( toggled(bool) ), le_after, TQ_SLOT( setEnabled(bool) ) );
    connect( cb_onerror, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_after, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_retries, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_onbroken, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_nodata, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_noresume, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( cmb_type, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_linknum, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_offlinemode, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( cmb_type, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( comboActivated(int) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DlgConnectionBase::languageChange()
{
    gb_reconnect->setTitle( tr2i18n( "Reconnect Options" ) );
    cb_onerror->setText( tr2i18n( "On login or timeout error" ) );
    lb_after->setText( tr2i18n( "Reconnect after:" ) );
    lb_retries->setText( tr2i18n( "Number of retries:" ) );
    le_after->setSuffix( tr2i18n( " min" ) );
    cb_onbroken->setText( tr2i18n( "On broken connection" ) );
    gb_timeout->setTitle( tr2i18n( "Timeout Options" ) );
    lb_nodata->setText( tr2i18n( "If no data arrives in:" ) );
    lb_cannot->setText( tr2i18n( "If server cannot resume:" ) );
    le_noresume->setSuffix( tr2i18n( " min" ) );
    lb_or->setText( tr2i18n( "or" ) );
    le_nodata->setSuffix( tr2i18n( " min" ) );
    gb_type->setTitle( tr2i18n( "Connection Type" ) );
    cmb_type->clear();
    cmb_type->insertItem( tr2i18n( "Permanent" ) );
    cmb_type->insertItem( tr2i18n( "Ethernet" ) );
    cmb_type->insertItem( tr2i18n( "PLIP" ) );
    cmb_type->insertItem( tr2i18n( "SLIP" ) );
    cmb_type->insertItem( tr2i18n( "PPP" ) );
    cmb_type->insertItem( tr2i18n( "ISDN" ) );
    cb_offlinemode->setText( tr2i18n( "Offline mode" ) );
    lb_linknum->setText( tr2i18n( "Link number:" ) );
}

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

TQMetaObject *DlgConnectionBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DlgConnectionBase( "DlgConnectionBase", &DlgConnectionBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* DlgConnectionBase::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 TQUMethod slot_1 = {"slotChanged", 0, 0 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"comboActivated", 1, param_slot_2 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotChanged()", &slot_1, TQMetaData::Protected },
	{ "comboActivated(int)", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"DlgConnectionBase", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_DlgConnectionBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool DlgConnectionBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: slotChanged(); break;
    case 2: comboActivated((int)static_QUType_int.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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