/****************************************************************************
** Form implementation generated from reading ui file 'score.ui'
**
** Created: Sat Sep 15 20:04:26 2001
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "score.h"

#include <qlabel.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qvaluelist.h>
#include <qfont.h>

#include <kapp.h>
#include <kconfig.h>
#include <stdio.h>
/* 
 *  Constructs a CScore which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
CScore::CScore( QWidget* parent,  const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
	QString str;
	
  if ( !name )
  	setName( "Form2" );
  setFixedSize( 233, 196 );
  setCaption( tr( "Kslide's Hall of Fame" ) );

  MultiLineEdit1 = new QMultiLineEdit( this, "MultiLineEdit1" );
  MultiLineEdit1->setGeometry( QRect( 0, 30, 230, 101 ) );

  KConfig *config = kapp->config();
  config->setGroup("PlayersScores");
  QStringList names=config->readListEntry("Players");
  QValueList<int> scores=config->readIntListEntry("Scores");
  QStringList::Iterator itp=names.begin();
  QValueList<int>::Iterator its=scores.begin();
  while(itp!=names.end())
  {
    str=str.sprintf("%s\t\t%d",(*itp).latin1(),*its);
    MultiLineEdit1->insertLine(str);
    itp++;
    its++;
  }

    TextLabel2 = new QLabel( this, "TextLabel2" );
    TextLabel2->setGeometry( QRect( 20, 0, 200, 30 ) );
    TextLabel2->setFont(QFont("Helvetica", 14, QFont::Bold));
    TextLabel2->setText( tr( "Hall of fame" ) );

    PushButton2 = new QPushButton( this, "PushButton2" );
    PushButton2->setGeometry( QRect( 80, 140, 61, 30 ) ); 
    PushButton2->setText( tr( "OK" ) );
    PushButton2->setFocus();
    connect(PushButton2, SIGNAL(clicked()), this, SLOT(accept()));
}

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

//#include "score.moc.cpp"
