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

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

#include "torservers.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqwidget.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlistbox.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqgroupbox.h>
#include <ntqspinbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "torservers.ui.h"

/*
 *  Constructs a TorServers as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
TorServers::TorServers( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "TorServers" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setSizeGripEnabled( true );
    TorServersLayout = new TQGridLayout( this, 1, 1, 11, 6, "TorServersLayout"); 

    tabWidget = new TQTabWidget( this, "tabWidget" );

    TabPage = new TQWidget( tabWidget, "TabPage" );
    TabPageLayout = new TQGridLayout( TabPage, 1, 1, 11, 6, "TabPageLayout"); 

    ExcludeNodes = new TQListView( TabPage, "ExcludeNodes" );
    ExcludeNodes->addColumn( tr2i18n( "CC" ) );
    ExcludeNodes->addColumn( tr2i18n( "geoipcc" ) );
    ExcludeNodes->addColumn( tr2i18n( "FP" ) );
    ExcludeNodes->addColumn( tr2i18n( "Enemy Servers          " ) );
    ExcludeNodes->header()->setResizeEnabled( false, ExcludeNodes->header()->count() - 1 );
    ExcludeNodes->setSelectionMode( TQListView::Extended );
    ExcludeNodes->setAllColumnsShowFocus( true );
    ExcludeNodes->setResizeMode( TQListView::AllColumns );

    TabPageLayout->addMultiCellWidget( ExcludeNodes, 0, 3, 2, 2 );

    CountryList = new TQListBox( TabPage, "CountryList" );
    CountryList->setMinimumSize( TQSize( 0, 110 ) );
    CountryList->setSelectionMode( TQListBox::Multi );

    TabPageLayout->addWidget( CountryList, 3, 0 );

    textLabel1 = new TQLabel( TabPage, "textLabel1" );

    TabPageLayout->addWidget( textLabel1, 2, 0 );
    spacer7 = new TQSpacerItem( 310, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    TabPageLayout->addMultiCell( spacer7, 1, 1, 0, 1 );
    spacer8 = new TQSpacerItem( 140, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    TabPageLayout->addItem( spacer8, 3, 1 );

    textLabel7_2_2_2 = new TQLabel( TabPage, "textLabel7_2_2_2" );

    TabPageLayout->addMultiCellWidget( textLabel7_2_2_2, 0, 0, 0, 1 );

    clearSelectedNodes = new TQPushButton( TabPage, "clearSelectedNodes" );

    TabPageLayout->addWidget( clearSelectedNodes, 4, 2 );

    clearSelectedCountries = new TQPushButton( TabPage, "clearSelectedCountries" );

    TabPageLayout->addWidget( clearSelectedCountries, 4, 0 );
    tabWidget->insertTab( TabPage, TQString::fromLatin1("") );

    TabPage_2 = new TQWidget( tabWidget, "TabPage_2" );
    TabPageLayout_2 = new TQGridLayout( TabPage_2, 1, 1, 11, 6, "TabPageLayout_2"); 

    ExitNodes = new TQListView( TabPage_2, "ExitNodes" );
    ExitNodes->addColumn( tr2i18n( "CC" ) );
    ExitNodes->addColumn( tr2i18n( "geoipcc" ) );
    ExitNodes->addColumn( tr2i18n( "FP" ) );
    ExitNodes->addColumn( tr2i18n( "Preferred Exit Servers" ) );
    ExitNodes->header()->setResizeEnabled( false, ExitNodes->header()->count() - 1 );
    ExitNodes->setSelectionMode( TQListView::Extended );
    ExitNodes->setAllColumnsShowFocus( true );
    ExitNodes->setResizeMode( TQListView::AllColumns );

    TabPageLayout_2->addWidget( ExitNodes, 0, 1 );

    clearSelectedPreferredNodes = new TQPushButton( TabPage_2, "clearSelectedPreferredNodes" );

    TabPageLayout_2->addWidget( clearSelectedPreferredNodes, 1, 1 );

    kcfg_StrictExitNodes = new TQCheckBox( TabPage_2, "kcfg_StrictExitNodes" );

    TabPageLayout_2->addWidget( kcfg_StrictExitNodes, 1, 0 );

    textLabel7_2 = new TQLabel( TabPage_2, "textLabel7_2" );

    TabPageLayout_2->addWidget( textLabel7_2, 0, 0 );
    tabWidget->insertTab( TabPage_2, TQString::fromLatin1("") );

    TabPage_3 = new TQWidget( tabWidget, "TabPage_3" );
    TabPageLayout_3 = new TQGridLayout( TabPage_3, 1, 1, 11, 6, "TabPageLayout_3"); 

    textLabel7_2_2_2_2 = new TQLabel( TabPage_3, "textLabel7_2_2_2_2" );

    TabPageLayout_3->addWidget( textLabel7_2_2_2_2, 0, 0 );

    Destination = new TQLineEdit( TabPage_3, "Destination" );

    TabPageLayout_3->addWidget( Destination, 1, 1 );

    pushButton6 = new TQPushButton( TabPage_3, "pushButton6" );

    TabPageLayout_3->addWidget( pushButton6, 1, 4 );

    CandidateList = new TQComboBox( false, TabPage_3, "CandidateList" );
    CandidateList->setEditable( true );

    TabPageLayout_3->addWidget( CandidateList, 1, 2 );

    MapAddress = new TQListView( TabPage_3, "MapAddress" );
    MapAddress->addColumn( tr2i18n( "Destination       " ) );
    MapAddress->header()->setResizeEnabled( false, MapAddress->header()->count() - 1 );
    MapAddress->addColumn( tr2i18n( "Server     " ) );
    MapAddress->addColumn( tr2i18n( "When     " ) );
    MapAddress->setSelectionMode( TQListView::Extended );
    MapAddress->setAllColumnsShowFocus( true );
    MapAddress->setResizeMode( TQListView::AllColumns );

    TabPageLayout_3->addMultiCellWidget( MapAddress, 0, 0, 1, 4 );

    WayPoints = new TQComboBox( false, TabPage_3, "WayPoints" );

    TabPageLayout_3->addWidget( WayPoints, 1, 3 );
    tabWidget->insertTab( TabPage_3, TQString::fromLatin1("") );

    Widget8 = new TQWidget( tabWidget, "Widget8" );
    Widget8Layout = new TQGridLayout( Widget8, 1, 1, 11, 6, "Widget8Layout"); 

    groupBox14 = new TQGroupBox( Widget8, "groupBox14" );
    groupBox14->setColumnLayout(0, TQt::Vertical );
    groupBox14->layout()->setSpacing( 6 );
    groupBox14->layout()->setMargin( 11 );
    groupBox14Layout = new TQGridLayout( groupBox14->layout() );
    groupBox14Layout->setAlignment( TQt::AlignTop );

    textLabel5 = new TQLabel( groupBox14, "textLabel5" );

    groupBox14Layout->addWidget( textLabel5, 0, 0 );

    AllowUnverifiedNodes = new TQListView( groupBox14, "AllowUnverifiedNodes" );
    AllowUnverifiedNodes->addColumn( tr2i18n( "Position on Circuit" ) );
    AllowUnverifiedNodes->setSelectionMode( TQListView::Extended );
    AllowUnverifiedNodes->setResizeMode( TQListView::AllColumns );

    groupBox14Layout->addWidget( AllowUnverifiedNodes, 0, 1 );

    pushButton6_2 = new TQPushButton( groupBox14, "pushButton6_2" );

    groupBox14Layout->addWidget( pushButton6_2, 1, 1 );

    Widget8Layout->addWidget( groupBox14, 1, 0 );

    groupBox19 = new TQGroupBox( Widget8, "groupBox19" );
    groupBox19->setColumnLayout(0, TQt::Vertical );
    groupBox19->layout()->setSpacing( 6 );
    groupBox19->layout()->setMargin( 11 );
    groupBox19Layout = new TQGridLayout( groupBox19->layout() );
    groupBox19Layout->setAlignment( TQt::AlignTop );

    textLabel6_3 = new TQLabel( groupBox19, "textLabel6_3" );

    groupBox19Layout->addWidget( textLabel6_3, 0, 2 );

    kcfg_NewCircuitPeriod = new TQSpinBox( groupBox19, "kcfg_NewCircuitPeriod" );
    kcfg_NewCircuitPeriod->setMaxValue( 99999 );

    groupBox19Layout->addWidget( kcfg_NewCircuitPeriod, 0, 1 );

    textLabel6_2_2 = new TQLabel( groupBox19, "textLabel6_2_2" );

    groupBox19Layout->addWidget( textLabel6_2_2, 0, 0 );

    Widget8Layout->addWidget( groupBox19, 0, 0 );
    tabWidget->insertTab( Widget8, TQString::fromLatin1("") );

    TorServersLayout->addWidget( tabWidget, 0, 0 );
    languageChange();
    resize( TQSize(556, 435).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( MapAddress, TQ_SIGNAL( contextMenuRequested(TQListViewItem*,const TQPoint&,int) ), this, TQ_SLOT( MapAddress_contextMenuRequested(TQListViewItem*,const TQPoint&,int) ) );
    connect( MapAddress, TQ_SIGNAL( returnPressed(TQListViewItem*) ), this, TQ_SLOT( MapAddress_returnPressed(TQListViewItem*) ) );
    connect( pushButton6, TQ_SIGNAL( clicked() ), this, TQ_SLOT( pushButton6_clicked() ) );
    connect( pushButton6_2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( pushButton6_2_clicked() ) );
    connect( clearSelectedCountries, TQ_SIGNAL( clicked() ), this, TQ_SLOT( clearSelectedCountries_clicked() ) );
    connect( clearSelectedNodes, TQ_SIGNAL( clicked() ), this, TQ_SLOT( clearSelectedNodes_clicked() ) );
    connect( clearSelectedPreferredNodes, TQ_SIGNAL( clicked() ), this, TQ_SLOT( clearSelectedPreferredNodes_clicked() ) );
    connect( CountryList, TQ_SIGNAL( selectionChanged() ), this, TQ_SLOT( CountryList_clicked() ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TorServers::languageChange()
{
    setCaption( tr2i18n( "MyDialog1" ) );
    ExcludeNodes->header()->setLabel( 0, tr2i18n( "CC" ) );
    ExcludeNodes->header()->setLabel( 1, tr2i18n( "geoipcc" ) );
    ExcludeNodes->header()->setLabel( 2, tr2i18n( "FP" ) );
    ExcludeNodes->header()->setLabel( 3, tr2i18n( "Enemy Servers          " ) );
    textLabel1->setText( tr2i18n( "<b>Countries To Avoid:</b>" ) );
    textLabel7_2_2_2->setText( tr2i18n( "<p> These are exit servers you have chosen to avoid. Exit servers are the computers where your traffic emerges back in to the real world and connects to the service you are using (e.g.the web page you are reading).</p>\n"
"<p>  You have selected countries to avoid below. </p>\n"
"<p>  To select a country or server, right-click on a server in the 'Tor Network' window and select 'From Now On Never Use At All' or 'From Now On Never Use Country At All'. </p>" ) );
    clearSelectedNodes->setText( tr2i18n( "&Delete Selected" ) );
    clearSelectedCountries->setText( tr2i18n( "&Delete Selected" ) );
    tabWidget->changeTab( TabPage, tr2i18n( "Exit Servers To Avoid" ) );
    ExitNodes->header()->setLabel( 0, tr2i18n( "CC" ) );
    ExitNodes->header()->setLabel( 1, tr2i18n( "geoipcc" ) );
    ExitNodes->header()->setLabel( 2, tr2i18n( "FP" ) );
    ExitNodes->header()->setLabel( 3, tr2i18n( "Preferred Exit Servers" ) );
    clearSelectedPreferredNodes->setText( tr2i18n( "Delete Selected" ) );
    kcfg_StrictExitNodes->setText( tr2i18n( "Use onl&y these servers for 'Exit'." ) );
    textLabel7_2->setText( tr2i18n( "<p> This is the list of servers you prefer to use as the exit point for traffic over the internet. These are the servers where you traffic emerges back in to the real world and connects to the service you are using (e.g.the web page you are reading).\n"
"<p>  To select a country or server, right-click on a server in the 'Tor Network' window and select 'Try to Use Server as an Exit' or 'Always Use Server as an Exit'. </p>" ) );
    tabWidget->changeTab( TabPage_2, tr2i18n( "Preferred Exit Servers" ) );
    textLabel7_2_2_2_2->setText( tr2i18n( "<p> This is the list of servers you like to use for particular destinations. For example, all traffic to Google should pop out on to the internet from the friendly server 'trustme'." ) );
    pushButton6->setText( tr2i18n( "O&K" ) );
    MapAddress->header()->setLabel( 0, tr2i18n( "Destination       " ) );
    MapAddress->header()->setLabel( 1, tr2i18n( "Server     " ) );
    MapAddress->header()->setLabel( 2, tr2i18n( "When     " ) );
    WayPoints->clear();
    WayPoints->insertItem( tr2i18n( "Entry" ) );
    WayPoints->insertItem( tr2i18n( "Exit" ) );
    tabWidget->changeTab( TabPage_3, tr2i18n( "S&pecial Friends" ) );
    groupBox14->setTitle( tr2i18n( "Unverified Servers" ) );
    textLabel5->setText( tr2i18n( "You can direct your traffic over <br> servers that haven't been verified <br> yet. Choose the stages in the route over the internet you feel comfortable trusting unverified servers with." ) );
    AllowUnverifiedNodes->header()->setLabel( 0, tr2i18n( "Position on Circuit" ) );
    AllowUnverifiedNodes->clear();
    TQListViewItem * item = new TQListViewItem( AllowUnverifiedNodes, 0 );
    item->setText( 0, tr2i18n( "Rendezvous" ) );

    item = new TQListViewItem( AllowUnverifiedNodes, item );
    item->setText( 0, tr2i18n( "Introduction" ) );

    item = new TQListViewItem( AllowUnverifiedNodes, item );
    item->setText( 0, tr2i18n( "Middle" ) );

    item = new TQListViewItem( AllowUnverifiedNodes, item );
    item->setText( 0, tr2i18n( "Exit" ) );

    item = new TQListViewItem( AllowUnverifiedNodes, item );
    item->setText( 0, tr2i18n( "Entry" ) );

    pushButton6_2->setText( tr2i18n( "Clear Selected" ) );
    groupBox19->setTitle( tr2i18n( "Verified Servers" ) );
    textLabel6_3->setText( tr2i18n( "seconds" ) );
    textLabel6_2_2->setText( tr2i18n( "Build new route on known servers every:" ) );
    tabWidget->changeTab( Widget8, tr2i18n( "&Servers Status" ) );
}

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

TQMetaObject *TorServers::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_TorServers( "TorServers", &TorServers::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* TorServers::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"pushButton6_clicked", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In },
	{ "point", &static_QUType_varptr, "\x0e", TQUParameter::In },
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"MapAddress_contextMenuRequested", 3, param_slot_1 };
    static const TQUMethod slot_2 = {"slotDeleteEntry", 0, 0 };
    static const TQUParameter param_slot_3[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"MapAddress_returnPressed", 1, param_slot_3 };
    static const TQUMethod slot_4 = {"clearSelectedCountries_clicked", 0, 0 };
    static const TQUMethod slot_5 = {"clearSelectedNodes_clicked", 0, 0 };
    static const TQUMethod slot_6 = {"clearSelectedPreferredNodes_clicked", 0, 0 };
    static const TQUMethod slot_7 = {"pushButton6_2_clicked", 0, 0 };
    static const TQUMethod slot_8 = {"CountryList_clicked", 0, 0 };
    static const TQUMethod slot_9 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "pushButton6_clicked()", &slot_0, TQMetaData::Public },
	{ "MapAddress_contextMenuRequested(TQListViewItem*,const TQPoint&,int)", &slot_1, TQMetaData::Public },
	{ "slotDeleteEntry()", &slot_2, TQMetaData::Public },
	{ "MapAddress_returnPressed(TQListViewItem*)", &slot_3, TQMetaData::Public },
	{ "clearSelectedCountries_clicked()", &slot_4, TQMetaData::Public },
	{ "clearSelectedNodes_clicked()", &slot_5, TQMetaData::Public },
	{ "clearSelectedPreferredNodes_clicked()", &slot_6, TQMetaData::Public },
	{ "pushButton6_2_clicked()", &slot_7, TQMetaData::Public },
	{ "CountryList_clicked()", &slot_8, TQMetaData::Public },
	{ "languageChange()", &slot_9, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"TorServers", parentObject,
	slot_tbl, 10,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_TorServers.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool TorServers::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: pushButton6_clicked(); break;
    case 1: MapAddress_contextMenuRequested((TQListViewItem*)static_QUType_ptr.get(_o+1),(const TQPoint&)*((const TQPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 2: slotDeleteEntry(); break;
    case 3: MapAddress_returnPressed((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: clearSelectedCountries_clicked(); break;
    case 5: clearSelectedNodes_clicked(); break;
    case 6: clearSelectedPreferredNodes_clicked(); break;
    case 7: pushButton6_2_clicked(); break;
    case 8: CountryList_clicked(); break;
    case 9: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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