QTfrontend/ui/page/pagegamestats.cpp
changeset 8901 505307b9735d
parent 8384 a6e7a95f3b2e
child 9039 24e1ccd9326f
--- a/QTfrontend/ui/page/pagegamestats.cpp	Wed Apr 10 22:59:40 2013 +0400
+++ b/QTfrontend/ui/page/pagegamestats.cpp	Wed Apr 10 22:52:38 2013 +0200
@@ -97,10 +97,12 @@
     return pageLayout;
 }
 
+//TODO button placement, image etc
 QLayout * PageGameStats::footerLayoutDefinition()
 {
     QHBoxLayout * bottomLayout = new QHBoxLayout();
 
+    btnRestart = addButton(":/res/Start.png", bottomLayout, 0, true);
     btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);
     btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
     bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
@@ -112,6 +114,7 @@
 {
     connect(this, SIGNAL(pageEnter()), this, SLOT(renderStats()));
     connect(btnSave, SIGNAL(clicked()), this, SIGNAL(saveDemoRequested()));
+    connect(btnRestart, SIGNAL(clicked()), this, SIGNAL(restartGameRequested()));
 }
 
 PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
@@ -133,6 +136,11 @@
     lastColor = 0;
 }
 
+void PageGameStats::restartBtnVisible(bool visible)
+{
+    btnRestart->setVisible(visible);
+}
+
 void PageGameStats::renderStats()
 {
     QGraphicsScene * scene = new QGraphicsScene();