# HG changeset patch # User unc0rr # Date 1189102452 0 # Node ID ecb6347dfecae3056f0ba5a73ac2c702be6b95a5 # Parent 7531ae5b146e0dd6a323ccb63ee6f3bbf6f804a5 Prepare to new page 'Training' diff -r 7531ae5b146e -r ecb6347dfeca QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Thu Sep 06 15:31:52 2007 +0000 +++ b/QTfrontend/hwform.cpp Thu Sep 06 18:14:12 2007 +0000 @@ -74,6 +74,7 @@ connect(ui.pageMultiplayer->BtnStartMPGame, SIGNAL(clicked()), this, SLOT(StartMPGame())); connect(ui.pageMultiplayer->teamsSelect, SIGNAL(setEnabledGameStart(bool)), ui.pageMultiplayer->BtnStartMPGame, SLOT(setEnabled(bool))); + connect(ui.pageMultiplayer->teamsSelect, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup())); connect(ui.pagePlayDemo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); connect(ui.pagePlayDemo->BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo())); @@ -102,7 +103,9 @@ connect(ui.pageGameStats->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); - connect(ui.pageMultiplayer->teamsSelect, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup())); + connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(GoToSimpleGame())); + connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), this, SLOT(GoBack())); + connect(ui.pageSinglePlayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); GoToPage(ID_PAGE_MAIN); } @@ -136,6 +139,11 @@ GoToPage(ID_PAGE_SINGLEPLAYER); } +void HWForm::GoToSimpleGame() +{ + GoToPage(ID_PAGE_SIMPLEGAME); +} + void HWForm::GoToSetup() { GoToPage(ID_PAGE_SETUP); diff -r 7531ae5b146e -r ecb6347dfeca QTfrontend/hwform.h --- a/QTfrontend/hwform.h Thu Sep 06 15:31:52 2007 +0000 +++ b/QTfrontend/hwform.h Thu Sep 06 18:14:12 2007 +0000 @@ -50,6 +50,7 @@ void GoToDemos(); void GoToNet(); void GoToInfo(); + void GoToSimpleGame(); void GoToPage(quint8 id); void GoBack(); void btnExitPressed(); @@ -81,16 +82,17 @@ void UpdateTeamsLists(const QStringList* editable_teams=0); void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget); enum PageIDs { - ID_PAGE_SINGLEPLAYER = 0, - ID_PAGE_SETUP_TEAM = 1, - ID_PAGE_SETUP = 2, - ID_PAGE_MULTIPLAYER = 3, - ID_PAGE_DEMOS = 4, - ID_PAGE_NET = 5, - ID_PAGE_NETCFG = 6, - ID_PAGE_INFO = 7, - ID_PAGE_MAIN = 8, - ID_PAGE_GAMESTATS = 9 + ID_PAGE_SIMPLEGAME = 0, + ID_PAGE_SETUP_TEAM = 1, + ID_PAGE_SETUP = 2, + ID_PAGE_MULTIPLAYER = 3, + ID_PAGE_DEMOS = 4, + ID_PAGE_NET = 5, + ID_PAGE_NETCFG = 6, + ID_PAGE_INFO = 7, + ID_PAGE_MAIN = 8, + ID_PAGE_GAMESTATS = 9, + ID_PAGE_SINGLEPLAYER = 10 }; HWGame * game; HWTeam * editedTeam; diff -r 7531ae5b146e -r ecb6347dfeca QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Thu Sep 06 15:31:52 2007 +0000 +++ b/QTfrontend/pages.cpp Thu Sep 06 18:14:12 2007 +0000 @@ -57,43 +57,43 @@ BtnSinglePlayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnSinglePlayer->setFont(*font14); BtnSinglePlayer->setText(QPushButton::tr("Single Player")); - pageLayout->addWidget(BtnSinglePlayer, 1, 1); + pageLayout->addWidget(BtnSinglePlayer, 0, 1); BtnMultiplayer = new QPushButton(this); BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnMultiplayer->setFont(*font14); BtnMultiplayer->setText(QPushButton::tr("Multiplayer")); - pageLayout->addWidget(BtnMultiplayer, 2, 1); + pageLayout->addWidget(BtnMultiplayer, 1, 1); BtnNet = new QPushButton(this); BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnNet->setFont(*font14); BtnNet->setText(QPushButton::tr("Net game")); - pageLayout->addWidget(BtnNet, 3, 1); + pageLayout->addWidget(BtnNet, 2, 1); BtnLoad = new QPushButton(this); BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnLoad->setFont(*font14); BtnLoad->setText(QPushButton::tr("Load")); - pageLayout->addWidget(BtnLoad, 4, 1); + pageLayout->addWidget(BtnLoad, 3, 1); BtnDemos = new QPushButton(this); BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnDemos->setFont(*font14); BtnDemos->setText(QPushButton::tr("Demos")); - pageLayout->addWidget(BtnDemos, 5, 1); + pageLayout->addWidget(BtnDemos, 4, 1); BtnSetup = new QPushButton(this); BtnSetup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnSetup->setFont(*font14); BtnSetup->setText(QPushButton::tr("Setup")); - pageLayout->addWidget(BtnSetup, 6, 1); + pageLayout->addWidget(BtnSetup, 5, 1); BtnInfo = new QPushButton(this); BtnInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); BtnInfo->setFont(*font14); BtnInfo->setText(QPushButton::tr("About")); - pageLayout->addWidget(BtnInfo, 7, 1); + pageLayout->addWidget(BtnInfo, 6, 1); BtnExit = new QPushButton(parent); BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -116,7 +116,7 @@ BtnBack->setText(QPushButton::tr("Back")); bottomLayout->addWidget(BtnBack, 100); bottomLayout->addStretch(100); - BtnSimpleGame = new QPushButton(this); + BtnSimpleGame = new QPushButton(this); BtnSimpleGame->setFont(*font14); BtnSimpleGame->setText(QPushButton::tr("Simple Game")); bottomLayout->addWidget(BtnSimpleGame, 100); @@ -530,3 +530,30 @@ labelGameStats->setTextFormat(Qt::RichText); pageLayout->addWidget(labelGameStats, 0, 0, 1, 3); } + +PageSinglePlayer::PageSinglePlayer(QWidget* parent) : QWidget(parent) +{ + QFont * font14 = new QFont("MS Shell Dlg", 14); + QGridLayout * pageLayout = new QGridLayout(this); + pageLayout->setMargin(25); + pageLayout->setColumnStretch(0, 1); + pageLayout->setColumnStretch(1, 2); + pageLayout->setColumnStretch(2, 1); + + BtnSimpleGamePage = new QPushButton(this); + BtnSimpleGamePage->setFont(*font14); + BtnSimpleGamePage->setText(QPushButton::tr("Simple Game")); + pageLayout->addWidget(BtnSimpleGamePage, 0, 1); + + BtnTrainPage = new QPushButton(this); + BtnTrainPage->setFont(*font14); + BtnTrainPage->setText(QPushButton::tr("Training")); + pageLayout->addWidget(BtnTrainPage, 1, 1); + + BtnBack = new QPushButton(this); + BtnBack->setFont(*font14); + BtnBack->setText(QPushButton::tr("Back")); + pageLayout->addWidget(BtnBack, 3, 1); + +} + diff -r 7531ae5b146e -r ecb6347dfeca QTfrontend/pages.h --- a/QTfrontend/pages.h Thu Sep 06 15:31:52 2007 +0000 +++ b/QTfrontend/pages.h Thu Sep 06 18:14:12 2007 +0000 @@ -202,5 +202,18 @@ QLabel *labelGameStats; }; +class PageSinglePlayer : public QWidget +{ + Q_OBJECT + +public: + PageSinglePlayer(QWidget* parent = 0); + + QPushButton *BtnSimpleGamePage; + QPushButton *BtnTrainPage; + QPushButton *BtnBack; + GameCFGWidget *gameCFG; +}; + #endif // PAGES_H diff -r 7531ae5b146e -r ecb6347dfeca QTfrontend/ui_hwform.cpp --- a/QTfrontend/ui_hwform.cpp Thu Sep 06 15:31:52 2007 +0000 +++ b/QTfrontend/ui_hwform.cpp Thu Sep 06 18:14:12 2007 +0000 @@ -52,7 +52,7 @@ void Ui_HWForm::SetupPages(QWidget *Parent) { - Pages = new QStackedLayout(Parent); + Pages = new QStackedLayout(Parent); pageSimpleGame = new PageSimpleGame(); Pages->addWidget(pageSimpleGame); @@ -66,13 +66,13 @@ pageMultiplayer = new PageMultiplayer(); Pages->addWidget(pageMultiplayer); - pagePlayDemo = new PagePlayDemo(); + pagePlayDemo = new PagePlayDemo(); Pages->addWidget(pagePlayDemo); pageNet = new PageNet(); Pages->addWidget(pageNet); - pageNetGame = new PageNetGame(); + pageNetGame = new PageNetGame(); Pages->addWidget(pageNetGame); pageInfo = new PageInfo(); @@ -83,4 +83,7 @@ pageGameStats = new PageGameStats(); Pages->addWidget(pageGameStats); + + pageSinglePlayer = new PageSinglePlayer(); + Pages->addWidget(pageSinglePlayer); } diff -r 7531ae5b146e -r ecb6347dfeca QTfrontend/ui_hwform.h --- a/QTfrontend/ui_hwform.h Thu Sep 06 15:31:52 2007 +0000 +++ b/QTfrontend/ui_hwform.h Thu Sep 06 18:14:12 2007 +0000 @@ -30,6 +30,7 @@ class PageNetGame; class PageInfo; class PageGameStats; +class PageSinglePlayer; class QStackedLayout; class QFont; class QWidget; @@ -51,6 +52,7 @@ PageNetGame *pageNetGame; PageInfo *pageInfo; PageGameStats *pageGameStats; + PageSinglePlayer *pageSinglePlayer; QStackedLayout *Pages; QFont *font14;