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

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

#include "statustabbase.h"

#include <ntqvariant.h>
#include <availabilitychunkbar.h>
#include <downloadedchunkbar.h>
#include <floatspinbox.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqframe.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "downloadedchunkbar.h"
#include "availabilitychunkbar.h"
#include "floatspinbox.h"

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

    m_info_caption = new TQLabel( this, "m_info_caption" );
    m_info_caption->setPaletteBackgroundColor( TQColor( 200, 200, 200 ) );
    TQFont m_info_caption_font(  m_info_caption->font() );
    m_info_caption_font.setBold( true );
    m_info_caption->setFont( m_info_caption_font ); 
    StatusTabBaseLayout->addWidget( m_info_caption );

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

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

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

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

    textLabel1_6 = new TQLabel( this, "textLabel1_6" );

    layout15->addWidget( textLabel1_6, 0, 0 );

    m_seeders = new TQLabel( this, "m_seeders" );
    m_seeders->setMinimumSize( TQSize( 100, 0 ) );
    m_seeders->setFrameShape( TQLabel::Panel );
    m_seeders->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout15->addWidget( m_seeders, 1, 1 );

    m_leechers = new TQLabel( this, "m_leechers" );
    m_leechers->setMinimumSize( TQSize( 100, 0 ) );
    m_leechers->setFrameShape( TQLabel::Panel );
    m_leechers->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout15->addWidget( m_leechers, 0, 1 );
    layout16->addLayout( layout15 );

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

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

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

    m_avg_down = new TQLabel( this, "m_avg_down" );
    m_avg_down->setMinimumSize( TQSize( 100, 0 ) );
    m_avg_down->setFrameShape( TQLabel::Panel );
    m_avg_down->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout14->addWidget( m_avg_down, 1, 1 );

    m_avg_up = new TQLabel( this, "m_avg_up" );
    m_avg_up->setMinimumSize( TQSize( 100, 0 ) );
    m_avg_up->setFrameShape( TQLabel::Panel );
    m_avg_up->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout14->addWidget( m_avg_up, 0, 1 );

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

    layout14->addWidget( textLabel1_7, 0, 0 );
    layout16->addLayout( layout14 );

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

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

    layout12->addWidget( textLabel3_2, 1, 0 );

    textLabel1_5 = new TQLabel( this, "textLabel1_5" );

    layout12->addWidget( textLabel1_5, 0, 0 );

    m_tracker_status = new TQLabel( this, "m_tracker_status" );
    m_tracker_status->setMinimumSize( TQSize( 100, 0 ) );
    m_tracker_status->setFrameShape( TQLabel::Panel );
    m_tracker_status->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout12->addWidget( m_tracker_status, 0, 1 );

    m_tracker_update_time = new TQLabel( this, "m_tracker_update_time" );
    m_tracker_update_time->setMinimumSize( TQSize( 100, 0 ) );
    m_tracker_update_time->setFrameShape( TQLabel::Panel );
    m_tracker_update_time->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout12->addWidget( m_tracker_update_time, 1, 1 );
    layout16->addLayout( layout12 );
    spacer9 = new TQSpacerItem( 207, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout16->addItem( spacer9 );
    StatusTabBaseLayout->addLayout( layout16 );

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

    layout23 = new TQVBoxLayout( 0, 0, 6, "layout23"); 

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

    m_chunks_caption = new TQLabel( this, "m_chunks_caption" );
    m_chunks_caption->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, m_chunks_caption->sizePolicy().hasHeightForWidth() ) );
    m_chunks_caption->setPaletteBackgroundColor( TQColor( 200, 200, 200 ) );
    TQFont m_chunks_caption_font(  m_chunks_caption->font() );
    m_chunks_caption_font.setBold( true );
    m_chunks_caption->setFont( m_chunks_caption_font ); 
    layout25->addWidget( m_chunks_caption );

    textLabel1_2 = new TQLabel( this, "textLabel1_2" );
    textLabel1_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );
    layout25->addWidget( textLabel1_2 );

    m_chunk_bar = new kt::DownloadedChunkBar( this, "m_chunk_bar" );
    m_chunk_bar->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)4, 0, 0, m_chunk_bar->sizePolicy().hasHeightForWidth() ) );
    m_chunk_bar->setMinimumSize( TQSize( 0, 20 ) );
    layout25->addWidget( m_chunk_bar );

    textLabel1_3 = new TQLabel( this, "textLabel1_3" );
    textLabel1_3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel1_3->sizePolicy().hasHeightForWidth() ) );
    layout25->addWidget( textLabel1_3 );

    m_av_chunk_bar = new kt::AvailabilityChunkBar( this, "m_av_chunk_bar" );
    m_av_chunk_bar->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)4, 0, 0, m_av_chunk_bar->sizePolicy().hasHeightForWidth() ) );
    m_av_chunk_bar->setMinimumSize( TQSize( 0, 20 ) );
    layout25->addWidget( m_av_chunk_bar );
    layout23->addLayout( layout25 );
    spacer11 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout23->addItem( spacer11 );
    layout17->addLayout( layout23 );

    line1 = new TQFrame( this, "line1" );
    line1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, line1->sizePolicy().hasHeightForWidth() ) );
    line1->setFrameShape( TQFrame::VLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::VLine );
    layout17->addWidget( line1 );

    layout16_2 = new TQVBoxLayout( 0, 0, 6, "layout16_2"); 

    m_sharing_caption = new TQLabel( this, "m_sharing_caption" );
    m_sharing_caption->setPaletteBackgroundColor( TQColor( 200, 200, 200 ) );
    TQFont m_sharing_caption_font(  m_sharing_caption->font() );
    m_sharing_caption_font.setBold( true );
    m_sharing_caption->setFont( m_sharing_caption_font ); 
    layout16_2->addWidget( m_sharing_caption );

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

    maxRatio = new kt::FloatSpinBox( this, "maxRatio" );
    maxRatio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, maxRatio->sizePolicy().hasHeightForWidth() ) );
    maxRatio->setMinimumSize( TQSize( 20, 0 ) );

    layout15_2->addWidget( maxRatio, 1, 1 );

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

    layout15_2->addWidget( textLabel3_3, 0, 0 );

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

    maxTime = new kt::FloatSpinBox( this, "maxTime" );
    maxTime->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, maxTime->sizePolicy().hasHeightForWidth() ) );
    maxTime->setMinimumSize( TQSize( 20, 0 ) );
    layout11->addWidget( maxTime );

    textLabel1_9 = new TQLabel( this, "textLabel1_9" );
    layout11->addWidget( textLabel1_9 );

    layout15_2->addLayout( layout11, 2, 1 );

    useLimit = new TQCheckBox( this, "useLimit" );

    layout15_2->addWidget( useLimit, 1, 0 );

    useTimeLimit = new TQCheckBox( this, "useTimeLimit" );

    layout15_2->addWidget( useTimeLimit, 2, 0 );

    m_share_ratio = new TQLabel( this, "m_share_ratio" );
    m_share_ratio->setMinimumSize( TQSize( 50, 0 ) );
    m_share_ratio->setFrameShape( TQLabel::Panel );
    m_share_ratio->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout15_2->addWidget( m_share_ratio, 0, 1 );
    layout16_2->addLayout( layout15_2 );
    spacer6 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding );
    layout16_2->addItem( spacer6 );
    layout17->addLayout( layout16_2 );
    StatusTabBaseLayout->addLayout( layout17 );
    languageChange();
    resize( TQSize(839, 250).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void StatusTabBase::languageChange()
{
    setCaption( tr2i18n( "Status" ) );
    m_info_caption->setText( tr2i18n( "Info" ) );
    textLabel2->setText( tr2i18n( "Seeders:" ) );
    textLabel1_6->setText( tr2i18n( "Leechers:" ) );
    m_seeders->setText( TQString::null );
    m_leechers->setText( TQString::null );
    textLabel2_2->setText( tr2i18n( "Average Down Speed:" ) );
    m_avg_down->setText( TQString::null );
    m_avg_up->setText( TQString::null );
    textLabel1_7->setText( tr2i18n( "Average Up Speed:" ) );
    textLabel3_2->setText( tr2i18n( "Next update in:" ) );
    textLabel1_5->setText( tr2i18n( "Tracker Status:" ) );
    m_tracker_status->setText( TQString::null );
    m_tracker_update_time->setText( TQString::null );
    m_chunks_caption->setText( tr2i18n( "Chunks" ) );
    textLabel1_2->setText( tr2i18n( "Parts of the torrent which have been downloaded:" ) );
    textLabel1_3->setText( tr2i18n( "Parts of the torrent which are available:" ) );
    m_sharing_caption->setText( tr2i18n( "Sharing" ) );
    TQToolTip::add( maxRatio, tr2i18n( "Your upload will stop when share ratio gets to this value. Zero means no limit." ) );
    textLabel3_3->setText( tr2i18n( "Share ratio:" ) );
    TQToolTip::add( maxTime, tr2i18n( "Your upload will stop when you have uploaded for this many hours." ) );
    textLabel1_9->setText( tr2i18n( "Hours" ) );
    useLimit->setText( tr2i18n( "Ratio limit:" ) );
    TQToolTip::add( useLimit, tr2i18n( "Limit works only in seed mode" ) );
    useTimeLimit->setText( tr2i18n( "Time &limit:" ) );
    m_share_ratio->setText( TQString::null );
}

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

TQMetaObject *StatusTabBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_StatusTabBase( "StatusTabBase", &StatusTabBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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