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

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

#include "hiddensrvs.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "hiddensrvs.ui.h"

/*
 *  Constructs a MyHidden 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.
 */
MyHidden::MyHidden( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "MyHidden" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setSizeGripEnabled( true );
    MyHiddenLayout = new TQGridLayout( this, 1, 1, 11, 6, "MyHiddenLayout"); 

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

    startService = new TQPushButton( groupBox4, "startService" );

    groupBox4Layout->addWidget( startService, 2, 1 );

    deleteService = new TQPushButton( groupBox4, "deleteService" );

    groupBox4Layout->addWidget( deleteService, 2, 3 );

    startAllServices = new TQPushButton( groupBox4, "startAllServices" );

    groupBox4Layout->addWidget( startAllServices, 2, 2 );

    createService = new TQPushButton( groupBox4, "createService" );

    groupBox4Layout->addWidget( createService, 2, 0 );

    testService = new TQPushButton( groupBox4, "testService" );

    groupBox4Layout->addWidget( testService, 3, 1 );

    publishService = new TQPushButton( groupBox4, "publishService" );

    groupBox4Layout->addWidget( publishService, 3, 2 );

    servicesList = new TQListView( groupBox4, "servicesList" );
    servicesList->addColumn( tr2i18n( "Tor Address" ) );
    servicesList->addColumn( tr2i18n( "Nick" ) );
    servicesList->addColumn( tr2i18n( "Public Port" ) );
    servicesList->addColumn( tr2i18n( "Actual Address" ) );
    servicesList->addColumn( tr2i18n( "Folder Serving Files" ) );
    servicesList->addColumn( tr2i18n( "Service Folder" ) );

    groupBox4Layout->addMultiCellWidget( servicesList, 1, 1, 0, 3 );

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

    groupBox4Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 3 );

    MyHiddenLayout->addWidget( groupBox4, 0, 0 );
    languageChange();
    resize( TQSize(576, 525).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( createService, TQ_SIGNAL( clicked() ), this, TQ_SLOT( createService_clicked() ) );
    connect( deleteService, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteService_clicked() ) );
    connect( startService, TQ_SIGNAL( clicked() ), this, TQ_SLOT( startService_clicked() ) );
    connect( servicesList, TQ_SIGNAL( selectionChanged() ), this, TQ_SLOT( servicesList_selectionChanged() ) );
    connect( startAllServices, TQ_SIGNAL( clicked() ), this, TQ_SLOT( startAllServices_clicked() ) );
    connect( testService, TQ_SIGNAL( clicked() ), this, TQ_SLOT( testService_clicked() ) );
    connect( publishService, TQ_SIGNAL( clicked() ), this, TQ_SLOT( publishService_clicked() ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MyHidden::languageChange()
{
    setCaption( tr2i18n( "Create and Manage Hidden Services on the Tor Network" ) );
    groupBox4->setTitle( tr2i18n( "Your Hidden Services" ) );
    startService->setText( tr2i18n( "Start Service" ) );
    deleteService->setText( tr2i18n( "Delete Service" ) );
    startAllServices->setText( tr2i18n( "Start All Services" ) );
    createService->setText( tr2i18n( "Create Service" ) );
    testService->setText( tr2i18n( "Test Service" ) );
    publishService->setText( tr2i18n( "Publish Service" ) );
    servicesList->header()->setLabel( 0, tr2i18n( "Tor Address" ) );
    servicesList->header()->setLabel( 1, tr2i18n( "Nick" ) );
    servicesList->header()->setLabel( 2, tr2i18n( "Public Port" ) );
    servicesList->header()->setLabel( 3, tr2i18n( "Actual Address" ) );
    servicesList->header()->setLabel( 4, tr2i18n( "Folder Serving Files" ) );
    servicesList->header()->setLabel( 5, tr2i18n( "Service Folder" ) );
    textLabel1->setText( tr2i18n( "<blockquote>Hidden Services are services you either run locally or redirect to remotely by offering them anonymously on the Tor network.</blockquote>\n"
"<blockquote><b>For more information on hidden services, see http://www.torproject.org.</b></blockquote>" ) );
}

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

TQMetaObject *MyHidden::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MyHidden( "MyHidden", &MyHidden::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* MyHidden::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 = {"createService_clicked", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ "nick", &static_QUType_TQString, 0, TQUParameter::In },
	{ "publicport", &static_QUType_TQString, 0, TQUParameter::In },
	{ "actualaddress", &static_QUType_TQString, 0, TQUParameter::In },
	{ "toraddress", &static_QUType_TQString, 0, TQUParameter::In },
	{ "folder", &static_QUType_TQString, 0, TQUParameter::In },
	{ "servicefolder", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"addService", 6, param_slot_1 };
    static const TQUMethod slot_2 = {"deleteService_clicked", 0, 0 };
    static const TQUMethod slot_3 = {"startService_clicked", 0, 0 };
    static const TQUParameter param_slot_4[] = {
	{ "proc", &static_QUType_ptr, "TDEProcess", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"thttpdprocExited", 1, param_slot_4 };
    static const TQUMethod slot_5 = {"servicesList_selectionChanged", 0, 0 };
    static const TQUMethod slot_6 = {"startAllServices_clicked", 0, 0 };
    static const TQUMethod slot_7 = {"testService_clicked", 0, 0 };
    static const TQUMethod slot_8 = {"publishService_clicked", 0, 0 };
    static const TQUMethod slot_9 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "createService_clicked()", &slot_0, TQMetaData::Public },
	{ "addService(const TQString&,const TQString&,const TQString&,const TQString&,const TQString&,const TQString&)", &slot_1, TQMetaData::Public },
	{ "deleteService_clicked()", &slot_2, TQMetaData::Public },
	{ "startService_clicked()", &slot_3, TQMetaData::Public },
	{ "thttpdprocExited(TDEProcess*)", &slot_4, TQMetaData::Public },
	{ "servicesList_selectionChanged()", &slot_5, TQMetaData::Public },
	{ "startAllServices_clicked()", &slot_6, TQMetaData::Public },
	{ "testService_clicked()", &slot_7, TQMetaData::Public },
	{ "publishService_clicked()", &slot_8, TQMetaData::Public },
	{ "languageChange()", &slot_9, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"MyHidden", parentObject,
	slot_tbl, 10,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_MyHidden.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool MyHidden::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: createService_clicked(); break;
    case 1: addService((const TQString&)static_QUType_TQString.get(_o+1),(const TQString&)static_QUType_TQString.get(_o+2),(const TQString&)static_QUType_TQString.get(_o+3),(const TQString&)static_QUType_TQString.get(_o+4),(const TQString&)static_QUType_TQString.get(_o+5),(const TQString&)static_QUType_TQString.get(_o+6)); break;
    case 2: deleteService_clicked(); break;
    case 3: startService_clicked(); break;
    case 4: thttpdprocExited((TDEProcess*)static_QUType_ptr.get(_o+1)); break;
    case 5: servicesList_selectionChanged(); break;
    case 6: startAllServices_clicked(); break;
    case 7: testService_clicked(); break;
    case 8: publishService_clicked(); break;
    case 9: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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