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