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

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

#include "organizecollectiondialog.h"

#include <ntqvariant.h>
#include <tqdialog.h>
#include <tqstring.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kactivelabel.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "organizecollectiondialog.ui.h"

/*
 *  Constructs a OrganizeCollectionDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
OrganizeCollectionDialog::OrganizeCollectionDialog( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "organizeCollectionDialog" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    organizeCollectionDialogLayout = new TQVBoxLayout( this, 0, 6, "organizeCollectionDialogLayout"); 

    folderLayout = new TQHBoxLayout( 0, 5, 6, "folderLayout"); 

    folderLabel = new TQLabel( this, "folderLabel" );
    folderLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, folderLabel->sizePolicy().hasHeightForWidth() ) );
    folderLayout->addWidget( folderLabel );

    folderCombo = new KComboBox( false, this, "folderCombo" );
    folderCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, folderCombo->sizePolicy().hasHeightForWidth() ) );
    folderLayout->addWidget( folderCombo );
    organizeCollectionDialogLayout->addLayout( folderLayout );

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

    coverCheck = new TQCheckBox( this, "coverCheck" );
    layout5->addWidget( coverCheck );

    ignoreTheCheck = new TQCheckBox( this, "ignoreTheCheck" );
    layout5->addWidget( ignoreTheCheck );
    organizeCollectionDialogLayout->addLayout( layout5 );
    spacer2_5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    organizeCollectionDialogLayout->addItem( spacer2_5 );

    groupingGroup = new TQGroupBox( this, "groupingGroup" );
    groupingGroup->setMargin( 0 );
    groupingGroup->setColumnLayout(0, TQt::Vertical );
    groupingGroup->layout()->setSpacing( 6 );
    groupingGroup->layout()->setMargin( 5 );
    groupingGroupLayout = new TQVBoxLayout( groupingGroup->layout() );
    groupingGroupLayout->setAlignment( TQt::AlignTop );

    customschemeCheck = new TQCheckBox( groupingGroup, "customschemeCheck" );
    groupingGroupLayout->addWidget( customschemeCheck );

    filetypeCheck = new TQCheckBox( groupingGroup, "filetypeCheck" );
    groupingGroupLayout->addWidget( filetypeCheck );

    initialCheck = new TQCheckBox( groupingGroup, "initialCheck" );
    groupingGroupLayout->addWidget( initialCheck );

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

    formatLabel = new TQLabel( groupingGroup, "formatLabel" );
    formatLabel->setEnabled( false );
    customFormatLayout->addWidget( formatLabel );

    formatEdit = new KLineEdit( groupingGroup, "formatEdit" );
    formatEdit->setEnabled( false );
    customFormatLayout->addWidget( formatEdit );

    formatHelp = new KActiveLabel( groupingGroup, "formatHelp" );
    formatHelp->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, formatHelp->sizePolicy().hasHeightForWidth() ) );
    customFormatLayout->addWidget( formatHelp );
    groupingGroupLayout->addLayout( customFormatLayout );
    organizeCollectionDialogLayout->addWidget( groupingGroup );
    spacer2_4 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    organizeCollectionDialogLayout->addItem( spacer2_4 );

    replacementGroup = new TQGroupBox( this, "replacementGroup" );
    replacementGroup->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, replacementGroup->sizePolicy().hasHeightForWidth() ) );
    replacementGroup->setMargin( 0 );
    replacementGroup->setColumnLayout(0, TQt::Vertical );
    replacementGroup->layout()->setSpacing( 6 );
    replacementGroup->layout()->setMargin( 5 );
    replacementGroupLayout = new TQVBoxLayout( replacementGroup->layout() );
    replacementGroupLayout->setAlignment( TQt::AlignTop );

    spaceCheck = new TQCheckBox( replacementGroup, "spaceCheck" );
    replacementGroupLayout->addWidget( spaceCheck );

    asciiCheck = new TQCheckBox( replacementGroup, "asciiCheck" );
    replacementGroupLayout->addWidget( asciiCheck );

    vfatCheck = new TQCheckBox( replacementGroup, "vfatCheck" );
    replacementGroupLayout->addWidget( vfatCheck );

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

    textLabel1 = new TQLabel( replacementGroup, "textLabel1" );
    layout4->addWidget( textLabel1 );

    regexpEdit = new KLineEdit( replacementGroup, "regexpEdit" );
    layout4->addWidget( regexpEdit );

    textLabel2 = new TQLabel( replacementGroup, "textLabel2" );
    layout4->addWidget( textLabel2 );

    replaceEdit = new KLineEdit( replacementGroup, "replaceEdit" );
    layout4->addWidget( replaceEdit );
    replacementGroupLayout->addLayout( layout4 );
    organizeCollectionDialogLayout->addWidget( replacementGroup );
    spacer2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    organizeCollectionDialogLayout->addItem( spacer2 );

    previewBox = new TQGroupBox( this, "previewBox" );
    previewBox->setColumnLayout(0, TQt::Vertical );
    previewBox->layout()->setSpacing( 0 );
    previewBox->layout()->setMargin( 5 );
    previewBoxLayout = new TQGridLayout( previewBox->layout() );
    previewBoxLayout->setAlignment( TQt::AlignTop );

    previewText = new TQLabel( previewBox, "previewText" );
    previewText->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, previewText->sizePolicy().hasHeightForWidth() ) );

    previewBoxLayout->addWidget( previewText, 0, 1 );
    organizeCollectionDialogLayout->addWidget( previewBox );

    layout7 = new TQHBoxLayout( 0, 0, 6, "layout7"); 
    spacer2_2 = new TQSpacerItem( 347, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout7->addItem( spacer2_2 );

    overwriteCheck = new TQCheckBox( this, "overwriteCheck" );
    layout7->addWidget( overwriteCheck );
    organizeCollectionDialogLayout->addLayout( layout7 );
    spacer2_3 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    organizeCollectionDialogLayout->addItem( spacer2_3 );
    languageChange();
    resize( TQSize(476, 549).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( customschemeCheck, TQ_SIGNAL( toggled(bool) ), formatEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( customschemeCheck, TQ_SIGNAL( toggled(bool) ), formatLabel, TQ_SLOT( setEnabled(bool) ) );
    connect( customschemeCheck, TQ_SIGNAL( toggled(bool) ), filetypeCheck, TQ_SLOT( setDisabled(bool) ) );
    connect( customschemeCheck, TQ_SIGNAL( toggled(bool) ), initialCheck, TQ_SLOT( setDisabled(bool) ) );
    connect( formatEdit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( preview(const TQString&) ) );
    connect( this, TQ_SIGNAL( updatePreview( const TQString & ) ), previewText, TQ_SLOT( setText(const TQString&) ) );
    connect( customschemeCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( filetypeCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( initialCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( spaceCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( asciiCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( vfatCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( ignoreTheCheck, TQ_SIGNAL( stateChanged(int) ), this, TQ_SLOT( update(int) ) );
    connect( folderCombo, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( update(int) ) );
    connect( regexpEdit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( update(const TQString&) ) );
    connect( replaceEdit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( update(const TQString&) ) );

    // buddies
    folderLabel->setBuddy( folderCombo );
    formatLabel->setBuddy( formatEdit );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void OrganizeCollectionDialog::languageChange()
{
    setCaption( tr2i18n( "Organize Files" ) );
    folderLabel->setText( tr2i18n( "C&ollection Folder:" ) );
    TQToolTip::add( folderLabel, tr2i18n( "Base directory under which to put files" ) );
    TQToolTip::add( folderCombo, TQString::null );
    coverCheck->setText( tr2i18n( "&Use Cover Art for Folder Icons" ) );
    ignoreTheCheck->setText( tr2i18n( "I&gnore 'The' in Artist Names" ) );
    TQToolTip::add( ignoreTheCheck, tr2i18n( "If checked, postfix artists' names starting with 'The' with ', The'." ) );
    groupingGroup->setTitle( tr2i18n( "File Naming Scheme" ) );
    customschemeCheck->setText( tr2i18n( "Custo&m Format" ) );
    TQToolTip::add( customschemeCheck, tr2i18n( "If checked, use a custom format string for naming the files in the collection" ) );
    filetypeCheck->setText( tr2i18n( "Group b&y File Type" ) );
    TQToolTip::add( filetypeCheck, tr2i18n( "If checked, create a directory hierarchy using the filename extension." ) );
    initialCheck->setText( tr2i18n( "Group &by Artist's Initial" ) );
    TQToolTip::add( initialCheck, tr2i18n( "If checked, introduce another directory hierarchy for the artists' initials." ) );
    formatLabel->setText( tr2i18n( "F&ilename Format:" ) );
    formatEdit->setText( TQString::null );
    formatHelp->setText( tr2i18n( "(Help)" ) );
    replacementGroup->setTitle( tr2i18n( "Character Replacement" ) );
    spaceCheck->setText( tr2i18n( "&Replace Spaces with Underscores" ) );
    TQToolTip::add( spaceCheck, tr2i18n( "If checked, convert spaces to underscores." ) );
    asciiCheck->setText( tr2i18n( "Restrict to &ASCII" ) );
    TQToolTip::add( asciiCheck, tr2i18n( "If checked, replace characters that are unavailable in the 7-bit ASCII code." ) );
    vfatCheck->setText( tr2i18n( "VFAT Safe &Names" ) );
    TQToolTip::add( vfatCheck, tr2i18n( "If checked, replace characters that are incompatible with MS-DOS/VFAT file systems." ) );
    textLabel1->setText( tr2i18n( "Replace" ) );
    TQToolTip::add( regexpEdit, tr2i18n( "Regular expression" ) );
    textLabel2->setText( tr2i18n( "with" ) );
    TQToolTip::add( replaceEdit, tr2i18n( "Character string" ) );
    previewBox->setTitle( tr2i18n( "Destination Preview" ) );
    previewText->setText( TQString::null );
    TQToolTip::add( previewText, tr2i18n( "This is what the file names will look like after renaming." ) );
    overwriteCheck->setText( tr2i18n( "Overwrite &Destination" ) );
    TQToolTip::add( overwriteCheck, tr2i18n( "If checked, overwrite files of the same name without asking." ) );
}

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

TQMetaObject *OrganizeCollectionDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_OrganizeCollectionDialog( "OrganizeCollectionDialog", &OrganizeCollectionDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* OrganizeCollectionDialog::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 TQUParameter param_slot_0[] = {
	{ "format", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"preview", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "dummy", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"update", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ "dummy", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"update", 1, param_slot_2 };
    static const TQUMethod slot_3 = {"slotDetails", 0, 0 };
    static const TQUMethod slot_4 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "preview(const TQString&)", &slot_0, TQMetaData::Public },
	{ "update(int)", &slot_1, TQMetaData::Public },
	{ "update(const TQString&)", &slot_2, TQMetaData::Public },
	{ "slotDetails()", &slot_3, TQMetaData::Public },
	{ "languageChange()", &slot_4, TQMetaData::Protected }
    };
    static const TQUParameter param_signal_0[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod signal_0 = {"updatePreview", 1, param_signal_0 };
    static const TQMetaData signal_tbl[] = {
	{ "updatePreview(const TQString&)", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"OrganizeCollectionDialog", parentObject,
	slot_tbl, 5,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_OrganizeCollectionDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL updatePreview
void OrganizeCollectionDialog::updatePreview( const TQString& t0 )
{
    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
}

bool OrganizeCollectionDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: preview((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 1: update((int)static_QUType_int.get(_o+1)); break;
    case 2: update((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 3: slotDetails(); break;
    case 4: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool OrganizeCollectionDialog::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: updatePreview((const TQString&)static_QUType_TQString.get(_o+1)); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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