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

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

#include "connectioneditor.h"

#include <ntqvariant.h>
#include <tdelistview.h>
#include <kcombobox.h>
#include <kpushbutton.h>
#include <ntqpushbutton.h>
#include <tdelistbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    connectionView = new TDEListView( this, "connectionView" );
    connectionView->addColumn( tr2i18n( "Sender" ) );
    connectionView->addColumn( tr2i18n( "Signal" ) );
    connectionView->addColumn( tr2i18n( "Receiver" ) );
    connectionView->addColumn( tr2i18n( "Slot" ) );
    connectionView->setAllColumnsShowFocus( true );
    connectionView->setShowSortIndicator( true );
    connectionView->setFullWidth( true );

    ConnectionEditorBaseLayout->addMultiCellWidget( connectionView, 3, 3, 0, 1 );

    slotBox = new TDEListBox( this, "slotBox" );

    ConnectionEditorBaseLayout->addWidget( slotBox, 1, 1 );

    signalBox = new TDEListBox( this, "signalBox" );

    ConnectionEditorBaseLayout->addWidget( signalBox, 1, 0 );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 

    labelSignal = new TQLabel( this, "labelSignal" );
    layout3->addWidget( labelSignal );

    comboSender = new KComboBox( false, this, "comboSender" );
    comboSender->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, comboSender->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( comboSender );

    ConnectionEditorBaseLayout->addLayout( layout3, 0, 0 );

    Layout3 = new TQHBoxLayout( 0, 0, 6, "Layout3"); 

    labelSlot = new TQLabel( this, "labelSlot" );
    Layout3->addWidget( labelSlot );

    comboReceiver = new KComboBox( false, this, "comboReceiver" );
    comboReceiver->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, comboReceiver->sizePolicy().hasHeightForWidth() ) );
    Layout3->addWidget( comboReceiver );

    ConnectionEditorBaseLayout->addLayout( Layout3, 0, 1 );

    layout7 = new TQHBoxLayout( 0, 0, 6, "layout7"); 

    disconnectButton = new KPushButton( this, "disconnectButton" );
    disconnectButton->setAutoDefault( true );
    layout7->addWidget( disconnectButton );
    spacer5 = new TQSpacerItem( 71, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout7->addItem( spacer5 );

    okButton = new KPushButton( this, "okButton" );
    okButton->setAutoDefault( true );
    okButton->setDefault( true );
    layout7->addWidget( okButton );

    cancelButton = new KPushButton( this, "cancelButton" );
    cancelButton->setAutoDefault( true );
    layout7->addWidget( cancelButton );
    spacer4 = new TQSpacerItem( 230, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout7->addItem( spacer4 );

    ConnectionEditorBaseLayout->addMultiCellLayout( layout7, 4, 4, 0, 1 );

    layout8 = new TQHBoxLayout( 0, 0, 6, "layout8"); 

    TextLabel1 = new TQLabel( this, "TextLabel1" );
    layout8->addWidget( TextLabel1 );
    Spacer2 = new TQSpacerItem( 231, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout8->addItem( Spacer2 );

    connectButton = new KPushButton( this, "connectButton" );
    connectButton->setAutoDefault( true );
    layout8->addWidget( connectButton );
    Spacer3 = new TQSpacerItem( 211, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout8->addItem( Spacer3 );

    ConnectionEditorBaseLayout->addMultiCellLayout( layout8, 2, 2, 0, 1 );
    languageChange();
    resize( TQSize(780, 538).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( comboSender, signalBox );
    setTabOrder( signalBox, comboReceiver );
    setTabOrder( comboReceiver, slotBox );
    setTabOrder( slotBox, connectButton );
    setTabOrder( connectButton, connectionView );
    setTabOrder( connectionView, disconnectButton );
    setTabOrder( disconnectButton, okButton );
    setTabOrder( okButton, cancelButton );

    // buddies
    labelSignal->setBuddy( signalBox );
    labelSlot->setBuddy( slotBox );
    TextLabel1->setBuddy( connectionView );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConnectionEditorBase::languageChange()
{
    setCaption( tr2i18n( "Edit Connections" ) );
    TQWhatsThis::add( this, tr2i18n( "<b>Edit Connections</b><p>Add and remove connections in the current form .</p><p>Select a signal and a corresponding slot then press the <b>Connect</b>-button to create a connection.</p><p>Select a connection from the list then press the <b>Disconnect</b>-button to delete the connection.</p>" ) );
    connectionView->header()->setLabel( 0, tr2i18n( "Sender" ) );
    connectionView->header()->setLabel( 1, tr2i18n( "Signal" ) );
    connectionView->header()->setLabel( 2, tr2i18n( "Receiver" ) );
    connectionView->header()->setLabel( 3, tr2i18n( "Slot" ) );
    TQWhatsThis::add( connectionView, tr2i18n( "Displays the connections between the sender and the receiver." ) );
    TQWhatsThis::add( slotBox, tr2i18n( "<b>A list of slots for the receiver.</b><p>The slots that are displayed are only those which have arguments that correspond with the arguments of the signal that is currently selected in the Signal-list.</b>" ) );
    TQWhatsThis::add( signalBox, tr2i18n( "Displays the list of signals that the widget emits." ) );
    labelSignal->setText( tr2i18n( "Si&gnals:" ) );
    labelSlot->setText( tr2i18n( "&Slots:" ) );
    disconnectButton->setText( tr2i18n( "&Disconnect" ) );
    TQToolTip::add( disconnectButton, tr2i18n( "Remove the selected connection" ) );
    TQWhatsThis::add( disconnectButton, tr2i18n( "Remove the selected connection." ) );
    okButton->setText( tr2i18n( "&OK" ) );
    TQWhatsThis::add( okButton, tr2i18n( "Close the dialog and apply all the changes." ) );
    cancelButton->setText( tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( cancelButton, tr2i18n( "Close the dialog and discard any changes." ) );
    TextLabel1->setText( tr2i18n( "Connec&tions:" ) );
    connectButton->setText( tr2i18n( "Co&nnect" ) );
    TQToolTip::add( connectButton, tr2i18n( "Create connection" ) );
    TQWhatsThis::add( connectButton, tr2i18n( "Create a connection between a signal and a slot." ) );
}

void ConnectionEditorBase::init()
{
}

void ConnectionEditorBase::destroy()
{
}

void ConnectionEditorBase::addSlotClicked()
{
    tqWarning( "ConnectionEditorBase::addSlotClicked(): Not implemented yet" );
}

void ConnectionEditorBase::connectClicked()
{
    tqWarning( "ConnectionEditorBase::connectClicked(): Not implemented yet" );
}

void ConnectionEditorBase::connectionsChanged()
{
    tqWarning( "ConnectionEditorBase::connectionsChanged(): Not implemented yet" );
}

void ConnectionEditorBase::disconnectClicked()
{
    tqWarning( "ConnectionEditorBase::disconnectClicked(): Not implemented yet" );
}

void ConnectionEditorBase::receiverChanged(const TQString&)
{
    tqWarning( "ConnectionEditorBase::receiverChanged(const TQString&): Not implemented yet" );
}

void ConnectionEditorBase::okClicked()
{
    tqWarning( "ConnectionEditorBase::okClicked(): Not implemented yet" );
}

void ConnectionEditorBase::signalChanged()
{
    tqWarning( "ConnectionEditorBase::signalChanged(): Not implemented yet" );
}

void ConnectionEditorBase::Q_SLOTSChanged()
{
    tqWarning( "ConnectionEditorBase::Q_SLOTSChanged(): Not implemented yet" );
}

void ConnectionEditorBase::cancelClicked()
{
    tqWarning( "ConnectionEditorBase::cancelClicked(): Not implemented yet" );
}

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

TQMetaObject *ConnectionEditorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ConnectionEditorBase( "ConnectionEditorBase", &ConnectionEditorBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ConnectionEditorBase::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 = {"addSlotClicked", 0, 0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQUMethod slot_2 = {"init", 0, 0 };
    static const TQUMethod slot_3 = {"destroy", 0, 0 };
    static const TQUMethod slot_4 = {"connectClicked", 0, 0 };
    static const TQUMethod slot_5 = {"connectionsChanged", 0, 0 };
    static const TQUMethod slot_6 = {"disconnectClicked", 0, 0 };
    static const TQUParameter param_slot_7[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_7 = {"receiverChanged", 1, param_slot_7 };
    static const TQUMethod slot_8 = {"okClicked", 0, 0 };
    static const TQUMethod slot_9 = {"signalChanged", 0, 0 };
    static const TQUMethod slot_10 = {"Q_SLOTSChanged", 0, 0 };
    static const TQUMethod slot_11 = {"cancelClicked", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "addSlotClicked()", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected },
	{ "init()", &slot_2, TQMetaData::Protected },
	{ "destroy()", &slot_3, TQMetaData::Protected },
	{ "connectClicked()", &slot_4, TQMetaData::Protected },
	{ "connectionsChanged()", &slot_5, TQMetaData::Protected },
	{ "disconnectClicked()", &slot_6, TQMetaData::Protected },
	{ "receiverChanged(const TQString&)", &slot_7, TQMetaData::Protected },
	{ "okClicked()", &slot_8, TQMetaData::Protected },
	{ "signalChanged()", &slot_9, TQMetaData::Protected },
	{ "Q_SLOTSChanged()", &slot_10, TQMetaData::Protected },
	{ "cancelClicked()", &slot_11, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ConnectionEditorBase", parentObject,
	slot_tbl, 12,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ConnectionEditorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ConnectionEditorBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: addSlotClicked(); break;
    case 1: languageChange(); break;
    case 2: init(); break;
    case 3: destroy(); break;
    case 4: connectClicked(); break;
    case 5: connectionsChanged(); break;
    case 6: disconnectClicked(); break;
    case 7: receiverChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 8: okClicked(); break;
    case 9: signalChanged(); break;
    case 10: Q_SLOTSChanged(); break;
    case 11: cancelClicked(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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