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

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

#include "filerenameroptionsbase.h"

#include <ntqvariant.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    m_tagFormatGroup = new TQGroupBox( this, "m_tagFormatGroup" );
    m_tagFormatGroup->setColumnLayout(0, TQt::Vertical );
    m_tagFormatGroup->layout()->setSpacing( 6 );
    m_tagFormatGroup->layout()->setMargin( 11 );
    m_tagFormatGroupLayout = new TQVBoxLayout( m_tagFormatGroup->layout() );
    m_tagFormatGroupLayout->setAlignment( TQt::AlignTop );

    m_description = new TQLabel( m_tagFormatGroup, "m_description" );
    m_description->setTextFormat( TQLabel::RichText );
    m_description->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) );
    m_tagFormatGroupLayout->addWidget( m_description );

    m_tagLayout = new TQHBoxLayout( 0, 0, 6, "m_tagLayout"); 
    spacer1 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    m_tagLayout->addItem( spacer1 );

    m_prefixText = new TQLineEdit( m_tagFormatGroup, "m_prefixText" );
    m_prefixText->setAlignment( int( TQLineEdit::AlignRight ) );
    m_tagLayout->addWidget( m_prefixText );

    m_tagLabel = new TQLabel( m_tagFormatGroup, "m_tagLabel" );
    m_tagLayout->addWidget( m_tagLabel );

    m_suffixText = new TQLineEdit( m_tagFormatGroup, "m_suffixText" );
    m_suffixText->setAlignment( int( TQLineEdit::AlignLeft ) );
    m_tagLayout->addWidget( m_suffixText );
    spacer1_2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    m_tagLayout->addItem( spacer1_2 );
    m_tagFormatGroupLayout->addLayout( m_tagLayout );

    m_substitution = new TQLabel( m_tagFormatGroup, "m_substitution" );
    TQFont m_substitution_font(  m_substitution->font() );
    m_substitution_font.setItalic( true );
    m_substitution->setFont( m_substitution_font ); 
    m_substitution->setAlignment( int( TQLabel::AlignCenter ) );
    m_tagFormatGroupLayout->addWidget( m_substitution );
    FileRenamerTagOptionsBaseLayout->addWidget( m_tagFormatGroup );

    m_emptyTagGroup = new TQButtonGroup( this, "m_emptyTagGroup" );
    m_emptyTagGroup->setColumnLayout(0, TQt::Vertical );
    m_emptyTagGroup->layout()->setSpacing( 6 );
    m_emptyTagGroup->layout()->setMargin( 11 );
    m_emptyTagGroupLayout = new TQVBoxLayout( m_emptyTagGroup->layout() );
    m_emptyTagGroupLayout->setAlignment( TQt::AlignTop );

    m_includeEmptyButton = new TQRadioButton( m_emptyTagGroup, "m_includeEmptyButton" );
    m_emptyTagGroupLayout->addWidget( m_includeEmptyButton );

    m_ignoreTagButton = new TQRadioButton( m_emptyTagGroup, "m_ignoreTagButton" );
    m_ignoreTagButton->setChecked( true );
    m_emptyTagGroupLayout->addWidget( m_ignoreTagButton );

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

    m_useValueButton = new TQRadioButton( m_emptyTagGroup, "m_useValueButton" );
    m_emptyValueLayout->addWidget( m_useValueButton );

    m_emptyTagValue = new TQLineEdit( m_emptyTagGroup, "m_emptyTagValue" );
    m_emptyTagValue->setEnabled( false );
    m_emptyValueLayout->addWidget( m_emptyTagValue );
    m_emptyTagGroupLayout->addLayout( m_emptyValueLayout );
    FileRenamerTagOptionsBaseLayout->addWidget( m_emptyTagGroup );

    m_trackGroup = new TQGroupBox( this, "m_trackGroup" );
    m_trackGroup->setColumnLayout(0, TQt::Vertical );
    m_trackGroup->layout()->setSpacing( 6 );
    m_trackGroup->layout()->setMargin( 11 );
    m_trackGroupLayout = new TQVBoxLayout( m_trackGroup->layout() );
    m_trackGroupLayout->setAlignment( TQt::AlignTop );

    textLabel10 = new TQLabel( m_trackGroup, "textLabel10" );
    textLabel10->setTextFormat( TQLabel::RichText );
    textLabel10->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) );
    m_trackGroupLayout->addWidget( textLabel10 );

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

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

    textLabel5 = new TQLabel( m_trackGroup, "textLabel5" );
    m_spinLayout->addWidget( textLabel5 );

    m_trackWidth = new KIntSpinBox( m_trackGroup, "m_trackWidth" );
    m_trackWidth->setMaxValue( 6 );
    m_trackWidth->setMinValue( 1 );
    m_spinLayout->addWidget( m_trackWidth );
    m_widthLayout->addLayout( m_spinLayout );

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

    m_doubleDigitExample = new TQLabel( m_trackGroup, "m_doubleDigitExample" );
    TQFont m_doubleDigitExample_font(  m_doubleDigitExample->font() );
    m_doubleDigitExample_font.setItalic( true );
    m_doubleDigitExample->setFont( m_doubleDigitExample_font ); 

    m_exampleLayout->addWidget( m_doubleDigitExample, 1, 1 );

    m_singleDigitExample = new TQLabel( m_trackGroup, "m_singleDigitExample" );
    TQFont m_singleDigitExample_font(  m_singleDigitExample->font() );
    m_singleDigitExample_font.setItalic( true );
    m_singleDigitExample->setFont( m_singleDigitExample_font ); 

    m_exampleLayout->addWidget( m_singleDigitExample, 0, 1 );

    m_singleDigit = new TQLabel( m_trackGroup, "m_singleDigit" );
    m_singleDigit->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    m_exampleLayout->addWidget( m_singleDigit, 0, 0 );

    m_doubleDigit = new TQLabel( m_trackGroup, "m_doubleDigit" );
    m_doubleDigit->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    m_exampleLayout->addWidget( m_doubleDigit, 1, 0 );
    m_widthLayout->addLayout( m_exampleLayout );
    m_trackGroupLayout->addLayout( m_widthLayout );
    FileRenamerTagOptionsBaseLayout->addWidget( m_trackGroup );
    spacer6 = new TQSpacerItem( 20, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    FileRenamerTagOptionsBaseLayout->addItem( spacer6 );
    languageChange();
    resize( TQSize(568, 377).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_useValueButton, TQ_SIGNAL( toggled(bool) ), m_emptyTagValue, TQ_SLOT( setEnabled(bool) ) );
    connect( m_useValueButton, TQ_SIGNAL( clicked() ), m_emptyTagValue, TQ_SLOT( setFocus() ) );
    connect( m_trackWidth, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotTrackWidthChanged() ) );
    connect( m_prefixText, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotBracketsChanged() ) );
    connect( m_suffixText, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotBracketsChanged() ) );
    connect( m_includeEmptyButton, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotEmptyActionChanged() ) );
    connect( m_ignoreTagButton, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotEmptyActionChanged() ) );
    connect( m_useValueButton, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotEmptyActionChanged() ) );
    connect( m_emptyTagValue, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotEmptyActionChanged() ) );

    // buddies
    textLabel5->setBuddy( m_trackWidth );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FileRenamerTagOptionsBase::languageChange()
{
    setCaption( tr2i18n( "%1 Options" ) );
    m_tagFormatGroup->setTitle( tr2i18n( "%1 Format" ) );
    m_description->setText( tr2i18n( "When using the file renamer your files will be renamed to the values that you have in your track's %1 tag, plus any additional text that you specify below." ) );
    m_tagLabel->setText( tr2i18n( "%1" ) );
    m_substitution->setText( tr2i18n( "Substitution Example" ) );
    m_emptyTagGroup->setTitle( tr2i18n( "When the Track's %1 is Empty" ) );
    m_includeEmptyButton->setText( tr2i18n( "Include in the &filename anyways" ) );
    m_ignoreTagButton->setText( tr2i18n( "&Ignore this tag when renaming the file" ) );
    m_useValueButton->setText( tr2i18n( "Use &this value:" ) );
    m_emptyTagValue->setText( tr2i18n( "Empty" ) );
    m_trackGroup->setTitle( tr2i18n( "Track Width Options" ) );
    textLabel10->setText( tr2i18n( "JuK can force the track used in a file name to have a minimum number of digits.  You may want to do this for better sorting in file managers." ) );
    textLabel5->setText( tr2i18n( "Minimum track &width:" ) );
    m_trackWidth->setSpecialValueText( tr2i18n( "None" ) );
    m_doubleDigitExample->setText( tr2i18n( "014" ) );
    m_singleDigitExample->setText( tr2i18n( "003" ) );
    m_singleDigit->setText( tr2i18n( "3 ->" ) );
    m_doubleDigit->setText( tr2i18n( "14 ->" ) );
}

