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

#include "useragentdlg_ui.h"

#include <qvariant.h>
#include <kdialog.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <klineedit.h>
#include <qgroupbox.h>
#include <qheader.h>
#include <klistview.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "klineedit.h"
#include "klistview.h"

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

    cbSendUAString = new QCheckBox( this, "cbSendUAString" );
    cbSendUAString->setChecked( TRUE );
    UserAgentDlgUILayout->addWidget( cbSendUAString );

    gbDefaultId = new QButtonGroup( this, "gbDefaultId" );
    gbDefaultId->setEnabled( TRUE );
    gbDefaultId->setColumnLayout(0, Qt::Vertical );
    gbDefaultId->layout()->setSpacing( KDialog::spacingHint() );
    gbDefaultId->layout()->setMargin( 11 );
    gbDefaultIdLayout = new QVBoxLayout( gbDefaultId->layout() );
    gbDefaultIdLayout->setAlignment( Qt::AlignTop );

    leDefaultId = new KLineEdit( gbDefaultId, "leDefaultId" );
    QFont leDefaultId_font(  leDefaultId->font() );
    leDefaultId_font.setBold( TRUE );
    leDefaultId->setFont( leDefaultId_font ); 
    leDefaultId->setFrameShape( KLineEdit::Box );
    leDefaultId->setFrameShadow( KLineEdit::Raised );
    leDefaultId->setLineWidth( 0 );
    leDefaultId->setReadOnly( TRUE );
    gbDefaultIdLayout->addWidget( leDefaultId );

    cbOS = new QCheckBox( gbDefaultId, "cbOS" );
    gbDefaultIdLayout->addWidget( cbOS );

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

    cbOSVersion = new QCheckBox( gbDefaultId, "cbOSVersion" );
    cbOSVersion->setEnabled( FALSE );
    layout2->addWidget( cbOSVersion );
    gbDefaultIdLayout->addLayout( layout2 );

    cbPlatform = new QCheckBox( gbDefaultId, "cbPlatform" );
    gbDefaultIdLayout->addWidget( cbPlatform );

    cbProcessorType = new QCheckBox( gbDefaultId, "cbProcessorType" );
    gbDefaultIdLayout->addWidget( cbProcessorType );

    cbLanguage = new QCheckBox( gbDefaultId, "cbLanguage" );
    gbDefaultIdLayout->addWidget( cbLanguage );
    UserAgentDlgUILayout->addWidget( gbDefaultId );

    gbDomainPolicy = new QGroupBox( this, "gbDomainPolicy" );
    gbDomainPolicy->setEnabled( TRUE );
    gbDomainPolicy->setColumnLayout(0, Qt::Vertical );
    gbDomainPolicy->layout()->setSpacing( KDialog::spacingHint() );
    gbDomainPolicy->layout()->setMargin( 11 );
    gbDomainPolicyLayout = new QHBoxLayout( gbDomainPolicy->layout() );
    gbDomainPolicyLayout->setAlignment( Qt::AlignTop );

    lvDomainPolicyList = new KListView( gbDomainPolicy, "lvDomainPolicyList" );
    lvDomainPolicyList->addColumn( tr2i18n( "Site Name" ) );
    lvDomainPolicyList->addColumn( tr2i18n( "Identification" ) );
    lvDomainPolicyList->addColumn( tr2i18n( "User Agent" ) );
    lvDomainPolicyList->setProperty( "selectionMode", "Extended" );
    lvDomainPolicyList->setAllColumnsShowFocus( TRUE );
    lvDomainPolicyList->setShowSortIndicator( TRUE );
    lvDomainPolicyList->setResizeMode( KListView::AllColumns );
    lvDomainPolicyList->setTreeStepSize( 0 );
    gbDomainPolicyLayout->addWidget( lvDomainPolicyList );

    layout1 = new QVBoxLayout( 0, 0, KDialog::spacingHint(), "layout1"); 

    pbNew = new QPushButton( gbDomainPolicy, "pbNew" );
    layout1->addWidget( pbNew );

    pbChange = new QPushButton( gbDomainPolicy, "pbChange" );
    layout1->addWidget( pbChange );

    pbDelete = new QPushButton( gbDomainPolicy, "pbDelete" );
    layout1->addWidget( pbDelete );

    pbDeleteAll = new QPushButton( gbDomainPolicy, "pbDeleteAll" );
    layout1->addWidget( pbDeleteAll );
    spacer1 = new QSpacerItem( 21, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout1->addItem( spacer1 );
    gbDomainPolicyLayout->addLayout( layout1 );
    UserAgentDlgUILayout->addWidget( gbDomainPolicy );
    languageChange();
    resize( QSize(395, 470).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cbOS, SIGNAL( toggled(bool) ), cbOSVersion, SLOT( setEnabled(bool) ) );
    connect( cbSendUAString, SIGNAL( toggled(bool) ), gbDefaultId, SLOT( setEnabled(bool) ) );
    connect( cbSendUAString, SIGNAL( toggled(bool) ), gbDomainPolicy, SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void UserAgentDlgUI::languageChange()
{
    QWhatsThis::add( this, tr2i18n( "<qt>\n"
"Here you can modify the default browser-identification text or set a site <code>(eg. www.kde.org)</code> or a domain <code>(eg. kde.org)</code> specific identification text.<p>\n"
"To add a new site specific identification text, click the <code>New</code> button and supply the necessary information. To change an existing site specific entry, click on the <code>Change</code> button. The <code>Delete</code> button will remove the selected site specific identification text, causing the setting to be used for that site or domain.\n"
"</qt>" ) );
    cbSendUAString->setText( tr2i18n( "&Send identification" ) );
    QWhatsThis::add( cbSendUAString, tr2i18n( "<qt>\n"
"Send the browser identification to web sites.<p>\n"
"<u>NOTE:</u> Many sites rely on this information to display pages properly, hence, it is highly recommended that you do not totally disable this feature but rather customize it.<p>\n"
"By default, only minimal identification information is sent to remote sites. The identification text that will be sent is shown below.\n"
"</qt>" ) );
    gbDefaultId->setTitle( tr2i18n( "Default Identification" ) );
    QWhatsThis::add( gbDefaultId, tr2i18n( "The browser identification text sent to the sites you visit. Use the provided options to customize it." ) );
    QWhatsThis::add( leDefaultId, tr2i18n( "The browser identification text sent to the sites you visit. You can customize it using the options provided below." ) );
    cbOS->setText( tr2i18n( "Add operating s&ystem name" ) );
    QWhatsThis::add( cbOS, tr2i18n( "Includes your operating system's name in the browser identification text." ) );
    cbOSVersion->setText( tr2i18n( "Add operating system &version" ) );
    QWhatsThis::add( cbOSVersion, tr2i18n( "Includes your operating system's version number in the browser identification text." ) );
    cbPlatform->setText( tr2i18n( "Add &platform name" ) );
    QWhatsThis::add( cbPlatform, tr2i18n( "Includes your platform type in the browser identification text" ) );
    cbProcessorType->setText( tr2i18n( "Add &machine (processor) type" ) );
    QWhatsThis::add( cbProcessorType, tr2i18n( "Includes your machine's CPU type in the browser identification text." ) );
    cbLanguage->setText( tr2i18n( "Add lang&uage information" ) );
    QWhatsThis::add( cbLanguage, tr2i18n( "Includes your language settings in the browser identification text." ) );
    gbDomainPolicy->setTitle( tr2i18n( "Site Specific Identification" ) );
    lvDomainPolicyList->header()->setLabel( 0, tr2i18n( "Site Name" ) );
    lvDomainPolicyList->header()->setLabel( 1, tr2i18n( "Identification" ) );
    lvDomainPolicyList->header()->setLabel( 2, tr2i18n( "User Agent" ) );
    QWhatsThis::add( lvDomainPolicyList, tr2i18n( "List of sites for which the specified identification text will be used instead of the default one." ) );
    pbNew->setText( tr2i18n( "&New..." ) );
    QWhatsThis::add( pbNew, tr2i18n( "Add new identification text for a site." ) );
    pbChange->setText( tr2i18n( "Chan&ge..." ) );
    QWhatsThis::add( pbChange, tr2i18n( "Change the selected identifier text." ) );
    pbDelete->setText( tr2i18n( "D&elete" ) );
    QWhatsThis::add( pbDelete, tr2i18n( "Delete the selected identifier text." ) );
    pbDeleteAll->setText( tr2i18n( "Delete A&ll" ) );
    QWhatsThis::add( pbDeleteAll, tr2i18n( "Delete all identifiers." ) );
}

#include "useragentdlg_ui.moc"
