184
|
1 |
/*
|
|
2 |
* Hedgewars, a worms-like game
|
|
3 |
* Copyright (c) 2006 Andrey Korotaev <unC0Rr@gmail.com>
|
|
4 |
*
|
|
5 |
* This program is free software; you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License as published by
|
|
7 |
* the Free Software Foundation; version 2 of the License
|
|
8 |
*
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program; if not, write to the Free Software
|
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
17 |
*/
|
|
18 |
|
|
19 |
#include <QGridLayout>
|
|
20 |
#include <QDir>
|
|
21 |
#include <QPushButton>
|
|
22 |
#include <QGroupBox>
|
|
23 |
#include <QComboBox>
|
|
24 |
#include <QLabel>
|
|
25 |
#include <QToolBox>
|
|
26 |
#include <QLineEdit>
|
|
27 |
#include <QListWidget>
|
|
28 |
#include <QApplication>
|
231
|
29 |
#include <QSpinBox>
|
184
|
30 |
|
|
31 |
#include "pages.h"
|
|
32 |
#include "sdlkeys.h"
|
|
33 |
#include "hwconsts.h"
|
|
34 |
#include "gamecfgwidget.h"
|
|
35 |
#include "teamselect.h"
|
|
36 |
#include "gamecfgwidget.h"
|
|
37 |
#include "SquareLabel.h"
|
|
38 |
#include "mapContainer.h"
|
187
|
39 |
#include "about.h"
|
297
|
40 |
#include "fpsedit.h"
|
184
|
41 |
|
|
42 |
PageMain::PageMain(QWidget* parent) : QWidget(parent)
|
|
43 |
{
|
|
44 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
45 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
46 |
pageLayout->setMargin(25);
|
|
47 |
pageLayout->setColumnStretch(0, 1);
|
|
48 |
pageLayout->setColumnStretch(1, 2);
|
|
49 |
pageLayout->setColumnStretch(2, 1);
|
|
50 |
|
|
51 |
BtnSinglePlayer = new QPushButton(this);
|
|
52 |
BtnSinglePlayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
53 |
BtnSinglePlayer->setFont(*font14);
|
|
54 |
BtnSinglePlayer->setText(QPushButton::tr("Single Player"));
|
|
55 |
pageLayout->addWidget(BtnSinglePlayer, 1, 1);
|
|
56 |
|
|
57 |
BtnMultiplayer = new QPushButton(this);
|
|
58 |
BtnMultiplayer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
59 |
BtnMultiplayer->setFont(*font14);
|
|
60 |
BtnMultiplayer->setText(QPushButton::tr("Multiplayer"));
|
|
61 |
pageLayout->addWidget(BtnMultiplayer, 2, 1);
|
|
62 |
|
|
63 |
BtnNet = new QPushButton(this);
|
|
64 |
BtnNet->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
65 |
BtnNet->setFont(*font14);
|
|
66 |
BtnNet->setText(QPushButton::tr("Net game"));
|
|
67 |
pageLayout->addWidget(BtnNet, 3, 1);
|
|
68 |
|
|
69 |
BtnDemos = new QPushButton(this);
|
|
70 |
BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
71 |
BtnDemos->setFont(*font14);
|
|
72 |
BtnDemos->setText(QPushButton::tr("Demos"));
|
|
73 |
pageLayout->addWidget(BtnDemos, 4, 1);
|
|
74 |
|
|
75 |
BtnSetup = new QPushButton(this);
|
|
76 |
BtnSetup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
77 |
BtnSetup->setFont(*font14);
|
|
78 |
BtnSetup->setText(QPushButton::tr("Setup"));
|
|
79 |
pageLayout->addWidget(BtnSetup, 5, 1);
|
|
80 |
|
187
|
81 |
BtnInfo = new QPushButton(this);
|
|
82 |
BtnInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
83 |
BtnInfo->setFont(*font14);
|
|
84 |
BtnInfo->setText(QPushButton::tr("About"));
|
|
85 |
pageLayout->addWidget(BtnInfo, 6, 1);
|
|
86 |
|
184
|
87 |
BtnExit = new QPushButton(parent);
|
|
88 |
BtnExit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
89 |
BtnExit->setFont(*font14);
|
|
90 |
BtnExit->setText(QPushButton::tr("Exit"));
|
187
|
91 |
pageLayout->addWidget(BtnExit, 7, 1);
|
184
|
92 |
}
|
|
93 |
|
|
94 |
PageLocalGame::PageLocalGame(QWidget* parent) : QWidget(parent)
|
|
95 |
{
|
|
96 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
97 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
98 |
BtnBack = new QPushButton(this);
|
|
99 |
BtnBack->setFont(*font14);
|
|
100 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
101 |
pageLayout->addWidget(BtnBack, 1, 0);
|
|
102 |
BtnSimpleGame = new QPushButton(this);
|
|
103 |
BtnSimpleGame->setFont(*font14);
|
|
104 |
BtnSimpleGame->setText(QPushButton::tr("Simple Game"));
|
|
105 |
pageLayout->addWidget(BtnSimpleGame, 1, 3);
|
|
106 |
gameCFG = new GameCFGWidget(this);
|
|
107 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
|
|
108 |
}
|
|
109 |
|
|
110 |
PageEditTeam::PageEditTeam(QWidget* parent) : QWidget(parent)
|
|
111 |
{
|
|
112 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
113 |
QGridLayout * pageLayout = new QGridLayout(this);
|
310
|
114 |
pageLayout->setColumnStretch(0, 1);
|
184
|
115 |
pageLayout->setColumnMinimumWidth(0, 150);
|
|
116 |
pageLayout->setColumnStretch(1, 100);
|
|
117 |
pageLayout->setColumnMinimumWidth(1, 200);
|
310
|
118 |
pageLayout->setColumnStretch(2, 150);
|
184
|
119 |
pageLayout->setColumnMinimumWidth(2, 250);
|
|
120 |
|
|
121 |
GBoxTeam = new QGroupBox(this);
|
|
122 |
GBoxTeam->setTitle(QGroupBox::tr("Team"));
|
|
123 |
GBoxTeam->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
124 |
QGridLayout * GBTLayout = new QGridLayout(GBoxTeam);
|
|
125 |
TeamNameEdit = new QLineEdit(GBoxTeam);
|
|
126 |
TeamNameEdit->setMaxLength(15);
|
231
|
127 |
GBTLayout->addWidget(TeamNameEdit, 0, 0, 1, 0);
|
|
128 |
|
|
129 |
QLabel* difficultyLabel=new QLabel(GBoxTeam);
|
236
|
130 |
difficultyLabel->setText(QLabel::tr("difficulty:"));
|
231
|
131 |
difficultyBox=new QSpinBox(GBoxTeam);
|
|
132 |
difficultyBox->setRange(0, 5);
|
|
133 |
difficultyBox->setSingleStep(1);
|
|
134 |
difficultyBox->setValue(0);
|
|
135 |
GBTLayout->addWidget(difficultyLabel, 1, 0);
|
|
136 |
GBTLayout->addWidget(difficultyBox, 1, 1);
|
236
|
137 |
|
184
|
138 |
pageLayout->addWidget(GBoxTeam, 0, 0);
|
|
139 |
|
|
140 |
GBoxHedgehogs = new QGroupBox(this);
|
|
141 |
GBoxHedgehogs->setTitle(QGroupBox::tr("Team Members"));
|
|
142 |
GBoxHedgehogs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
143 |
QGridLayout * GBHLayout = new QGridLayout(GBoxHedgehogs);
|
|
144 |
for(int i = 0; i < 8; i++)
|
|
145 |
{
|
|
146 |
HHNameEdit[i] = new QLineEdit(GBoxHedgehogs);
|
|
147 |
HHNameEdit[i]->setGeometry(QRect(10, 20 + i * 30, 141, 20));
|
|
148 |
HHNameEdit[i]->setMaxLength(15);
|
|
149 |
GBHLayout->addWidget(HHNameEdit[i]);
|
|
150 |
}
|
|
151 |
pageLayout->addWidget(GBoxHedgehogs, 1, 0, 2, 1);
|
|
152 |
|
|
153 |
BtnTeamDiscard = new QPushButton(this);
|
|
154 |
BtnTeamDiscard->setFont(*font14);
|
|
155 |
BtnTeamDiscard->setText(QPushButton::tr("Discard"));
|
|
156 |
pageLayout->addWidget(BtnTeamDiscard, 4, 0);
|
|
157 |
|
|
158 |
GBoxBinds = new QGroupBox(this);
|
|
159 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds"));
|
|
160 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds);
|
|
161 |
BindsBox = new QToolBox(GBoxBinds);
|
|
162 |
BindsBox->setLineWidth(0);
|
|
163 |
GBBLayout->addWidget(BindsBox);
|
|
164 |
page_A = new QWidget();
|
|
165 |
BindsBox->addItem(page_A, QToolBox::tr("Actions"));
|
|
166 |
page_W = new QWidget();
|
|
167 |
BindsBox->addItem(page_W, QToolBox::tr("Weapons"));
|
|
168 |
page_WP = new QWidget();
|
|
169 |
BindsBox->addItem(page_WP, QToolBox::tr("Weapon properties"));
|
|
170 |
page_O = new QWidget();
|
|
171 |
BindsBox->addItem(page_O, QToolBox::tr("Other"));
|
|
172 |
pageLayout->addWidget(GBoxBinds, 0, 1, 5, 1);
|
|
173 |
|
|
174 |
QStringList binds;
|
|
175 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++)
|
|
176 |
{
|
|
177 |
binds << sdlkeys[i][1];
|
|
178 |
}
|
|
179 |
|
|
180 |
quint16 widind = 0, i = 0;
|
|
181 |
while (i < BINDS_NUMBER) {
|
|
182 |
quint16 num = 0;
|
|
183 |
QGridLayout * pagelayout = new QGridLayout(BindsBox->widget(widind));
|
|
184 |
do {
|
|
185 |
LBind[i] = new QLabel(BindsBox->widget(widind));
|
|
186 |
LBind[i]->setText(QApplication::translate("binds", cbinds[i].name));
|
|
187 |
LBind[i]->setAlignment(Qt::AlignRight);
|
|
188 |
pagelayout->addWidget(LBind[i], num, 0);
|
|
189 |
CBBind[i] = new QComboBox(BindsBox->widget(widind));
|
|
190 |
CBBind[i]->addItems(binds);
|
|
191 |
pagelayout->addWidget(CBBind[i], num, 1);
|
|
192 |
num++;
|
|
193 |
} while (!cbinds[i++].chwidget);
|
|
194 |
pagelayout->addWidget(new QWidget(BindsBox->widget(widind)), num, 0, 1, 2);
|
|
195 |
widind++;
|
|
196 |
}
|
|
197 |
|
|
198 |
GBoxGrave = new QGroupBox(this);
|
|
199 |
GBoxGrave->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
200 |
GBoxGrave->setTitle(QGroupBox::tr("Grave"));
|
|
201 |
QGridLayout * GBGLayout = new QGridLayout(GBoxGrave);
|
|
202 |
CBGrave = new QComboBox(GBoxGrave);
|
|
203 |
CBGrave->setMaxCount(65535);
|
|
204 |
GBGLayout->addWidget(CBGrave, 0, 0, 1, 3);
|
|
205 |
GravePreview = new QLabel(GBoxGrave);
|
|
206 |
GravePreview->setScaledContents(false);
|
|
207 |
GBGLayout->addWidget(GravePreview, 1, 1);
|
|
208 |
pageLayout->addWidget(GBoxGrave, 0, 2, 2, 1);
|
|
209 |
|
|
210 |
GBoxFort = new QGroupBox(this);
|
|
211 |
GBoxFort->setTitle(QGroupBox::tr("Fort"));
|
|
212 |
QGridLayout * GBFLayout = new QGridLayout(GBoxFort);
|
|
213 |
CBFort = new QComboBox(GBoxFort);
|
|
214 |
CBFort->setMaxCount(65535);
|
|
215 |
GBFLayout->addWidget(CBFort, 0, 0);
|
|
216 |
FortPreview = new SquareLabel(GBoxFort);
|
310
|
217 |
FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
184
|
218 |
FortPreview->setPixmap(QPixmap());
|
|
219 |
GBFLayout->addWidget(FortPreview, 1, 0);
|
|
220 |
pageLayout->addWidget(GBoxFort, 2, 2, 1, 1);
|
|
221 |
|
|
222 |
BtnTeamSave = new QPushButton(this);
|
|
223 |
BtnTeamSave->setFont(*font14);
|
|
224 |
BtnTeamSave->setText(QPushButton::tr("Save"));
|
|
225 |
pageLayout->addWidget(BtnTeamSave, 4, 2);
|
|
226 |
|
|
227 |
|
|
228 |
QDir tmpdir;
|
|
229 |
tmpdir.cd(datadir->absolutePath());
|
|
230 |
tmpdir.cd("Forts");
|
|
231 |
tmpdir.setFilter(QDir::Files);
|
|
232 |
|
|
233 |
CBFort->addItems(tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L.png"), "\\1"));
|
|
234 |
tmpdir.cd("../Graphics/Graves");
|
|
235 |
QStringList list = tmpdir.entryList(QStringList("*.png"));
|
|
236 |
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it )
|
|
237 |
{
|
|
238 |
CBGrave->addItem((*it).replace(QRegExp("^(.*).png"), "\\1"));
|
|
239 |
}
|
|
240 |
|
|
241 |
connect(CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &)));
|
|
242 |
connect(CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &)));
|
|
243 |
}
|
|
244 |
|
|
245 |
void PageEditTeam::CBGrave_activated(const QString & gravename)
|
|
246 |
{
|
|
247 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + gravename + ".png");
|
|
248 |
GravePreview->setPixmap(pix.copy(0, 0, 32, 32));
|
|
249 |
}
|
|
250 |
|
|
251 |
void PageEditTeam::CBFort_activated(const QString & fortname)
|
|
252 |
{
|
|
253 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png");
|
|
254 |
FortPreview->setPixmap(pix);
|
|
255 |
}
|
|
256 |
|
|
257 |
PageMultiplayer::PageMultiplayer(QWidget* parent) : QWidget(parent)
|
|
258 |
{
|
|
259 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
260 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
261 |
|
|
262 |
BtnBack = new QPushButton(this);
|
|
263 |
BtnBack->setFont(*font14);
|
|
264 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
265 |
pageLayout->addWidget(BtnBack, 1, 0);
|
187
|
266 |
|
184
|
267 |
//HWMapContainer* pMapContainer=new HWMapContainer(this);
|
|
268 |
//pageLayout->addWidget(pMapContainer, 1, 1);
|
|
269 |
|
|
270 |
gameCFG = new GameCFGWidget(this);
|
|
271 |
pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
|
|
272 |
teamsSelect = new TeamSelWidget(this);
|
|
273 |
pageLayout->addWidget(teamsSelect, 0, 2, 1, 2);
|
|
274 |
|
|
275 |
BtnStartMPGame = new QPushButton(this);
|
|
276 |
BtnStartMPGame->setFont(*font14);
|
|
277 |
BtnStartMPGame->setText(QPushButton::tr("Start"));
|
|
278 |
pageLayout->addWidget(BtnStartMPGame, 1, 3);
|
|
279 |
}
|
|
280 |
|
|
281 |
PagePlayDemo::PagePlayDemo(QWidget* parent) : QWidget(parent)
|
|
282 |
{
|
|
283 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
284 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
285 |
pageLayout->setColumnStretch(0, 1);
|
|
286 |
pageLayout->setColumnStretch(1, 2);
|
|
287 |
pageLayout->setColumnStretch(2, 1);
|
|
288 |
|
|
289 |
BtnBack = new QPushButton(this);
|
|
290 |
BtnBack->setFont(*font14);
|
|
291 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
292 |
pageLayout->addWidget(BtnBack, 1, 0);
|
|
293 |
|
|
294 |
BtnPlayDemo = new QPushButton(this);
|
|
295 |
BtnPlayDemo->setGeometry(QRect(240, 330, 161, 41));
|
|
296 |
BtnPlayDemo->setFont(*font14);
|
|
297 |
BtnPlayDemo->setText(QPushButton::tr("Play demo"));
|
|
298 |
pageLayout->addWidget(BtnPlayDemo, 1, 2);
|
|
299 |
|
|
300 |
DemosList = new QListWidget(this);
|
|
301 |
DemosList->setGeometry(QRect(170, 10, 311, 311));
|
|
302 |
pageLayout->addWidget(DemosList, 0, 1);
|
|
303 |
}
|
|
304 |
|
|
305 |
PageOptions::PageOptions(QWidget* parent) : QWidget(parent)
|
|
306 |
{
|
|
307 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
308 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
309 |
groupBox = new QGroupBox(this);
|
|
310 |
groupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
311 |
groupBox->setTitle(QGroupBox::tr("Teams"));
|
|
312 |
pageLayout->addWidget(groupBox, 0, 0, 1, 3);
|
|
313 |
|
|
314 |
QGridLayout * GBTlayout = new QGridLayout(groupBox);
|
|
315 |
BtnNewTeam = new QPushButton(groupBox);
|
|
316 |
BtnNewTeam->setFont(*font14);
|
|
317 |
BtnNewTeam->setText(QPushButton::tr("New team"));
|
|
318 |
GBTlayout->addWidget(BtnNewTeam, 0, 0);
|
|
319 |
|
|
320 |
CBTeamName = new QComboBox(groupBox);
|
|
321 |
GBTlayout->addWidget(CBTeamName, 0, 1);
|
|
322 |
|
|
323 |
BtnEditTeam = new QPushButton(groupBox);
|
|
324 |
BtnEditTeam->setFont(*font14);
|
|
325 |
BtnEditTeam->setText(QPushButton::tr("Edit team"));
|
|
326 |
GBTlayout->addWidget(BtnEditTeam, 0, 2);
|
|
327 |
|
|
328 |
AGGroupBox = new QGroupBox(this);
|
|
329 |
AGGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
330 |
AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
|
|
331 |
pageLayout->addWidget(AGGroupBox, 1, 0, 1, 3);
|
|
332 |
|
|
333 |
QGridLayout * GBAlayout = new QGridLayout(AGGroupBox);
|
|
334 |
CBResolution = new QComboBox(AGGroupBox);
|
|
335 |
CBResolution->addItem("640x480");
|
|
336 |
CBResolution->addItem("800x600");
|
|
337 |
CBResolution->addItem("1024x768");
|
|
338 |
CBResolution->addItem("1280x1024");
|
|
339 |
GBAlayout->addWidget(CBResolution, 0, 0);
|
|
340 |
|
|
341 |
CBFullscreen = new QCheckBox(AGGroupBox);
|
|
342 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
|
|
343 |
GBAlayout->addWidget(CBFullscreen, 0, 1);
|
|
344 |
|
|
345 |
CBEnableSound = new QCheckBox(AGGroupBox);
|
|
346 |
CBEnableSound->setText(QCheckBox::tr("Enable sound"));
|
|
347 |
GBAlayout->addWidget(CBEnableSound, 0, 2);
|
|
348 |
|
297
|
349 |
CBShowFPS = new QCheckBox(AGGroupBox);
|
|
350 |
CBShowFPS->setText(QCheckBox::tr("Show FPS"));
|
|
351 |
GBAlayout->addWidget(CBShowFPS, 0, 3);
|
|
352 |
|
|
353 |
fpsedit = new FPSEdit(AGGroupBox);
|
|
354 |
GBAlayout->addWidget(fpsedit, 0, 4);
|
|
355 |
|
184
|
356 |
pageLayout->addWidget(new QWidget(), 3, 0, 1, 3);
|
|
357 |
|
|
358 |
BtnSaveOptions = new QPushButton(this);
|
|
359 |
BtnSaveOptions->setFont(*font14);
|
|
360 |
BtnSaveOptions->setText(QPushButton::tr("Save"));
|
|
361 |
pageLayout->addWidget(BtnSaveOptions, 4, 2);
|
|
362 |
|
|
363 |
BtnBack = new QPushButton(this);
|
|
364 |
BtnBack->setFont(*font14);
|
|
365 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
366 |
pageLayout->addWidget(BtnBack, 4, 0);
|
|
367 |
}
|
|
368 |
|
|
369 |
PageNet::PageNet(QWidget* parent) : QWidget(parent)
|
|
370 |
{
|
|
371 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
372 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
373 |
pageLayout->setColumnStretch(0, 1);
|
|
374 |
pageLayout->setColumnStretch(1, 1);
|
|
375 |
pageLayout->setColumnStretch(2, 1);
|
|
376 |
|
|
377 |
NNGroupBox = new QGroupBox(this);
|
|
378 |
NNGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
379 |
NNGroupBox->setTitle(QGroupBox::tr("Net options"));
|
|
380 |
pageLayout->addWidget(NNGroupBox, 0, 1);
|
|
381 |
|
|
382 |
pageLayout->addWidget(new QWidget(), 1, 1);
|
|
383 |
|
|
384 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox);
|
|
385 |
labelNN = new QLabel(NNGroupBox);
|
|
386 |
labelNN->setText(QLabel::tr("Net nick"));
|
|
387 |
GBNlayout->addWidget(labelNN, 0, 0);
|
|
388 |
|
|
389 |
editNetNick = new QLineEdit(NNGroupBox);
|
|
390 |
editNetNick->setMaxLength(20);
|
|
391 |
editNetNick->setText(QLineEdit::tr("unnamed"));
|
|
392 |
GBNlayout->addWidget(editNetNick, 0, 1);
|
|
393 |
|
|
394 |
labelIP = new QLabel(NNGroupBox);
|
|
395 |
labelIP->setText(QLabel::tr("Server address"));
|
|
396 |
GBNlayout->addWidget(labelIP, 1, 0);
|
|
397 |
|
|
398 |
editIP = new QLineEdit(NNGroupBox);
|
|
399 |
editIP->setMaxLength(50);
|
|
400 |
GBNlayout->addWidget(editIP, 1, 1);
|
|
401 |
|
|
402 |
BtnNetConnect = new QPushButton(this);
|
|
403 |
BtnNetConnect->setFont(*font14);
|
|
404 |
BtnNetConnect->setText(QPushButton::tr("Connect"));
|
|
405 |
pageLayout->addWidget(BtnNetConnect, 2, 2);
|
|
406 |
|
|
407 |
BtnBack = new QPushButton(this);
|
|
408 |
BtnBack->setFont(*font14);
|
|
409 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
410 |
pageLayout->addWidget(BtnBack, 2, 0);
|
|
411 |
}
|
|
412 |
|
|
413 |
PageNetChat::PageNetChat(QWidget* parent) : QWidget(parent)
|
|
414 |
{
|
|
415 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
416 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
417 |
pageLayout->setColumnStretch(0, 1);
|
|
418 |
pageLayout->setColumnStretch(1, 1);
|
|
419 |
pageLayout->setColumnStretch(2, 1);
|
|
420 |
|
|
421 |
BtnDisconnect = new QPushButton(this);
|
|
422 |
BtnDisconnect->setFont(*font14);
|
|
423 |
BtnDisconnect->setText(QPushButton::tr("Disconnect"));
|
|
424 |
pageLayout->addWidget(BtnDisconnect, 2, 0);
|
|
425 |
|
|
426 |
ChannelsList = new QListWidget(this);
|
|
427 |
pageLayout->addWidget(ChannelsList, 0, 1);
|
|
428 |
|
|
429 |
BtnJoin = new QPushButton(this);
|
|
430 |
BtnJoin->setFont(*font14);
|
|
431 |
BtnJoin->setText(QPushButton::tr("Join"));
|
|
432 |
pageLayout->addWidget(BtnJoin, 2, 2);
|
|
433 |
|
|
434 |
BtnCreate = new QPushButton(this);
|
|
435 |
BtnCreate->setFont(*font14);
|
|
436 |
BtnCreate->setText(QPushButton::tr("Create"));
|
|
437 |
pageLayout->addWidget(BtnCreate, 1, 2);
|
|
438 |
}
|
|
439 |
|
|
440 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent)
|
|
441 |
{
|
|
442 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
443 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
444 |
pageLayout->setColumnStretch(0, 1);
|
|
445 |
pageLayout->setColumnStretch(1, 1);
|
|
446 |
pageLayout->setColumnStretch(2, 1);
|
|
447 |
|
|
448 |
BtnBack = new QPushButton(this);
|
|
449 |
BtnBack->setFont(*font14);
|
|
450 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
451 |
pageLayout->addWidget(BtnBack, 2, 0);
|
|
452 |
|
|
453 |
BtnAddTeam = new QPushButton(this);
|
|
454 |
BtnAddTeam->setFont(*font14);
|
|
455 |
BtnAddTeam->setText(QPushButton::tr("Add Team"));
|
|
456 |
pageLayout->addWidget(BtnAddTeam, 1, 1);
|
|
457 |
|
|
458 |
BtnGo = new QPushButton(this);
|
|
459 |
BtnGo->setFont(*font14);
|
|
460 |
BtnGo->setText(QPushButton::tr("Go!"));
|
|
461 |
pageLayout->addWidget(BtnGo, 2, 2);
|
|
462 |
|
|
463 |
listNetTeams = new QListWidget(this);
|
|
464 |
pageLayout->addWidget(listNetTeams, 0, 1);
|
|
465 |
}
|
187
|
466 |
|
|
467 |
PageInfo::PageInfo(QWidget* parent) : QWidget(parent)
|
|
468 |
{
|
|
469 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
470 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
471 |
pageLayout->setColumnStretch(0, 1);
|
|
472 |
pageLayout->setColumnStretch(1, 1);
|
|
473 |
pageLayout->setColumnStretch(2, 1);
|
|
474 |
|
|
475 |
BtnBack = new QPushButton(this);
|
|
476 |
BtnBack->setFont(*font14);
|
|
477 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
478 |
pageLayout->addWidget(BtnBack, 1, 0);
|
|
479 |
|
|
480 |
about = new About(this);
|
|
481 |
pageLayout->addWidget(about, 0, 0, 1, 3);
|
|
482 |
}
|
306
|
483 |
|
|
484 |
PageGameStats::PageGameStats(QWidget* parent) : QWidget(parent)
|
|
485 |
{
|
|
486 |
QFont * font14 = new QFont("MS Shell Dlg", 14);
|
|
487 |
QGridLayout * pageLayout = new QGridLayout(this);
|
|
488 |
pageLayout->setColumnStretch(0, 1);
|
|
489 |
pageLayout->setColumnStretch(1, 1);
|
|
490 |
pageLayout->setColumnStretch(2, 1);
|
|
491 |
|
|
492 |
BtnBack = new QPushButton(this);
|
|
493 |
BtnBack->setFont(*font14);
|
|
494 |
BtnBack->setText(QPushButton::tr("Back"));
|
|
495 |
pageLayout->addWidget(BtnBack, 1, 0);
|
|
496 |
|
307
|
497 |
labelGameStats = new QLabel(this);
|
|
498 |
labelGameStats->setTextFormat(Qt::RichText);
|
|
499 |
pageLayout->addWidget(labelGameStats, 0, 0, 1, 3);
|
306
|
500 |
}
|