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

#include "dbconnection.h"

#include <ntqvariant.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqspinbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a DatabaseConnectionWidget as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
DatabaseConnectionWidget::DatabaseConnectionWidget( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "DatabaseConnectionWidget" );
    DatabaseConnectionWidgetLayout = new TQGridLayout( this, 1, 1, 0, 6, "DatabaseConnectionWidgetLayout"); 

    TextLabel3 = new TQLabel( this, "TextLabel3" );

    DatabaseConnectionWidgetLayout->addWidget( TextLabel3, 2, 0 );

    TextLabel4 = new TQLabel( this, "TextLabel4" );

    DatabaseConnectionWidgetLayout->addWidget( TextLabel4, 3, 0 );

    TextLabel4_2 = new TQLabel( this, "TextLabel4_2" );

    DatabaseConnectionWidgetLayout->addWidget( TextLabel4_2, 4, 0 );

    TextLabel2 = new TQLabel( this, "TextLabel2" );

    DatabaseConnectionWidgetLayout->addWidget( TextLabel2, 1, 0 );

    editName = new TQLineEdit( this, "editName" );
    editName->setEnabled( false );

    DatabaseConnectionWidgetLayout->addWidget( editName, 0, 1 );

    TextLabel5 = new TQLabel( this, "TextLabel5" );

    DatabaseConnectionWidgetLayout->addWidget( TextLabel5, 5, 0 );

    comboDriver = new TQComboBox( false, this, "comboDriver" );
    comboDriver->setEnabled( false );
    comboDriver->setEditable( true );

    DatabaseConnectionWidgetLayout->addWidget( comboDriver, 1, 1 );

    TextLabel1 = new TQLabel( this, "TextLabel1" );

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

    editHostname = new TQLineEdit( this, "editHostname" );
    editHostname->setEnabled( false );

    DatabaseConnectionWidgetLayout->addWidget( editHostname, 5, 1 );

    TextLabel1_2 = new TQLabel( this, "TextLabel1_2" );

    DatabaseConnectionWidgetLayout->addWidget( TextLabel1_2, 6, 0 );

    editUsername = new TQLineEdit( this, "editUsername" );
    editUsername->setEnabled( false );

    DatabaseConnectionWidgetLayout->addWidget( editUsername, 3, 1 );

    editPassword = new TQLineEdit( this, "editPassword" );
    editPassword->setEnabled( false );
    editPassword->setEchoMode( TQLineEdit::Password );

    DatabaseConnectionWidgetLayout->addWidget( editPassword, 4, 1 );

    editDatabase = new TQLineEdit( this, "editDatabase" );
    editDatabase->setEnabled( false );

    DatabaseConnectionWidgetLayout->addWidget( editDatabase, 2, 1 );

    editPort = new TQSpinBox( this, "editPort" );
    editPort->setEnabled( false );
    editPort->setMaxValue( 65535 );
    editPort->setMinValue( -1 );
    editPort->setValue( -1 );

    DatabaseConnectionWidgetLayout->addWidget( editPort, 6, 1 );
    languageChange();
    resize( TQSize(199, 185).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections

    // tab order
    setTabOrder( editName, comboDriver );
    setTabOrder( comboDriver, editDatabase );
    setTabOrder( editDatabase, editUsername );
    setTabOrder( editUsername, editPassword );
    setTabOrder( editPassword, editHostname );
    setTabOrder( editHostname, editPort );

    // buddies
    TextLabel3->setBuddy( editDatabase );
    TextLabel4->setBuddy( editUsername );
    TextLabel4_2->setBuddy( editPassword );
    TextLabel2->setBuddy( comboDriver );
    TextLabel5->setBuddy( editHostname );
    TextLabel1->setBuddy( editName );
    TextLabel1_2->setBuddy( editPort );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DatabaseConnectionWidget::languageChange()
{
    setCaption( tr( "Edit Database Connection" ) );
    TextLabel3->setText( tr( "&Database Name:" ) );
    TextLabel4->setText( tr( "&Username:" ) );
    TextLabel4_2->setText( tr( "&Password:" ) );
    TextLabel2->setText( tr( "D&river" ) );
    TextLabel5->setText( tr( "&Hostname:" ) );
    TextLabel1->setText( tr( "&Name:" ) );
    TextLabel1_2->setText( tr( "P&ort" ) );
    editPort->setSpecialValueText( tr( "Default" ) );
}

void DatabaseConnectionWidget::init()
{
}

void DatabaseConnectionWidget::destroy()
{
}

