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