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

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

#include "serverwizard.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqwidget.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqbuttongroup.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "serverwizard.ui.h"

/*
 *  Constructs a ServerWizard as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qwizard will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qwizard.
 */
ServerWizard::ServerWizard( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : KWizard( parent, name, modal, fl )
{
    if ( !name )
	setName( "ServerWizard" );

    ServerName = new TQWidget( this, "ServerName" );
    ServerNameLayout = new TQGridLayout( ServerName, 1, 1, 11, 6, "ServerNameLayout"); 

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

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

    groupBox1Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 1 );

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

    groupBox1Layout->addWidget( textLabel2, 2, 0 );

    serverName = new TQLineEdit( groupBox1, "serverName" );

    groupBox1Layout->addWidget( serverName, 2, 1 );
    spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    groupBox1Layout->addItem( spacer1, 1, 1 );

    ServerNameLayout->addWidget( groupBox1, 0, 0 );
    addPage( ServerName, TQString("") );

    ContactInfo = new TQWidget( this, "ContactInfo" );
    ContactInfoLayout = new TQGridLayout( ContactInfo, 1, 1, 11, 6, "ContactInfoLayout"); 

    groupBox1_2 = new TQGroupBox( ContactInfo, "groupBox1_2" );
    groupBox1_2->setColumnLayout(0, TQt::Vertical );
    groupBox1_2->layout()->setSpacing( 6 );
    groupBox1_2->layout()->setMargin( 11 );
    groupBox1_2Layout = new TQGridLayout( groupBox1_2->layout() );
    groupBox1_2Layout->setAlignment( TQt::AlignTop );

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

    groupBox1_2Layout->addMultiCellWidget( textLabel1_2, 0, 0, 0, 1 );

    contactMail = new TQLineEdit( groupBox1_2, "contactMail" );

    groupBox1_2Layout->addWidget( contactMail, 2, 1 );

    textLabel2_2 = new TQLabel( groupBox1_2, "textLabel2_2" );

    groupBox1_2Layout->addWidget( textLabel2_2, 2, 0 );
    spacer2 = new TQSpacerItem( 20, 31, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    groupBox1_2Layout->addItem( spacer2, 1, 1 );

    ContactInfoLayout->addWidget( groupBox1_2, 0, 0 );
    addPage( ContactInfo, TQString("") );

    ServerReachability = new TQWidget( this, "ServerReachability" );
    ServerReachabilityLayout = new TQGridLayout( ServerReachability, 1, 1, 11, 6, "ServerReachabilityLayout"); 

    groupBox1_2_2 = new TQGroupBox( ServerReachability, "groupBox1_2_2" );
    groupBox1_2_2->setColumnLayout(0, TQt::Vertical );
    groupBox1_2_2->layout()->setSpacing( 6 );
    groupBox1_2_2->layout()->setMargin( 11 );
    groupBox1_2_2Layout = new TQGridLayout( groupBox1_2_2->layout() );
    groupBox1_2_2Layout->setAlignment( TQt::AlignTop );

    textLabel1_2_2 = new TQLabel( groupBox1_2_2, "textLabel1_2_2" );

    groupBox1_2_2Layout->addWidget( textLabel1_2_2, 0, 0 );

    buttonGroup1 = new TQButtonGroup( groupBox1_2_2, "buttonGroup1" );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQGridLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    ForwardPorts = new TQCheckBox( buttonGroup1, "ForwardPorts" );

    buttonGroup1Layout->addWidget( ForwardPorts, 0, 0 );

    RoutersFound = new TQLabel( buttonGroup1, "RoutersFound" );
    RoutersFound->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );

    buttonGroup1Layout->addWidget( RoutersFound, 1, 0 );

    groupBox1_2_2Layout->addWidget( buttonGroup1, 1, 0 );

    ServerReachabilityLayout->addWidget( groupBox1_2_2, 0, 0 );
    addPage( ServerReachability, TQString("") );
    languageChange();
    resize( TQSize(416, 329).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ServerWizard::languageChange()
{
    setCaption( tr2i18n( "Tor Server Guide" ) );
    groupBox1->setTitle( tr2i18n( "Server Name" ) );
    textLabel1->setText( tr2i18n( "<p>By running a Tor server you will allow users of the Tor network to route their traffic through your computer. Running a Tor server does not affect your own anonymity while using Tor.</p>\n"
"<p>Every Tor server has a nickname, for easy identification. It's not that important what you call it.</p>" ) );
    textLabel2->setText( tr2i18n( "Server NickName:" ) );
    setTitle( ServerName, tr2i18n( "Naming your Tor Server" ) );
    groupBox1_2->setTitle( tr2i18n( "Contact Information" ) );
    textLabel1_2->setText( tr2i18n( "<p>In case you inadvertently mis-configure your server, other operators or the Tor team may want to contact you so you can correct any issues..</p>\n"
"<p>You are not obliged to provide a contact email, but it will certainly help in the event of a problem.</p>" ) );
    textLabel2_2->setText( tr2i18n( "Your email:" ) );
    setTitle( ContactInfo, tr2i18n( "In Case There's a Problem" ) );
    groupBox1_2_2->setTitle( tr2i18n( "Opening Up Your Router For Tor Users" ) );
    textLabel1_2_2->setText( tr2i18n( "<p>Most Tor users can access the internet over ports 80 (http://) and 443 (https://). It will help if these are the ports Tor advertises to them.</p>\n"
"<p>If you want, TorK can contact your router and tell it to ensure anything that arrives on ports 80 and 443 is sent to Tor. If you'd like to do this, tick the box below if it is enabled..</p>" ) );
    buttonGroup1->setTitle( tr2i18n( "Server Accessibility" ) );
    ForwardPorts->setText( tr2i18n( "Make Tor Easily Accessible." ) );
    RoutersFound->setText( tr2i18n( "<b>No Routers Found. Check your local firewall and ensure your router has UPnP enabled.</b>" ) );
    setTitle( ServerReachability, tr2i18n( "Making Your Server Reachable" ) );
}

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

TQMetaObject *ServerWizard::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ServerWizard( "ServerWizard", &ServerWizard::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ServerWizard::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 = KWizard::staticMetaObject();
    static const TQUParameter param_slot_0[] = {
	{ "w", &static_QUType_ptr, "TQWidget", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"showPage", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "id", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"setServerType", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"accept", 0, 0 };
    static const TQUMethod slot_3 = {"reject", 0, 0 };
    static const TQUMethod slot_4 = {"displayDiscoveredRouters", 0, 0 };
    static const TQUMethod slot_5 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "showPage(TQWidget*)", &slot_0, TQMetaData::Public },
	{ "setServerType(int)", &slot_1, TQMetaData::Public },
	{ "accept()", &slot_2, TQMetaData::Public },
	{ "reject()", &slot_3, TQMetaData::Public },
	{ "displayDiscoveredRouters()", &slot_4, TQMetaData::Public },
	{ "languageChange()", &slot_5, TQMetaData::Protected }
    };
    static const TQUParameter param_signal_0[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod signal_0 = {"setUpServer", 1, param_signal_0 };
    static const TQMetaData signal_tbl[] = {
	{ "setUpServer(int)", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ServerWizard", parentObject,
	slot_tbl, 6,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ServerWizard.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL setUpServer
void ServerWizard::setUpServer( int t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
}

bool ServerWizard::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: showPage((TQWidget*)static_QUType_ptr.get(_o+1)); break;
    case 1: setServerType((int)static_QUType_int.get(_o+1)); break;
    case 2: accept(); break;
    case 3: reject(); break;
    case 4: displayDiscoveredRouters(); break;
    case 5: languageChange(); break;
    default:
	return KWizard::tqt_invoke( _id, _o );
    }
    return true;
}

bool ServerWizard::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: setUpServer((int)static_QUType_int.get(_o+1)); break;
    default:
	return KWizard::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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