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

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

#include "audiocdconfig.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqwidget.h>
#include <ntqgroupbox.h>
#include <ntqslider.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a AudiocdConfig which is a child of 'parent', with the
 *  name 'name'.' 
 */
AudiocdConfig::AudiocdConfig( TQWidget* parent,  const char* name )
    : TDECModule( parent, name )
{
    if ( !name )
	setName( "AudiocdConfig" );
    AudiocdConfigLayout = new TQVBoxLayout( this, 0, 0, "AudiocdConfigLayout"); 

    tabWidget = new TQTabWidget( this, "tabWidget" );
    tabWidget->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, tabWidget->sizePolicy().hasHeightForWidth() ) );

    tab = new TQWidget( tabWidget, "tab" );
    tabLayout = new TQGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 
    Spacer5 = new TQSpacerItem( 20, 210, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( Spacer5, 4, 2 );

    encoderPriority = new TQGroupBox( tab, "encoderPriority" );
    encoderPriority->setColumnLayout(0, TQt::Vertical );
    encoderPriority->layout()->setSpacing( 6 );
    encoderPriority->layout()->setMargin( 11 );
    encoderPriorityLayout = new TQGridLayout( encoderPriority->layout() );
    encoderPriorityLayout->setAlignment( TQt::AlignTop );

    niceLevel = new TQSlider( encoderPriority, "niceLevel" );
    niceLevel->setMinValue( -19 );
    niceLevel->setMaxValue( 19 );
    niceLevel->setLineStep( 5 );
    niceLevel->setOrientation( TQSlider::Horizontal );
    niceLevel->setTickmarks( TQSlider::NoMarks );

    encoderPriorityLayout->addMultiCellWidget( niceLevel, 0, 0, 0, 2 );

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

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

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

    encoderPriorityLayout->addWidget( textLabel3, 1, 2 );

    textLabel4 = new TQLabel( encoderPriority, "textLabel4" );
    textLabel4->setAlignment( int( TQLabel::AlignCenter ) );

    encoderPriorityLayout->addWidget( textLabel4, 1, 1 );

    tabLayout->addMultiCellWidget( encoderPriority, 3, 3, 0, 2 );

    cd_device_string = new TQLineEdit( tab, "cd_device_string" );
    cd_device_string->setEnabled( false );

    tabLayout->addWidget( cd_device_string, 0, 2 );

    cd_specify_device = new TQCheckBox( tab, "cd_specify_device" );

    tabLayout->addMultiCellWidget( cd_specify_device, 0, 0, 0, 1 );

    ec_enable_check = new TQCheckBox( tab, "ec_enable_check" );
    ec_enable_check->setChecked( true );

    tabLayout->addMultiCellWidget( ec_enable_check, 1, 1, 0, 2 );

    ec_skip_check = new TQCheckBox( tab, "ec_skip_check" );
    ec_skip_check->setChecked( false );

    tabLayout->addMultiCellWidget( ec_skip_check, 2, 2, 1, 2 );
    spacer4_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    tabLayout->addItem( spacer4_2, 2, 0 );
    tabWidget->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    fileNameGroupBox = new TQGroupBox( tab_2, "fileNameGroupBox" );
    fileNameGroupBox->setColumnLayout(0, TQt::Vertical );
    fileNameGroupBox->layout()->setSpacing( 6 );
    fileNameGroupBox->layout()->setMargin( 11 );
    fileNameGroupBoxLayout = new TQVBoxLayout( fileNameGroupBox->layout() );
    fileNameGroupBoxLayout->setAlignment( TQt::AlignTop );

    textLabel1_2 = new TQLabel( fileNameGroupBox, "textLabel1_2" );
    fileNameGroupBoxLayout->addWidget( textLabel1_2 );

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

    textLabel13 = new TQLabel( fileNameGroupBox, "textLabel13" );

    layout7->addWidget( textLabel13, 5, 1 );

    textLabel7 = new TQLabel( fileNameGroupBox, "textLabel7" );

    layout7->addWidget( textLabel7, 1, 1 );

    textLabel2_3 = new TQLabel( fileNameGroupBox, "textLabel2_3" );

    layout7->addWidget( textLabel2_3, 0, 0 );

    textLabel11 = new TQLabel( fileNameGroupBox, "textLabel11" );

    layout7->addWidget( textLabel11, 4, 1 );

    textLabel3_3 = new TQLabel( fileNameGroupBox, "textLabel3_3" );

    layout7->addWidget( textLabel3_3, 0, 1 );

    textLabel9 = new TQLabel( fileNameGroupBox, "textLabel9" );

    layout7->addWidget( textLabel9, 3, 1 );

    textLabel10 = new TQLabel( fileNameGroupBox, "textLabel10" );

    layout7->addWidget( textLabel10, 4, 0 );

    textLabel6 = new TQLabel( fileNameGroupBox, "textLabel6" );

    layout7->addWidget( textLabel6, 2, 0 );

    textLabel5 = new TQLabel( fileNameGroupBox, "textLabel5" );

    layout7->addWidget( textLabel5, 2, 1 );

    textLabel12 = new TQLabel( fileNameGroupBox, "textLabel12" );

    layout7->addWidget( textLabel12, 5, 0 );

    textLabel8 = new TQLabel( fileNameGroupBox, "textLabel8" );

    layout7->addWidget( textLabel8, 3, 0 );

    textLabel4_2 = new TQLabel( fileNameGroupBox, "textLabel4_2" );

    layout7->addWidget( textLabel4_2, 1, 0 );
    fileNameGroupBoxLayout->addLayout( layout7 );

    fileNameLineEdit = new KLineEdit( fileNameGroupBox, "fileNameLineEdit" );
    fileNameGroupBoxLayout->addWidget( fileNameLineEdit );

    tabLayout_2->addWidget( fileNameGroupBox, 0, 0 );

    groupBox2 = new TQGroupBox( tab_2, "groupBox2" );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new TQGridLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    textLabel2_2 = new TQLabel( groupBox2, "textLabel2_2" );

    groupBox2Layout->addWidget( textLabel2_2, 1, 0 );

    textLabel1 = new TQLabel( groupBox2, "textLabel1" );
    textLabel1->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );

    groupBox2Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 2 );

    inputlabel = new TQLabel( groupBox2, "inputlabel" );

    groupBox2Layout->addWidget( inputlabel, 5, 0 );

    outputLabel = new TQLabel( groupBox2, "outputLabel" );

    groupBox2Layout->addWidget( outputLabel, 6, 0 );

    exampleLabel = new TQLabel( groupBox2, "exampleLabel" );

    groupBox2Layout->addMultiCellWidget( exampleLabel, 4, 4, 0, 1 );

    exampleOutput = new TQLabel( groupBox2, "exampleOutput" );

    groupBox2Layout->addMultiCellWidget( exampleOutput, 6, 6, 1, 2 );

    example = new TQLineEdit( groupBox2, "example" );

    groupBox2Layout->addMultiCellWidget( example, 5, 5, 1, 2 );

    kcfg_replaceInput = new TQLineEdit( groupBox2, "kcfg_replaceInput" );

    groupBox2Layout->addMultiCellWidget( kcfg_replaceInput, 2, 2, 0, 1 );

    kcfg_replaceOutput = new TQLineEdit( groupBox2, "kcfg_replaceOutput" );

    groupBox2Layout->addWidget( kcfg_replaceOutput, 2, 2 );

    textLabel3_2 = new TQLabel( groupBox2, "textLabel3_2" );

    groupBox2Layout->addWidget( textLabel3_2, 1, 2 );

    line1 = new TQFrame( groupBox2, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );

    groupBox2Layout->addMultiCellWidget( line1, 3, 3, 0, 2 );

    tabLayout_2->addMultiCellWidget( groupBox2, 1, 1, 0, 1 );
    spacer4 = new TQSpacerItem( 21, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer4, 2, 0 );

    fileNameGroupBox_2 = new TQGroupBox( tab_2, "fileNameGroupBox_2" );
    fileNameGroupBox_2->setColumnLayout(0, TQt::Vertical );
    fileNameGroupBox_2->layout()->setSpacing( 6 );
    fileNameGroupBox_2->layout()->setMargin( 11 );
    fileNameGroupBox_2Layout = new TQVBoxLayout( fileNameGroupBox_2->layout() );
    fileNameGroupBox_2Layout->setAlignment( TQt::AlignTop );

    fileNameLabel_2 = new TQLabel( fileNameGroupBox_2, "fileNameLabel_2" );
    fileNameGroupBox_2Layout->addWidget( fileNameLabel_2 );

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

    textLabel20 = new TQLabel( fileNameGroupBox_2, "textLabel20" );

    layout9->addMultiCellWidget( textLabel20, 2, 3, 1, 1 );

    textLabel15 = new TQLabel( fileNameGroupBox_2, "textLabel15" );

    layout9->addMultiCellWidget( textLabel15, 1, 2, 0, 0 );

    textLabel16 = new TQLabel( fileNameGroupBox_2, "textLabel16" );

    layout9->addWidget( textLabel16, 3, 0 );

    textLabel21 = new TQLabel( fileNameGroupBox_2, "textLabel21" );

    layout9->addWidget( textLabel21, 4, 1 );

    textLabel19 = new TQLabel( fileNameGroupBox_2, "textLabel19" );

    layout9->addWidget( textLabel19, 1, 1 );

    textLabel18 = new TQLabel( fileNameGroupBox_2, "textLabel18" );

    layout9->addWidget( textLabel18, 0, 1 );

    textLabel17 = new TQLabel( fileNameGroupBox_2, "textLabel17" );

    layout9->addWidget( textLabel17, 4, 0 );

    textLabel14 = new TQLabel( fileNameGroupBox_2, "textLabel14" );

    layout9->addWidget( textLabel14, 0, 0 );
    fileNameGroupBox_2Layout->addLayout( layout9 );
    spacer3 = new TQSpacerItem( 20, 31, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    fileNameGroupBox_2Layout->addItem( spacer3 );

    albumNameLineEdit = new KLineEdit( fileNameGroupBox_2, "albumNameLineEdit" );
    fileNameGroupBox_2Layout->addWidget( albumNameLineEdit );

    tabLayout_2->addWidget( fileNameGroupBox_2, 0, 1 );
    tabWidget->insertTab( tab_2, TQString::fromLatin1("") );
    AudiocdConfigLayout->addWidget( tabWidget );
    languageChange();
    resize( TQSize(640, 563).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( ec_enable_check, TQ_SIGNAL( toggled(bool) ), ec_skip_check, TQ_SLOT( setEnabled(bool) ) );
    connect( cd_specify_device, TQ_SIGNAL( toggled(bool) ), cd_device_string, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( tabWidget, cd_device_string );
    setTabOrder( cd_device_string, ec_enable_check );
    setTabOrder( ec_enable_check, ec_skip_check );
    setTabOrder( ec_skip_check, niceLevel );
    setTabOrder( niceLevel, fileNameLineEdit );
    setTabOrder( fileNameLineEdit, albumNameLineEdit );
    setTabOrder( albumNameLineEdit, kcfg_replaceInput );
    setTabOrder( kcfg_replaceInput, kcfg_replaceOutput );
    setTabOrder( kcfg_replaceOutput, example );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void AudiocdConfig::languageChange()
{
    encoderPriority->setTitle( tr2i18n( "Encoder Priority" ) );
    textLabel2->setText( tr2i18n( "Highest" ) );
    textLabel3->setText( tr2i18n( "Lowest" ) );
    textLabel4->setText( tr2i18n( "Normal" ) );
    cd_device_string->setText( tr2i18n( "/dev/cdrom" ) );
    TQWhatsThis::add( cd_device_string, tr2i18n( "Specify a location for the drive you want to use. Normally, this is a file inside the /dev folder representing your CD or DVD drive." ) );
    cd_specify_device->setText( tr2i18n( "&Specify CD device:" ) );
    TQWhatsThis::add( cd_specify_device, tr2i18n( "Check this to specify a CD device different from the one which is detected automatically" ) );
    ec_enable_check->setText( tr2i18n( "Use &error correction when reading the CD" ) );
    TQWhatsThis::add( ec_enable_check, tr2i18n( "If you uncheck this option, the slave will not try to use error correction which can be useful for reading damaged CDs. However, this feature can be problematic in some cases, so you can switch it off here." ) );
    ec_skip_check->setText( tr2i18n( "&Skip on errors" ) );
    tabWidget->changeTab( tab, tr2i18n( "&General" ) );
    fileNameGroupBox->setTitle( tr2i18n( "File Name (without extension)" ) );
    textLabel1_2->setText( tr2i18n( "The following macros will be expanded:" ) );
    textLabel13->setText( tr2i18n( "Genre" ) );
    textLabel7->setText( tr2i18n( "Track Number" ) );
    textLabel2_3->setText( tr2i18n( "%{title}" ) );
    textLabel11->setText( tr2i18n( "Year" ) );
    textLabel3_3->setText( tr2i18n( "Track Title" ) );
    textLabel9->setText( tr2i18n( "Album Artist" ) );
    textLabel10->setText( tr2i18n( "%{year}" ) );
    textLabel6->setText( tr2i18n( "%{albumtitle}" ) );
    textLabel5->setText( tr2i18n( "Album Title" ) );
    textLabel12->setText( tr2i18n( "%{genre}" ) );
    textLabel8->setText( tr2i18n( "%{albumartist}" ) );
    textLabel4_2->setText( tr2i18n( "%{number}" ) );
    groupBox2->setTitle( tr2i18n( "Name Regular Expression Replacement" ) );
    textLabel2_2->setText( tr2i18n( "Selection:" ) );
    textLabel1->setText( tr2i18n( "Regular expression used on all file names. For example using selection \" \" and replace with \"_\" would replace all the spaces with underlines.\n"
"" ) );
    inputlabel->setText( tr2i18n( "Input:" ) );
    outputLabel->setText( tr2i18n( "Output:" ) );
    exampleLabel->setText( tr2i18n( "Example" ) );
    exampleOutput->setText( tr2i18n( "Cool artist - example audio file.wav" ) );
    example->setText( tr2i18n( "Cool artist - example audio file.wav" ) );
    textLabel3_2->setText( tr2i18n( "Replace with:" ) );
    fileNameGroupBox_2->setTitle( tr2i18n( "Album Name" ) );
    fileNameLabel_2->setText( tr2i18n( "The following macros will be expanded:" ) );
    textLabel20->setText( tr2i18n( "Year" ) );
    textLabel15->setText( tr2i18n( "%{albumartist}" ) );
    textLabel16->setText( tr2i18n( "%{year}" ) );
    textLabel21->setText( tr2i18n( "Genre" ) );
    textLabel19->setText( tr2i18n( "Album Artist" ) );
    textLabel18->setText( tr2i18n( "Album Title" ) );
    textLabel17->setText( tr2i18n( "%{genre}" ) );
    textLabel14->setText( tr2i18n( "%{albumtitle}" ) );
    tabWidget->changeTab( tab_2, tr2i18n( "&Names" ) );
}

void AudiocdConfig::toggleLowpass()
{
    tqWarning( "AudiocdConfig::toggleLowpass(): Not implemented yet" );
}

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

TQMetaObject *AudiocdConfig::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_AudiocdConfig( "AudiocdConfig", &AudiocdConfig::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* AudiocdConfig::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 = TDECModule::staticMetaObject();
    static const TQUMethod slot_0 = {"toggleLowpass", 0, 0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "toggleLowpass()", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"AudiocdConfig", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_AudiocdConfig.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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