QTfrontend/ui/page/pagegamestats.cpp
changeset 8901 505307b9735d
parent 8384 a6e7a95f3b2e
child 9039 24e1ccd9326f
equal deleted inserted replaced
8899:7493dde4ef51 8901:505307b9735d
    95     pageLayout->addWidget(gb, 1, 0);
    95     pageLayout->addWidget(gb, 1, 0);
    96 
    96 
    97     return pageLayout;
    97     return pageLayout;
    98 }
    98 }
    99 
    99 
       
   100 //TODO button placement, image etc
   100 QLayout * PageGameStats::footerLayoutDefinition()
   101 QLayout * PageGameStats::footerLayoutDefinition()
   101 {
   102 {
   102     QHBoxLayout * bottomLayout = new QHBoxLayout();
   103     QHBoxLayout * bottomLayout = new QHBoxLayout();
   103 
   104 
       
   105     btnRestart = addButton(":/res/Start.png", bottomLayout, 0, true);
   104     btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);
   106     btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);
   105     btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
   107     btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
   106     bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
   108     bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
   107 
   109 
   108     return bottomLayout;
   110     return bottomLayout;
   110 
   112 
   111 void PageGameStats::connectSignals()
   113 void PageGameStats::connectSignals()
   112 {
   114 {
   113     connect(this, SIGNAL(pageEnter()), this, SLOT(renderStats()));
   115     connect(this, SIGNAL(pageEnter()), this, SLOT(renderStats()));
   114     connect(btnSave, SIGNAL(clicked()), this, SIGNAL(saveDemoRequested()));
   116     connect(btnSave, SIGNAL(clicked()), this, SIGNAL(saveDemoRequested()));
       
   117     connect(btnRestart, SIGNAL(clicked()), this, SIGNAL(restartGameRequested()));
   115 }
   118 }
   116 
   119 
   117 PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
   120 PageGameStats::PageGameStats(QWidget* parent) : AbstractPage(parent)
   118 {
   121 {
   119     initPage();
   122     initPage();
   129     labelGameStats->setText("");
   132     labelGameStats->setText("");
   130     healthPoints.clear();
   133     healthPoints.clear();
   131     labelGameRank->setText("");
   134     labelGameRank->setText("");
   132     playerPosition = 0;
   135     playerPosition = 0;
   133     lastColor = 0;
   136     lastColor = 0;
       
   137 }
       
   138 
       
   139 void PageGameStats::restartBtnVisible(bool visible)
       
   140 {
       
   141     btnRestart->setVisible(visible);
   134 }
   142 }
   135 
   143 
   136 void PageGameStats::renderStats()
   144 void PageGameStats::renderStats()
   137 {
   145 {
   138     QGraphicsScene * scene = new QGraphicsScene();
   146     QGraphicsScene * scene = new QGraphicsScene();