author | unc0rr |
Thu, 05 Oct 2006 16:33:18 +0000 | |
changeset 183 | 57c2ef19f719 |
parent 164 | 92cff18a3ab6 |
child 184 | f97a7a3dc8f6 |
permissions | -rw-r--r-- |
87 | 1 |
/* |
2 |
* Hedgewars, a worms-like game |
|
3 |
* Copyright (c) 2006 Andrey Korotaev <unC0Rr@gmail.com> |
|
4 |
* |
|
183 | 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 |
|
87 | 8 |
* |
183 | 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. |
|
87 | 13 |
* |
183 | 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 |
|
87 | 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> |
|
88 | 28 |
#include <QApplication> |
87 | 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" |
|
93 | 36 |
#include "SquareLabel.h" |
164 | 37 |
#include "mapContainer.h" |
87 | 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); |
|
90 | 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 |
||
87 | 112 |
GBoxTeam = new QGroupBox(this); |
113 |
GBoxTeam->setTitle(QGroupBox::tr("Team")); |
|
90 | 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 |
||
87 | 139 |
GBoxBinds = new QGroupBox(this); |
140 |
GBoxBinds->setTitle(QGroupBox::tr("Key binds")); |
|
90 | 141 |
QGridLayout * GBBLayout = new QGridLayout(GBoxBinds); |
87 | 142 |
BindsBox = new QToolBox(GBoxBinds); |
143 |
BindsBox->setLineWidth(0); |
|
90 | 144 |
GBBLayout->addWidget(BindsBox); |
87 | 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")); |
|
90 | 153 |
pageLayout->addWidget(GBoxBinds, 0, 1, 5, 1); |
87 | 154 |
|
155 |
QStringList binds; |
|
156 |
for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
|
157 |
{ |
|
158 |
binds << sdlkeys[i][1]; |
|
159 |
} |
|
160 |
||
90 | 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++; |
|
87 | 177 |
} |
178 |
||
90 | 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); |
|
93 | 197 |
FortPreview = new SquareLabel(GBoxFort); |
90 | 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 |
||
87 | 209 |
QDir tmpdir; |
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
94
diff
changeset
|
210 |
tmpdir.cd(datadir->absolutePath()); |
87 | 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 |
{ |
|
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
94
diff
changeset
|
228 |
QPixmap pix(datadir->absolutePath() + "/Graphics/Graves/" + gravename + ".png"); |
87 | 229 |
GravePreview->setPixmap(pix.copy(0, 0, 32, 32)); |
230 |
} |
|
231 |
||
232 |
void PageEditTeam::CBFort_activated(const QString & fortname) |
|
233 |
{ |
|
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
94
diff
changeset
|
234 |
QPixmap pix(datadir->absolutePath() + "/Forts/" + fortname + "L.png"); |
87 | 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); |
|
133 | 242 |
|
87 | 243 |
BtnBack = new QPushButton(this); |
244 |
BtnBack->setFont(*font14); |
|
245 |
BtnBack->setText(QPushButton::tr("Back")); |
|
246 |
pageLayout->addWidget(BtnBack, 1, 0); |
|
164 | 247 |
|
248 |
//HWMapContainer* pMapContainer=new HWMapContainer(this); |
|
249 |
//pageLayout->addWidget(pMapContainer, 1, 1); |
|
133 | 250 |
|
87 | 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); |
|
133 | 255 |
|
256 |
BtnStartMPGame = new QPushButton(this); |
|
257 |
BtnStartMPGame->setFont(*font14); |
|
258 |
BtnStartMPGame->setText(QPushButton::tr("Start")); |
|
259 |
pageLayout->addWidget(BtnStartMPGame, 1, 3); |
|
87 | 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); |
|
94 | 289 |
QGridLayout * pageLayout = new QGridLayout(this); |
87 | 290 |
groupBox = new QGroupBox(this); |
94 | 291 |
groupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
87 | 292 |
groupBox->setTitle(QGroupBox::tr("Teams")); |
94 | 293 |
pageLayout->addWidget(groupBox, 0, 0, 1, 3); |
87 | 294 |
|
94 | 295 |
QGridLayout * GBTlayout = new QGridLayout(groupBox); |
87 | 296 |
BtnNewTeam = new QPushButton(groupBox); |
297 |
BtnNewTeam->setFont(*font14); |
|
298 |
BtnNewTeam->setText(QPushButton::tr("New team")); |
|
94 | 299 |
GBTlayout->addWidget(BtnNewTeam, 0, 0); |
300 |
||
301 |
CBTeamName = new QComboBox(groupBox); |
|
302 |
GBTlayout->addWidget(CBTeamName, 0, 1); |
|
87 | 303 |
|
304 |
BtnEditTeam = new QPushButton(groupBox); |
|
305 |
BtnEditTeam->setFont(*font14); |
|
306 |
BtnEditTeam->setText(QPushButton::tr("Edit team")); |
|
94 | 307 |
GBTlayout->addWidget(BtnEditTeam, 0, 2); |
87 | 308 |
|
94 | 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); |
|
87 | 316 |
CBResolution->addItem("640x480"); |
317 |
CBResolution->addItem("800x600"); |
|
318 |
CBResolution->addItem("1024x768"); |
|
319 |
CBResolution->addItem("1280x1024"); |
|
94 | 320 |
GBAlayout->addWidget(CBResolution, 0, 0); |
87 | 321 |
|
94 | 322 |
CBFullscreen = new QCheckBox(AGGroupBox); |
323 |
CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
324 |
GBAlayout->addWidget(CBFullscreen, 0, 1); |
|
325 |
||
326 |
CBEnableSound = new QCheckBox(AGGroupBox); |
|
87 | 327 |
CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
94 | 328 |
GBAlayout->addWidget(CBEnableSound, 0, 2); |
87 | 329 |
|
94 | 330 |
pageLayout->addWidget(new QWidget(), 3, 0, 1, 3); |
87 | 331 |
|
332 |
BtnSaveOptions = new QPushButton(this); |
|
333 |
BtnSaveOptions->setFont(*font14); |
|
334 |
BtnSaveOptions->setText(QPushButton::tr("Save")); |
|
94 | 335 |
pageLayout->addWidget(BtnSaveOptions, 4, 2); |
87 | 336 |
|
337 |
BtnBack = new QPushButton(this); |
|
338 |
BtnBack->setFont(*font14); |
|
339 |
BtnBack->setText(QPushButton::tr("Back")); |
|
94 | 340 |
pageLayout->addWidget(BtnBack, 4, 0); |
87 | 341 |
} |
342 |
||
343 |
PageNet::PageNet(QWidget* parent) : QWidget(parent) |
|
344 |
{ |
|
345 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
111
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
346 |
QGridLayout * pageLayout = new QGridLayout(this); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
347 |
pageLayout->setColumnStretch(0, 1); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
348 |
pageLayout->setColumnStretch(1, 1); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
349 |
pageLayout->setColumnStretch(2, 1); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
350 |
|
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
351 |
NNGroupBox = new QGroupBox(this); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
352 |
NNGroupBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
353 |
NNGroupBox->setTitle(QGroupBox::tr("Net options")); |
113 | 354 |
pageLayout->addWidget(NNGroupBox, 0, 1); |
355 |
||
356 |
pageLayout->addWidget(new QWidget(), 1, 1); |
|
111
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
357 |
|
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
358 |
QGridLayout * GBNlayout = new QGridLayout(NNGroupBox); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
359 |
labelNN = new QLabel(NNGroupBox); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
360 |
labelNN->setText(QLabel::tr("Net nick")); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
361 |
GBNlayout->addWidget(labelNN, 0, 0); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
362 |
|
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
363 |
editNetNick = new QLineEdit(NNGroupBox); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
364 |
editNetNick->setMaxLength(20); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
365 |
editNetNick->setText(QLineEdit::tr("unnamed")); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
366 |
GBNlayout->addWidget(editNetNick, 0, 1); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
367 |
|
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
368 |
labelIP = new QLabel(NNGroupBox); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
369 |
labelIP->setText(QLabel::tr("Server address")); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
370 |
GBNlayout->addWidget(labelIP, 1, 0); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
371 |
|
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
372 |
editIP = new QLineEdit(NNGroupBox); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
373 |
editIP->setMaxLength(50); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
374 |
GBNlayout->addWidget(editIP, 1, 1); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
375 |
|
87 | 376 |
BtnNetConnect = new QPushButton(this); |
377 |
BtnNetConnect->setFont(*font14); |
|
378 |
BtnNetConnect->setText(QPushButton::tr("Connect")); |
|
111
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
379 |
pageLayout->addWidget(BtnNetConnect, 2, 2); |
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
380 |
|
87 | 381 |
BtnBack = new QPushButton(this); |
382 |
BtnBack->setFont(*font14); |
|
383 |
BtnBack->setText(QPushButton::tr("Back")); |
|
111
30ca06092a64
- 'net nickname' and 'server address' options are on PageNet
unc0rr
parents:
97
diff
changeset
|
384 |
pageLayout->addWidget(BtnBack, 2, 0); |
87 | 385 |
} |
386 |
||
387 |
PageNetChat::PageNetChat(QWidget* parent) : QWidget(parent) |
|
388 |
{ |
|
389 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
129 | 390 |
QGridLayout * pageLayout = new QGridLayout(this); |
391 |
pageLayout->setColumnStretch(0, 1); |
|
392 |
pageLayout->setColumnStretch(1, 1); |
|
393 |
pageLayout->setColumnStretch(2, 1); |
|
394 |
||
87 | 395 |
BtnDisconnect = new QPushButton(this); |
396 |
BtnDisconnect->setFont(*font14); |
|
397 |
BtnDisconnect->setText(QPushButton::tr("Disconnect")); |
|
129 | 398 |
pageLayout->addWidget(BtnDisconnect, 2, 0); |
399 |
||
87 | 400 |
ChannelsList = new QListWidget(this); |
129 | 401 |
pageLayout->addWidget(ChannelsList, 0, 1); |
402 |
||
87 | 403 |
BtnJoin = new QPushButton(this); |
404 |
BtnJoin->setFont(*font14); |
|
405 |
BtnJoin->setText(QPushButton::tr("Join")); |
|
129 | 406 |
pageLayout->addWidget(BtnJoin, 2, 2); |
407 |
||
87 | 408 |
BtnCreate = new QPushButton(this); |
409 |
BtnCreate->setFont(*font14); |
|
410 |
BtnCreate->setText(QPushButton::tr("Create")); |
|
129 | 411 |
pageLayout->addWidget(BtnCreate, 1, 2); |
87 | 412 |
} |
413 |
||
414 |
||
415 |
PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent) |
|
416 |
{ |
|
417 |
QFont * font14 = new QFont("MS Shell Dlg", 14); |
|
129 | 418 |
QGridLayout * pageLayout = new QGridLayout(this); |
419 |
pageLayout->setColumnStretch(0, 1); |
|
420 |
pageLayout->setColumnStretch(1, 1); |
|
421 |
pageLayout->setColumnStretch(2, 1); |
|
422 |
||
87 | 423 |
BtnBack = new QPushButton(this); |
424 |
BtnBack->setFont(*font14); |
|
425 |
BtnBack->setText(QPushButton::tr("Back")); |
|
129 | 426 |
pageLayout->addWidget(BtnBack, 2, 0); |
87 | 427 |
|
428 |
BtnAddTeam = new QPushButton(this); |
|
429 |
BtnAddTeam->setFont(*font14); |
|
430 |
BtnAddTeam->setText(QPushButton::tr("Add Team")); |
|
129 | 431 |
pageLayout->addWidget(BtnAddTeam, 1, 1); |
87 | 432 |
|
433 |
BtnGo = new QPushButton(this); |
|
434 |
BtnGo->setFont(*font14); |
|
435 |
BtnGo->setText(QPushButton::tr("Go!")); |
|
129 | 436 |
pageLayout->addWidget(BtnGo, 2, 2); |
87 | 437 |
|
438 |
listNetTeams = new QListWidget(this); |
|
129 | 439 |
pageLayout->addWidget(listNetTeams, 0, 1); |
87 | 440 |
} |