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