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

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

#include "externaltooldialogbase.h"

#include <ntqvariant.h>
#include <kicondialog.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurllabel.h>
#include <kurlrequester.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a ExternalToolDialogBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ExternalToolDialogBase::ExternalToolDialogBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "ExternalToolDialogBase" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( TQSize( 720, 0 ) );
    ExternalToolDialogBaseLayout = new TQGridLayout( this, 1, 1, 0, 6, "ExternalToolDialogBaseLayout"); 
    spacer3_2 = new TQSpacerItem( 487, 16, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    ExternalToolDialogBaseLayout->addItem( spacer3_2, 1, 2 );

    mDeleteButton = new TQPushButton( this, "mDeleteButton" );

    ExternalToolDialogBaseLayout->addWidget( mDeleteButton, 1, 1 );

    mAddButton = new TQPushButton( this, "mAddButton" );

    ExternalToolDialogBaseLayout->addWidget( mAddButton, 1, 0 );

    mToolListView = new TDEListView( this, "mToolListView" );
    mToolListView->addColumn( tr2i18n( "Name" ) );
    mToolListView->header()->setClickEnabled( false, mToolListView->header()->count() - 1 );
    mToolListView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, mToolListView->sizePolicy().hasHeightForWidth() ) );
    mToolListView->setFullWidth( true );

    ExternalToolDialogBaseLayout->addMultiCellWidget( mToolListView, 0, 0, 0, 1 );

    mMoreTools = new KURLLabel( this, "mMoreTools" );
    mMoreTools->setUseTips( true );

    ExternalToolDialogBaseLayout->addWidget( mMoreTools, 1, 3 );

    mDetails = new TQFrame( this, "mDetails" );
    mDetails->setFrameShape( TQFrame::NoFrame );
    mDetails->setFrameShadow( TQFrame::Raised );
    mDetailsLayout = new TQGridLayout( mDetails, 1, 1, 0, 6, "mDetailsLayout"); 

    textLabel1_2 = new TQLabel( mDetails, "textLabel1_2" );
    textLabel1_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );
    TQFont textLabel1_2_font(  textLabel1_2->font() );
    textLabel1_2_font.setBold( true );
    textLabel1_2->setFont( textLabel1_2_font ); 

    mDetailsLayout->addWidget( textLabel1_2, 1, 0 );

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

    mIconButton = new TDEIconButton( mDetails, "mIconButton" );
    mIconButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, mIconButton->sizePolicy().hasHeightForWidth() ) );

    layout3->addMultiCellWidget( mIconButton, 0, 1, 3, 3 );

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

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

    mHelp = new KURLLabel( mDetails, "mHelp" );

    layout3->addWidget( mHelp, 1, 2 );

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

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

    mName = new KLineEdit( mDetails, "mName" );

    layout3->addMultiCellWidget( mName, 0, 0, 1, 2 );

    mCommand = new KURLRequester( mDetails, "mCommand" );
    mCommand->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, mCommand->sizePolicy().hasHeightForWidth() ) );

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

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

    mFileAssociationGroup = new TQButtonGroup( mDetails, "mFileAssociationGroup" );
    mFileAssociationGroup->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 1, mFileAssociationGroup->sizePolicy().hasHeightForWidth() ) );
    mFileAssociationGroup->setFrameShape( TQButtonGroup::NoFrame );
    mFileAssociationGroup->setColumnLayout(0, TQt::Vertical );
    mFileAssociationGroup->layout()->setSpacing( 6 );
    mFileAssociationGroup->layout()->setMargin( 0 );
    mFileAssociationGroupLayout = new TQGridLayout( mFileAssociationGroup->layout() );
    mFileAssociationGroupLayout->setAlignment( TQt::AlignTop );

    radioButton1 = new TQRadioButton( mFileAssociationGroup, "radioButton1" );
    radioButton1->setChecked( true );
    mFileAssociationGroup->insert( radioButton1, 0 );

    mFileAssociationGroupLayout->addMultiCellWidget( radioButton1, 0, 0, 0, 1 );

    radioButton2 = new TQRadioButton( mFileAssociationGroup, "radioButton2" );
    mFileAssociationGroup->insert( radioButton2, 1 );

    mFileAssociationGroupLayout->addMultiCellWidget( radioButton2, 1, 1, 0, 1 );

    radioButton3 = new TQRadioButton( mFileAssociationGroup, "radioButton3" );

    mFileAssociationGroupLayout->addWidget( radioButton3, 2, 0 );
    spacer3 = new TQSpacerItem( 21, 140, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    mFileAssociationGroupLayout->addItem( spacer3, 3, 0 );

    mMimeTypeListView = new TDEListView( mFileAssociationGroup, "mMimeTypeListView" );
    mMimeTypeListView->addColumn( tr2i18n( "Mime Type" ) );
    mMimeTypeListView->header()->setClickEnabled( false, mMimeTypeListView->header()->count() - 1 );
    mMimeTypeListView->setEnabled( false );
    mMimeTypeListView->setFullWidth( true );

    mFileAssociationGroupLayout->addMultiCellWidget( mMimeTypeListView, 2, 3, 1, 1 );

    mDetailsLayout->addWidget( mFileAssociationGroup, 2, 0 );

    ExternalToolDialogBaseLayout->addMultiCellWidget( mDetails, 0, 0, 2, 3 );
    languageChange();
    resize( TQSize(723, 361).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( radioButton3, TQ_SIGNAL( toggled(bool) ), mMimeTypeListView, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( mToolListView, mAddButton );
    setTabOrder( mAddButton, mDeleteButton );
    setTabOrder( mDeleteButton, mName );
    setTabOrder( mName, mCommand );
    setTabOrder( mCommand, radioButton1 );
    setTabOrder( radioButton1, mMimeTypeListView );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ExternalToolDialogBase::languageChange()
{
    setCaption( tr2i18n( "Configure External Tools" ) );
    mDeleteButton->setText( tr2i18n( "&Delete" ) );
    mAddButton->setText( tr2i18n( "&Add" ) );
    mToolListView->header()->setLabel( 0, tr2i18n( "Name" ) );
    mMoreTools->setText( tr2i18n( "Get more tools" ) );
    mMoreTools->setProperty( "url", tr2i18n( "http://gwenview.sourceforge.net/tools" ) );
    textLabel1_2->setText( tr2i18n( "File Associations" ) );
    mIconButton->setText( TQString::null );
    textLabel1->setText( tr2i18n( "Name:" ) );
    mHelp->setText( tr2i18n( "Help" ) );
    mHelp->setProperty( "url", TQString::null );
    textLabel2->setText( tr2i18n( "Command:" ) );
    TQWhatsThis::add( mCommand, tr2i18n( "<qt>\n"
"You can use keywords in the Command field:\n"
"<ul>\n"
"<li><tt>%u</tt>: Current URL.</li>\n"
"<li><tt>%U</tt>: Current URLs. Use this if the tool can handle multiple files.</li>\n"
"<li><tt>%f</tt>: Current file. Use this if the tool can't handle URLs.</li>\n"
"<li><tt>%F</tt>: Same as %f, but for multiple files.</li>\n"
"</ul>\n"
"</qt>" ) );
    mFileAssociationGroup->setTitle( TQString::null );
    radioButton1->setText( tr2i18n( "All images" ) );
    radioButton2->setText( tr2i18n( "All files" ) );
    radioButton3->setText( tr2i18n( "Custom:" ) );
    mMimeTypeListView->header()->setLabel( 0, tr2i18n( "Mime Type" ) );
}

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

TQMetaObject *ExternalToolDialogBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ExternalToolDialogBase( "ExternalToolDialogBase", &ExternalToolDialogBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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