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

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

#include "stringreplacerconfwidget.h"

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

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

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 

    nameLabel = new TQLabel( this, "nameLabel" );
    nameLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout3->addWidget( nameLabel );

    nameLineEdit = new KLineEdit( this, "nameLineEdit" );
    layout3->addWidget( nameLineEdit );

    StringReplacerConfWidgetLayout->addLayout( layout3, 0, 0 );

    applyGroupBox = new TQGroupBox( this, "applyGroupBox" );
    applyGroupBox->setColumnLayout(0, TQt::Vertical );
    applyGroupBox->layout()->setSpacing( 6 );
    applyGroupBox->layout()->setMargin( 11 );
    applyGroupBoxLayout = new TQGridLayout( applyGroupBox->layout() );
    applyGroupBoxLayout->setAlignment( TQt::AlignTop );

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

    languageLabel = new TQLabel( applyGroupBox, "languageLabel" );
    languageLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout11->addWidget( languageLabel );

    appIdLabel = new TQLabel( applyGroupBox, "appIdLabel" );
    appIdLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout11->addWidget( appIdLabel );

    applyGroupBoxLayout->addLayout( layout11, 0, 0 );

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

    layout12 = new TQHBoxLayout( 0, 0, 6, "layout12"); 

    languageLineEdit = new KLineEdit( applyGroupBox, "languageLineEdit" );
    languageLineEdit->setEnabled( false );
    layout12->addWidget( languageLineEdit );

    languageBrowseButton = new KPushButton( applyGroupBox, "languageBrowseButton" );
    layout12->addWidget( languageBrowseButton );
    layout13->addLayout( layout12 );

    appIdLineEdit = new KLineEdit( applyGroupBox, "appIdLineEdit" );
    layout13->addWidget( appIdLineEdit );

    applyGroupBoxLayout->addLayout( layout13, 0, 1 );

    StringReplacerConfWidgetLayout->addWidget( applyGroupBox, 3, 0 );

    layout6 = new TQHBoxLayout( 0, 0, 6, "layout6"); 

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

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

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

    StringReplacerConfWidgetLayout->addLayout( layout6, 2, 0 );

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

    substLView = new TDEListView( this, "substLView" );
    substLView->addColumn( tr2i18n( "Type" ) );
    substLView->addColumn( tr2i18n( "Match Case" ) );
    substLView->addColumn( tr2i18n( "Match" ) );
    substLView->addColumn( tr2i18n( "Replace With" ) );
    substLView->setFullWidth( true );

    layout24->addWidget( substLView, 0, 0 );

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

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

    upButton = new TQPushButton( this, "upButton" );
    upButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, upButton->sizePolicy().hasHeightForWidth() ) );
    layout23->addWidget( upButton );

    downButton = new TQPushButton( this, "downButton" );
    downButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, downButton->sizePolicy().hasHeightForWidth() ) );
    layout23->addWidget( downButton );

    editButton = new KPushButton( this, "editButton" );
    editButton->setEnabled( false );
    editButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, editButton->sizePolicy().hasHeightForWidth() ) );
    editButton->setToggleButton( false );
    layout23->addWidget( editButton );

    removeButton = new KPushButton( this, "removeButton" );
    removeButton->setEnabled( false );
    removeButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, removeButton->sizePolicy().hasHeightForWidth() ) );
    removeButton->setToggleButton( false );
    layout23->addWidget( removeButton );
    spacer13 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout23->addItem( spacer13 );

    layout24->addLayout( layout23, 0, 1 );

    StringReplacerConfWidgetLayout->addLayout( layout24, 1, 0 );
    languageChange();
    resize( TQSize(548, 421).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( nameLineEdit, substLView );
    setTabOrder( substLView, addButton );
    setTabOrder( addButton, upButton );
    setTabOrder( upButton, downButton );
    setTabOrder( downButton, editButton );
    setTabOrder( editButton, removeButton );
    setTabOrder( removeButton, loadButton );
    setTabOrder( loadButton, saveButton );
    setTabOrder( saveButton, clearButton );
    setTabOrder( clearButton, languageLineEdit );
    setTabOrder( languageLineEdit, languageBrowseButton );
    setTabOrder( languageBrowseButton, appIdLineEdit );

    // buddies
    nameLabel->setBuddy( nameLineEdit );
    languageLabel->setBuddy( languageLineEdit );
    appIdLabel->setBuddy( appIdLineEdit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void StringReplacerConfWidget::languageChange()
{
    setCaption( tr2i18n( "Configure String Replacer" ) );
    nameLabel->setText( tr2i18n( "&Name:" ) );
    TQWhatsThis::add( nameLabel, tr2i18n( "Enter any name you like for this filter.", "What's this text" ) );
    TQWhatsThis::add( nameLineEdit, tr2i18n( "Enter any name you like for this filter." ) );
    applyGroupBox->setTitle( tr2i18n( "Apply This &Filter When" ) );
    TQWhatsThis::add( applyGroupBox, tr2i18n( "These settings determines when the filter is applied to text." ) );
    languageLabel->setText( tr2i18n( "Lan&guage is:" ) );
    TQWhatsThis::add( languageLabel, tr2i18n( "This filter is applied to text jobs of the specified language.  You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list.  If blank the filter applies to all text jobs of any language.", "What's this text" ) );
    appIdLabel->setText( tr2i18n( "Application &ID contains:" ) );
    TQWhatsThis::add( appIdLabel, tr2i18n( "Enter a DCOP Application ID.  This filter will only apply to text jobs queued by that application.  You may enter more than one ID separated by commas.  If blank, this filter applies to text jobs queued by all applications.  Tip: Use kdcop from the command line to get the Application IDs of running applications.  Example: \"konversation, kvirc,ksirc,kopete\"" ) );
    TQWhatsThis::add( languageLineEdit, tr2i18n( "This filter is applied to text jobs of the specified language.  You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list.  If blank the filter applies to all text jobs of any language." ) );
    languageBrowseButton->setText( tr2i18n( "..." ) );
    TQWhatsThis::add( languageBrowseButton, tr2i18n( "Click to select one or more languages.  This filter will be applied to text jobs of those languages." ) );
    TQWhatsThis::add( appIdLineEdit, tr2i18n( "<qt>Enter a DCOP Application ID.  This filter will only apply to text jobs queued by that application.  You may enter more than one ID separated by commas.  Use <b>knotify</b> to match all messages sent as TDE notifications.  If blank, this filter applies to text jobs queued by all applications.  Tip: Use kdcop from the command line to get the Application IDs of running applications.  Example: \"konversation, kvirc,ksirc,kopete\"</qt>" ) );
    loadButton->setText( tr2i18n( "Load..." ) );
    TQWhatsThis::add( loadButton, tr2i18n( "Click to load a word list from a file.", "What's this text" ) );
    saveButton->setText( tr2i18n( "&Save..." ) );
    TQWhatsThis::add( saveButton, tr2i18n( "Click to save word list to a file.", "What's this text" ) );
    clearButton->setText( tr2i18n( "C&lear" ) );
    TQWhatsThis::add( clearButton, tr2i18n( "Click to empty the word list.", "What's this text" ) );
    substLView->header()->setLabel( 0, tr2i18n( "Type" ) );
    substLView->header()->setLabel( 1, tr2i18n( "Match Case" ) );
    substLView->header()->setLabel( 2, tr2i18n( "Match" ) );
    substLView->header()->setLabel( 3, tr2i18n( "Replace With" ) );
    addButton->setText( tr2i18n( "&Add..." ) );
    TQWhatsThis::add( addButton, tr2i18n( "Click to add another word or regular expression to the list.", "What's this text" ) );
    upButton->setText( tr2i18n( "&Up" ) );
    TQWhatsThis::add( upButton, tr2i18n( "Click to move selected word up in the list.  Words higher in the list are applied first." ) );
    downButton->setText( tr2i18n( "Do&wn" ) );
    TQWhatsThis::add( downButton, tr2i18n( "Click to move a word down in the list.  Words lower in the list are applied last." ) );
    editButton->setText( tr2i18n( "&Edit..." ) );
    TQWhatsThis::add( editButton, tr2i18n( "Click to modify an existing word or regular expression in the list." ) );
    removeButton->setText( tr2i18n( "&Remove" ) );
    TQWhatsThis::add( removeButton, tr2i18n( "Click to remove a word or regular expression from the list." ) );
}

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

TQMetaObject *StringReplacerConfWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_StringReplacerConfWidget( "StringReplacerConfWidget", &StringReplacerConfWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* StringReplacerConfWidget::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(
	"StringReplacerConfWidget", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_StringReplacerConfWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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