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

#include "dbconnections.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqlistbox.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    DatabaseConnectionBaseLayout->addWidget( buttonNew, 0, 1 );

    listConnections = new TQListBox( this, "listConnections" );

    DatabaseConnectionBaseLayout->addMultiCellWidget( listConnections, 0, 4, 0, 0 );

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

    DatabaseConnectionBaseLayout->addWidget( buttonDelete, 1, 1 );

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

    buttonHelp = new TQPushButton( this, "buttonHelp" );
    buttonHelp->setAutoDefault( true );
    Layout5->addWidget( buttonHelp );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout5->addItem( Horizontal_Spacing2 );

    buttonClose = new TQPushButton( this, "buttonClose" );
    buttonClose->setAutoDefault( true );
    Layout5->addWidget( buttonClose );

    DatabaseConnectionBaseLayout->addMultiCellLayout( Layout5, 5, 5, 0, 2 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    DatabaseConnectionBaseLayout->addMultiCell( Spacer1, 2, 4, 1, 1 );

    grp = new TQGroupBox( this, "grp" );
    grp->setColumnLayout(0, TQt::Vertical );
    grp->layout()->setSpacing( 6 );
    grp->layout()->setMargin( 11 );
    grpLayout = new TQGridLayout( grp->layout() );
    grpLayout->setAlignment( TQt::AlignTop );
    Spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    grpLayout->addItem( Spacer3, 0, 0 );

    DatabaseConnectionBaseLayout->addMultiCellWidget( grp, 0, 2, 2, 2 );

    Layout4 = new TQHBoxLayout( 0, 0, 6, "Layout4"); 
    Spacer4 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout4->addItem( Spacer4 );

    buttonConnect = new TQPushButton( this, "buttonConnect" );
    buttonConnect->setEnabled( false );
    Layout4->addWidget( buttonConnect );
    Spacer5 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout4->addItem( Spacer5 );

    DatabaseConnectionBaseLayout->addLayout( Layout4, 3, 2 );
    Spacer6 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    DatabaseConnectionBaseLayout->addItem( Spacer6, 4, 2 );
    languageChange();
    resize( TQSize(512, 309).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonClose, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonNew, TQ_SIGNAL( clicked() ), this, TQ_SLOT( newConnection() ) );
    connect( buttonDelete, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteConnection() ) );
    connect( buttonConnect, TQ_SIGNAL( clicked() ), this, TQ_SLOT( doConnect() ) );
    connect( listConnections, TQ_SIGNAL( highlighted(const TQString&) ), this, TQ_SLOT( currentConnectionChanged(const TQString&) ) );
    connect( listConnections, TQ_SIGNAL( selected(const TQString&) ), this, TQ_SLOT( currentConnectionChanged(const TQString&) ) );

    // tab order
    setTabOrder( buttonClose, listConnections );
    setTabOrder( listConnections, buttonNew );
    setTabOrder( buttonNew, buttonDelete );
    setTabOrder( buttonDelete, buttonConnect );
    setTabOrder( buttonConnect, buttonHelp );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DatabaseConnectionBase::languageChange()
{
    setCaption( tr( "Edit Database Connections" ) );
    buttonNew->setText( tr( "&New Connection" ) );
    buttonDelete->setText( tr( "&Delete Connection" ) );
    buttonHelp->setText( tr( "&Help" ) );
    buttonClose->setText( tr( "&Close" ) );
    TQWhatsThis::add( buttonClose, tr( "Close the dialog and discard any changes." ) );
    grp->setTitle( tr( "Connection" ) );
    buttonConnect->setText( tr( "Connec&t" ) );
}

void DatabaseConnectionBase::init()
{
}

void DatabaseConnectionBase::destroy()
{
}

void DatabaseConnectionBase::currentConnectionChanged(const TQString&)
{
    tqWarning( "DatabaseConnectionBase::currentConnectionChanged(const TQString&): Not implemented yet" );
}

void DatabaseConnectionBase::deleteConnection()
{
    tqWarning( "DatabaseConnectionBase::deleteConnection(): Not implemented yet" );
}

void DatabaseConnectionBase::newConnection()
{
    tqWarning( "DatabaseConnectionBase::newConnection(): Not implemented yet" );
}

void DatabaseConnectionBase::connectionNameChanged(const TQString&)
{
    tqWarning( "DatabaseConnectionBase::connectionNameChanged(const TQString&): Not implemented yet" );
}

void DatabaseConnectionBase::doConnect()
{
    tqWarning( "DatabaseConnectionBase::doConnect(): Not implemented yet" );
}

