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