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

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

#include "sprefwgt.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcombobox.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    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 );

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

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

    GuiUpdatesSbw = new TQSpinBox( groupBox1, "GuiUpdatesSbw" );
    GuiUpdatesSbw->setMaxValue( 429496729 );
    GuiUpdatesSbw->setMinValue( 1 );
    GuiUpdatesSbw->setValue( 4 );
    layout2->addWidget( GuiUpdatesSbw );

    textLabel2 = new TQLabel( groupBox1, "textLabel2" );
    layout2->addWidget( textLabel2 );
    groupBox1Layout->addLayout( layout2 );

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

    textLabel3 = new TQLabel( groupBox1, "textLabel3" );
    layout4->addWidget( textLabel3 );

    DataIvalSbw = new TQSpinBox( groupBox1, "DataIvalSbw" );
    DataIvalSbw->setMaxValue( 999999999 );
    DataIvalSbw->setMinValue( 1 );
    DataIvalSbw->setLineStep( 250 );
    DataIvalSbw->setValue( 1000 );
    layout4->addWidget( DataIvalSbw );

    textLabel4 = new TQLabel( groupBox1, "textLabel4" );
    layout4->addWidget( textLabel4 );
    groupBox1Layout->addLayout( layout4 );
    sprefwgtLayout->addWidget( groupBox1 );

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

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

    textLabel1_4 = new TQLabel( groupBox5, "textLabel1_4" );
    layout11->addWidget( textLabel1_4 );

    MaxSpdModeCbw = new TQComboBox( false, groupBox5, "MaxSpdModeCbw" );
    layout11->addWidget( MaxSpdModeCbw );
    groupBox5Layout->addLayout( layout11 );
    sprefwgtLayout->addWidget( groupBox5 );

    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 );

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

    PeersSpdCbw = new TQCheckBox( groupBox3, "PeersSpdCbw" );
    PeersSpdCbw->setChecked( true );
    layout3->addWidget( PeersSpdCbw );

    textLabel1_2 = new TQLabel( groupBox3, "textLabel1_2" );
    layout3->addWidget( textLabel1_2 );

    PeersSpdUpdIvalSbw = new TQSpinBox( groupBox3, "PeersSpdUpdIvalSbw" );
    PeersSpdUpdIvalSbw->setMaxValue( 999999999 );
    PeersSpdUpdIvalSbw->setMinValue( 1 );
    PeersSpdUpdIvalSbw->setValue( 4 );
    layout3->addWidget( PeersSpdUpdIvalSbw );

    textLabel2_2 = new TQLabel( groupBox3, "textLabel2_2" );
    layout3->addWidget( textLabel2_2 );
    groupBox3Layout->addLayout( layout3 );

    textLabel3_2 = new TQLabel( groupBox3, "textLabel3_2" );
    textLabel3_2->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );
    groupBox3Layout->addWidget( textLabel3_2 );
    sprefwgtLayout->addWidget( groupBox3 );

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

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

    ConnSdrInSwaCbw = new TQCheckBox( groupBox11, "ConnSdrInSwaCbw" );
    layout7->addWidget( ConnSdrInSwaCbw );

    ConnLchInSwaCbw = new TQCheckBox( groupBox11, "ConnLchInSwaCbw" );
    layout7->addWidget( ConnLchInSwaCbw );
    groupBox11Layout->addLayout( layout7 );
    sprefwgtLayout->addWidget( groupBox11 );

    groupBox8 = new TQGroupBox( this, "groupBox8" );
    groupBox8->setColumnLayout(0, TQt::Vertical );
    groupBox8->layout()->setSpacing( 6 );
    groupBox8->layout()->setMargin( 11 );
    groupBox8Layout = new TQGridLayout( groupBox8->layout() );
    groupBox8Layout->setAlignment( TQt::AlignTop );

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

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

    DownloadMrmtSbw = new TQSpinBox( groupBox8, "DownloadMrmtSbw" );
    DownloadMrmtSbw->setMaxValue( 999999999 );
    DownloadMrmtSbw->setMinValue( 1 );
    DownloadMrmtSbw->setValue( 256 );
    layout5->addWidget( DownloadMrmtSbw );

    groupBox8Layout->addLayout( layout5, 0, 0 );

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

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

    PeersSpdMrmtSbw = new TQSpinBox( groupBox8, "PeersSpdMrmtSbw" );
    PeersSpdMrmtSbw->setMaxValue( 999999999 );
    PeersSpdMrmtSbw->setMinValue( 1 );
    PeersSpdMrmtSbw->setValue( 256 );
    layout5_2->addWidget( PeersSpdMrmtSbw );

    groupBox8Layout->addLayout( layout5_2, 1, 0 );

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

    textLabel1_3_3 = new TQLabel( groupBox8, "textLabel1_3_3" );
    layout5_3->addWidget( textLabel1_3_3 );

    UploadMrmtSbw = new TQSpinBox( groupBox8, "UploadMrmtSbw" );
    UploadMrmtSbw->setMaxValue( 999999999 );
    UploadMrmtSbw->setMinValue( 1 );
    UploadMrmtSbw->setValue( 256 );
    layout5_3->addWidget( UploadMrmtSbw );

    groupBox8Layout->addLayout( layout5_3, 2, 0 );

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

    textLabel1_3_5 = new TQLabel( groupBox8, "textLabel1_3_5" );
    layout5_5->addWidget( textLabel1_3_5 );

    ConnsMrmtSbw = new TQSpinBox( groupBox8, "ConnsMrmtSbw" );
    ConnsMrmtSbw->setMaxValue( 999999999 );
    ConnsMrmtSbw->setMinValue( 1 );
    ConnsMrmtSbw->setValue( 512 );
    layout5_5->addWidget( ConnsMrmtSbw );

    groupBox8Layout->addLayout( layout5_5, 0, 1 );

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

    textLabel1_3_4 = new TQLabel( groupBox8, "textLabel1_3_4" );
    layout5_4->addWidget( textLabel1_3_4 );

    DHTMrmtSbw = new TQSpinBox( groupBox8, "DHTMrmtSbw" );
    DHTMrmtSbw->setMaxValue( 999999999 );
    DHTMrmtSbw->setMinValue( 1 );
    DHTMrmtSbw->setValue( 512 );
    layout5_4->addWidget( DHTMrmtSbw );

    groupBox8Layout->addLayout( layout5_4, 1, 1 );
    sprefwgtLayout->addWidget( groupBox8 );
    spacer3 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    sprefwgtLayout->addItem( spacer3 );
    languageChange();
    resize( TQSize(600, 480).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PeersSpdCbw, TQ_SIGNAL( toggled(bool) ), textLabel2_2, TQ_SLOT( setEnabled(bool) ) );
    connect( PeersSpdCbw, TQ_SIGNAL( toggled(bool) ), PeersSpdUpdIvalSbw, TQ_SLOT( setEnabled(bool) ) );
    connect( PeersSpdCbw, TQ_SIGNAL( toggled(bool) ), textLabel1_2, TQ_SLOT( setEnabled(bool) ) );

    // buddies
    textLabel1->setBuddy( GuiUpdatesSbw );
    textLabel2->setBuddy( GuiUpdatesSbw );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void sprefwgt::languageChange()
{
    groupBox1->setTitle( tr2i18n( "Update" ) );
    textLabel1->setText( tr2i18n( "Update charts every" ) );
    textLabel2->setText( tr2i18n( "GUI updates" ) );
    textLabel3->setText( tr2i18n( "Gather data every" ) );
    textLabel4->setText( tr2i18n( "miliseconds" ) );
    groupBox5->setTitle( tr2i18n( "Maximum" ) );
    textLabel1_4->setText( tr2i18n( "Maximum speed scale mode:" ) );
    MaxSpdModeCbw->clear();
    MaxSpdModeCbw->insertItem( tr2i18n( "Top" ) );
    MaxSpdModeCbw->insertItem( tr2i18n( "Exact" ) );
    MaxSpdModeCbw->setCurrentItem( 1 );
    TQToolTip::add( MaxSpdModeCbw, tr2i18n( "See 'What's this' for more help" ) );
    TQWhatsThis::add( MaxSpdModeCbw, tr2i18n( "Set maximum value on OY scale as:\n"
"- Top: Globally achieved maximum speed\n"
"- Exact: Maximum achieved speed visible on chart" ) );
    groupBox3->setTitle( tr2i18n( "Peers speed" ) );
    PeersSpdCbw->setText( tr2i18n( "Peers speed:" ) );
    textLabel1_2->setText( tr2i18n( "update every" ) );
    textLabel2_2->setText( tr2i18n( "chart data updates" ) );
    textLabel3_2->setText( tr2i18n( "Gathering data about many connected peers can be CPU consuming." ) );
    groupBox11->setTitle( tr2i18n( "Peers connections" ) );
    TQToolTip::add( groupBox11, tr2i18n( "Large values can obscure charts of connected peers" ) );
    ConnSdrInSwaCbw->setText( tr2i18n( "Show seeders in swarms" ) );
    ConnLchInSwaCbw->setText( tr2i18n( "Show leechers in swarms" ) );
    groupBox8->setTitle( tr2i18n( "Measurements count" ) );
    textLabel1_3->setText( tr2i18n( "Download" ) );
    textLabel1_3_2->setText( tr2i18n( "Peers speed" ) );
    textLabel1_3_3->setText( tr2i18n( "Upload" ) );
    textLabel1_3_5->setText( tr2i18n( "Connections" ) );
    textLabel1_3_4->setText( tr2i18n( "DHT" ) );
}

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

TQMetaObject *sprefwgt::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_sprefwgt( "sprefwgt", &sprefwgt::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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