QTfrontend/ui_hwform.cpp
author unc0rr
Thu, 05 Oct 2006 16:33:18 +0000
changeset 183 57c2ef19f719
parent 128 223522298250
child 184 f97a7a3dc8f6
permissions -rw-r--r--
Relicense to GPL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
128
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
     1
/*
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
     2
 * Hedgewars, a worms-like game
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
     3
 * Copyright (c) 2006 Andrey Korotaev <unC0Rr@gmail.com>
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
     4
 *
183
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
128
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
     8
 *
183
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
    12
 * GNU General Public License for more details.
128
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
    13
 *
183
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
    14
 * You should have received a copy of the GNU General Public License
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
    15
 * along with this program; if not, write to the Free Software
57c2ef19f719 Relicense to GPL
unc0rr
parents: 128
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
128
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
    17
 */
223522298250 Update file headers & delete unneeded files
unc0rr
parents: 87
diff changeset
    18
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    19
#include <QVBoxLayout>
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    20
#include <QGridLayout>
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    21
#include "ui_hwform.h"
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    22
#include "pages.h"
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    23
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    24
void Ui_HWForm::setupUi(QMainWindow *HWForm)
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    25
{
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    26
	SetupFonts();
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    27
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    28
	HWForm->setObjectName(QString::fromUtf8("HWForm"));
85
44d9045b26ff New GameCFGWidget. Now it's possible to set forts mode from ui
unc0rr
parents: 84
diff changeset
    29
	HWForm->resize(QSize(620, 430).expandedTo(HWForm->minimumSizeHint()));
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    30
	HWForm->setMinimumSize(QSize(620, 430));
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    31
	HWForm->setWindowTitle(QMainWindow::tr("-= by unC0Rr =-"));
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    32
	centralWidget = new QWidget(HWForm);
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    33
	centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    34
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    35
	centralWidget = new QWidget(HWForm);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    36
	centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    37
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    38
	SetupPages(centralWidget);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    39
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    40
	HWForm->setCentralWidget(centralWidget);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    41
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    42
	Pages->setCurrentIndex(0);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    43
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    44
	QMetaObject::connectSlotsByName(HWForm);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    45
}
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    46
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    47
void Ui_HWForm::SetupFonts()
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    48
{
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    49
	font14 = new QFont("MS Shell Dlg", 14);
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    50
}
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    51
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    52
void Ui_HWForm::SetupPages(QWidget *Parent)
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    53
{
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    54
	Pages =	new QStackedLayout(Parent);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    55
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    56
	pageLocalGame = new PageLocalGame();
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    57
	Pages->addWidget(pageLocalGame);
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    58
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    59
	pageEditTeam = new PageEditTeam();
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    60
	Pages->addWidget(pageEditTeam);
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    61
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    62
	pageOptions = new PageOptions();
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    63
	Pages->addWidget(pageOptions);
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    64
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    65
	pageMultiplayer = new PageMultiplayer();
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    66
	Pages->addWidget(pageMultiplayer);
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    67
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    68
	pagePlayDemo =	new PagePlayDemo();
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    69
	Pages->addWidget(pagePlayDemo);
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    70
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    71
	pageNet = new PageNet();
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    72
	Pages->addWidget(pageNet);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    73
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    74
	pageNetChat	= new PageNetChat();
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    75
	Pages->addWidget(pageNetChat);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    76
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    77
	pageNetGame	= new PageNetGame();
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    78
	Pages->addWidget(pageNetGame);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    79
87
ff213e443336 Convert all pages to classes
unc0rr
parents: 85
diff changeset
    80
	pageMain = new PageMain();
84
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    81
	Pages->addWidget(pageMain);
0f6669da2fcb Start rewrite ui
unc0rr
parents:
diff changeset
    82
}