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

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

#include "connectiondialog.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "connectiontable.h"
#include "connectiondialog.ui.h"

/*
 *  Constructs a ConnectionDialog 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.
 */
ConnectionDialog::ConnectionDialog( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ConnectionDialog" );
    ConnectionDialogLayout = new TQGridLayout( this, 1, 1, 11, 6, "ConnectionDialogLayout"); 

    PushButton1 = new TQPushButton( this, "PushButton1" );

    ConnectionDialogLayout->addWidget( PushButton1, 1, 1 );

    TextLabel1 = new TQLabel( this, "TextLabel1" );
    TextLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)4, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );

    ConnectionDialogLayout->addWidget( TextLabel1, 0, 0 );

    PushButton2 = new TQPushButton( this, "PushButton2" );

    ConnectionDialogLayout->addWidget( PushButton2, 2, 1 );

    PushButton3 = new TQPushButton( this, "PushButton3" );

    ConnectionDialogLayout->addWidget( PushButton3, 6, 1 );

    PushButton7 = new TQPushButton( this, "PushButton7" );
    PushButton7->setDefault( true );

    ConnectionDialogLayout->addWidget( PushButton7, 5, 1 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ConnectionDialogLayout->addItem( Spacer1, 4, 1 );

    buttonEditSlots = new TQPushButton( this, "buttonEditSlots" );

    ConnectionDialogLayout->addWidget( buttonEditSlots, 3, 1 );

    connectionsTable = new ConnectionTable( this, "connectionsTable" );

    ConnectionDialogLayout->addMultiCellWidget( connectionsTable, 1, 6, 0, 0 );
    languageChange();
    resize( TQSize(600, 365).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addConnection() ) );
    connect( PushButton7, TQ_SIGNAL( clicked() ), this, TQ_SLOT( okClicked() ) );
    connect( PushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( cancelClicked() ) );
    connect( PushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteClicked() ) );
    connect( buttonEditSlots, TQ_SIGNAL( clicked() ), this, TQ_SLOT( editSlots() ) );

    // buddies
    TextLabel1->setBuddy( connectionsTable );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConnectionDialog::languageChange()
{
    setCaption( tr2i18n( "View & Edit Connections" ) );
    PushButton1->setText( tr2i18n( "&New" ) );
    TextLabel1->setText( tr2i18n( "&Connections:" ) );
    PushButton2->setText( tr2i18n( "&Delete" ) );
    PushButton3->setText( tr2i18n( "&Cancel" ) );
    PushButton7->setText( tr2i18n( "&OK" ) );
    buttonEditSlots->setText( tr2i18n( "&Edit Slots..." ) );
}

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

TQMetaObject *ConnectionDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ConnectionDialog( "ConnectionDialog", &ConnectionDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ConnectionDialog::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 = {"init", 0, 0 };
    static const TQUMethod slot_1 = {"addConnection", 0, 0 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_ptr, "ConnectionContainer", TQUParameter::Out },
	{ "sender", &static_QUType_ptr, "TQObject", TQUParameter::In },
	{ "receiver", &static_QUType_ptr, "TQObject", TQUParameter::In },
	{ "signal", &static_QUType_TQString, 0, TQUParameter::In },
	{ "slot", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"addConnection", 5, param_slot_2 };
    static const TQUParameter param_slot_3[] = {
	{ "c", &static_QUType_ptr, "ConnectionContainer", TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"updateConnectionState", 1, param_slot_3 };
    static const TQUMethod slot_4 = {"okClicked", 0, 0 };
    static const TQUMethod slot_5 = {"cancelClicked", 0, 0 };
    static const TQUMethod slot_6 = {"deleteClicked", 0, 0 };
    static const TQUMethod slot_7 = {"editSlots", 0, 0 };
    static const TQUParameter param_slot_8[] = {
	{ "sender", &static_QUType_ptr, "TQObject", TQUParameter::In },
	{ "receiver", &static_QUType_ptr, "TQObject", TQUParameter::In }
    };
    static const TQUMethod slot_8 = {"setDefault", 2, param_slot_8 };
    static const TQUMethod slot_9 = {"updateEditSlotsButton", 0, 0 };
    static const TQUMethod slot_10 = {"updateConnectionContainers", 0, 0 };
    static const TQUMethod slot_11 = {"ensureConnectionVisible", 0, 0 };
    static const TQUMethod slot_12 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "init()", &slot_0, TQMetaData::Public },
	{ "addConnection()", &slot_1, TQMetaData::Public },
	{ "addConnection(TQObject*,TQObject*,const TQString&,const TQString&)", &slot_2, TQMetaData::Public },
	{ "updateConnectionState(ConnectionContainer*)", &slot_3, TQMetaData::Public },
	{ "okClicked()", &slot_4, TQMetaData::Public },
	{ "cancelClicked()", &slot_5, TQMetaData::Public },
	{ "deleteClicked()", &slot_6, TQMetaData::Public },
	{ "editSlots()", &slot_7, TQMetaData::Public },
	{ "setDefault(TQObject*,TQObject*)", &slot_8, TQMetaData::Public },
	{ "updateEditSlotsButton()", &slot_9, TQMetaData::Public },
	{ "updateConnectionContainers()", &slot_10, TQMetaData::Public },
	{ "ensureConnectionVisible()", &slot_11, TQMetaData::Public },
	{ "languageChange()", &slot_12, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ConnectionDialog", parentObject,
	slot_tbl, 13,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ConnectionDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ConnectionDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: init(); break;
    case 1: addConnection(); break;
    case 2: static_QUType_ptr.set(_o,addConnection((TQObject*)static_QUType_ptr.get(_o+1),(TQObject*)static_QUType_ptr.get(_o+2),(const TQString&)static_QUType_TQString.get(_o+3),(const TQString&)static_QUType_TQString.get(_o+4))); break;
    case 3: updateConnectionState((ConnectionContainer*)static_QUType_ptr.get(_o+1)); break;
    case 4: okClicked(); break;
    case 5: cancelClicked(); break;
    case 6: deleteClicked(); break;
    case 7: editSlots(); break;
    case 8: setDefault((TQObject*)static_QUType_ptr.get(_o+1),(TQObject*)static_QUType_ptr.get(_o+2)); break;
    case 9: updateEditSlotsButton(); break;
    case 10: updateConnectionContainers(); break;
    case 11: ensureConnectionVisible(); break;
    case 12: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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