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

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

#include "socksbase.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <ntqpushbutton.h>
#include <ntqcheckbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlabel.h>
#include <kurlrequester.h>
#include <ntqgroupbox.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    _c_enableSocks = new TQCheckBox( this, "_c_enableSocks" );
    SocksBaseLayout->addWidget( _c_enableSocks );

    bg = new TQButtonGroup( this, "bg" );
    bg->setEnabled( false );
    bg->setColumnLayout(0, TQt::Vertical );
    bg->layout()->setSpacing( KDialog::spacingHint() );
    bg->layout()->setMargin( KDialog::marginHint() );
    bgLayout = new TQGridLayout( bg->layout() );
    bgLayout->setAlignment( TQt::AlignTop );

    _c_detect = new TQRadioButton( bg, "_c_detect" );
    bg->insert( _c_detect, 1 );

    bgLayout->addWidget( _c_detect, 0, 0 );

    _c_NEC = new TQRadioButton( bg, "_c_NEC" );
    bg->insert( _c_NEC, 2 );

    bgLayout->addWidget( _c_NEC, 0, 1 );

    _c_custom = new TQRadioButton( bg, "_c_custom" );
    bg->insert( _c_custom, 4 );

    bgLayout->addMultiCellWidget( _c_custom, 1, 1, 0, 2 );

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

    _c_customLabel = new TQLabel( bg, "_c_customLabel" );
    _c_customLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)1, 0, 0, _c_customLabel->sizePolicy().hasHeightForWidth() ) );
    _c_customLabel->setIndent( 20 );
    Layout6->addWidget( _c_customLabel );

    _c_customPath = new KURLRequester( bg, "_c_customPath" );
    _c_customPath->setMinimumSize( TQSize( 0, 20 ) );
    Layout6->addWidget( _c_customPath );

    bgLayout->addMultiCellLayout( Layout6, 2, 2, 0, 2 );

    _c_Dante = new TQRadioButton( bg, "_c_Dante" );
    bg->insert( _c_Dante, 3 );

    bgLayout->addWidget( _c_Dante, 0, 2 );
    SocksBaseLayout->addWidget( bg );

    _c_addPaths = new TQGroupBox( this, "_c_addPaths" );
    _c_addPaths->setEnabled( false );
    _c_addPaths->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, _c_addPaths->sizePolicy().hasHeightForWidth() ) );
    _c_addPaths->setColumnLayout(0, TQt::Vertical );
    _c_addPaths->layout()->setSpacing( KDialog::spacingHint() );
    _c_addPaths->layout()->setMargin( KDialog::marginHint() );
    _c_addPathsLayout = new TQVBoxLayout( _c_addPaths->layout() );
    _c_addPathsLayout->setAlignment( TQt::AlignTop );

    _c_libs = new TQListView( _c_addPaths, "_c_libs" );
    _c_libs->addColumn( tr2i18n( "Path" ) );
    _c_libs->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, _c_libs->sizePolicy().hasHeightForWidth() ) );
    _c_addPathsLayout->addWidget( _c_libs );

    _c_newPath = new KURLRequester( _c_addPaths, "_c_newPath" );
    _c_newPath->setMinimumSize( TQSize( 0, 25 ) );
    _c_addPathsLayout->addWidget( _c_newPath );

    Layout1 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout1"); 
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum );
    Layout1->addItem( Spacer1 );

    _c_add = new TQPushButton( _c_addPaths, "_c_add" );
    Layout1->addWidget( _c_add );

    _c_remove = new TQPushButton( _c_addPaths, "_c_remove" );
    Layout1->addWidget( _c_remove );
    _c_addPathsLayout->addLayout( Layout1 );
    SocksBaseLayout->addWidget( _c_addPaths );

    Layout2 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout2"); 
    Spacer2 = new TQSpacerItem( 20, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout2->addItem( Spacer2 );

    _c_test = new TQPushButton( this, "_c_test" );
    _c_test->setEnabled( false );
    Layout2->addWidget( _c_test );
    SocksBaseLayout->addLayout( Layout2 );
    languageChange();
    resize( TQSize(455, 402).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( _c_enableSocks, TQ_SIGNAL( toggled(bool) ), bg, TQ_SLOT( setEnabled(bool) ) );
    connect( _c_enableSocks, TQ_SIGNAL( toggled(bool) ), _c_addPaths, TQ_SLOT( setEnabled(bool) ) );
    connect( _c_enableSocks, TQ_SIGNAL( toggled(bool) ), _c_test, TQ_SLOT( setEnabled(bool) ) );

    // buddies
    _c_customLabel->setBuddy( _c_customPath );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SocksBase::languageChange()
{
    setCaption( tr2i18n( "SOCKS" ) );
    _c_enableSocks->setText( tr2i18n( "&Enable SOCKS support" ) );
    TQWhatsThis::add( _c_enableSocks, tr2i18n( "Check this to enable SOCKS4 and SOCKS5 support in TDE applications and I/O subsystems." ) );
    bg->setTitle( tr2i18n( "SOCKS Implementation" ) );
    _c_detect->setText( tr2i18n( "A&uto detect" ) );
    TQWhatsThis::add( _c_detect, tr2i18n( "If you select Autodetect, then TDE will automatically search for an implementation of SOCKS on your computer." ) );
    _c_NEC->setText( tr2i18n( "&NEC SOCKS" ) );
    TQWhatsThis::add( _c_NEC, tr2i18n( "This will force TDE to use NEC SOCKS if it can be found." ) );
    _c_custom->setText( tr2i18n( "Use &custom library" ) );
    TQWhatsThis::add( _c_custom, tr2i18n( "Select custom if you wish to use an unlisted SOCKS library. Please note that this may not always work as it depends on the API of the library which you specify (below)." ) );
    _c_customLabel->setText( tr2i18n( "&Path:" ) );
    TQWhatsThis::add( _c_customPath, tr2i18n( "Enter the path to an unsupported SOCKS library." ) );
    _c_Dante->setText( tr2i18n( "&Dante" ) );
    TQWhatsThis::add( _c_Dante, tr2i18n( "This will force TDE to use Dante if it can be found." ) );
    _c_addPaths->setTitle( tr2i18n( "Additional Library Search Paths" ) );
    TQWhatsThis::add( _c_addPaths, tr2i18n( "Here you can specify additional directories to search for the SOCKS libraries. /usr/lib, /usr/local/lib, /usr/local/socks5/lib and /opt/socks5/lib are already searched by default." ) );
    _c_libs->header()->setLabel( 0, tr2i18n( "Path" ) );
    TQWhatsThis::add( _c_libs, tr2i18n( "This is the list of additional paths that will be searched." ) );
    _c_add->setText( tr2i18n( "&Add" ) );
    _c_remove->setText( tr2i18n( "&Remove" ) );
    _c_test->setText( tr2i18n( "&Test" ) );
    TQWhatsThis::add( _c_test, tr2i18n( "Click here to test SOCKS support." ) );
}

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

TQMetaObject *SocksBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SocksBase( "SocksBase", &SocksBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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