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

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

#include "advancedpref.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqcheckbox.h>
#include <ntqslider.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

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

    textLabel1_5 = new TQLabel( groupBox4, "textLabel1_5" );
    layout15->addWidget( textLabel1_5 );

    eta = new TQComboBox( false, groupBox4, "eta" );
    layout15->addWidget( eta );

    textLabel3 = new TQLabel( groupBox4, "textLabel3" );
    layout15->addWidget( textLabel3 );
    spacer8 = new TQSpacerItem( 148, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout15->addItem( spacer8 );
    groupBox4Layout->addLayout( layout15 );

    prealloc_disabled = new TQCheckBox( groupBox4, "prealloc_disabled" );
    groupBox4Layout->addWidget( prealloc_disabled );

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

    full_prealloc = new TQCheckBox( groupBox4, "full_prealloc" );
    layout25->addWidget( full_prealloc );

    full_prealloc_method = new TQComboBox( false, groupBox4, "full_prealloc_method" );
    full_prealloc_method->setEnabled( false );
    full_prealloc_method->setDuplicatesEnabled( false );
    layout25->addWidget( full_prealloc_method );
    groupBox4Layout->addLayout( layout25 );
    AdvancedPrefLayout->addWidget( groupBox4 );

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

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

    textLabel1_3 = new TQLabel( groupBox1, "textLabel1_3" );
    layout5->addWidget( textLabel1_3 );

    mem_usage = new KComboBox( false, groupBox1, "mem_usage" );
    layout5->addWidget( mem_usage );
    spacer2_2 = new TQSpacerItem( 111, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer2_2 );
    groupBox1Layout->addLayout( layout5 );

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

    textLabel1_3_2 = new TQLabel( groupBox1, "textLabel1_3_2" );
    layout5_2->addWidget( textLabel1_3_2 );

    gui_interval = new KComboBox( false, groupBox1, "gui_interval" );
    layout5_2->addWidget( gui_interval );
    spacer2_2_2 = new TQSpacerItem( 111, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5_2->addItem( spacer2_2_2 );
    groupBox1Layout->addLayout( layout5_2 );

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

    textLabel1_6 = new TQLabel( groupBox1, "textLabel1_6" );
    layout8->addWidget( textLabel1_6 );

    cpu_usage = new TQSlider( groupBox1, "cpu_usage" );
    cpu_usage->setMinValue( 1 );
    cpu_usage->setMaxValue( 50 );
    cpu_usage->setValue( 3 );
    cpu_usage->setOrientation( TQSlider::Horizontal );
    cpu_usage->setTickmarks( TQSlider::Below );
    cpu_usage->setTickInterval( 1 );
    layout8->addWidget( cpu_usage );

    textLabel2_2 = new TQLabel( groupBox1, "textLabel2_2" );
    layout8->addWidget( textLabel2_2 );
    groupBox1Layout->addLayout( layout8 );
    AdvancedPrefLayout->addWidget( groupBox1 );

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

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

    no_recheck = new TQCheckBox( groupBox3, "no_recheck" );
    layout7->addWidget( no_recheck );

    recheck_size = new KIntNumInput( groupBox3, "recheck_size" );
    recheck_size->setValue( 512 );
    recheck_size->setMinValue( 16 );
    recheck_size->setMaxValue( 8192 );
    layout7->addWidget( recheck_size );

    textLabel2 = new TQLabel( groupBox3, "textLabel2" );
    layout7->addWidget( textLabel2 );
    spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout7->addItem( spacer3 );
    groupBox3Layout->addLayout( layout7 );

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

    auto_recheck = new TQCheckBox( groupBox3, "auto_recheck" );
    layout10->addWidget( auto_recheck );

    num_corrupted = new KIntNumInput( groupBox3, "num_corrupted" );
    num_corrupted->setValue( 3 );
    num_corrupted->setMinValue( 1 );
    layout10->addWidget( num_corrupted );

    textLabel1_2 = new TQLabel( groupBox3, "textLabel1_2" );
    layout10->addWidget( textLabel1_2 );
    spacer7 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout10->addItem( spacer7 );
    groupBox3Layout->addLayout( layout10 );
    AdvancedPrefLayout->addWidget( groupBox3 );

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

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

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

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

    layout32->addWidget( textLabel1_7, 1, 0 );

    max_con_setups = new KIntNumInput( groupBox2, "max_con_setups" );
    max_con_setups->setValue( 50 );
    max_con_setups->setMinValue( 10 );
    max_con_setups->setMaxValue( 200 );

    layout32->addWidget( max_con_setups, 1, 1 );

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

    layout32->addWidget( textLabel1, 0, 0 );

    dscp = new KIntNumInput( groupBox2, "dscp" );
    dscp->setValue( 0 );
    dscp->setMinValue( 0 );
    dscp->setMaxValue( 63 );

    layout32->addWidget( dscp, 0, 1 );
    layout33->addLayout( layout32 );
    spacer4 = new TQSpacerItem( 383, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout33->addItem( spacer4 );
    groupBox2Layout->addLayout( layout33 );

    do_not_use_kde_proxy = new TQCheckBox( groupBox2, "do_not_use_kde_proxy" );
    groupBox2Layout->addWidget( do_not_use_kde_proxy );

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

    textLabel1_4 = new TQLabel( groupBox2, "textLabel1_4" );
    layout7_2->addWidget( textLabel1_4 );

    http_proxy = new KLineEdit( groupBox2, "http_proxy" );
    layout7_2->addWidget( http_proxy );
    spacer7_2 = new TQSpacerItem( 81, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout7_2->addItem( spacer7_2 );
    groupBox2Layout->addLayout( layout7_2 );
    AdvancedPrefLayout->addWidget( groupBox2 );
    spacer5 = new TQSpacerItem( 20, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    AdvancedPrefLayout->addItem( spacer5 );
    languageChange();
    resize( TQSize(743, 683).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

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

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void AdvancedPref::languageChange()
{
    setCaption( tr2i18n( "Advanced Preferences" ) );
    groupBox4->setTitle( tr2i18n( "Advanced Options" ) );
    textLabel1_5->setText( tr2i18n( "Time left estimation algorithm:" ) );
    TQToolTip::add( textLabel1_5, tr2i18n( "<b>KTorrent algorithm:</b> Default algorithm using combination of other algorithms based on our tests.<br>\n"
"<b>Current speed algorithm:</b> Simplest algorithm - BytesLeft/CurrentSpeed<br>\n"
"<b>Global average speed algorithm:</b> BytesLeft/AverageSpeed<br>\n"
"<b>Window of X algorithm:</b> ET calculated from X speed samples<br>\n"
"<b>Moving average algorithm:</b> Moving average speed calculated from X samples" ) );
    eta->clear();
    eta->insertItem( tr2i18n( "KTorrent" ) );
    eta->insertItem( tr2i18n( "Current speed" ) );
    eta->insertItem( tr2i18n( "Global average speed" ) );
    eta->insertItem( tr2i18n( "Window of X" ) );
    eta->insertItem( tr2i18n( "Moving average" ) );
    TQToolTip::add( eta, tr2i18n( "<b>KTorrent algorithm:</b> Default algorithm using combination of other algorithms based on our tests.<br>\n"
"<b>Current speed algorithm:</b> Simplest algorithm - BytesLeft/CurrentSpeed<br>\n"
"<b>Global average speed algorithm:</b> BytesLeft/AverageSpeed<br>\n"
"<b>Window of X algorithm:</b> ET calculated from X speed samples<br>\n"
"<b>Moving average algorithm:</b> Moving average speed calculated from X samples" ) );
    textLabel3->setText( tr2i18n( "(takes effect after restart)" ) );
    prealloc_disabled->setText( tr2i18n( "Disa&ble diskspace preallocation" ) );
    full_prealloc->setText( tr2i18n( "F&ully preallocate diskspace (avoids fragmentation)" ) );
    full_prealloc_method->clear();
    full_prealloc_method->insertItem( tr2i18n( "Basic (slow)" ) );
    full_prealloc_method->insertItem( tr2i18n( "Filesystem specific" ) );
    groupBox1->setTitle( tr2i18n( "Performance" ) );
    textLabel1_3->setText( tr2i18n( "Memory usage:" ) );
    mem_usage->clear();
    mem_usage->insertItem( tr2i18n( "Low" ) );
    mem_usage->insertItem( tr2i18n( "Medium" ) );
    mem_usage->insertItem( tr2i18n( "High" ) );
    textLabel1_3_2->setText( tr2i18n( "GUI update interval:" ) );
    gui_interval->clear();
    gui_interval->insertItem( tr2i18n( "500ms" ) );
    gui_interval->insertItem( tr2i18n( "1s" ) );
    gui_interval->insertItem( tr2i18n( "2s" ) );
    gui_interval->insertItem( tr2i18n( "5s" ) );
    textLabel1_6->setText( tr2i18n( "Fast CPU" ) );
    TQToolTip::add( cpu_usage, TQString::null );
    textLabel2_2->setText( tr2i18n( "Slow CPU" ) );
    groupBox3->setTitle( tr2i18n( "Data Checking" ) );
    no_recheck->setText( tr2i18n( "During uploading, do &not recheck chunks bigger than" ) );
    textLabel2->setText( tr2i18n( "KB" ) );
    auto_recheck->setText( tr2i18n( "Do a data integrit&y check after" ) );
    textLabel1_2->setText( tr2i18n( "corrupted chunks" ) );
    groupBox2->setTitle( tr2i18n( "Networking" ) );
    textLabel1_7->setText( tr2i18n( "Maximum number of connection setups:" ) );
    textLabel1->setText( tr2i18n( "DSCP for IP packets:" ) );
    do_not_use_kde_proxy->setText( tr2i18n( "Do not use the TDE pro&xy settings for HTTP tracker connections" ) );
    textLabel1_4->setText( tr2i18n( "HTTP tracker proxy:" ) );
}

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

TQMetaObject *AdvancedPref::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_AdvancedPref( "AdvancedPref", &AdvancedPref::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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