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

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

#include "quickconfig.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcombobox.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "quickconfig.ui.h"

/*
 *  Constructs a QuickConfig as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
QuickConfig::QuickConfig( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "QuickConfig" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    QuickConfigLayout = new TQGridLayout( this, 1, 1, 11, 6, "QuickConfigLayout"); 

    groupBox2 = new TQGroupBox( this, "groupBox2" );

    kcfg_ShowDNSLeaks = new TQCheckBox( groupBox2, "kcfg_ShowDNSLeaks" );
    kcfg_ShowDNSLeaks->setGeometry( TQRect( 21, 51, 221, 21 ) );

    kcfg_ShowSecurityWarnings = new TQCheckBox( groupBox2, "kcfg_ShowSecurityWarnings" );
    kcfg_ShowSecurityWarnings->setGeometry( TQRect( 21, 111, 221, 21 ) );

    kcfg_ShowUsageWarnings = new TQCheckBox( groupBox2, "kcfg_ShowUsageWarnings" );
    kcfg_ShowUsageWarnings->setGeometry( TQRect( 21, 81, 221, 21 ) );

    textLabel1_3 = new TQLabel( groupBox2, "textLabel1_3" );
    textLabel1_3->setGeometry( TQRect( 22, 20, 200, 21 ) );

    textLabel1_3_2 = new TQLabel( groupBox2, "textLabel1_3_2" );
    textLabel1_3_2->setGeometry( TQRect( 262, 20, 220, 21 ) );

    kcfg_ShowGuideQuestions = new TQCheckBox( groupBox2, "kcfg_ShowGuideQuestions" );
    kcfg_ShowGuideQuestions->setGeometry( TQRect( 261, 51, 261, 21 ) );

    kcfg_ShowApplySettingsQuestions = new TQCheckBox( groupBox2, "kcfg_ShowApplySettingsQuestions" );
    kcfg_ShowApplySettingsQuestions->setGeometry( TQRect( 261, 81, 261, 21 ) );

    QuickConfigLayout->addWidget( groupBox2, 1, 0 );

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

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

    quickGroupLayout->addMultiCellWidget( textLabel1_2, 4, 5, 3, 4 );
    spacer1_2 = new TQSpacerItem( 51, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    quickGroupLayout->addItem( spacer1_2, 5, 5 );
    spacer1 = new TQSpacerItem( 51, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    quickGroupLayout->addItem( spacer1, 2, 5 );

    kcfg_RemoteTorPort = new TQSpinBox( quickGroup, "kcfg_RemoteTorPort" );
    kcfg_RemoteTorPort->setEnabled( false );
    kcfg_RemoteTorPort->setMaxValue( 65535 );

    quickGroupLayout->addWidget( kcfg_RemoteTorPort, 5, 4 );
    spacer2_3 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    quickGroupLayout->addItem( spacer2_3, 5, 0 );

    QuickConfigure = new TQComboBox( false, quickGroup, "QuickConfigure" );

    quickGroupLayout->addMultiCellWidget( QuickConfigure, 2, 2, 1, 4 );
    spacer2 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    quickGroupLayout->addItem( spacer2, 2, 0 );
    spacer7 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    quickGroupLayout->addItem( spacer7, 1, 1 );

    textLabel9 = new TQLabel( quickGroup, "textLabel9" );

    quickGroupLayout->addMultiCellWidget( textLabel9, 0, 0, 0, 5 );

    kcfg_AlwaysAnonymizeTDE = new TQCheckBox( quickGroup, "kcfg_AlwaysAnonymizeTDE" );
    TQFont kcfg_AlwaysAnonymizeTDE_font(  kcfg_AlwaysAnonymizeTDE->font() );
    kcfg_AlwaysAnonymizeTDE_font.setBold( true );
    kcfg_AlwaysAnonymizeTDE->setFont( kcfg_AlwaysAnonymizeTDE_font ); 
    kcfg_AlwaysAnonymizeTDE->setChecked( true );

    quickGroupLayout->addMultiCellWidget( kcfg_AlwaysAnonymizeTDE, 7, 7, 1, 5 );
    spacer8 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    quickGroupLayout->addItem( spacer8, 6, 1 );

    kcfg_RemoteTorAddress = new TQLineEdit( quickGroup, "kcfg_RemoteTorAddress" );
    kcfg_RemoteTorAddress->setEnabled( false );

    quickGroupLayout->addWidget( kcfg_RemoteTorAddress, 5, 2 );

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

    quickGroupLayout->addWidget( textLabel1, 5, 1 );

    QuickConfigLayout->addWidget( quickGroup, 0, 0 );
    languageChange();
    resize( TQSize(566, 529).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( QuickConfigure, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( QuickConfigure_activated(int) ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void QuickConfig::languageChange()
{
    setCaption( tr2i18n( "Form1" ) );
    groupBox2->setTitle( tr2i18n( "Messages" ) );
    kcfg_ShowDNSLeaks->setText( tr2i18n( "Show DNS Leak Warnings" ) );
    kcfg_ShowSecurityWarnings->setText( tr2i18n( "Show Security Warnings" ) );
    kcfg_ShowUsageWarnings->setText( tr2i18n( "Show Usage Warnings" ) );
    textLabel1_3->setText( tr2i18n( "<b>Warning Messages</b>" ) );
    textLabel1_3_2->setText( tr2i18n( "<b>Question Messages</b>" ) );
    kcfg_ShowGuideQuestions->setText( tr2i18n( "Show Guide Questions" ) );
    kcfg_ShowApplySettingsQuestions->setText( tr2i18n( "Never Apply Settings Automatically" ) );
    quickGroup->setTitle( tr2i18n( "Quick Configuration" ) );
    textLabel1_2->setText( tr2i18n( ":" ) );
    QuickConfigure->clear();
    QuickConfigure->insertItem( tr2i18n( "Run a Tor Client and Server With Default Settings" ) );
    QuickConfigure->insertItem( tr2i18n( "Run a Tor Client and Relay Server With Default Settings" ) );
    QuickConfigure->insertItem( tr2i18n( "Run a Tor Server With Default Settings" ) );
    QuickConfigure->insertItem( tr2i18n( "Run a Tor Relay Server With Default Settings" ) );
    QuickConfigure->insertItem( tr2i18n( "Run a Tor Client with Default Settings" ) );
    QuickConfigure->insertItem( tr2i18n( "Let me configure Tor myself." ) );
    QuickConfigure->insertItem( tr2i18n( "Manage a Remote Instance of Tor" ) );
    QuickConfigure->insertItem( tr2i18n( "Manage a Local Instance of Tor that's already running" ) );
    textLabel9->setText( tr2i18n( "<p> TorK allows you to configure Tor in a very fine-grained manner. However, it's possible to make a mess of things and stop Tor working properly. Tor has very sensible defaults, so you can choose whether you want to configure things yourself or let Tor decide it for you.\n"
"<p> <b>If you choose to manage a remote instance of Tor or a local instance that's already running, only configuration changes made after you have connected to the remote instance will be applied to it.</b>" ) );
    kcfg_AlwaysAnonymizeTDE->setText( tr2i18n( "Anonymize Konqueror When Tor Starts" ) );
    textLabel1->setText( tr2i18n( "Address/ Port of Tor Instance:" ) );
}

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

TQMetaObject *QuickConfig::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_QuickConfig( "QuickConfig", &QuickConfig::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* QuickConfig::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 TQUParameter param_slot_0[] = {
	{ "item", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"QuickConfigure_activated", 1, param_slot_0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "QuickConfigure_activated(int)", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    static const TQUMethod signal_0 = {"settingsChanged", 0, 0 };
    static const TQUParameter param_signal_1[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod signal_1 = {"configChanged", 1, param_signal_1 };
    static const TQMetaData signal_tbl[] = {
	{ "settingsChanged()", &signal_0, TQMetaData::Public },
	{ "configChanged(const int&)", &signal_1, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"QuickConfig", parentObject,
	slot_tbl, 2,
	signal_tbl, 2,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_QuickConfig.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL settingsChanged
void QuickConfig::settingsChanged()
{
    activate_signal( staticMetaObject()->signalOffset() + 0 );
}

// TQ_SIGNAL configChanged
void QuickConfig::configChanged( const int& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 1, t0 );
}

bool QuickConfig::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: QuickConfigure_activated((int)static_QUType_int.get(_o+1)); break;
    case 1: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool QuickConfig::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: settingsChanged(); break;
    case 1: configChanged((const int&)static_QUType_int.get(_o+1)); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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