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

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

#include "kproxydlg_ui.h"

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

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

    gbConfigure = new TQButtonGroup( this, "gbConfigure" );
    gbConfigure->setFrameShape( TQButtonGroup::NoFrame );
    gbConfigure->setLineWidth( 0 );
    gbConfigure->setExclusive( true );
    gbConfigure->setColumnLayout(0, TQt::Vertical );
    gbConfigure->layout()->setSpacing( KDialog::spacingHint() );
    gbConfigure->layout()->setMargin( 0 );
    gbConfigureLayout = new TQVBoxLayout( gbConfigure->layout() );
    gbConfigureLayout->setAlignment( TQt::AlignTop );

    rbNoProxy = new TQRadioButton( gbConfigure, "rbNoProxy" );
    rbNoProxy->setChecked( true );
    gbConfigureLayout->addWidget( rbNoProxy );

    rbAutoDiscover = new TQRadioButton( gbConfigure, "rbAutoDiscover" );
    rbAutoDiscover->setEnabled( true );
    gbConfigureLayout->addWidget( rbAutoDiscover );

    rbAutoScript = new TQRadioButton( gbConfigure, "rbAutoScript" );
    rbAutoScript->setEnabled( true );
    gbConfigureLayout->addWidget( rbAutoScript );

    layout5 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout5"); 
    spacer2 = new TQSpacerItem( 16, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout5->addItem( spacer2 );

    location = new KURLRequester( gbConfigure, "location" );
    location->setEnabled( false );
    location->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, location->sizePolicy().hasHeightForWidth() ) );
    layout5->addWidget( location );
    gbConfigureLayout->addLayout( layout5 );

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

    rbEnvVar = new TQRadioButton( gbConfigure, "rbEnvVar" );
    rbEnvVar->setEnabled( true );
    rbEnvVar->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, rbEnvVar->sizePolicy().hasHeightForWidth() ) );
    layout7->addWidget( rbEnvVar );

    pbEnvSetup = new TQPushButton( gbConfigure, "pbEnvSetup" );
    pbEnvSetup->setEnabled( true );
    layout7->addWidget( pbEnvSetup );
    gbConfigureLayout->addLayout( layout7 );

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

    rbManual = new TQRadioButton( gbConfigure, "rbManual" );
    rbManual->setEnabled( true );
    rbManual->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, rbManual->sizePolicy().hasHeightForWidth() ) );
    layout6->addWidget( rbManual );

    pbManSetup = new TQPushButton( gbConfigure, "pbManSetup" );
    pbManSetup->setEnabled( true );
    layout6->addWidget( pbManSetup );
    gbConfigureLayout->addLayout( layout6 );
    ProxyDlgUILayout->addWidget( gbConfigure );

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

    rbPrompt = new TQRadioButton( gbAuth, "rbPrompt" );
    rbPrompt->setChecked( true );
    gbAuthLayout->addWidget( rbPrompt );

    rbPresetLogin = new TQRadioButton( gbAuth, "rbPresetLogin" );
    rbPresetLogin->setEnabled( false );
    gbAuthLayout->addWidget( rbPresetLogin );

    layout5_2 = new TQGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout5_2"); 
    spacer5 = new TQSpacerItem( 16, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout5_2->addMultiCell( spacer5, 0, 1, 0, 0 );

    lePassword = new KLineEdit( gbAuth, "lePassword" );
    lePassword->setEnabled( false );
    lePassword->setEchoMode( KLineEdit::Password );

    layout5_2->addWidget( lePassword, 1, 2 );

    leUsername = new KLineEdit( gbAuth, "leUsername" );
    leUsername->setEnabled( false );

    layout5_2->addWidget( leUsername, 0, 2 );

    lbPassword = new TQLabel( gbAuth, "lbPassword" );
    lbPassword->setEnabled( false );

    layout5_2->addWidget( lbPassword, 1, 1 );

    lbUsername = new TQLabel( gbAuth, "lbUsername" );
    lbUsername->setEnabled( false );

    layout5_2->addWidget( lbUsername, 0, 1 );
    gbAuthLayout->addLayout( layout5_2 );
    ProxyDlgUILayout->addWidget( gbAuth );

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

    cbPersConn = new TQCheckBox( gbOptions, "cbPersConn" );
    gbOptionsLayout->addWidget( cbPersConn );
    ProxyDlgUILayout->addWidget( gbOptions );
    languageChange();
    resize( TQSize(418, 420).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( rbPresetLogin, TQ_SIGNAL( toggled(bool) ), leUsername, TQ_SLOT( setEnabled(bool) ) );
    connect( rbPresetLogin, TQ_SIGNAL( toggled(bool) ), lbUsername, TQ_SLOT( setEnabled(bool) ) );
    connect( rbPresetLogin, TQ_SIGNAL( toggled(bool) ), lePassword, TQ_SLOT( setEnabled(bool) ) );
    connect( rbPresetLogin, TQ_SIGNAL( toggled(bool) ), lbPassword, TQ_SLOT( setEnabled(bool) ) );
    connect( rbAutoScript, TQ_SIGNAL( toggled(bool) ), location, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KProxyDialogUI::languageChange()
{
    TQWhatsThis::add( this, tr2i18n( "<qt>\n"
"Setup proxy configuration.\n"
"<p>\n"
"A proxy server is an intermediate machine that sits between your computer and the Internet and provides services such as web page caching and filtering. Caching proxy servers give you faster access to web sites you have already visited by locally storing or caching those pages; filtering proxy servers usually provide the ability to block out requests for ads, spam, or anything else you want to block.\n"
"<p>\n"
"If you are uncertain whether or not you need to use a proxy server to connect to the Internet, consult your Internet service provider's setup guide or your system administrator.\n"
"</qt>" ) );
    gbConfigure->setTitle( TQString::null );
    rbNoProxy->setText( tr2i18n( "Connect to the &Internet directly" ) );
    TQWhatsThis::add( rbNoProxy, tr2i18n( "Connect to the Internet directly." ) );
    rbAutoDiscover->setText( tr2i18n( "A&utomatically detect proxy configuration" ) );
    TQWhatsThis::add( rbAutoDiscover, tr2i18n( "<qt>\n"
"Automatically detect and configure the proxy settings.<p>\n"
"Automatic detection is performed using the <b>Web Proxy Auto-Discovery Protocol (WPAD)</b>.<p>\n"
"<b>NOTE:</b> This option might not work properly or not work at all in some UNIX/Linux distributions. If you encounter a problem when using this option, please contact the Trinity developers or file a bug report at http://bugs.trinitydesktop.org/.\n"
"</qt>" ) );
    rbAutoScript->setText( tr2i18n( "U&se the following proxy configuration URL" ) );
    TQWhatsThis::add( rbAutoScript, tr2i18n( "Use the specified proxy script URL to configure the proxy settings." ) );
    TQWhatsThis::add( location, tr2i18n( "Enter the address for the proxy configuration script." ) );
    rbEnvVar->setText( tr2i18n( "Use preset proxy environment &variables" ) );
    TQWhatsThis::add( rbEnvVar, tr2i18n( "<qt>\n"
"Use environment variables to configure the proxy settings.<p>\n"
"Environment variables such as <b>HTTP_PROXY</b> and <b>NO_PROXY</b> are usually used in multi-user UNIX installations, where both graphical and non-graphical applications need to share the same proxy configuration information.\n"
"</qt>" ) );
    pbEnvSetup->setText( tr2i18n( "Setup..." ) );
    TQWhatsThis::add( pbEnvSetup, tr2i18n( "Show the proxy environment variable configuration dialog." ) );
    rbManual->setText( tr2i18n( "&Manually specify the proxy settings" ) );
    TQWhatsThis::add( rbManual, tr2i18n( "Manually enter proxy server configuration information." ) );
    pbManSetup->setText( tr2i18n( "Setup..." ) );
    TQWhatsThis::add( pbManSetup, tr2i18n( "Show the manual proxy configuration dialog." ) );
    gbAuth->setTitle( tr2i18n( "Authori&zation" ) );
    rbPrompt->setText( tr2i18n( "Prompt as &needed" ) );
    TQWhatsThis::add( rbPrompt, tr2i18n( "Prompt for login information whenever it is required." ) );
    rbPresetLogin->setText( tr2i18n( "Use the following lo&gin information." ) );
    TQWhatsThis::add( rbPresetLogin, tr2i18n( "Use the information below to login into proxy servers as needed." ) );
    TQWhatsThis::add( lePassword, tr2i18n( "Login password." ) );
    TQWhatsThis::add( leUsername, tr2i18n( "Login name." ) );
    lbPassword->setText( tr2i18n( "Password:" ) );
    TQWhatsThis::add( lbPassword, tr2i18n( "Login password." ) );
    lbUsername->setText( tr2i18n( "Username:" ) );
    TQWhatsThis::add( lbUsername, tr2i18n( "Login name." ) );
    gbOptions->setTitle( tr2i18n( "O&ptions" ) );
    cbPersConn->setText( tr2i18n( "Use persistent connections to proxy" ) );
    TQWhatsThis::add( cbPersConn, tr2i18n( "<qt>\n"
"Use persistent proxy connection.<p>\n"
"Although a persistent proxy connection is faster, note that it only works correctly with proxies that are fully HTTP 1.1 compliant. Do <b>not</b> use this option in combination with non-HTTP 1.1 compliant proxy servers such as JunkBuster and WWWOfle.\n"
"</qt>" ) );
}

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

TQMetaObject *KProxyDialogUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KProxyDialogUI( "KProxyDialogUI", &KProxyDialogUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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