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

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

#include "smpppdcsprefs.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <smpppdlocationwidget.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "smpppdlocationwidget.h"

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

    tabWidget = new TQTabWidget( this, "tabWidget" );

    tab = new TQWidget( tabWidget, "tab" );
    tabLayout = new TQVBoxLayout( tab, 0, 0, "tabLayout"); 

    layout4 = new TQVBoxLayout( 0, 6, 6, "layout4"); 

    csMethod = new TQButtonGroup( tab, "csMethod" );
    csMethod->setColumnLayout(0, TQt::Vertical );
    csMethod->layout()->setSpacing( 6 );
    csMethod->layout()->setMargin( 6 );
    csMethodLayout = new TQVBoxLayout( csMethod->layout() );
    csMethodLayout->setAlignment( TQt::AlignTop );

    useNetstat = new TQRadioButton( csMethod, "useNetstat" );
    useNetstat->setChecked( true );
    csMethodLayout->addWidget( useNetstat );

    useSmpppd = new TQRadioButton( csMethod, "useSmpppd" );
    csMethodLayout->addWidget( useSmpppd );

    autoCSLayout = new TQHBoxLayout( 0, 0, 0, "autoCSLayout"); 

    autoCSTest = new KPushButton( csMethod, "autoCSTest" );
    autoCSLayout->addWidget( autoCSTest );
    spacer4 = new TQSpacerItem( 341, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    autoCSLayout->addItem( spacer4 );
    csMethodLayout->addLayout( autoCSLayout );
    layout4->addWidget( csMethod );

    smpppdPrefs = new TQGroupBox( tab, "smpppdPrefs" );
    smpppdPrefs->setEnabled( false );
    smpppdPrefs->setColumnLayout(0, TQt::Vertical );
    smpppdPrefs->layout()->setSpacing( 6 );
    smpppdPrefs->layout()->setMargin( 6 );
    smpppdPrefsLayout = new TQVBoxLayout( smpppdPrefs->layout() );
    smpppdPrefsLayout->setAlignment( TQt::AlignTop );

    SMPPPDLocation = new SMPPPDLocationWidget( smpppdPrefs, "SMPPPDLocation" );
    smpppdPrefsLayout->addWidget( SMPPPDLocation );
    layout4->addWidget( smpppdPrefs );
    spacer18 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout4->addItem( spacer18 );
    tabLayout->addLayout( layout4 );
    tabWidget->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget, "tab_2" );
    tabLayout_2 = new TQVBoxLayout( tab_2, 0, 6, "tabLayout_2"); 
    spacer4_2 = new TQSpacerItem( 20, 6, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    tabLayout_2->addItem( spacer4_2 );

    toIgnoreLabel = new TQLabel( tab_2, "toIgnoreLabel" );
    tabLayout_2->addWidget( toIgnoreLabel );

    accountList = new TDEListView( tab_2, "accountList" );
    accountList->addColumn( tr2i18n( "Account" ) );
    accountList->header()->setResizeEnabled( false, accountList->header()->count() - 1 );
    accountList->setAllColumnsShowFocus( true );
    accountList->setResizeMode( TDEListView::LastColumn );
    tabLayout_2->addWidget( accountList );
    tabWidget->insertTab( tab_2, TQString::fromLatin1("") );
    SMPPPDCSPrefsBaseLayout->addWidget( tabWidget );
    languageChange();
    resize( TQSize(476, 225).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( tabWidget, useNetstat );
    setTabOrder( useNetstat, autoCSTest );
    setTabOrder( autoCSTest, useSmpppd );
    setTabOrder( useSmpppd, accountList );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SMPPPDCSPrefsBase::languageChange()
{
    setCaption( tr2i18n( "SMPPPDCS Preferences" ) );
    csMethod->setTitle( tr2i18n( "Method of Connection Status Detection" ) );
    useNetstat->setText( tr2i18n( "&netstat - Standard method of connection status detection" ) );
    TQToolTip::add( useNetstat, tr2i18n( "Uses the netstat command to find a gateway; suitable on dial-up computers" ) );
    useSmpppd->setText( tr2i18n( "smpppd - Ad&vanced method of connection status detection" ) );
    TQToolTip::add( useSmpppd, tr2i18n( "Uses the smpppd on a gateway; suitable for a computer in a private network" ) );
    autoCSTest->setText( tr2i18n( "&Try to Detect Automatically" ) );
    TQToolTip::add( autoCSTest, tr2i18n( "Tries to find an appropriate connection method" ) );
    smpppdPrefs->setTitle( tr2i18n( "Location of the SMPPPD" ) );
    tabWidget->changeTab( tab, tr2i18n( "&Connection" ) );
    toIgnoreLabel->setText( tr2i18n( "Choose the accounts to ignore:" ) );
    accountList->header()->setLabel( 0, tr2i18n( "Account" ) );
    tabWidget->changeTab( tab_2, tr2i18n( "Acco&unts" ) );
}

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

TQMetaObject *SMPPPDCSPrefsBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SMPPPDCSPrefsBase( "SMPPPDCSPrefsBase", &SMPPPDCSPrefsBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* SMPPPDCSPrefsBase::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(
	"SMPPPDCSPrefsBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_SMPPPDCSPrefsBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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