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

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

#include "quickbuttons_preferencesui.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    buttonListView = new TDEListView( this, "buttonListView" );
    buttonListView->addColumn( tr2i18n( "Button Name" ) );
    buttonListView->addColumn( tr2i18n( "Button Action" ) );
    buttonListView->setAcceptDrops( true );
    buttonListView->setAllColumnsShowFocus( true );
    buttonListView->setFullWidth( true );
    buttonListView->setItemsRenameable( false );
    buttonListView->setDragEnabled( true );

    QuickButtons_ConfigUILayout->addWidget( buttonListView, 0, 0 );

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

    actionInput = new KLineEdit( this, "actionInput" );
    actionInput->setEnabled( false );
    actionInput->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, actionInput->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( actionInput, 1, 1 );

    nameInput = new KLineEdit( this, "nameInput" );
    nameInput->setEnabled( false );
    nameInput->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, nameInput->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( nameInput, 0, 1 );

    actionLabel = new TQLabel( this, "actionLabel" );
    actionLabel->setEnabled( false );

    layout3->addWidget( actionLabel, 1, 0 );

    nameLabel = new TQLabel( this, "nameLabel" );
    nameLabel->setEnabled( false );

    layout3->addWidget( nameLabel, 0, 0 );

    QuickButtons_ConfigUILayout->addLayout( layout3, 1, 0 );

    groupBox3 = new TQGroupBox( this, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQHBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    placeholderHelpLabel = new TQLabel( groupBox3, "placeholderHelpLabel" );
    placeholderHelpLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, placeholderHelpLabel->sizePolicy().hasHeightForWidth() ) );
    groupBox3Layout->addWidget( placeholderHelpLabel );

    QuickButtons_ConfigUILayout->addWidget( groupBox3, 2, 0 );

    layout1 = new TQVBoxLayout( 0, 0, 6, "layout1"); 

    newButton = new TQPushButton( this, "newButton" );
    layout1->addWidget( newButton );

    removeButton = new TQPushButton( this, "removeButton" );
    layout1->addWidget( removeButton );
    spacer1 = new TQSpacerItem( 20, 230, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout1->addItem( spacer1 );

    QuickButtons_ConfigUILayout->addMultiCellLayout( layout1, 0, 2, 1, 1 );
    languageChange();
    resize( TQSize(439, 351).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( buttonListView, nameInput );
    setTabOrder( nameInput, actionInput );
    setTabOrder( actionInput, newButton );
    setTabOrder( newButton, removeButton );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void QuickButtons_ConfigUI::languageChange()
{
    buttonListView->header()->setLabel( 0, tr2i18n( "Button Name" ) );
    buttonListView->header()->setLabel( 1, tr2i18n( "Button Action" ) );
    actionLabel->setText( tr2i18n( "Button action:" ) );
    nameLabel->setText( tr2i18n( "Button name:" ) );
    groupBox3->setTitle( tr2i18n( "Available Placeholders" ) );
    placeholderHelpLabel->setText( tr2i18n( "%o: Current nickname\n"
"%c: Current channel\n"
"%K: Server password\n"
"%u: List of selected nicknames\n"
"%s<term>%: term used to separate nicknames in %u\n"
"%n: Send command directly to the server instead of your input line" ) );
    newButton->setText( tr2i18n( "New" ) );
    removeButton->setText( tr2i18n( "Remove" ) );
}

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

TQMetaObject *QuickButtons_ConfigUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_QuickButtons_ConfigUI( "QuickButtons_ConfigUI", &QuickButtons_ConfigUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* QuickButtons_ConfigUI::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 TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"QuickButtons_ConfigUI", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_QuickButtons_ConfigUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool QuickButtons_ConfigUI::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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