QTfrontend/ui/page/pagegamestats.cpp
changeset 9177 d5e98b81e135
parent 9175 dc3c0e44f7f3
child 9178 c0902317c823
--- a/QTfrontend/ui/page/pagegamestats.cpp	Sat Jun 08 23:54:44 2013 +0300
+++ b/QTfrontend/ui/page/pagegamestats.cpp	Sun Jun 09 01:18:58 2013 +0300
@@ -40,6 +40,7 @@
 
 QLayout * PageGameStats::bodyLayoutDefinition()
 {
+	defaultGraphTitle = true;	
     QGridLayout * pageLayout = new QGridLayout();
     pageLayout->setSpacing(20);
     pageLayout->setColumnStretch(0, 1);
@@ -159,12 +160,16 @@
 {
 	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 {
-		labelGraphTitle->setText("<br><h1><img src=\":/res/StatsH.png\"> " + PageGameStats::tr("Health graph") + "</h1>");
 		QGraphicsScene * scene = new QGraphicsScene();
 
 		QMap<quint32, QVector<quint32> >::const_iterator i = healthPoints.constBegin();
@@ -232,6 +237,7 @@
         case 'g' :
         {
 			// TODO: change default picture or add change pic capability
+			defaultGraphTitle = false;
 			labelGraphTitle->setText("<br><h1><img src=\":/res/StatsR.png\"> " + info + "</h1>");
             break;
         }