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

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

#include "gamestats.h"

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

/*
 *  Constructs a GameStats as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
GameStats::GameStats( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "GameStats" );
    setSizeGripEnabled( true );
    GameStatsLayout = new TQVBoxLayout( this, 11, 6, "GameStatsLayout"); 

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

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

    GameType = new TQComboBox( false, this, "GameType" );
    GameType->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, GameType->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( GameType );
    GameStatsLayout->addLayout( layout3 );

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

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

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

    layout2->addWidget( Won, 1, 1 );

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

    layout2->addWidget( WonPerc, 1, 2 );

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

    layout2->addWidget( textLabel7, 2, 0 );

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

    layout2->addWidget( textLabel2, 0, 0 );

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

    layout2->addWidget( LooseStreak, 3, 1 );

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

    layout2->addWidget( textLabel8, 3, 0 );

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

    layout2->addWidget( WinStreak, 2, 1 );

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

    layout2->addWidget( textLabel3, 1, 0 );

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

    layout2->addWidget( Played, 0, 1 );
    layout5->addLayout( layout2 );
    spacer2 = new TQSpacerItem( 250, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer2 );
    GameStatsLayout->addLayout( layout5 );
    spacer3 = new TQSpacerItem( 20, 71, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    GameStatsLayout->addItem( spacer3 );

    Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1"); 
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout1->addWidget( buttonOk );
    GameStatsLayout->addLayout( Layout1 );
    languageChange();
    resize( TQSize(310, 211).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( GameType, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( setGameType(int) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GameStats::languageChange()
{
    setCaption( tr2i18n( "Statistics" ) );
    textLabel1->setText( tr2i18n( "Game:" ) );
    Won->setText( tr2i18n( "%1" ) );
    WonPerc->setText( tr2i18n( "(%1%)" ) );
    textLabel7->setText( tr2i18n( "Longest winning streak:" ) );
    textLabel2->setText( tr2i18n( "Games played:" ) );
    LooseStreak->setText( tr2i18n( "%1" ) );
    textLabel8->setText( tr2i18n( "Longest losing streak:" ) );
    WinStreak->setText( tr2i18n( "%1" ) );
    textLabel3->setText( tr2i18n( "Games won:" ) );
    Played->setText( tr2i18n( "%1" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
}

void GameStats::setGameType(int)
{
    tqWarning( "GameStats::setGameType(int): Not implemented yet" );
}

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

TQMetaObject *GameStats::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GameStats( "GameStats", &GameStats::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* GameStats::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 = TQDialog::staticMetaObject();
    static const TQUParameter param_slot_0[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"setGameType", 1, param_slot_0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "setGameType(int)", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"GameStats", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_GameStats.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool GameStats::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setGameType((int)static_QUType_int.get(_o+1)); break;
    case 1: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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