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

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

#include "tagguesserconfigdialog.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <tdelistview.h>
#include <kpushbutton.h>
#include <ntqtoolbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "tagguesserconfigdialog.ui.h"

/*
 *  Constructs a TagGuesserConfigDialog which is a child of 'parent', with the
 *  name 'name'.' 
 */
TagGuesserConfigDialog::TagGuesserConfigDialog( TQWidget* parent,  const char* name )
    : KDialog( parent, name )
{
    if ( !name )
	setName( "TagGuesserConfigDialog" );
    TagGuesserConfigDialogLayout = new TQGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "TagGuesserConfigDialogLayout"); 

    lvSchemes = new TDEListView( this, "lvSchemes" );
    lvSchemes->addColumn( tr2i18n( "File Name Scheme" ) );
    lvSchemes->header()->setClickEnabled( false, lvSchemes->header()->count() - 1 );
    lvSchemes->header()->setResizeEnabled( false, lvSchemes->header()->count() - 1 );
    lvSchemes->setFrameShape( TDEListView::StyledPanel );
    lvSchemes->setFrameShadow( TDEListView::Sunken );
    lvSchemes->setFullWidth( true );

    TagGuesserConfigDialogLayout->addMultiCellWidget( lvSchemes, 0, 6, 0, 0 );

    bMoveUp = new TQToolButton( this, "bMoveUp" );

    TagGuesserConfigDialogLayout->addWidget( bMoveUp, 0, 1 );

    bMoveDown = new TQToolButton( this, "bMoveDown" );

    TagGuesserConfigDialogLayout->addWidget( bMoveDown, 0, 3 );

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

    TagGuesserConfigDialogLayout->addMultiCellWidget( bModify, 2, 2, 1, 3 );

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

    TagGuesserConfigDialogLayout->addMultiCellWidget( bRemove, 3, 3, 1, 3 );

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

    TagGuesserConfigDialogLayout->addMultiCellWidget( bAdd, 1, 1, 1, 3 );
    spacer1 = new TQSpacerItem( 20, 60, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    TagGuesserConfigDialogLayout->addItem( spacer1, 4, 2 );

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

    TagGuesserConfigDialogLayout->addMultiCellWidget( bOk, 5, 5, 1, 3 );

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

    TagGuesserConfigDialogLayout->addMultiCellWidget( bCancel, 6, 6, 1, 3 );
    languageChange();
    resize( TQSize(467, 260).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TagGuesserConfigDialog::languageChange()
{
    setCaption( tr2i18n( "Tag Guesser" ) );
    lvSchemes->header()->setLabel( 0, tr2i18n( "File Name Scheme" ) );
    TQToolTip::add( lvSchemes, tr2i18n( "Here you can see the currently configured file name schemes which the \"Guess Tags From Filename\" button uses to extract tag information from a file name. Each string may contain one of the following placeholders:<ul>\n"
"<li>%title: Song Title</li>\n"
"<li>%artist: Artist</li>\n"
"<li>%album: Album</li>\n"
"<li>%track: Track Number</li>\n"
"<li>%year: Year</li>\n"
"<li>%comment: Comment</li>\n"
"</ul>\n"
"For example, the file name scheme \"[%track] %artist - %title\" would match \"[01] Deep Purple - Smoke on the water\" but not \"(Deep Purple) Smoke on the water\". For that second name, you would use the scheme \"(%artist) %title\".<p/>\n"
"Note that the order in which the schemes appear in the list is relevant, since the tag guesser will go through the list from the top to the bottom, and use the first matching scheme." ) );
    TQWhatsThis::add( lvSchemes, tr2i18n( "Here you can see the currently configured file name schemes which the \"Guess Tags From Filename\" button uses to extract tag information from a file name. Each string may contain one of the following placeholders:<ul>\n"
"<li>%title: Song Title</li>\n"
"<li>%artist: Artist</li>\n"
"<li>%album: Album</li>\n"
"<li>%track: Track Number</li>\n"
"<li>%year: Year</li>\n"
"<li>%comment: Comment</li>\n"
"</ul>\n"
"For example, the file name scheme \"[%track] %artist - %title\" would match \"[01] Deep Purple - Smoke on the water\" but not \"(Deep Purple) Smoke on the water\". For that second name, you would use the scheme \"(%a) %t\".<p/>\n"
"Note that the order in which the schemes appear in the list is relevant, since the tag guesser will go through the list from the top to the bottom, and use the first matching scheme." ) );
    bMoveUp->setText( TQString::null );
    TQToolTip::add( bMoveUp, tr2i18n( "Move scheme up" ) );
    TQWhatsThis::add( bMoveUp, tr2i18n( "Press this button to move the currently selected scheme one step upwards." ) );
    bMoveDown->setText( TQString::null );
    TQToolTip::add( bMoveDown, tr2i18n( "Move scheme down" ) );
    TQWhatsThis::add( bMoveDown, tr2i18n( "Press this button to move the currently selected scheme one step downwards." ) );
    bModify->setText( tr2i18n( "Mo&dify" ) );
    TQToolTip::add( bModify, tr2i18n( "Modify scheme" ) );
    TQWhatsThis::add( bModify, tr2i18n( "Press this button to modify the currently selected scheme." ) );
    bRemove->setText( tr2i18n( "&Remove" ) );
    TQToolTip::add( bRemove, tr2i18n( "Remove scheme" ) );
    TQWhatsThis::add( bRemove, tr2i18n( "Press this button to remove the currently selected scheme from the list." ) );
    bAdd->setText( tr2i18n( "&Add" ) );
    TQToolTip::add( bAdd, tr2i18n( "Add a new scheme" ) );
    TQWhatsThis::add( bAdd, tr2i18n( "Press this button to add a new file name scheme to the end of the list." ) );
    bOk->setText( tr2i18n( "O&k" ) );
    TQToolTip::add( bOk, tr2i18n( "Add a new scheme" ) );
    TQWhatsThis::add( bOk, tr2i18n( "Press this button to add a new file name scheme to the end of the list." ) );
    bCancel->setText( tr2i18n( "&Cancel" ) );
    TQToolTip::add( bCancel, tr2i18n( "Add a new scheme" ) );
    TQWhatsThis::add( bCancel, tr2i18n( "Press this button to add a new file name scheme to the end of the list." ) );
}

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

TQMetaObject *TagGuesserConfigDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_TagGuesserConfigDialog( "TagGuesserConfigDialog", &TagGuesserConfigDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* TagGuesserConfigDialog::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 = KDialog::staticMetaObject();
    static const TQUParameter param_slot_0[] = {
	{ "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"slotCurrentChanged", 1, param_slot_0 };
    static const TQUMethod slot_1 = {"accept", 0, 0 };
    static const TQUMethod slot_2 = {"reject", 0, 0 };
    static const TQUParameter param_slot_3[] = {
	{ "item", &static_QUType_ptr, "TQListViewItem", TQUParameter::In },
	{ 0, &static_QUType_varptr, "\x0e", TQUParameter::In },
	{ "c", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"slotRenameItem", 3, param_slot_3 };
    static const TQUMethod slot_4 = {"slotMoveUpClicked", 0, 0 };
    static const TQUMethod slot_5 = {"slotMoveDownClicked", 0, 0 };
    static const TQUMethod slot_6 = {"slotAddClicked", 0, 0 };
    static const TQUMethod slot_7 = {"slotModifyClicked", 0, 0 };
    static const TQUMethod slot_8 = {"slotRemoveClicked", 0, 0 };
    static const TQUMethod slot_9 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotCurrentChanged(TQListViewItem*)", &slot_0, TQMetaData::Public },
	{ "accept()", &slot_1, TQMetaData::Public },
	{ "reject()", &slot_2, TQMetaData::Public },
	{ "slotRenameItem(TQListViewItem*,const TQPoint&,int)", &slot_3, TQMetaData::Public },
	{ "slotMoveUpClicked()", &slot_4, TQMetaData::Public },
	{ "slotMoveDownClicked()", &slot_5, TQMetaData::Public },
	{ "slotAddClicked()", &slot_6, TQMetaData::Public },
	{ "slotModifyClicked()", &slot_7, TQMetaData::Public },
	{ "slotRemoveClicked()", &slot_8, TQMetaData::Public },
	{ "languageChange()", &slot_9, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"TagGuesserConfigDialog", parentObject,
	slot_tbl, 10,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_TagGuesserConfigDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool TagGuesserConfigDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotCurrentChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 1: accept(); break;
    case 2: reject(); break;
    case 3: slotRenameItem((TQListViewItem*)static_QUType_ptr.get(_o+1),(const TQPoint&)*((const TQPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 4: slotMoveUpClicked(); break;
    case 5: slotMoveDownClicked(); break;
    case 6: slotAddClicked(); break;
    case 7: slotModifyClicked(); break;
    case 8: slotRemoveClicked(); break;
    case 9: languageChange(); break;
    default:
	return KDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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