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

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

#include "configtoolboxdialog.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqtoolbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "myiconloader.h"
#include "configtoolboxdialog.ui.h"
/*
 *  Constructs a ConfigToolboxDialog 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.
 */
ConfigToolboxDialog::ConfigToolboxDialog( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ConfigToolboxDialog" );
    ConfigToolboxDialogLayout = new TQGridLayout( this, 1, 1, 11, 6, "ConfigToolboxDialogLayout"); 

    Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2"); 
    Spacer2 = new TQSpacerItem( 342, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout2->addItem( Spacer2 );

    PushButton3 = new TQPushButton( this, "PushButton3" );
    PushButton3->setDefault( true );
    Layout2->addWidget( PushButton3 );

    PushButton4 = new TQPushButton( this, "PushButton4" );
    Layout2->addWidget( PushButton4 );

    ConfigToolboxDialogLayout->addMultiCellLayout( Layout2, 1, 1, 0, 1 );

    Layout4 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout4"); 

    buttonAdd = new TQPushButton( this, "buttonAdd" );
    buttonAdd->setEnabled( false );

    Layout4->addWidget( buttonAdd, 1, 1 );
    Spacer3 = new TQSpacerItem( 111, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout4->addItem( Spacer3, 1, 0 );

    listViewTools = new TQListView( this, "listViewTools" );
    listViewTools->addColumn( tr2i18n( "Available Tools" ) );
    listViewTools->setSelectionMode( TQListView::Extended );
    listViewTools->setResizeMode( TQListView::LastColumn );

    Layout4->addMultiCellWidget( listViewTools, 0, 0, 0, 1 );

    ConfigToolboxDialogLayout->addLayout( Layout4, 0, 0 );

    Layout5 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout5"); 

    buttonRemove = new TQPushButton( this, "buttonRemove" );
    buttonRemove->setEnabled( false );

    Layout5->addWidget( buttonRemove, 1, 0 );

    listViewCommon = new TQListView( this, "listViewCommon" );
    listViewCommon->addColumn( tr2i18n( "Common Widgets Page" ) );
    listViewCommon->setSelectionMode( TQListView::Extended );
    listViewCommon->setResizeMode( TQListView::LastColumn );

    Layout5->addMultiCellWidget( listViewCommon, 0, 0, 0, 3 );

    buttonDown = new TQToolButton( this, "buttonDown" );
    buttonDown->setEnabled( false );
    buttonDown->setPixmap( BarIcon2( "designer_s_down.png" ) );

    Layout5->addWidget( buttonDown, 1, 3 );
    Spacer4 = new TQSpacerItem( 41, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout5->addItem( Spacer4, 1, 1 );

    buttonUp = new TQToolButton( this, "buttonUp" );
    buttonUp->setEnabled( false );
    buttonUp->setPixmap( BarIcon2( "designer_s_up.png" ) );

    Layout5->addWidget( buttonUp, 1, 2 );

    ConfigToolboxDialogLayout->addLayout( Layout5, 0, 1 );
    languageChange();
    resize( TQSize(403, 467).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonAdd, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addTool() ) );
    connect( buttonRemove, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeTool() ) );
    connect( buttonUp, TQ_SIGNAL( clicked() ), this, TQ_SLOT( moveToolUp() ) );
    connect( buttonDown, TQ_SIGNAL( clicked() ), this, TQ_SLOT( moveToolDown() ) );
    connect( listViewTools, TQ_SIGNAL( clicked(TQListViewItem*) ), this, TQ_SLOT( currentToolChanged(TQListViewItem*) ) );
    connect( listViewCommon, TQ_SIGNAL( clicked(TQListViewItem*) ), this, TQ_SLOT( currentCommonToolChanged(TQListViewItem*) ) );
    connect( PushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( PushButton4, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( PushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( ok() ) );
    connect( listViewTools, TQ_SIGNAL( doubleClicked(TQListViewItem*) ), this, TQ_SLOT( addTool() ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConfigToolboxDialog::languageChange()
{
    setCaption( tr2i18n( "Configure Toolbox" ) );
    PushButton3->setText( tr2i18n( "&OK" ) );
    PushButton4->setText( tr2i18n( "&Cancel" ) );
    buttonAdd->setText( tr2i18n( "&Add" ) );
    listViewTools->header()->setLabel( 0, tr2i18n( "Available Tools" ) );
    buttonRemove->setText( tr2i18n( "&Remove" ) );
    listViewCommon->header()->setLabel( 0, tr2i18n( "Common Widgets Page" ) );
    buttonDown->setText( TQString::null );
    buttonUp->setText( TQString::null );
}

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

TQMetaObject *ConfigToolboxDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ConfigToolboxDialog( "ConfigToolboxDialog", &ConfigToolboxDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ConfigToolboxDialog::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"addTool", 0, 0 };
    static const TQUMethod slot_1 = {"removeTool", 0, 0 };
    static const TQUMethod slot_2 = {"moveToolUp", 0, 0 };
    static const TQUMethod slot_3 = {"moveToolDown", 0, 0 };
    static const TQUParameter param_slot_4[] = {
	{ "i", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"currentToolChanged", 1, param_slot_4 };
    static const TQUParameter param_slot_5[] = {
	{ "i", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_5 = {"currentCommonToolChanged", 1, param_slot_5 };
    static const TQUMethod slot_6 = {"ok", 0, 0 };
    static const TQUMethod slot_7 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "addTool()", &slot_0, TQMetaData::Public },
	{ "removeTool()", &slot_1, TQMetaData::Public },
	{ "moveToolUp()", &slot_2, TQMetaData::Public },
	{ "moveToolDown()", &slot_3, TQMetaData::Public },
	{ "currentToolChanged(TQListViewItem*)", &slot_4, TQMetaData::Public },
	{ "currentCommonToolChanged(TQListViewItem*)", &slot_5, TQMetaData::Public },
	{ "ok()", &slot_6, TQMetaData::Public },
	{ "languageChange()", &slot_7, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ConfigToolboxDialog", parentObject,
	slot_tbl, 8,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ConfigToolboxDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ConfigToolboxDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: addTool(); break;
    case 1: removeTool(); break;
    case 2: moveToolUp(); break;
    case 3: moveToolDown(); break;
    case 4: currentToolChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 5: currentCommonToolChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: ok(); break;
    case 7: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

bool ConfigToolboxDialog::tqt_emit( int _id, TQUObject* _o )
{
    return TQDialog::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

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

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