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

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

#include "quicktoolconfigwidget.h"

#include <ntqvariant.h>
#include <tdelocale.h>
#include <tqstring.h>
#include <tdeglobal.h>
#include <kcombobox.h>
#include <ntqlabel.h>
#include <kpushbutton.h>
#include <tdelistbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kiletoolmanager.h"
#include "quicktoolconfigwidget.ui.h"

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

    m_cbTools = new KComboBox( false, this, "m_cbTools" );
    m_cbTools->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)2, (TQSizePolicy::SizeType)0, 1, 0, m_cbTools->sizePolicy().hasHeightForWidth() ) );
    m_cbTools->setMinimumSize( TQSize( 100, 0 ) );

    QuickToolConfigWidgetLayout->addMultiCellWidget( m_cbTools, 0, 0, 1, 2 );

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

    QuickToolConfigWidgetLayout->addWidget( m_lbTool, 0, 0 );

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

    QuickToolConfigWidgetLayout->addWidget( m_lbConfig, 0, 3 );

    m_cbConfigs = new KComboBox( false, this, "m_cbConfigs" );
    m_cbConfigs->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)2, (TQSizePolicy::SizeType)0, 1, 0, m_cbConfigs->sizePolicy().hasHeightForWidth() ) );
    m_cbConfigs->setMinimumSize( TQSize( 150, 0 ) );

    QuickToolConfigWidgetLayout->addWidget( m_cbConfigs, 0, 4 );

    m_pshbAdd = new KPushButton( this, "m_pshbAdd" );
    m_pshbAdd->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, m_pshbAdd->sizePolicy().hasHeightForWidth() ) );

    QuickToolConfigWidgetLayout->addMultiCellWidget( m_pshbAdd, 1, 1, 0, 1 );

    m_pshbRemove = new KPushButton( this, "m_pshbRemove" );
    m_pshbRemove->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, m_pshbRemove->sizePolicy().hasHeightForWidth() ) );

    QuickToolConfigWidgetLayout->addMultiCellWidget( m_pshbRemove, 2, 2, 0, 1 );

    m_pshbDown = new KPushButton( this, "m_pshbDown" );
    m_pshbDown->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, m_pshbDown->sizePolicy().hasHeightForWidth() ) );

    QuickToolConfigWidgetLayout->addMultiCellWidget( m_pshbDown, 5, 5, 0, 1 );

    m_pshbUp = new KPushButton( this, "m_pshbUp" );
    m_pshbUp->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, m_pshbUp->sizePolicy().hasHeightForWidth() ) );

    QuickToolConfigWidgetLayout->addMultiCellWidget( m_pshbUp, 4, 4, 0, 1 );
    spacer5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    QuickToolConfigWidgetLayout->addItem( spacer5, 3, 0 );

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

    QuickToolConfigWidgetLayout->addMultiCellWidget( m_lstbSeq, 1, 5, 2, 4 );
    languageChange();
    resize( TQSize(407, 216).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_pshbAdd, TQ_SIGNAL( clicked() ), this, TQ_SLOT( add() ) );
    connect( m_pshbRemove, TQ_SIGNAL( clicked() ), this, TQ_SLOT( remove() ) );
    connect( m_pshbUp, TQ_SIGNAL( clicked() ), this, TQ_SLOT( up() ) );
    connect( m_pshbDown, TQ_SIGNAL( clicked() ), this, TQ_SLOT( down() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void QuickToolConfigWidget::languageChange()
{
    m_lbTool->setText( tr2i18n( "Tool:" ) );
    m_lbConfig->setText( tr2i18n( "Configuration:" ) );
    m_pshbAdd->setText( tr2i18n( "&Add" ) );
    m_pshbRemove->setText( tr2i18n( "&Remove" ) );
    m_pshbDown->setText( tr2i18n( "&Down" ) );
    m_pshbUp->setText( tr2i18n( "&Up" ) );
}

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

TQMetaObject *QuickToolConfigWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_QuickToolConfigWidget( "QuickToolConfigWidget", &QuickToolConfigWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* QuickToolConfigWidget::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 = TQWidget::staticMetaObject();
    static const TQUParameter param_slot_0[] = {
	{ "sequence", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"updateSequence", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "tool", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"updateConfigs", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQUMethod slot_3 = {"down", 0, 0 };
    static const TQUMethod slot_4 = {"up", 0, 0 };
    static const TQUMethod slot_5 = {"remove", 0, 0 };
    static const TQUMethod slot_6 = {"add", 0, 0 };
    static const TQUMethod slot_7 = {"changed", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "updateSequence(const TQString&)", &slot_0, TQMetaData::Public },
	{ "updateConfigs(const TQString&)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected },
	{ "down()", &slot_3, TQMetaData::Private },
	{ "up()", &slot_4, TQMetaData::Private },
	{ "remove()", &slot_5, TQMetaData::Private },
	{ "add()", &slot_6, TQMetaData::Private },
	{ "changed()", &slot_7, TQMetaData::Private }
    };
    static const TQUParameter param_signal_0[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_0 = {"sequenceChanged", 1, param_signal_0 };
    static const TQMetaData signal_tbl[] = {
	{ "sequenceChanged(const TQString&)", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"QuickToolConfigWidget", parentObject,
	slot_tbl, 8,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_QuickToolConfigWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL sequenceChanged
void QuickToolConfigWidget::sequenceChanged( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
}

bool QuickToolConfigWidget::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: updateSequence((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 1: updateConfigs((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 2: languageChange(); break;
    case 3: down(); break;
    case 4: up(); break;
    case 5: remove(); break;
    case 6: add(); break;
    case 7: changed(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool QuickToolConfigWidget::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: sequenceChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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