QTfrontend/pagesingleplayer.cpp
changeset 6042 8b5345758f62
parent 6009 14f6fc9869f2
equal deleted inserted replaced
6040:a740069c21e3 6042:8b5345758f62
    20 #include <QPushButton>
    20 #include <QPushButton>
    21 
    21 
    22 #include "pagesingleplayer.h"
    22 #include "pagesingleplayer.h"
    23 #include "gamecfgwidget.h"
    23 #include "gamecfgwidget.h"
    24 
    24 
    25 PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent)
    25 QLayout * PageSinglePlayer::bodyLayoutDefinition()
    26 {
    26 {
    27     QVBoxLayout * vLayout = new QVBoxLayout(this);
    27     QVBoxLayout * vLayout = new QVBoxLayout();
       
    28 
    28     QHBoxLayout * topLine = new QHBoxLayout();
    29     QHBoxLayout * topLine = new QHBoxLayout();
    29     QHBoxLayout * middleLine = new QHBoxLayout();
    30     QHBoxLayout * middleLine = new QHBoxLayout();
    30     QHBoxLayout * bottomLine = new QHBoxLayout();
       
    31     vLayout->addStretch();
    31     vLayout->addStretch();
    32     vLayout->addLayout(topLine);
    32     vLayout->addLayout(topLine);
    33     vLayout->addSpacing(30);
    33     vLayout->addSpacing(30);
    34     vLayout->addLayout(middleLine);
    34     vLayout->addLayout(middleLine);
    35     vLayout->addStretch();
    35     vLayout->addStretch();
    36     vLayout->addLayout(bottomLine);
       
    37 
    36 
    38     topLine->addStretch();
    37     topLine->addStretch();
    39     BtnSimpleGamePage = addButton(":/res/SimpleGame.png", topLine, 0, true);
    38     BtnSimpleGamePage = addButton(":/res/SimpleGame.png", topLine, 0, true);
    40     BtnSimpleGamePage->setToolTip(tr("Simple Game (a quick game against the computer, settings are chosen for you)"));
    39     BtnSimpleGamePage->setToolTip(tr("Simple Game (a quick game against the computer, settings are chosen for you)"));
    41     topLine->addSpacing(60);
    40     topLine->addSpacing(60);
    49     BtnCampaignPage->setVisible(false);
    48     BtnCampaignPage->setVisible(false);
    50 
    49 
    51     BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 1, true);
    50     BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 1, true);
    52     BtnTrainPage->setToolTip(tr("Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT"));
    51     BtnTrainPage->setToolTip(tr("Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT"));
    53 
    52 
       
    53     return vLayout;
       
    54 }
    54 
    55 
    55     BtnBack = addButton(":/res/Exit.png", bottomLine, 0, true);
    56 QLayout * PageSinglePlayer::footerLayoutDefinition()
    56     connect(BtnBack, SIGNAL(clicked()), this, SIGNAL(goBack()));
    57 {
    57 
    58     QHBoxLayout * bottomLine = new QHBoxLayout();
    58 
       
    59     bottomLine->addStretch();
    59     bottomLine->addStretch();
    60 
    60 
    61     BtnDemos = addButton(":/res/Record.png", bottomLine, 1, true);
    61     BtnDemos = addButton(":/res/Record.png", bottomLine, 1, true);
    62     BtnDemos->setToolTip(tr("Demos (Watch recorded demos)"));
    62     BtnDemos->setToolTip(tr("Demos (Watch recorded demos)"));
    63     BtnLoad = addButton(":/res/Save.png", bottomLine, 2, true);
    63     BtnLoad = addButton(":/res/Load.png", bottomLine, 2, true);
    64     BtnLoad->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}");
    64     BtnLoad->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
    65     BtnLoad->setToolTip(tr("Load (Load a previously saved game)"));
    65     BtnLoad->setToolTip(tr("Load (Load a previously saved game)"));
    66     BtnBack->setFixedHeight(BtnLoad->height());
    66 
    67     BtnBack->setStyleSheet("QPushButton{margin-top: 31px;}");
    67     bottomLine->setStretch(1,0);
       
    68     bottomLine->setStretch(2,0);
       
    69     bottomLine->setAlignment(BtnDemos, Qt::AlignRight | Qt::AlignBottom);
       
    70     bottomLine->setAlignment(BtnLoad, Qt::AlignRight | Qt::AlignBottom);
       
    71 
       
    72     return bottomLine;
    68 }
    73 }
       
    74 
       
    75 void PageSinglePlayer::connectSignals()
       
    76 {
       
    77     //TODO
       
    78 }
       
    79 
       
    80 PageSinglePlayer::PageSinglePlayer(QWidget* parent) : AbstractPage(parent)
       
    81 {
       
    82     initPage();
       
    83 }