author | Wuzzy <Wuzzy2@mail.ru> |
Tue, 07 Aug 2018 16:23:51 +0200 | |
changeset 13637 | 4c49a4944884 |
parent 12303 | 91ebbadc461d |
permissions | -rw-r--r-- |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
1 |
/* |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
2 |
* Hedgewars, a free turn based strategy game |
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
4 |
* |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
8 |
* |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
13 |
* |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
9998
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
17 |
*/ |
6170 | 18 |
|
19 |
/** |
|
20 |
* @file |
|
21 |
* @brief PageMultiplayer class implementation |
|
22 |
*/ |
|
23 |
||
6171 | 24 |
#include <QGridLayout> |
6170 | 25 |
#include <QHBoxLayout> |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
26 |
#include <QPushButton> |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
27 |
|
5204 | 28 |
#include "pagemultiplayer.h" |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
29 |
#include "gamecfgwidget.h" |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
30 |
#include "teamselect.h" |
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
31 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
32 |
QLayout * PageMultiplayer::bodyLayoutDefinition() |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
33 |
{ |
8886
5c521d1fdd63
Fixed map preview overlap on certain locales (Fixes issue 549).
dag10
parents:
8434
diff
changeset
|
34 |
QHBoxLayout * pageLayout = new QHBoxLayout(); |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
35 |
|
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
36 |
gameCFG = new GameCFGWidget(this); |
12303
91ebbadc461d
Stretch teamselwidget across whole page in local multiplayer page
Wuzzy <almikes@aol.com>
parents:
12241
diff
changeset
|
37 |
pageLayout->addWidget(gameCFG); |
91ebbadc461d
Stretch teamselwidget across whole page in local multiplayer page
Wuzzy <almikes@aol.com>
parents:
12241
diff
changeset
|
38 |
pageLayout->setAlignment(gameCFG, Qt::AlignTop); |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
39 |
|
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
40 |
teamsSelect = new TeamSelWidget(this); |
12303
91ebbadc461d
Stretch teamselwidget across whole page in local multiplayer page
Wuzzy <almikes@aol.com>
parents:
12241
diff
changeset
|
41 |
pageLayout->addWidget(teamsSelect); |
91ebbadc461d
Stretch teamselwidget across whole page in local multiplayer page
Wuzzy <almikes@aol.com>
parents:
12241
diff
changeset
|
42 |
teamsSelect->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
43 |
|
6170 | 44 |
return pageLayout; |
45 |
} |
|
46 |
||
8377 | 47 |
QLayout * PageMultiplayer::footerLayoutLeftDefinition() |
48 |
{ |
|
49 |
QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); |
|
8434 | 50 |
|
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11817
diff
changeset
|
51 |
btnSetup = addButton(":/res/Settings.png", bottomLeftLayout, 0, true, Qt::AlignBottom); |
8377 | 52 |
btnSetup->setWhatsThis(tr("Edit game preferences")); |
53 |
||
54 |
return bottomLeftLayout; |
|
55 |
} |
|
56 |
||
6170 | 57 |
QLayout * PageMultiplayer::footerLayoutDefinition() |
58 |
{ |
|
59 |
QHBoxLayout * footerLayout = new QHBoxLayout(); |
|
6009 | 60 |
|
8377 | 61 |
const QIcon& lp = QIcon(":/res/Start.png"); |
62 |
QSize sz = lp.actualSize(QSize(65535, 65535)); |
|
63 |
BtnStartMPGame = new QPushButton(); |
|
12241
a0ed4caa6d35
Apply minimal padding to all text buttons in frontend
Wuzzy <almikes@aol.com>
parents:
11824
diff
changeset
|
64 |
BtnStartMPGame->setStyleSheet("padding: 5px 10px"); |
8377 | 65 |
BtnStartMPGame->setText(tr("Start")); |
11817
92b3b0fcb41f
Add more What's This? texts throughout the frontend
Wuzzy <almikes@aol.com>
parents:
11046
diff
changeset
|
66 |
BtnStartMPGame->setWhatsThis(tr("Start fighting (requires at least 2 teams)")); |
8377 | 67 |
BtnStartMPGame->setIcon(lp); |
68 |
BtnStartMPGame->setFixedHeight(50); |
|
69 |
BtnStartMPGame->setIconSize(sz); |
|
70 |
BtnStartMPGame->setFlat(true); |
|
12241
a0ed4caa6d35
Apply minimal padding to all text buttons in frontend
Wuzzy <almikes@aol.com>
parents:
11824
diff
changeset
|
71 |
BtnStartMPGame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); |
6170 | 72 |
|
73 |
footerLayout->addStretch(); |
|
11824
7642955690bc
Tweak sizes and icons of most footer buttons of frontend
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
74 |
footerLayout->addWidget(BtnStartMPGame, 0, Qt::AlignBottom); |
6170 | 75 |
|
76 |
return footerLayout; |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
77 |
} |
6009 | 78 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
79 |
void PageMultiplayer::connectSignals() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
80 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
81 |
PageMultiplayer::connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked())); |
5078
3527f0e7bb21
Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff
changeset
|
82 |
} |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
83 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
84 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : AbstractPage(parent) |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
85 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
86 |
initPage(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
87 |
} |