QTfrontend/ui/page/pagegamestats.cpp
changeset 10017 de822cd3df3a
parent 9998 736015b847e3
child 10108 c68cf030eded
--- a/QTfrontend/ui/page/pagegamestats.cpp	Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/ui/page/pagegamestats.cpp	Tue Jan 21 22:43:06 2014 +0100
@@ -40,13 +40,13 @@
 
 QLayout * PageGameStats::bodyLayoutDefinition()
 {
-	kindOfPoints = QString("");
-	defaultGraphTitle = true;	
+    kindOfPoints = QString("");
+    defaultGraphTitle = true;
     QGridLayout * pageLayout = new QGridLayout();
     pageLayout->setSpacing(20);
     pageLayout->setColumnStretch(0, 1);
     pageLayout->setColumnStretch(1, 1);
-    pageLayout->setRowStretch(0, 1);    
+    pageLayout->setRowStretch(0, 1);
     pageLayout->setRowStretch(1, 20);
     //pageLayout->setRowStretch(1, -1); this should work but there is unnecessary empty space betwin lines if used
     pageLayout->setContentsMargins(7, 7, 7, 0);
@@ -106,11 +106,11 @@
 QLayout * PageGameStats::footerLayoutDefinition()
 {
     QHBoxLayout * bottomLayout = new QHBoxLayout();
-    
+
     mainNote = new QLabel(this);
     mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
     mainNote->setWordWrap(true);
-    
+
     bottomLayout->addWidget(mainNote, 0);
     bottomLayout->setStretch(0,1);
 
@@ -159,41 +159,41 @@
 
 void PageGameStats::renderStats()
 {
-	graphic->show();
-	labelGraphTitle-> show();
-	if(defaultGraphTitle) {
-		labelGraphTitle->setText("<br><h1><img src=\":/res/StatsH.png\"> " + PageGameStats::tr("Health graph") + "</h1>");
-	} else {
-		defaultGraphTitle = true;
-	}
-	// if not health data sent
-	if(healthPoints.size() == 0) {
-		labelGraphTitle->hide();
-		graphic->hide();
-	} else {
-		QGraphicsScene * scene = new QGraphicsScene();
+    graphic->show();
+    labelGraphTitle-> show();
+    if(defaultGraphTitle) {
+        labelGraphTitle->setText("<br><h1><img src=\":/res/StatsH.png\"> " + PageGameStats::tr("Health graph") + "</h1>");
+    } else {
+        defaultGraphTitle = true;
+    }
+    // if not health data sent
+    if(healthPoints.size() == 0) {
+        labelGraphTitle->hide();
+        graphic->hide();
+    } else {
+        QGraphicsScene * scene = new QGraphicsScene();
 
-		QMap<quint32, QVector<quint32> >::const_iterator i = healthPoints.constBegin();
-		while (i != healthPoints.constEnd())
-		{
-			quint32 c = i.key();
-			//QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
-			QVector<quint32> hps = i.value();
+        QMap<quint32, QVector<quint32> >::const_iterator i = healthPoints.constBegin();
+        while (i != healthPoints.constEnd())
+        {
+            quint32 c = i.key();
+            //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
+            QVector<quint32> hps = i.value();
 
-			QPainterPath path;
-			if (hps.size())
-				path.moveTo(0, hps[0]);
+            QPainterPath path;
+            if (hps.size())
+                path.moveTo(0, hps[0]);
 
-			for(int t = 1; t < hps.size(); ++t)
-				path.lineTo(t, hps[t]);
+            for(int t = 1; t < hps.size(); ++t)
+                path.lineTo(t, hps[t]);
 
-			scene->addPath(path, QPen(c));
-			++i;
-		}
+            scene->addPath(path, QPen(c));
+            ++i;
+        }
 
-		graphic->setScene(scene);
-		graphic->fitInView(graphic->sceneRect());
-	}
+        graphic->setScene(scene);
+        graphic->fitInView(graphic->sceneRect());
+    }
 }
 
 void PageGameStats::GameStats(char type, const QString & info)
@@ -237,9 +237,9 @@
         }
         case 'g' :
         {
-			// TODO: change default picture or add change pic capability
-			defaultGraphTitle = false;
-			labelGraphTitle->setText("<br><h1><img src=\":/res/StatsR.png\"> " + info + "</h1>");
+            // TODO: change default picture or add change pic capability
+            defaultGraphTitle = false;
+            labelGraphTitle->setText("<br><h1><img src=\":/res/StatsR.png\"> " + info + "</h1>");
             break;
         }
         case 'T':   // local team stats
@@ -257,7 +257,7 @@
             }
             break;
         }
-		case 'p' :
+        case 'p' :
         {
             kindOfPoints = info;
             break;
@@ -300,11 +300,11 @@
             QString message;
             QString killstring;
             if(kindOfPoints.compare("") == 0) {
-				killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
-			} else {
-				killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
-				kindOfPoints = QString("");
-			}
+                killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+            } else {
+                killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
+                kindOfPoints = QString("");
+            }
 
             message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "</h2></p>";