#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdebase3/kdebase3-3.5.10-11.x86_64/src/kdebase-3.5.10/kcontrol/kio/kproxydlg_ui.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kproxydlg_ui.h"

#include <qvariant.h>
#include <kdialog.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <kurlrequester.h>
#include <klineedit.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kpushbutton.h"

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

    gbConfigure = new QButtonGroup( this, "gbConfigure" );
    gbConfigure->setFrameShape( QButtonGroup::NoFrame );
    gbConfigure->setLineWidth( 0 );
    gbConfigure->setExclusive( TRUE );
    gbConfigure->setColumnLayout(0, Qt::Vertical );
    gbConfigure->layout()->setSpacing( KDialog::spacingHint() );
    gbConfigure->layout()->setMargin( 0 );
    gbConfigureLayout = new QVBoxLayout( gbConfigure->layout() );
    gbConfigureLayout->setAlignment( Qt::AlignTop );

    rbNoProxy = new QRadioButton( gbConfigure, "rbNoProxy" );
    rbNoProxy->setChecked( TRUE );
    gbConfigureLayout->addWidget( rbNoProxy );

    rbAutoDiscover = new QRadioButton( gbConfigure, "rbAutoDiscover" );
    rbAutoDiscover->setEnabled( TRUE );
    gbConfigureLayout->addWidget( rbAutoDiscover );

    rbAutoScript = new QRadioButton( gbConfigure, "rbAutoScript" );
    rbAutoScript->setEnabled( TRUE );
    gbConfigureLayout->addWidget( rbAutoScript );

    layout5 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout5"); 
    spacer2 = new QSpacerItem( 16, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    layout5->addItem( spacer2 );

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

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

    rbEnvVar = new QRadioButton( gbConfigure, "rbEnvVar" );
    rbEnvVar->setEnabled( TRUE );
    rbEnvVar->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, rbEnvVar->sizePolicy().hasHeightForWidth() ) );
    layout7->addWidget( rbEnvVar );

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

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

    rbManual = new QRadioButton( gbConfigure, "rbManual" );
    rbManual->setEnabled( TRUE );
    rbManual->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, rbManual->sizePolicy().hasHeightForWidth() ) );
    layout6->addWidget( rbManual );

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

    gbAuth = new QButtonGroup( this, "gbAuth" );
    gbAuth->setEnabled( FALSE );
    gbAuth->setColumnLayout(0, Qt::Vertical );
    gbAuth->layout()->setSpacing( KDialog::spacingHint() );
    gbAuth->layout()->setMargin( KDialog::marginHint() );
    gbAuthLayout = new QVBoxLayout( gbAuth->layout() );
    gbAuthLayout->setAlignment( Qt::AlignTop );

    rbPrompt = new QRadioButton( gbAuth, "rbPrompt" );
    rbPrompt->setChecked( TRUE );
    gbAuthLayout->addWidget( rbPrompt );

    rbPresetLogin = new QRadioButton( gbAuth, "rbPresetLogin" );
    rbPresetLogin->setEnabled( FALSE );
    gbAuthLayout->addWidget( rbPresetLogin );

    layout5_2 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout5_2"); 
    spacer5 = new QSpacerItem( 16, 20, QSizePolicy::Fixed, QSizePolicy::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 QLabel( gbAuth, "lbPassword" );
    lbPassword->setEnabled( FALSE );

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

    lbUsername = new QLabel( gbAuth, "lbUsername" );
    lbUsername->setEnabled( FALSE );

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

    gbOptions = new QButtonGroup( this, "gbOptions" );
    gbOptions->setEnabled( FALSE );
    gbOptions->setColumnLayout(0, Qt::Vertical );
    gbOptions->layout()->setSpacing( KDialog::spacingHint() );
    gbOptions->layout()->setMargin( KDialog::marginHint() );
    gbOptionsLayout = new QVBoxLayout( gbOptions->layout() );
    gbOptionsLayout->setAlignment( Qt::AlignTop );

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

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

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KProxyDialogUI::languageChange()
{
    QWhatsThis::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( QString::null );
    rbNoProxy->setText( tr2i18n( "Connect to the &Internet directly" ) );
    QWhatsThis::add( rbNoProxy, tr2i18n( "Connect to the Internet directly." ) );
    rbAutoDiscover->setText( tr2i18n( "A&utomatically detect proxy configuration" ) );
    QWhatsThis::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 check the FAQ section at http://konqueror.kde.org.\n"
"</qt>" ) );
    rbAutoScript->setText( tr2i18n( "U&se the following proxy configuration URL" ) );
    QWhatsThis::add( rbAutoScript, tr2i18n( "Use the specified proxy script URL to configure the proxy settings." ) );
    QWhatsThis::add( location, tr2i18n( "Enter the address for the proxy configuration script." ) );
    rbEnvVar->setText( tr2i18n( "Use preset proxy environment &variables" ) );
    QWhatsThis::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..." ) );
    QWhatsThis::add( pbEnvSetup, tr2i18n( "Show the proxy environment variable configuration dialog." ) );
    rbManual->setText( tr2i18n( "&Manually specify the proxy settings" ) );
    QWhatsThis::add( rbManual, tr2i18n( "Manually enter proxy server configuration information." ) );
    pbManSetup->setText( tr2i18n( "Setup..." ) );
    QWhatsThis::add( pbManSetup, tr2i18n( "Show the manual proxy configuration dialog." ) );
    gbAuth->setTitle( tr2i18n( "Authori&zation" ) );
    rbPrompt->setText( tr2i18n( "Prompt as &needed" ) );
    QWhatsThis::add( rbPrompt, tr2i18n( "Prompt for login information whenever it is required." ) );
    rbPresetLogin->setText( tr2i18n( "Use the following lo&gin information." ) );
    QWhatsThis::add( rbPresetLogin, tr2i18n( "Use the information below to login into proxy servers as needed." ) );
    QWhatsThis::add( lePassword, tr2i18n( "Login password." ) );
    QWhatsThis::add( leUsername, tr2i18n( "Login name." ) );
    lbPassword->setText( tr2i18n( "Password:" ) );
    QWhatsThis::add( lbPassword, tr2i18n( "Login password." ) );
    lbUsername->setText( tr2i18n( "Username:" ) );
    QWhatsThis::add( lbUsername, tr2i18n( "Login name." ) );
    gbOptions->setTitle( tr2i18n( "O&ptions" ) );
    cbPersConn->setText( tr2i18n( "Use persistent connections to proxy" ) );
    QWhatsThis::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>" ) );
}

#include "kproxydlg_ui.moc"
