QTfrontend/ui/page/pagemultiplayer.cpp
author sheepluva
Fri, 21 Oct 2011 18:53:36 +0200
changeset 6170 2b1748161278
parent 6060 fdfc01419815
child 6171 8627698134b6
permissions -rw-r--r--
fix multiplayer page layout, doc/comment fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     1
/*
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     3
 * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     4
 *
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     8
 *
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    12
 * GNU General Public License for more details.
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    13
 *
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    17
 */
6170
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    18
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    19
/**
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    20
 * @file
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    21
 * @brief PageMultiplayer class implementation
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    22
 */
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    23
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    24
#include <QHBoxLayout>
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    25
#include <QPushButton>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    26
5204
e1a5f4d5d86a split pages.h into several header files
koda
parents: 5078
diff changeset
    27
#include "pagemultiplayer.h"
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    28
#include "gamecfgwidget.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    29
#include "teamselect.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    30
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
    31
QLayout * PageMultiplayer::bodyLayoutDefinition()
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    32
{
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
    33
    QGridLayout * pageLayout = new QGridLayout();
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    34
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    35
    gameCFG = new GameCFGWidget(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    36
    pageLayout->addWidget(gameCFG, 0, 0, 1, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    37
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
    38
    btnSetup = new QPushButton(this);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    39
    btnSetup->setText(QPushButton::tr("Setup"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    40
    pageLayout->addWidget(btnSetup, 1, 0, 1, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    41
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    42
    pageLayout->setRowStretch(2, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    43
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    44
    teamsSelect = new TeamSelWidget(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    45
    pageLayout->addWidget(teamsSelect, 0, 2, 3, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    46
6170
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    47
    return pageLayout;
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    48
}
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    49
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    50
QLayout * PageMultiplayer::footerLayoutDefinition()
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    51
{
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    52
    QHBoxLayout * footerLayout = new QHBoxLayout();
6009
14f6fc9869f2 code cleanup/etc
sheepluva
parents: 5204
diff changeset
    53
6170
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    54
    BtnStartMPGame = formattedButton(tr("Start"));
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    55
    BtnStartMPGame->setMinimumWidth(180);
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    56
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    57
    footerLayout->addStretch();
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    58
    footerLayout->addWidget(BtnStartMPGame);
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    59
2b1748161278 fix multiplayer page layout, doc/comment fixes
sheepluva
parents: 6060
diff changeset
    60
    return footerLayout;
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
    61
}
6009
14f6fc9869f2 code cleanup/etc
sheepluva
parents: 5204
diff changeset
    62
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
    63
void PageMultiplayer::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
    64
{
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
    65
    PageMultiplayer::connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked()));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    66
}
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
    67
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
    68
PageMultiplayer::PageMultiplayer(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
    69
{
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
    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
    71
}