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

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

#include "ipblockingpref.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a IPBlockingPref as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
IPBlockingPref::IPBlockingPref( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "IPBlockingPref" );
    IPBlockingPrefLayout = new TQGridLayout( this, 1, 1, 11, 6, "IPBlockingPrefLayout"); 
    spacer7 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    IPBlockingPrefLayout->addItem( spacer7, 2, 0 );

    groupBox1 = new TQGroupBox( this, "groupBox1" );
    groupBox1->setEnabled( true );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQGridLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );

    checkUseLevel1 = new TQCheckBox( groupBox1, "checkUseLevel1" );

    groupBox1Layout->addWidget( checkUseLevel1, 0, 0 );

    layout5 = new TQHBoxLayout( 0, 0, 6, "layout5"); 

    textLabel1_3 = new TQLabel( groupBox1, "textLabel1_3" );
    layout5->addWidget( textLabel1_3 );

    m_url = new KURLRequester( groupBox1, "m_url" );
    m_url->setShowLocalProtocol( false );
    layout5->addWidget( m_url );

    groupBox1Layout->addLayout( layout5, 1, 0 );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 
    spacer3 = new TQSpacerItem( 361, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer3 );

    btnDownload = new TQPushButton( groupBox1, "btnDownload" );
    layout3->addWidget( btnDownload );

    groupBox1Layout->addLayout( layout3, 2, 0 );

    textLabel1_2 = new TQLabel( groupBox1, "textLabel1_2" );

    groupBox1Layout->addWidget( textLabel1_2, 3, 0 );

    lbl_status1 = new TQLabel( groupBox1, "lbl_status1" );

    groupBox1Layout->addWidget( lbl_status1, 5, 0 );
    spacer6 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    groupBox1Layout->addItem( spacer6, 4, 0 );

    IPBlockingPrefLayout->addWidget( groupBox1, 0, 0 );
    languageChange();
    resize( TQSize(564, 444).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( btnDownload, TQ_SIGNAL( clicked() ), this, TQ_SLOT( btnDownload_clicked() ) );
    connect( checkUseLevel1, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( checkUseLevel1_toggled(bool) ) );
    connect( checkUseLevel1, TQ_SIGNAL( toggled(bool) ), textLabel1_2, TQ_SLOT( setEnabled(bool) ) );
    connect( checkUseLevel1, TQ_SIGNAL( toggled(bool) ), textLabel1_3, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void IPBlockingPref::languageChange()
{
    setCaption( tr2i18n( "IPBlocking Preferences" ) );
    groupBox1->setTitle( tr2i18n( "Select PeerGuardian Filter File " ) );
    checkUseLevel1->setText( tr2i18n( "Use PeerGuardian filter?" ) );
    textLabel1_3->setText( tr2i18n( "IP filter file:" ) );
    m_url->setProperty( "url", tr2i18n( "http://www.bluetack.co.uk/modules.php?name=Downloads&d_op=getit&lid=8" ) );
    btnDownload->setText( tr2i18n( "Dow&nload/Convert" ) );
    textLabel1_2->setText( tr2i18n( "Download PeerGuardian filter from bluetack.co.uk or blocklist.org.\n"
"NOTE: ZIP file from bluetack.co.uk is supported." ) );
    lbl_status1->setText( TQString::null );
}

void IPBlockingPref::btnDownload_clicked()
{
    tqWarning( "IPBlockingPref::btnDownload_clicked(): Not implemented yet" );
}

void IPBlockingPref::checkUseLevel1_toggled(bool)
{
    tqWarning( "IPBlockingPref::checkUseLevel1_toggled(bool): Not implemented yet" );
}

void IPBlockingPref::checkUseKTfilter_toggled(bool)
{
    tqWarning( "IPBlockingPref::checkUseKTfilter_toggled(bool): Not implemented yet" );
}

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

TQMetaObject *IPBlockingPref::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_IPBlockingPref( "IPBlockingPref", &IPBlockingPref::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* IPBlockingPref::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 = {"btnDownload_clicked", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"checkUseLevel1_toggled", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"checkUseKTfilter_toggled", 1, param_slot_2 };
    static const TQUMethod slot_3 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "btnDownload_clicked()", &slot_0, TQMetaData::Public },
	{ "checkUseLevel1_toggled(bool)", &slot_1, TQMetaData::Public },
	{ "checkUseKTfilter_toggled(bool)", &slot_2, TQMetaData::Public },
	{ "languageChange()", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"IPBlockingPref", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_IPBlockingPref.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool IPBlockingPref::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: btnDownload_clicked(); break;
    case 1: checkUseLevel1_toggled((bool)static_QUType_bool.get(_o+1)); break;
    case 2: checkUseKTfilter_toggled((bool)static_QUType_bool.get(_o+1)); break;
    case 3: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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