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

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

#include "base_k3bvideodvdrippingwidget.h"

#include <ntqvariant.h>
#include <k3bintmapcombobox.h>
#include <kactivelabel.h>
#include <klineedit.h>
#include <kurllabel.h>
#include <kurlrequester.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqtabwidget.h>
#include <ntqgroupbox.h>
#include <ntqcombobox.h>
#include <ntqspinbox.h>
#include <ntqwidgetstack.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    textLabel4 = new TQLabel( this, "textLabel4" );
    Form1Layout->addWidget( textLabel4 );

    m_titleView = new TDEListView( this, "m_titleView" );
    m_titleView->setAllColumnsShowFocus( true );
    m_titleView->setFullWidth( true );
    Form1Layout->addWidget( m_titleView );

    tabWidget2 = new TQTabWidget( this, "tabWidget2" );

    tab = new TQWidget( tabWidget2, "tab" );
    tabLayout = new TQGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

    groupBox6 = new TQGroupBox( tab, "groupBox6" );
    groupBox6->setColumnLayout(0, TQt::Vertical );
    groupBox6->layout()->setSpacing( 6 );
    groupBox6->layout()->setMargin( 11 );
    groupBox6Layout = new TQVBoxLayout( groupBox6->layout() );
    groupBox6Layout->setAlignment( TQt::AlignTop );

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

    textLabel2_2 = new TQLabel( groupBox6, "textLabel2_2" );
    layout9->addWidget( textLabel2_2 );

    m_comboVideoSize = new TQComboBox( false, groupBox6, "m_comboVideoSize" );
    m_comboVideoSize->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, m_comboVideoSize->sizePolicy().hasHeightForWidth() ) );
    layout9->addWidget( m_comboVideoSize );

    m_buttonCustomPictureSize = new TQPushButton( groupBox6, "m_buttonCustomPictureSize" );
    layout9->addWidget( m_buttonCustomPictureSize );
    groupBox6Layout->addLayout( layout9 );

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

    textLabel2_3 = new TQLabel( groupBox6, "textLabel2_3" );
    layout9_2->addWidget( textLabel2_3 );

    m_spinVideoBitrate = new TQSpinBox( groupBox6, "m_spinVideoBitrate" );
    m_spinVideoBitrate->setEnabled( true );
    m_spinVideoBitrate->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, m_spinVideoBitrate->sizePolicy().hasHeightForWidth() ) );
    m_spinVideoBitrate->setMaxValue( 10000 );
    m_spinVideoBitrate->setValue( 1800 );
    layout9_2->addWidget( m_spinVideoBitrate );
    groupBox6Layout->addLayout( layout9_2 );

    tabLayout->addWidget( groupBox6, 0, 1 );

    groupBox1_2 = new TQGroupBox( tab, "groupBox1_2" );
    groupBox1_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 1, groupBox1_2->sizePolicy().hasHeightForWidth() ) );
    groupBox1_2->setColumnLayout(0, TQt::Vertical );
    groupBox1_2->layout()->setSpacing( 6 );
    groupBox1_2->layout()->setMargin( 11 );
    groupBox1_2Layout = new TQGridLayout( groupBox1_2->layout() );
    groupBox1_2Layout->setAlignment( TQt::AlignTop );

    textLabel1_2 = new TQLabel( groupBox1_2, "textLabel1_2" );

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

    m_editBaseDir = new KURLRequester( groupBox1_2, "m_editBaseDir" );

    groupBox1_2Layout->addMultiCellWidget( m_editBaseDir, 0, 0, 0, 1 );

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

    groupBox1_2Layout->addWidget( m_labelFreeSpace, 1, 1 );

    textLabel1_2_2 = new TQLabel( groupBox1_2, "textLabel1_2_2" );

    groupBox1_2Layout->addWidget( textLabel1_2_2, 2, 0 );

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

    groupBox1_2Layout->addWidget( m_labelNeededSpace, 2, 1 );

    tabLayout->addWidget( groupBox1_2, 1, 0 );

    groupBox4 = new TQGroupBox( tab, "groupBox4" );
    groupBox4->setColumnLayout(0, TQt::Vertical );
    groupBox4->layout()->setSpacing( 6 );
    groupBox4->layout()->setMargin( 11 );
    groupBox4Layout = new TQVBoxLayout( groupBox4->layout() );
    groupBox4Layout->setAlignment( TQt::AlignTop );

    m_stackAudioQuality = new TQWidgetStack( groupBox4, "m_stackAudioQuality" );

    m_stackPageAudioQualityMp3 = new TQWidget( m_stackAudioQuality, "m_stackPageAudioQualityMp3" );
    m_stackPageAudioQualityMp3Layout = new TQVBoxLayout( m_stackPageAudioQualityMp3, 0, 6, "m_stackPageAudioQualityMp3Layout"); 

    m_checkAudioVBR = new TQCheckBox( m_stackPageAudioQualityMp3, "m_checkAudioVBR" );
    m_stackPageAudioQualityMp3Layout->addWidget( m_checkAudioVBR );

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

    m_labelAudioBitrate = new TQLabel( m_stackPageAudioQualityMp3, "m_labelAudioBitrate" );
    layout4->addWidget( m_labelAudioBitrate );

    m_comboAudioBitrate = new TQComboBox( false, m_stackPageAudioQualityMp3, "m_comboAudioBitrate" );
    m_comboAudioBitrate->setDuplicatesEnabled( false );
    layout4->addWidget( m_comboAudioBitrate );
    m_stackPageAudioQualityMp3Layout->addLayout( layout4 );
    m_stackAudioQuality->addWidget( m_stackPageAudioQualityMp3, 0 );

    m_stackPageAudioQualityAC3Pt = new TQWidget( m_stackAudioQuality, "m_stackPageAudioQualityAC3Pt" );
    m_stackPageAudioQualityAC3PtLayout = new TQHBoxLayout( m_stackPageAudioQualityAC3Pt, 0, 6, "m_stackPageAudioQualityAC3PtLayout"); 

    m_labelNoAudioSettings = new KActiveLabel( m_stackPageAudioQualityAC3Pt, "m_labelNoAudioSettings" );
    m_labelNoAudioSettings->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, m_labelNoAudioSettings->sizePolicy().hasHeightForWidth() ) );
    m_stackPageAudioQualityAC3PtLayout->addWidget( m_labelNoAudioSettings );
    m_stackAudioQuality->addWidget( m_stackPageAudioQualityAC3Pt, 1 );

    m_stackPageAudioQualityAC3 = new TQWidget( m_stackAudioQuality, "m_stackPageAudioQualityAC3" );
    m_stackPageAudioQualityAC3Layout = new TQVBoxLayout( m_stackPageAudioQualityAC3, 0, 6, "m_stackPageAudioQualityAC3Layout"); 

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

    textLabel1_3 = new TQLabel( m_stackPageAudioQualityAC3, "textLabel1_3" );
    layout8->addWidget( textLabel1_3 );

    m_spinAudioBitrate = new TQSpinBox( m_stackPageAudioQualityAC3, "m_spinAudioBitrate" );
    m_spinAudioBitrate->setMaxValue( 640 );
    m_spinAudioBitrate->setMinValue( 32 );
    m_spinAudioBitrate->setLineStep( 2 );
    m_spinAudioBitrate->setValue( 128 );
    layout8->addWidget( m_spinAudioBitrate );
    m_stackPageAudioQualityAC3Layout->addLayout( layout8 );
    spacer3 = new TQSpacerItem( 20, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    m_stackPageAudioQualityAC3Layout->addItem( spacer3 );
    m_stackAudioQuality->addWidget( m_stackPageAudioQualityAC3, 2 );
    groupBox4Layout->addWidget( m_stackAudioQuality );

    tabLayout->addWidget( groupBox4, 1, 1 );

    groupBox1 = new TQGroupBox( tab, "groupBox1" );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );

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

    textLabel1 = new TQLabel( groupBox1, "textLabel1" );
    layout10->addWidget( textLabel1 );

    m_comboVideoCodec = new K3bIntMapComboBox( groupBox1, "m_comboVideoCodec" );
    layout10->addWidget( m_comboVideoCodec );
    groupBox1Layout->addLayout( layout10 );

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

    textLabel2 = new TQLabel( groupBox1, "textLabel2" );
    layout9_3->addWidget( textLabel2 );

    m_comboAudioCodec = new K3bIntMapComboBox( groupBox1, "m_comboAudioCodec" );
    layout9_3->addWidget( m_comboAudioCodec );
    groupBox1Layout->addLayout( layout9_3 );

    tabLayout->addWidget( groupBox1, 0, 0 );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    TabPage = new TQWidget( tabWidget2, "TabPage" );
    TabPageLayout = new TQVBoxLayout( TabPage, 11, 6, "TabPageLayout"); 

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

    textLabel1_4 = new TQLabel( TabPage, "textLabel1_4" );
    layout14->addWidget( textLabel1_4 );

    m_comboFilenamePattern = new TQComboBox( false, TabPage, "m_comboFilenamePattern" );
    m_comboFilenamePattern->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, m_comboFilenamePattern->sizePolicy().hasHeightForWidth() ) );
    m_comboFilenamePattern->setAcceptDrops( true );
    m_comboFilenamePattern->setEditable( true );
    m_comboFilenamePattern->setDuplicatesEnabled( false );
    layout14->addWidget( m_comboFilenamePattern );
    TabPageLayout->addLayout( layout14 );

    m_specialStringsLabel = new KURLLabel( TabPage, "m_specialStringsLabel" );
    m_specialStringsLabel->setAlignment( int( KURLLabel::AlignVCenter | KURLLabel::AlignRight ) );
    TabPageLayout->addWidget( m_specialStringsLabel );

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

    m_checkBlankReplace = new TQCheckBox( TabPage, "m_checkBlankReplace" );
    layout8_2->addWidget( m_checkBlankReplace );

    m_editBlankReplace = new KLineEdit( TabPage, "m_editBlankReplace" );
    m_editBlankReplace->setEnabled( false );
    m_editBlankReplace->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 1, 0, m_editBlankReplace->sizePolicy().hasHeightForWidth() ) );
    layout8_2->addWidget( m_editBlankReplace );
    TabPageLayout->addLayout( layout8_2 );
    spacer5 = new TQSpacerItem( 5, 1, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    TabPageLayout->addItem( spacer5 );
    tabWidget2->insertTab( TabPage, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 

    m_checkTwoPassEncoding = new TQCheckBox( tab_2, "m_checkTwoPassEncoding" );
    m_checkTwoPassEncoding->setChecked( true );
    tabLayout_2->addWidget( m_checkTwoPassEncoding );

    m_checkAutoClipping = new TQCheckBox( tab_2, "m_checkAutoClipping" );
    m_checkAutoClipping->setChecked( true );
    tabLayout_2->addWidget( m_checkAutoClipping );

    m_checkAudioResampling = new TQCheckBox( tab_2, "m_checkAudioResampling" );
    m_checkAudioResampling->setChecked( true );
    tabLayout_2->addWidget( m_checkAudioResampling );

    m_checkLowPriority = new TQCheckBox( tab_2, "m_checkLowPriority" );
    m_checkLowPriority->setChecked( true );
    tabLayout_2->addWidget( m_checkLowPriority );
    spacer1 = new TQSpacerItem( 20, 1, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer1 );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );
    Form1Layout->addWidget( tabWidget2 );
    languageChange();
    resize( TQSize(644, 387).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_checkBlankReplace, TQ_SIGNAL( toggled(bool) ), m_editBlankReplace, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void base_K3bVideoDVDRippingWidget::languageChange()
{
    textLabel4->setText( tr2i18n( "Please select the audio streams you want to include in every ripped title" ) );
    groupBox6->setTitle( tr2i18n( "Video Quality" ) );
    textLabel2_2->setText( tr2i18n( "Video Size:" ) );
    m_buttonCustomPictureSize->setText( tr2i18n( "&Custom..." ) );
    textLabel2_3->setText( tr2i18n( "Video Bitrate:" ) );
    m_spinVideoBitrate->setSuffix( tr2i18n( " kbps" ) );
    groupBox1_2->setTitle( tr2i18n( "Target Folder" ) );
    textLabel1_2->setText( tr2i18n( "Free space in directory:" ) );
    m_labelFreeSpace->setText( tr2i18n( "-" ) );
    textLabel1_2_2->setText( tr2i18n( "Space needed:" ) );
    m_labelNeededSpace->setText( tr2i18n( "-" ) );
    groupBox4->setTitle( tr2i18n( "Audio Quality" ) );
    m_checkAudioVBR->setText( tr2i18n( "Variable &Bitrate" ) );
    m_labelAudioBitrate->setText( tr2i18n( "Audio Bitrate:" ) );
    m_labelNoAudioSettings->setText( tr2i18n( "<p>No Audio Quality settings available for <em>AC3 pass-through</em>. The audio stream from the Video DVD is used without any changes." ) );
    textLabel1_3->setText( tr2i18n( "Audio Bitrate:" ) );
    m_spinAudioBitrate->setSuffix( tr2i18n( " kbps" ) );
    groupBox1->setTitle( tr2i18n( "Filetype" ) );
    textLabel1->setText( tr2i18n( "Video Codec:" ) );
    TQToolTip::add( m_comboVideoCodec, tr2i18n( "Select the Video codec used to encode the DVD titles" ) );
    textLabel2->setText( tr2i18n( "Audio Codec:" ) );
    TQToolTip::add( m_comboAudioCodec, tr2i18n( "Select the Audio codec used to encode the DVD titles" ) );
    tabWidget2->changeTab( tab, tr2i18n( "Setti&ngs" ) );
    textLabel1_4->setText( tr2i18n( "Ripped files pattern:" ) );
    m_specialStringsLabel->setText( tr2i18n( "See special strings" ) );
    m_checkBlankReplace->setText( tr2i18n( "Replace all &blanks with:" ) );
    m_editBlankReplace->setText( tr2i18n( "_" ) );
    tabWidget2->changeTab( TabPage, tr2i18n( "File Namin&g" ) );
    m_checkTwoPassEncoding->setText( tr2i18n( "&2-pass encoding" ) );
    TQToolTip::add( m_checkTwoPassEncoding, tr2i18n( "Enable 2-pass encoding" ) );
    TQWhatsThis::add( m_checkTwoPassEncoding, tr2i18n( "<p>If this option is checked K3b encodes the video titles in two passes. The first pass is used to gather information about the video in order to improve the distribution of bits in the second pass. The resulting video will have a higher quality using a variable bitrate.\n"
"<p>If this option is not checked K3b will create video files with a constant bitrate and a lower quality.\n"
"<p>2-pass encoding results in a doubled encoding time." ) );
    m_checkAutoClipping->setText( tr2i18n( "Automatic &Video Clipping" ) );
    TQToolTip::add( m_checkAutoClipping, tr2i18n( "Automatically detect the black borders of the video" ) );
    TQWhatsThis::add( m_checkAutoClipping, tr2i18n( "<p>Most Video DVDs are encoded in a letterboxed format. <em>Letterboxed</em> refers to black bars used at the top and bottom (and sometimes at the sides) of the video to force it into one of the aspect ratios supported by the Video DVD standard.\n"
"<p>If this option is checked K3b will automatically detect and remove these black bars from the resulting video.\n"
"<p>Although this method is very reliable there may be problems if the source material is exceptionally short or dark." ) );
    m_checkAudioResampling->setText( tr2i18n( "Resample Audio to &44.1 KHz" ) );
    TQToolTip::add( m_checkAudioResampling, tr2i18n( "Change the sample rate of the audio stream to 44.1 KHz" ) );
    TQWhatsThis::add( m_checkAudioResampling, tr2i18n( "<p>Video DVD audio streams normally are encoded with a sampling rate of 48000 Hz. Audio CDs on the other hand are encoded with a sampling rate of 44100 Hz.\n"
"<p>If this option is checked K3b will change the sampling rate of the audio stream to 44100 Hz." ) );
    m_checkLowPriority->setText( tr2i18n( "Low s&cheduling priority for the video transcoding process" ) );
    tabWidget2->changeTab( tab_2, tr2i18n( "&Advanced" ) );
}

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

TQMetaObject *base_K3bVideoDVDRippingWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_base_K3bVideoDVDRippingWidget( "base_K3bVideoDVDRippingWidget", &base_K3bVideoDVDRippingWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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