/****************************************************************************
** 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( tr( "View and Edit Connections" ) );
    PushButton1->setText( tr( "&New" ) );
    TextLabel1->setText( tr( "&Connections:" ) );
    PushButton2->setText( tr( "&Delete" ) );
    PushButton3->setText( tr( "&Cancel" ) );
    PushButton7->setText( tr( "&OK" ) );
    buttonEditSlots->setText( tr( "&Edit Slots..." ) );
}

