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

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

#include "useragentdlg_ui.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <klineedit.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqcheckbox.h>
#include <ntqbuttongroup.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    cbSendUAString = new TQCheckBox( this, "cbSendUAString" );
    cbSendUAString->setChecked( true );
    UserAgentDlgUILayout->addWidget( cbSendUAString );

    gbDefaultId = new TQButtonGroup( this, "gbDefaultId" );
    gbDefaultId->setEnabled( true );
    gbDefaultId->setColumnLayout(0, TQt::Vertical );
    gbDefaultId->layout()->setSpacing( KDialog::spacingHint() );
    gbDefaultId->layout()->setMargin( 11 );
    gbDefaultIdLayout = new TQVBoxLayout( gbDefaultId->layout() );
    gbDefaultIdLayout->setAlignment( TQt::AlignTop );

    leDefaultId = new KLineEdit( gbDefaultId, "leDefaultId" );
    TQFont 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 TQCheckBox( gbDefaultId, "cbOS" );
    gbDefaultIdLayout->addWidget( cbOS );

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

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

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

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

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

    gbDomainPolicy = new TQGroupBox( this, "gbDomainPolicy" );
    gbDomainPolicy->setEnabled( true );
    gbDomainPolicy->setColumnLayout(0, TQt::Vertical );
    gbDomainPolicy->layout()->setSpacing( KDialog::spacingHint() );
    gbDomainPolicy->layout()->setMargin( 11 );
    gbDomainPolicyLayout = new TQHBoxLayout( gbDomainPolicy->layout() );
    gbDomainPolicyLayout->setAlignment( TQt::AlignTop );

    lvDomainPolicyList = new TDEListView( 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( TDEListView::AllColumns );
    lvDomainPolicyList->setTreeStepSize( 0 );
    gbDomainPolicyLayout->addWidget( lvDomainPolicyList );

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

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

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

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

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

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

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void UserAgentDlgUI::languageChange()
{
    TQWhatsThis::add( this, tr2i18n( "<qt>\n"
"Here you can modify the default browser-identification text or set a site <code>(eg. www.trinitydesktop.org)</code> or a domain <code>(eg. trinitydesktop.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" ) );
    TQWhatsThis::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" ) );
    TQWhatsThis::add( gbDefaultId, tr2i18n( "The browser identification text sent to the sites you visit. Use the provided options to customize it." ) );
    TQWhatsThis::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" ) );
    TQWhatsThis::add( cbOS, tr2i18n( "Includes your operating system's name in the browser identification text." ) );
    cbOSVersion->setText( tr2i18n( "Add operating system &version" ) );
    TQWhatsThis::add( cbOSVersion, tr2i18n( "Includes your operating system's version number in the browser identification text." ) );
    cbPlatform->setText( tr2i18n( "Add &platform name" ) );
    TQWhatsThis::add( cbPlatform, tr2i18n( "Includes your platform type in the browser identification text" ) );
    cbProcessorType->setText( tr2i18n( "Add &machine (processor) type" ) );
    TQWhatsThis::add( cbProcessorType, tr2i18n( "Includes your machine's CPU type in the browser identification text." ) );
    cbLanguage->setText( tr2i18n( "Add lang&uage information" ) );
    TQWhatsThis::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" ) );
    TQWhatsThis::add( lvDomainPolicyList, tr2i18n( "List of sites for which the specified identification text will be used instead of the default one." ) );
    pbNew->setText( tr2i18n( "&New..." ) );
    TQWhatsThis::add( pbNew, tr2i18n( "Add new identification text for a site." ) );
    pbChange->setText( tr2i18n( "Chan&ge..." ) );
    TQWhatsThis::add( pbChange, tr2i18n( "Change the selected identifier text." ) );
    pbDelete->setText( tr2i18n( "D&elete" ) );
    TQWhatsThis::add( pbDelete, tr2i18n( "Delete the selected identifier text." ) );
    pbDeleteAll->setText( tr2i18n( "Delete A&ll" ) );
    TQWhatsThis::add( pbDeleteAll, tr2i18n( "Delete all identifiers." ) );
}

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

TQMetaObject *UserAgentDlgUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_UserAgentDlgUI( "UserAgentDlgUI", &UserAgentDlgUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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