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

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

#include "chunkdownloadviewbase.h"

#include <ntqvariant.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

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

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

    m_total_chunks = new TQLabel( this, "m_total_chunks" );
    m_total_chunks->setMinimumSize( TQSize( 50, 0 ) );
    m_total_chunks->setFrameShape( TQLabel::Box );
    m_total_chunks->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout11->addWidget( m_total_chunks );
    layout8->addLayout( layout11 );

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

    textLabel5 = new TQLabel( this, "textLabel5" );
    layout14->addWidget( textLabel5 );

    m_chunks_downloading = new TQLabel( this, "m_chunks_downloading" );
    m_chunks_downloading->setMinimumSize( TQSize( 50, 0 ) );
    m_chunks_downloading->setFrameShape( TQLabel::Panel );
    m_chunks_downloading->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout14->addWidget( m_chunks_downloading );
    layout8->addLayout( layout14 );

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

    textLabel3 = new TQLabel( this, "textLabel3" );
    layout13->addWidget( textLabel3 );

    m_chunks_downloaded = new TQLabel( this, "m_chunks_downloaded" );
    m_chunks_downloaded->setMinimumSize( TQSize( 50, 0 ) );
    m_chunks_downloaded->setFrameShape( TQLabel::Panel );
    m_chunks_downloaded->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout13->addWidget( m_chunks_downloaded );
    layout8->addLayout( layout13 );

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

    textLabel1_4 = new TQLabel( this, "textLabel1_4" );
    layout38->addWidget( textLabel1_4 );

    m_excluded_chunks = new TQLabel( this, "m_excluded_chunks" );
    m_excluded_chunks->setMinimumSize( TQSize( 50, 0 ) );
    m_excluded_chunks->setFrameShape( TQLabel::Panel );
    m_excluded_chunks->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout38->addWidget( m_excluded_chunks );
    layout8->addLayout( layout38 );

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

    textLabel1_4_2 = new TQLabel( this, "textLabel1_4_2" );
    layout38_2->addWidget( textLabel1_4_2 );

    m_chunks_left = new TQLabel( this, "m_chunks_left" );
    m_chunks_left->setMinimumSize( TQSize( 50, 0 ) );
    m_chunks_left->setFrameShape( TQLabel::Panel );
    m_chunks_left->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout38_2->addWidget( m_chunks_left );
    layout8->addLayout( layout38_2 );

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

    textLabel1_8 = new TQLabel( this, "textLabel1_8" );
    layout24->addWidget( textLabel1_8 );

    m_size_chunks = new TQLabel( this, "m_size_chunks" );
    m_size_chunks->setMinimumSize( TQSize( 80, 0 ) );
    m_size_chunks->setFrameShape( TQLabel::Panel );
    m_size_chunks->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );
    layout24->addWidget( m_size_chunks );
    layout8->addLayout( layout24 );
    spacer8 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout8->addItem( spacer8 );
    ChunkDownloadViewBaseLayout->addLayout( layout8 );

    m_list_view = new TDEListView( this, "m_list_view" );
    m_list_view->addColumn( tr2i18n( "Chunk" ) );
    m_list_view->addColumn( tr2i18n( "Progress" ) );
    m_list_view->addColumn( tr2i18n( "Peer" ) );
    m_list_view->addColumn( tr2i18n( "Down Speed" ) );
    m_list_view->addColumn( tr2i18n( "Assigned Peers" ) );
    ChunkDownloadViewBaseLayout->addWidget( m_list_view );
    languageChange();
    resize( TQSize(830, 534).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ChunkDownloadViewBase::languageChange()
{
    setCaption( tr2i18n( "Chunks" ) );
    textLabel1->setText( tr2i18n( "Total:" ) );
    m_total_chunks->setText( TQString::null );
    textLabel5->setText( tr2i18n( "Currently downloading:" ) );
    m_chunks_downloading->setText( TQString::null );
    textLabel3->setText( tr2i18n( "Downloaded:" ) );
    m_chunks_downloaded->setText( TQString::null );
    textLabel1_4->setText( tr2i18n( "Excluded:" ) );
    m_excluded_chunks->setText( TQString::null );
    textLabel1_4_2->setText( tr2i18n( "Left:" ) );
    m_chunks_left->setText( TQString::null );
    textLabel1_8->setText( tr2i18n( "Size:" ) );
    m_size_chunks->setText( TQString::null );
    m_list_view->header()->setLabel( 0, tr2i18n( "Chunk" ) );
    m_list_view->header()->setLabel( 1, tr2i18n( "Progress" ) );
    m_list_view->header()->setLabel( 2, tr2i18n( "Peer" ) );
    m_list_view->header()->setLabel( 3, tr2i18n( "Down Speed" ) );
    m_list_view->header()->setLabel( 4, tr2i18n( "Assigned Peers" ) );
}

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

TQMetaObject *ChunkDownloadViewBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ChunkDownloadViewBase( "ChunkDownloadViewBase", &ChunkDownloadViewBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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