author | unc0rr |
Mon, 22 Oct 2012 21:24:38 +0400 | |
changeset 7789 | 838d2e06c377 |
parent 6952 | 7f70f37bbf08 |
child 8609 | 3f6c08223aa1 |
permissions | -rw-r--r-- |
5080 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
6952 | 3 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
5080 | 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> |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
20 |
#include <QHBoxLayout> |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
21 |
#include <QVBoxLayout> |
5080 | 22 |
#include <QPushButton> |
23 |
#include <QGroupBox> |
|
24 |
#include <QLabel> |
|
25 |
#include <QLineEdit> |
|
26 |
#include <QSpinBox> |
|
27 |
||
5204 | 28 |
#include "pagenetserver.h" |
5080 | 29 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
30 |
QLayout * PageNetServer::bodyLayoutDefinition() |
5080 | 31 |
{ |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
32 |
QVBoxLayout * pageLayout = new QVBoxLayout(); |
5080 | 33 |
|
34 |
QWidget * wg = new QWidget(this); |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
35 |
pageLayout->addWidget(wg); |
5080 | 36 |
|
37 |
QGridLayout * wgLayout = new QGridLayout(wg); |
|
38 |
wgLayout->setColumnStretch(0, 1); |
|
39 |
wgLayout->setColumnStretch(1, 3); |
|
40 |
wgLayout->setColumnStretch(2, 1); |
|
41 |
||
42 |
wgLayout->setRowStretch(0, 0); |
|
43 |
wgLayout->setRowStretch(1, 1); |
|
44 |
||
45 |
QGroupBox * gb = new QGroupBox(wg); |
|
46 |
wgLayout->addWidget(gb, 0, 1); |
|
47 |
||
48 |
QGridLayout * gbLayout = new QGridLayout(gb); |
|
49 |
||
50 |
labelSD = new QLabel(gb); |
|
51 |
labelSD->setText(QLabel::tr("Server name:")); |
|
52 |
gbLayout->addWidget(labelSD, 0, 0); |
|
53 |
||
54 |
leServerDescr = new QLineEdit(gb); |
|
55 |
gbLayout->addWidget(leServerDescr, 0, 1); |
|
56 |
||
57 |
labelPort = new QLabel(gb); |
|
58 |
labelPort->setText(QLabel::tr("Server port:")); |
|
59 |
gbLayout->addWidget(labelPort, 1, 0); |
|
60 |
||
61 |
sbPort = new QSpinBox(gb); |
|
62 |
sbPort->setMinimum(0); |
|
63 |
sbPort->setMaximum(65535); |
|
64 |
gbLayout->addWidget(sbPort, 1, 1); |
|
65 |
||
66 |
BtnDefault = new QPushButton(gb); |
|
67 |
BtnDefault->setText(QPushButton::tr("default")); |
|
68 |
gbLayout->addWidget(BtnDefault, 1, 2); |
|
69 |
||
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
70 |
return pageLayout; |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
71 |
} |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
72 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
73 |
QLayout * PageNetServer::footerLayoutDefinition() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
74 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
75 |
QHBoxLayout * bottomLayout = new QHBoxLayout(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
76 |
|
6171 | 77 |
BtnStart = formattedButton(QPushButton::tr("Start")); |
78 |
BtnStart->setMinimumWidth(180); |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
79 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
80 |
bottomLayout->addStretch(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
81 |
bottomLayout->addWidget(BtnStart); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
82 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
83 |
return bottomLayout; |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
84 |
} |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
85 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
86 |
void PageNetServer::connectSignals() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
87 |
{ |
5080 | 88 |
connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort())); |
89 |
} |
|
90 |
||
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
91 |
PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent) |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
92 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
93 |
initPage(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
94 |
} |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
95 |
|
5080 | 96 |
void PageNetServer::setDefaultPort() |
97 |
{ |
|
98 |
sbPort->setValue(46631); |
|
99 |
} |