diff -r 0907b0fd5714 -r 9aa8a832e296 QTfrontend/statsPage.cpp
--- a/QTfrontend/statsPage.cpp Mon Aug 30 15:24:49 2010 +0200
+++ b/QTfrontend/statsPage.cpp Mon Aug 30 22:02:33 2010 +0200
@@ -19,7 +19,8 @@
#include The best shot award was won by %1 with %2 pts. The best shot award was won by %1 with %2 pts. The best killer is %1 with %2 kills in a turn. The best killer is %1 with %2 kills in a turn. A total of %1 hedgehog(s) were killed during this round. A total of %1 hedgehog(s) were killed during this round. Details
"));
+ l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
labelGameStats->setTextFormat(Qt::RichText);
- pageLayout->addWidget(labelGameStats, 0, 0, 1, 3);
-
- graphic = new FitGraphicsView(this);
+ labelGameStats->setAlignment(Qt::AlignTop);
+ gbl->addWidget(l);
+ gbl->addWidget(labelGameStats);
+ gb->setLayout(gbl);
+ pageLayout->addWidget(gb, 1, 1);
+
+ // graph
+ graphic = new FitGraphicsView(gb);
+ l = new QLabel(this);
+ l->setTextFormat(Qt::RichText);
+ l->setText(PageGameStats::tr(" Health graph
"));
+ l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ gbl->addWidget(l);
+ gbl->addWidget(graphic);
graphic->scale(1.0, -1.0);
graphic->setBackgroundBrush(QBrush(Qt::black));
- pageLayout->addWidget(graphic, 1, 0, 1, 3);
+
+ labelGameWin = new QLabel(this);
+ labelGameWin->setTextFormat(Qt::RichText);
+ pageLayout->addWidget(labelGameWin, 0, 0, 1, 2);
+
+ // ranking box
+ gb = new QGroupBox(this);
+ gbl = new QVBoxLayout;
+ labelGameRank = new QLabel(gb);
+ l = new QLabel(this);
+ l->setTextFormat(Qt::RichText);
+ l->setText(PageGameStats::tr(" Ranking
"));
+ l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ gbl->addWidget(l);
+ gbl->addWidget(labelGameRank);
+ gb->setLayout(gbl);
+
+ labelGameRank->setTextFormat(Qt::RichText);
+ labelGameRank->setAlignment(Qt::AlignTop);
+ pageLayout->addWidget(gb, 1, 0);
}
void PageGameStats::AddStatText(const QString & msg)
@@ -61,6 +101,9 @@
{
labelGameStats->setText("");
healthPoints.clear();
+ labelGameRank->setText("");
+ playerPosition = 0;
+ lastColor = 0;
}
void PageGameStats::renderStats()
@@ -93,12 +136,12 @@
{
switch(type) {
case 'r' : {
- AddStatText(QString("%1
").arg(info));
+ labelGameWin->setText(QString("%1
").arg(info));
break;
}
case 'D' : {
int i = info.indexOf(' ');
- QString message = PageGameStats::tr("%1 %2. %3 (%4 kill).
%1 thought it's good to shoot his own hedgehogs with %2 pts.
") + .arg(info.mid(i + 1), info.left(i)); + AddStatText(message); + break; + } + case 'S' : { + int i = info.indexOf(' '); + QString message = PageGameStats::tr("%1 killed %2 of his own hedgehogs.
") + .arg(info.mid(i + 1), info.left(i)); + AddStatText(message); + break; + } + case 'B' : { + int i = info.indexOf(' '); + QString message = PageGameStats::tr("%1 was scared and skipped turn %2 times.
") + .arg(info.mid(i + 1), info.left(i)); + AddStatText(message); + break; + } + } }