#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/manualproxy_ui.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "manualproxy_ui.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <klineedit.h>
#include <knuminput.h>
#include <qcheckbox.h>
#include <klistbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

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

    gbServers = new QGroupBox( this, "gbServers" );
    gbServers->setColumnLayout(0, Qt::Vertical );
    gbServers->layout()->setSpacing( 6 );
    gbServers->layout()->setMargin( 11 );
    gbServersLayout = new QGridLayout( gbServers->layout() );
    gbServersLayout->setAlignment( Qt::AlignTop );

    lbFtp = new QLabel( gbServers, "lbFtp" );
    lbFtp->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lbFtp->sizePolicy().hasHeightForWidth() ) );

    gbServersLayout->addWidget( lbFtp, 2, 0 );

    lbHttps = new QLabel( gbServers, "lbHttps" );
    lbHttps->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lbHttps->sizePolicy().hasHeightForWidth() ) );

    gbServersLayout->addWidget( lbHttps, 1, 0 );

    lbHttp = new QLabel( gbServers, "lbHttp" );
    lbHttp->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lbHttp->sizePolicy().hasHeightForWidth() ) );

    gbServersLayout->addWidget( lbHttp, 0, 0 );

    leHttp = new KLineEdit( gbServers, "leHttp" );

    gbServersLayout->addWidget( leHttp, 0, 1 );

    leHttps = new KLineEdit( gbServers, "leHttps" );

    gbServersLayout->addWidget( leHttps, 1, 1 );

    leFtp = new KLineEdit( gbServers, "leFtp" );

    gbServersLayout->addWidget( leFtp, 2, 1 );

    sbFtp = new KIntSpinBox( gbServers, "sbFtp" );
    sbFtp->setMaxValue( 65536 );

    gbServersLayout->addWidget( sbFtp, 2, 2 );

    sbHttps = new KIntSpinBox( gbServers, "sbHttps" );
    sbHttps->setMaxValue( 65536 );

    gbServersLayout->addWidget( sbHttps, 1, 2 );

    sbHttp = new KIntSpinBox( gbServers, "sbHttp" );
    sbHttp->setMaximumSize( QSize( 32767, 32767 ) );
    sbHttp->setMaxValue( 65536 );

    gbServersLayout->addWidget( sbHttp, 0, 2 );
    spacer1 = new QSpacerItem( 51, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
    gbServersLayout->addItem( spacer1, 3, 0 );

    cbSameProxy = new QCheckBox( gbServers, "cbSameProxy" );

    gbServersLayout->addMultiCellWidget( cbSameProxy, 3, 3, 1, 2 );

    pbCopyDown = new QPushButton( gbServers, "pbCopyDown" );

    gbServersLayout->addWidget( pbCopyDown, 0, 3 );
    ManualProxyDlgUILayout->addWidget( gbServers );

    gbExceptions = new QGroupBox( this, "gbExceptions" );
    gbExceptions->setColumnLayout(0, Qt::Vertical );
    gbExceptions->layout()->setSpacing( 6 );
    gbExceptions->layout()->setMargin( 11 );
    gbExceptionsLayout = new QVBoxLayout( gbExceptions->layout() );
    gbExceptionsLayout->setAlignment( Qt::AlignTop );

    cbReverseProxy = new QCheckBox( gbExceptions, "cbReverseProxy" );
    gbExceptionsLayout->addWidget( cbReverseProxy );

    layout2 = new QGridLayout( 0, 1, 1, 0, 6, "layout2"); 

    pbDeleteAll = new QPushButton( gbExceptions, "pbDeleteAll" );
    pbDeleteAll->setEnabled( FALSE );

    layout2->addWidget( pbDeleteAll, 3, 1 );

    pbDelete = new QPushButton( gbExceptions, "pbDelete" );
    pbDelete->setEnabled( FALSE );

    layout2->addWidget( pbDelete, 2, 1 );

    pbNew = new QPushButton( gbExceptions, "pbNew" );

    layout2->addWidget( pbNew, 0, 1 );

    pbChange = new QPushButton( gbExceptions, "pbChange" );
    pbChange->setEnabled( FALSE );

    layout2->addWidget( pbChange, 1, 1 );
    spacer2 = new QSpacerItem( 20, 114, QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout2->addItem( spacer2, 4, 1 );

    lbExceptions = new KListBox( gbExceptions, "lbExceptions" );

    layout2->addMultiCellWidget( lbExceptions, 0, 4, 0, 0 );
    gbExceptionsLayout->addLayout( layout2 );
    ManualProxyDlgUILayout->addWidget( gbExceptions );
    languageChange();
    resize( QSize(489, 438).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( leHttp, sbHttp );
    setTabOrder( sbHttp, leHttps );
    setTabOrder( leHttps, sbHttps );
    setTabOrder( sbHttps, leFtp );
    setTabOrder( leFtp, sbFtp );
    setTabOrder( sbFtp, cbSameProxy );
    setTabOrder( cbSameProxy, pbCopyDown );
    setTabOrder( pbCopyDown, cbReverseProxy );
    setTabOrder( cbReverseProxy, pbNew );
    setTabOrder( pbNew, pbChange );
    setTabOrder( pbChange, pbDelete );
    setTabOrder( pbDelete, pbDeleteAll );

    // buddies
    lbFtp->setBuddy( leFtp );
    lbHttps->setBuddy( leHttps );
    lbHttp->setBuddy( leHttp );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ManualProxyDlgUI::languageChange()
{
    gbServers->setTitle( tr2i18n( "Ser&vers" ) );
    lbFtp->setText( tr2i18n( "&FTP:" ) );
    lbHttps->setText( tr2i18n( "HTTP&S:" ) );
    lbHttp->setText( tr2i18n( "H&TTP:" ) );
    QWhatsThis::add( leHttp, tr2i18n( "Enter the address of the HTTP proxy server." ) );
    QWhatsThis::add( leHttps, tr2i18n( "Enter the address of the HTTPS proxy server." ) );
    QWhatsThis::add( leFtp, tr2i18n( "Enter the address of the FTP proxy server." ) );
    QWhatsThis::add( sbFtp, tr2i18n( "Enter the port number of the FTP proxy server. Default 8080. Another common value is 3128." ) );
    QWhatsThis::add( sbHttps, tr2i18n( "Enter the port number of the HTTP proxy server. Default is 8080. Another common value is 3128." ) );
    QWhatsThis::add( sbHttp, tr2i18n( "Enter the port number of the HTTP proxy server. Default is 8080. Another common value is 3128." ) );
    cbSameProxy->setText( tr2i18n( "&Use the same proxy server for all protocols" ) );
    pbCopyDown->setText( QString::null );
    gbExceptions->setTitle( tr2i18n( "E&xceptions" ) );
    cbReverseProxy->setText( tr2i18n( "Use proxy only for entries in this list" ) );
    QWhatsThis::add( cbReverseProxy, tr2i18n( "<qt>\n"
"Reverse the use of the exception list. Checking this box will result in the proxy servers being used only when the requested URL matches one of the addresses listed here.<p>This feature is useful if all you want or need is to use a proxy server  for a few specific sites.<p>If you have more complex requirements you might want to use a configuration script.\n"
"</qt>" ) );
    pbDeleteAll->setText( tr2i18n( "D&elete All" ) );
    QWhatsThis::add( pbDeleteAll, tr2i18n( "Remove all proxy exception addresses from the list." ) );
    pbDelete->setText( tr2i18n( "De&lete" ) );
    QWhatsThis::add( pbDelete, tr2i18n( "Remove the selected proxy exception address from the list." ) );
    pbNew->setText( tr2i18n( "&New..." ) );
    QWhatsThis::add( pbNew, tr2i18n( "Add new proxy exception address to the list." ) );
    pbChange->setText( tr2i18n( "C&hange..." ) );
    QWhatsThis::add( pbChange, tr2i18n( "Change the selected proxy exception address." ) );
}

#include "manualproxy_ui.moc"
