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

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

#include "aliasdialog.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqlabel.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    AliasDialogLayout->addWidget( textLabel2, 1, 0 );

    command = new KLineEdit( this, "command" );

    AliasDialogLayout->addMultiCellWidget( command, 1, 1, 1, 2 );

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

    AliasDialogLayout->addWidget( textLabel1, 0, 0 );

    alias = new KLineEdit( this, "alias" );

    AliasDialogLayout->addMultiCellWidget( alias, 0, 0, 1, 2 );

    addButton = new KPushButton( this, "addButton" );
    addButton->setDefault( false );

    AliasDialogLayout->addWidget( addButton, 4, 1 );

    kPushButton3 = new KPushButton( this, "kPushButton3" );

    AliasDialogLayout->addWidget( kPushButton3, 4, 2 );

    protocolList = new TDEListView( this, "protocolList" );
    protocolList->addColumn( tr2i18n( "Protocols" ) );
    protocolList->setEnabled( true );
    protocolList->setProperty( "selectionMode", "Multi" );
    protocolList->setItemMargin( 0 );
    protocolList->setResizeMode( TDEListView::AllColumns );
    protocolList->setFullWidth( true );
    protocolList->setItemsMovable( false );

    AliasDialogLayout->addMultiCellWidget( protocolList, 2, 2, 1, 2 );

    textLabel4 = new TQLabel( this, "textLabel4" );
    textLabel4->setEnabled( true );
    textLabel4->setAlignment( int( TQLabel::AlignTop ) );

    AliasDialogLayout->addWidget( textLabel4, 2, 0 );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );

    AliasDialogLayout->addMultiCellWidget( line1, 3, 3, 0, 2 );
    languageChange();
    resize( TQSize(361, 268).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kPushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( addButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );

    // tab order
    setTabOrder( alias, command );
    setTabOrder( command, protocolList );
    setTabOrder( protocolList, addButton );
    setTabOrder( addButton, kPushButton3 );

    // buddies
    textLabel2->setBuddy( command );
    textLabel1->setBuddy( alias );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void AliasDialog::languageChange()
{
    setCaption( tr2i18n( "Add New Alias" ) );
    textLabel2->setText( tr2i18n( "Command:" ) );
    TQToolTip::add( command, tr2i18n( "This is the command that you want to run when you execute this alias. " ) );
    TQWhatsThis::add( command, tr2i18n( "<qt>This is the command that you want to run when you execute this alias.\n"
"\n"
"You can use the variables <b>%1, %2 ... %9</b> in your command, and they will be replaced with the arguments of the alias. The variable <b>%s</b> will be replaced with all arguments. <b>%n</b> expands to your nickname.\n"
"\n"
"Do not include the '/' in the command (if you do it will be stripped off anyway).</qt>" ) );
    textLabel1->setText( tr2i18n( "Alias:" ) );
    TQToolTip::add( alias, tr2i18n( "This is the alias you are adding (what you will type after the command identifier, '/')." ) );
    TQWhatsThis::add( alias, tr2i18n( "This is the alias you are adding (what you will type after the command identifier, '/'). Do not include the '/' (it will be stripped off if you do anyway)." ) );
    addButton->setText( tr2i18n( "&Save" ) );
    kPushButton3->setText( tr2i18n( "&Cancel" ) );
    protocolList->header()->setLabel( 0, tr2i18n( "Protocols" ) );
    TQToolTip::add( protocolList, tr2i18n( "If you want this alias to only be active for certain protocols, select those protocols here." ) );
    TQWhatsThis::add( protocolList, tr2i18n( "If you want this alias to only be active for certain protocols, select those protocols here." ) );
    textLabel4->setText( tr2i18n( "For protocols:" ) );
}

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

TQMetaObject *AliasDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_AliasDialog( "AliasDialog", &AliasDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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