author | tonghuix |
Fri, 29 Oct 2010 09:55:29 -0400 | |
changeset 4012 | c364d52c2401 |
parent 3760 | d30f1ba768d7 |
child 4500 | 22d06b4be225 |
permissions | -rw-r--r-- |
184 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
3236
4ab3917d7d44
Update (c) lines to 2010 as unc0rr requested - they all had varying values so I just took the first year mentioned, then tacked on -2010
nemo
parents:
2948
diff
changeset
|
3 |
* Copyright (c) 2006-2010 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 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 <QVBoxLayout> |
|
20 |
#include <QGridLayout> |
|
471 | 21 |
#include <QMainWindow> |
22 |
#include <QStackedLayout> |
|
23 |
||
184 | 24 |
#include "ui_hwform.h" |
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
1950
diff
changeset
|
25 |
#include "hwform.h" |
184 | 26 |
#include "pages.h" |
1621 | 27 |
#include "statsPage.h" |
579 | 28 |
#include "playrecordpage.h" |
1542 | 29 |
#include "hwconsts.h" |
184 | 30 |
|
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
1950
diff
changeset
|
31 |
void Ui_HWForm::setupUi(HWForm *HWForm) |
184 | 32 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
33 |
SetupFonts(); |
184 | 34 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
35 |
HWForm->setObjectName(QString::fromUtf8("HWForm")); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
36 |
HWForm->resize(QSize(640, 480).expandedTo(HWForm->minimumSizeHint())); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
37 |
HWForm->setMinimumSize(QSize(720, 450)); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
38 |
HWForm->setWindowTitle(QMainWindow::tr("Hedgewars %1").arg(*cVersionString)); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
39 |
centralWidget = new QWidget(HWForm); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
40 |
centralWidget->setObjectName(QString::fromUtf8("centralWidget")); |
184 | 41 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
42 |
SetupPages(centralWidget, HWForm); |
184 | 43 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
44 |
HWForm->setCentralWidget(centralWidget); |
184 | 45 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
46 |
Pages->setCurrentIndex(0); |
184 | 47 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
48 |
QMetaObject::connectSlotsByName(HWForm); |
184 | 49 |
} |
50 |
||
51 |
void Ui_HWForm::SetupFonts() |
|
52 |
{ |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
53 |
font14 = new QFont("MS Shell Dlg", 14); |
184 | 54 |
} |
55 |
||
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
1950
diff
changeset
|
56 |
void Ui_HWForm::SetupPages(QWidget *Parent, HWForm *HWForm) |
184 | 57 |
{ |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
58 |
Pages = new QStackedLayout(Parent); |
184 | 59 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
60 |
pageEditTeam = new PageEditTeam(Parent, &HWForm->sdli); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
61 |
Pages->addWidget(pageEditTeam); |
184 | 62 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
63 |
pageOptions = new PageOptions(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
64 |
Pages->addWidget(pageOptions); |
184 | 65 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
66 |
pageMultiplayer = new PageMultiplayer(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
67 |
Pages->addWidget(pageMultiplayer); |
184 | 68 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
69 |
pagePlayDemo = new PagePlayDemo(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
70 |
Pages->addWidget(pagePlayDemo); |
184 | 71 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
72 |
pageNet = new PageNet(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
73 |
Pages->addWidget(pageNet); |
184 | 74 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
75 |
pageNetGame = new PageNetGame(Parent, HWForm->gameSettings, &HWForm->sdli); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
76 |
Pages->addWidget(pageNetGame); |
184 | 77 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
78 |
pageInfo = new PageInfo(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
79 |
Pages->addWidget(pageInfo); |
187 | 80 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
81 |
pageMain = new PageMain(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
82 |
Pages->addWidget(pageMain); |
306 | 83 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
84 |
pageGameStats = new PageGameStats(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
85 |
Pages->addWidget(pageGameStats); |
586 | 86 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
87 |
pageSinglePlayer = new PageSinglePlayer(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
88 |
Pages->addWidget(pageSinglePlayer); |
587 | 89 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
90 |
pageTraining = new PageTraining(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
91 |
Pages->addWidget(pageTraining); |
600 | 92 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
93 |
pageSelectWeapon = new PageSelectWeapon(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
94 |
Pages->addWidget(pageSelectWeapon); |
646 | 95 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
96 |
pageNetServer = new PageNetServer(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
97 |
Pages->addWidget(pageNetServer); |
686 | 98 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
99 |
pageInGame = new PageInGame(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
100 |
Pages->addWidget(pageInGame); |
1311 | 101 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
102 |
pageRoomsList = new PageRoomsList(Parent, HWForm->gameSettings, &HWForm->sdli); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
103 |
Pages->addWidget(pageRoomsList); |
1800 | 104 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
105 |
pageConnecting = new PageConnecting(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
106 |
Pages->addWidget(pageConnecting); |
1884 | 107 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
108 |
pageScheme = new PageScheme(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
109 |
Pages->addWidget(pageScheme); |
1905 | 110 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
111 |
pageAdmin = new PageAdmin(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
112 |
Pages->addWidget(pageAdmin); |
1950 | 113 |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
114 |
pageNetType = new PageNetType(); |
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2773
diff
changeset
|
115 |
Pages->addWidget(pageNetType); |
3760 | 116 |
|
117 |
pageCampaign = new PageCampaign(); |
|
118 |
Pages->addWidget(pageCampaign); |
|
184 | 119 |
} |