Source Code (Use browser search to find items of interest.)

Class Index

ksmiletris'ScoreDialog (./kdegames/ksmiletris/scoredialog.h:29)

class ScoreDialog : public QDialog {
public:
	ScoreDialog(QWidget *parent=0, const char *name=0);
};

ksmiletris'ScoreDialog::ScoreDialog() (./kdegames/ksmiletris/scoredialog.cpp:35)

ScoreDialog::ScoreDialog(QWidget *parent, const char *oname)
        : QDialog(parent, oname, true)
{
	setCaption(i18n("High Scores"));

	KConfig *config = kapp->config();
	config->setGroup("High Score");

	int yd = 10;
	QLabel *label;
	label = new QLabel(i18n("Level"), this);
	label->setAutoResize(true);
	label->move(50, yd);
	label = new QLabel(i18n("Score"), this);
	label->setAutoResize(true);
	label->move(100, yd);
	label = new QLabel(i18n("Name"), this);
	label->setAutoResize(true);
	label->move(160, yd);
	yd += 20;

	QString s, name, level, score, num;
	for (int i = 1; i <= 10; ++i) {
		num.setNum(i);
		s = "Pos" + num + "Level";
		level = config->readEntry(s, "0");
		s = "Pos" + num + "Score";
		score = config->readEntry(s, "0");
		s = "Pos" + num + "Name";
		name = config->readEntry(s, i18n("Noname"));
		s = "#" + num;
		label = new QLabel(s, this);
		label->setAutoResize(true);
		label->move(10, yd);
		label = new QLabel(level, this);
		label->setAutoResize(true);
		label->move(50, yd);	
		label = new QLabel(score, this);
		label->setAutoResize(true);
		label->move(100, yd);
		label = new QLabel(name, this);
		label->setAutoResize(true);
		label->move(160, yd);
		yd += 20;
	}

	QPushButton *ok;
	ok = new QPushButton(i18n("OK"), this);
	ok->setGeometry(85, yd+20, 70, 30);
	ok->setDefault(true);
	connect(ok, SIGNAL(clicked()), SLOT(accept()));

	resize(250, 290);
}