void FileRenamerTagOptionsBase::slotBracketsChanged()
{
    tqWarning( "FileRenamerTagOptionsBase::slotBracketsChanged(): Not implemented yet" );
}

void FileRenamerTagOptionsBase::slotTrackWidthChanged()
{
    tqWarning( "FileRenamerTagOptionsBase::slotTrackWidthChanged(): Not implemented yet" );
}

void FileRenamerTagOptionsBase::slotEmptyActionChanged()
{
    tqWarning( "FileRenamerTagOptionsBase::slotEmptyActionChanged(): Not implemented yet" );
}

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

TQMetaObject *FileRenamerTagOptionsBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_FileRenamerTagOptionsBase( "FileRenamerTagOptionsBase", &FileRenamerTagOptionsBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* FileRenamerTagOptionsBase::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 TQUMethod slot_1 = {"slotBracketsChanged", 0, 0 };
    static const TQUMethod slot_2 = {"slotTrackWidthChanged", 0, 0 };
    static const TQUMethod slot_3 = {"slotEmptyActionChanged", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotBracketsChanged()", &slot_1, TQMetaData::Protected },
	{ "slotTrackWidthChanged()", &slot_2, TQMetaData::Protected },
	{ "slotEmptyActionChanged()", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"FileRenamerTagOptionsBase", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_FileRenamerTagOptionsBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool FileRenamerTagOptionsBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: slotBracketsChanged(); break;
    case 2: slotTrackWidthChanged(); break;
    case 3: slotEmptyActionChanged(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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