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