#include "simapi.h"
/****************************************************************************
** Form implementation generated from reading ui file './managerbase.ui'
**
** Created: вт мар 30 16:43:34 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.1.2   edited Dec 19 11:45 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "managerbase.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qheader.h>
#include <qlistview.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/* 
 *  Constructs a ConnectionManagerBase as a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
ConnectionManagerBase::ConnectionManagerBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "Connection" );
    setProperty( "sizeGripEnabled", QVariant( TRUE, 0 ) );
    ConnectionLayout = new QGridLayout( this, 1, 1, 11, 6, "ConnectionLayout"); 

    btnUpdate = new QPushButton( this, "btnUpdate" );

    ConnectionLayout->addWidget( btnUpdate, 2, 1 );

    btnUp = new QPushButton( this, "btnUp" );
    btnUp->setProperty( "autoDefault", QVariant( TRUE, 0 ) );

    ConnectionLayout->addWidget( btnUp, 0, 1 );

    lstConnection = new QListView( this, "lstConnection" );
    lstConnection->addColumn( i18n( "Connection" ) );

    ConnectionLayout->addMultiCellWidget( lstConnection, 0, 5, 0, 0 );

    btnDown = new QPushButton( this, "btnDown" );

    ConnectionLayout->addWidget( btnDown, 1, 1 );

    btnRemove = new QPushButton( this, "btnRemove" );

    ConnectionLayout->addWidget( btnRemove, 4, 1 );

    btnAdd = new QPushButton( this, "btnAdd" );

    ConnectionLayout->addWidget( btnAdd, 3, 1 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    ConnectionLayout->addItem( spacer, 5, 1 );

    Layout4 = new QHBoxLayout( 0, 0, 6, "Layout4"); 
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout4->addItem( spacer_2 );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setProperty( "autoDefault", QVariant( TRUE, 0 ) );
    Layout4->addWidget( buttonCancel );

    ConnectionLayout->addMultiCellLayout( Layout4, 6, 6, 0, 1 );
    languageChange();
    resize( QSize(306, 252).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );

    // tab order
    setTabOrder( lstConnection, btnUp );
    setTabOrder( btnUp, btnDown );
    setTabOrder( btnDown, btnUpdate );
    setTabOrder( btnUpdate, btnAdd );
    setTabOrder( btnAdd, btnRemove );
    setTabOrder( btnRemove, buttonCancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConnectionManagerBase::languageChange()
{
    setProperty( "caption", i18n( "Connection manager" ) );
    btnUpdate->setProperty( "text", i18n( "&Configure" ) );
    btnUp->setProperty( "text", i18n( "&Up" ) );
    lstConnection->header()->setLabel( 0, i18n( "Connection" ) );
    btnDown->setProperty( "text", i18n( "&Down" ) );
    btnRemove->setProperty( "text", i18n( "&Remove" ) );
    btnAdd->setProperty( "text", i18n( "&New connection" ) );
    buttonCancel->setProperty( "text", i18n( "&Close" ) );
}

#include "managerbase.moc"
