QTfrontend/pageoptions.cpp
author sheepluva
Sun, 25 Sep 2011 19:30:10 +0200
changeset 6024 d38da7c19e43
parent 6009 14f6fc9869f2
child 6042 8b5345758f62
permissions -rw-r--r--
some more cleanups and refactoring. functional changes: when generating random hog names avoid duplicate names (if possible)
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
 */
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    18
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    19
#include <QGridLayout>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    20
#include <QPushButton>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    21
#include <QGroupBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    22
#include <QComboBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    23
#include <QCheckBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    24
#include <QLabel>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    25
#include <QLineEdit>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    26
#include <QSpinBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    27
#include <QTextBrowser>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    28
#include <QTableWidget>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    29
#include <QSlider>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    30
5204
e1a5f4d5d86a split pages.h into several header files
koda
parents: 5078
diff changeset
    31
#include "pageoptions.h"
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    32
#include "hwconsts.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    33
#include "fpsedit.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    34
#include "igbox.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    35
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    36
PageOptions::PageOptions(QWidget* parent) :
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    37
  AbstractPage(parent)
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    38
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    39
    QGridLayout * pageLayout = new QGridLayout(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    40
    pageLayout->setColumnStretch(0, 100);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    41
    pageLayout->setColumnStretch(1, 100);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    42
    pageLayout->setColumnStretch(2, 100);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    43
    pageLayout->setRowStretch(0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    44
    //pageLayout->setRowStretch(1, 100);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    45
    pageLayout->setRowStretch(2, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    46
    pageLayout->setContentsMargins(7, 7, 7, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    47
    pageLayout->setSpacing(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    48
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    49
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    50
    QGroupBox * gbTwoBoxes = new QGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    51
    pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    52
    QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    53
    gbTBLayout->setMargin(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    54
    gbTBLayout->setSpacing(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    55
    gbTBLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    56
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    57
    QPixmap pmNew(":/res/new.png");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    58
    QPixmap pmEdit(":/res/edit.png");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    59
    QPixmap pmDelete(":/res/delete.png");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    60
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    61
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    62
            teamsBox = new IconedGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    63
            //teamsBox->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    64
            //teamsBox->setAttribute(Qt::WA_PaintOnScreen, true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    65
            teamsBox->setIcon(QIcon(":/res/teamicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    66
            teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    67
            teamsBox->setTitle(QGroupBox::tr("Teams"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    68
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    69
            QGridLayout * GBTlayout = new QGridLayout(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    70
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    71
            CBTeamName = new QComboBox(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    72
            GBTlayout->addWidget(CBTeamName, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    73
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    74
            BtnNewTeam = new QPushButton(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    75
            BtnNewTeam->setToolTip(tr("New team"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    76
            BtnNewTeam->setIconSize(pmNew.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    77
            BtnNewTeam->setIcon(pmNew);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    78
            BtnNewTeam->setMaximumWidth(pmNew.width() + 6);
6024
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
    79
            connect(BtnNewTeam, SIGNAL(clicked()), this, SIGNAL(newTeamRequested()));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    80
            GBTlayout->addWidget(BtnNewTeam, 0, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    81
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    82
            BtnEditTeam = new QPushButton(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    83
            BtnEditTeam->setToolTip(tr("Edit team"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    84
            BtnEditTeam->setIconSize(pmEdit.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    85
            BtnEditTeam->setIcon(pmEdit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    86
            BtnEditTeam->setMaximumWidth(pmEdit.width() + 6);
6024
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
    87
            connect(BtnEditTeam, SIGNAL(clicked()), this, SLOT(requestEditSelectedTeam()));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    88
            GBTlayout->addWidget(BtnEditTeam, 0, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    89
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    90
            BtnDeleteTeam = new QPushButton(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    91
            BtnDeleteTeam->setToolTip(tr("Delete team"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    92
            BtnDeleteTeam->setIconSize(pmDelete.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    93
            BtnDeleteTeam->setIcon(pmDelete);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    94
            BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
6024
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
    95
            connect(BtnDeleteTeam, SIGNAL(clicked()), this, SLOT(requestDeleteSelectedTeam()));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    96
            GBTlayout->addWidget(BtnDeleteTeam, 0, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    97
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    98
            LblNoEditTeam = new QLabel(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    99
            LblNoEditTeam->setText(tr("You can't edit teams from team selection. Go back to main menu to add, edit or delete teams."));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   100
            LblNoEditTeam->setWordWrap(true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   101
            LblNoEditTeam->setVisible(false);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   102
            GBTlayout->addWidget(LblNoEditTeam, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   103
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   104
            gbTBLayout->addWidget(teamsBox, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   105
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   106
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   107
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   108
            IconedGroupBox* groupWeapons = new IconedGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   109
            
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   110
            //groupWeapons->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   111
            //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   112
            groupWeapons->setIcon(QIcon(":/res/weaponsicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   113
            groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   114
            groupWeapons->setTitle(QGroupBox::tr("Schemes and Weapons"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   115
            QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   116
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   117
            QLabel* SchemeLabel = new QLabel(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   118
            SchemeLabel->setText(QLabel::tr("Game scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   119
            WeaponsLayout->addWidget(SchemeLabel, 1, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   120
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   121
            SchemesName = new QComboBox(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   122
            WeaponsLayout->addWidget(SchemesName, 1, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   123
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   124
            SchemeNew = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   125
            SchemeNew->setToolTip(tr("New scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   126
            SchemeNew->setIconSize(pmNew.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   127
            SchemeNew->setIcon(pmNew);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   128
            SchemeNew->setMaximumWidth(pmNew.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   129
            WeaponsLayout->addWidget(SchemeNew, 1, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   130
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   131
            SchemeEdit = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   132
            SchemeEdit->setToolTip(tr("Edit scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   133
            SchemeEdit->setIconSize(pmEdit.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   134
            SchemeEdit->setIcon(pmEdit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   135
            SchemeEdit->setMaximumWidth(pmEdit.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   136
            WeaponsLayout->addWidget(SchemeEdit, 1, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   137
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   138
            SchemeDelete = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   139
            SchemeDelete->setToolTip(tr("Delete scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   140
            SchemeDelete->setIconSize(pmDelete.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   141
            SchemeDelete->setIcon(pmDelete);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   142
            SchemeDelete->setMaximumWidth(pmDelete.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   143
            WeaponsLayout->addWidget(SchemeDelete, 1, 4);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   144
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   145
            QLabel* WeaponLabel = new QLabel(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   146
            WeaponLabel->setText(QLabel::tr("Weapons"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   147
            WeaponsLayout->addWidget(WeaponLabel, 2, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   148
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   149
            WeaponsName = new QComboBox(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   150
            WeaponsLayout->addWidget(WeaponsName, 2, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   151
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   152
            WeaponNew = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   153
            WeaponNew->setToolTip(tr("New weapon set"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   154
            WeaponNew->setIconSize(pmNew.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   155
            WeaponNew->setIcon(pmNew);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   156
            WeaponNew->setMaximumWidth(pmNew.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   157
            WeaponsLayout->addWidget(WeaponNew, 2, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   158
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   159
            WeaponEdit = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   160
            WeaponEdit->setToolTip(tr("Edit weapon set"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   161
            WeaponEdit->setIconSize(pmEdit.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   162
            WeaponEdit->setIcon(pmEdit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   163
            WeaponEdit->setMaximumWidth(pmEdit.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   164
            WeaponsLayout->addWidget(WeaponEdit, 2, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   165
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   166
            WeaponDelete = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   167
            WeaponDelete->setToolTip(tr("Delete weapon set"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   168
            WeaponDelete->setIconSize(pmDelete.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   169
            WeaponDelete->setIcon(pmDelete);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   170
            WeaponDelete->setMaximumWidth(pmDelete.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   171
            WeaponsLayout->addWidget(WeaponDelete, 2, 4);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   172
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   173
            WeaponTooltip = new QCheckBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   174
            WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   175
            WeaponsLayout->addWidget(WeaponTooltip, 3, 0, 1, 4);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   176
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   177
            gbTBLayout->addWidget(groupWeapons, 1, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   178
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   179
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   180
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   181
            IconedGroupBox* groupMisc = new IconedGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   182
            //groupMisc->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   183
            groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   184
            groupMisc->setIcon(QIcon(":/res/miscicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   185
            //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   186
            groupMisc->setTitle(QGroupBox::tr("Misc"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   187
            QGridLayout * MiscLayout = new QGridLayout(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   188
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   189
            labelNN = new QLabel(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   190
            labelNN->setText(QLabel::tr("Net nick"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   191
            MiscLayout->addWidget(labelNN, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   192
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   193
            editNetNick = new QLineEdit(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   194
            editNetNick->setMaxLength(20);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   195
            editNetNick->setText(QLineEdit::tr("unnamed"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   196
            connect(editNetNick, SIGNAL(editingFinished()), this, SLOT(trimNetNick()));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   197
            MiscLayout->addWidget(editNetNick, 0, 1);
5229
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   198
            
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   199
            labelNetPassword = new QLabel(groupMisc);
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   200
            labelNetPassword->setText(QLabel::tr("Password"));
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   201
            MiscLayout->addWidget(labelNetPassword, 1, 0);
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   202
            
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   203
            editNetPassword = new QLineEdit(groupMisc);
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   204
            editNetPassword->setEchoMode(QLineEdit::Password);
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   205
            MiscLayout->addWidget(editNetPassword, 1, 1);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   206
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   207
            QLabel *labelLanguage = new QLabel(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   208
            labelLanguage->setText(QLabel::tr("Locale") + " *");
5229
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   209
            MiscLayout->addWidget(labelLanguage, 2, 0);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   210
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   211
            CBLanguage = new QComboBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   212
            QDir tmpdir;
5238
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   213
            tmpdir.cd(cfgdir->absolutePath());
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   214
            tmpdir.cd("Data/Locale");
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   215
            tmpdir.setFilter(QDir::Files);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   216
            QStringList locs = tmpdir.entryList(QStringList("hedgewars_*.qm"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   217
            CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   218
            for(int i = 0; i < locs.count(); i++)
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   219
            {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   220
                QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   221
                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   222
            }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   223
5238
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   224
            tmpdir.cd(datadir->absolutePath());
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   225
            tmpdir.cd("Locale");
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   226
            tmpdir.setFilter(QDir::Files);
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   227
            QStringList tmplist = tmpdir.entryList(QStringList("hedgewars_*.qm"));
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   228
            for(int i = 0; i < tmplist.count(); i++)
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   229
            {
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   230
                if (locs.contains(tmplist[i])) continue;
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   231
                QLocale loc(tmplist[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   232
                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   233
            }
46ddaf14509d Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents: 5229
diff changeset
   234
5229
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   235
            MiscLayout->addWidget(CBLanguage, 2, 1);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   236
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   237
            CBAltDamage = new QCheckBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   238
            CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
5229
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   239
            MiscLayout->addWidget(CBAltDamage, 3, 0, 1, 2);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   240
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   241
            CBNameWithDate = new QCheckBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   242
            CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
5229
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   243
            MiscLayout->addWidget(CBNameWithDate, 4, 0, 1, 2);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   244
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   245
            BtnAssociateFiles = new QPushButton(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   246
            BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   247
            BtnAssociateFiles->setEnabled(!custom_data && !custom_config);
5229
148d581b17ab Attempt to fix issue 125. The password pop-up doesn't appear every time when going into the official server anymore, now it only does it when the password is blank. If a user enters an invalid password, the password is set blank to avoid the user going back to the official server just to be rejected. When entering an invalid password, the unknown error dialog doesn't show up anymore, but the connection lost to server one still does. This fixes the bug where the user would be spammed with error messages. The user can also now change his password in the settings page.
Zorg <zorgiepoo@gmail.com>
parents: 5204
diff changeset
   248
            MiscLayout->addWidget(BtnAssociateFiles, 5, 0, 1, 2);
5252
ded882439548 file association for mac!
koda
parents: 5238
diff changeset
   249
5257
0bbdd47522b9 passing by reference... my darkest enemy
koda
parents: 5252
diff changeset
   250
#ifdef __APPLE__
0bbdd47522b9 passing by reference... my darkest enemy
koda
parents: 5252
diff changeset
   251
#ifdef SPARKLE_ENABLED
5252
ded882439548 file association for mac!
koda
parents: 5238
diff changeset
   252
            CBAutoUpdate = new QCheckBox(groupMisc);
ded882439548 file association for mac!
koda
parents: 5238
diff changeset
   253
            CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup"));
ded882439548 file association for mac!
koda
parents: 5238
diff changeset
   254
            MiscLayout->addWidget(CBAutoUpdate, 6, 0, 1, 3);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   255
#endif
5257
0bbdd47522b9 passing by reference... my darkest enemy
koda
parents: 5252
diff changeset
   256
#endif
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   257
            gbTBLayout->addWidget(groupMisc, 2, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   258
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   259
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   260
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   261
            AGGroupBox = new IconedGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   262
            //AGGroupBox->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   263
            AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   264
            //AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   265
            AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   266
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   267
            QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   268
            QHBoxLayout * GBAreslayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   269
            QHBoxLayout * GBAstereolayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   270
            QHBoxLayout * GBAqualayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   271
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   272
            CBFrontendFullscreen = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   273
            CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   274
            GBAlayout->addWidget(CBFrontendFullscreen);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   275
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   276
            CBFrontendEffects = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   277
            CBFrontendEffects->setText(QCheckBox::tr("Frontend effects") + " *");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   278
            GBAlayout->addWidget(CBFrontendEffects);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   279
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   280
            CBEnableFrontendSound = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   281
            CBEnableFrontendSound->setText(QCheckBox::tr("Enable frontend sounds"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   282
            GBAlayout->addWidget(CBEnableFrontendSound);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   283
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   284
            CBEnableFrontendMusic = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   285
            CBEnableFrontendMusic->setText(QCheckBox::tr("Enable frontend music"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   286
            GBAlayout->addWidget(CBEnableFrontendMusic);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   287
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   288
            QFrame * hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   289
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   290
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   291
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   292
            GBAlayout->addWidget(hr);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   293
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   294
            QLabel * resolution = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   295
            resolution->setText(QLabel::tr("Resolution"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   296
            GBAreslayout->addWidget(resolution);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   297
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   298
            CBResolution = new QComboBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   299
            GBAreslayout->addWidget(CBResolution);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   300
            GBAlayout->addLayout(GBAreslayout);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   301
            connect(CBResolution, SIGNAL(currentIndexChanged(int)), this, SLOT(setResolution(int)));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   302
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   303
            CBFullscreen = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   304
            CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   305
            GBAlayout->addWidget(CBFullscreen);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   306
            connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(int)));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   307
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   308
            QLabel * quality = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   309
            quality->setText(QLabel::tr("Quality"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   310
            quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   311
            GBAqualayout->addWidget(quality);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   312
            
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   313
            SLQuality = new QSlider(Qt::Horizontal, AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   314
            SLQuality->setTickPosition(QSlider::TicksBelow);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   315
            SLQuality->setMaximum(5);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   316
            SLQuality->setMinimum(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   317
            SLQuality->setFixedWidth(150);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   318
            GBAqualayout->addWidget(SLQuality);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   319
            GBAlayout->addLayout(GBAqualayout);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   320
            connect(SLQuality, SIGNAL(valueChanged(int)), this, SLOT(setQuality(int)));
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   321
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   322
            QLabel * stereo = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   323
            stereo->setText(QLabel::tr("Stereo rendering"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   324
            GBAstereolayout->addWidget(stereo);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   325
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   326
            CBStereoMode = new QComboBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   327
            CBStereoMode->addItem(QComboBox::tr("Disabled"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   328
            CBStereoMode->addItem(QComboBox::tr("Red/Cyan"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   329
            CBStereoMode->addItem(QComboBox::tr("Cyan/Red"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   330
            CBStereoMode->addItem(QComboBox::tr("Red/Blue"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   331
            CBStereoMode->addItem(QComboBox::tr("Blue/Red"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   332
            CBStereoMode->addItem(QComboBox::tr("Red/Green"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   333
            CBStereoMode->addItem(QComboBox::tr("Green/Red"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   334
            CBStereoMode->addItem(QComboBox::tr("Side-by-side"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   335
            CBStereoMode->addItem(QComboBox::tr("Top-Bottom"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   336
            CBStereoMode->addItem(QComboBox::tr("Wiggle"));
5441
39962b855540 Add grayscale option for 3d, helps with colour clashing
nemo
parents: 5257
diff changeset
   337
            CBStereoMode->addItem(QComboBox::tr("Red/Cyan grayscale"));
39962b855540 Add grayscale option for 3d, helps with colour clashing
nemo
parents: 5257
diff changeset
   338
            CBStereoMode->addItem(QComboBox::tr("Cyan/Red grayscale"));
39962b855540 Add grayscale option for 3d, helps with colour clashing
nemo
parents: 5257
diff changeset
   339
            CBStereoMode->addItem(QComboBox::tr("Red/Blue grayscale"));
39962b855540 Add grayscale option for 3d, helps with colour clashing
nemo
parents: 5257
diff changeset
   340
            CBStereoMode->addItem(QComboBox::tr("Blue/Red grayscale"));
39962b855540 Add grayscale option for 3d, helps with colour clashing
nemo
parents: 5257
diff changeset
   341
            CBStereoMode->addItem(QComboBox::tr("Red/Green grayscale"));
39962b855540 Add grayscale option for 3d, helps with colour clashing
nemo
parents: 5257
diff changeset
   342
            CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale"));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   343
            connect(CBStereoMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceFullscreen(int)));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   344
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   345
            GBAstereolayout->addWidget(CBStereoMode);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   346
            GBAlayout->addLayout(GBAstereolayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   347
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   348
            hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   349
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   350
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   351
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   352
            GBAlayout->addWidget(hr);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   353
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   354
            QHBoxLayout * GBAvollayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   355
            QLabel * vol = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   356
            vol->setText(QLabel::tr("Initial sound volume"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   357
            GBAvollayout->addWidget(vol);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   358
            GBAlayout->addLayout(GBAvollayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   359
            volumeBox = new QSpinBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   360
            volumeBox->setRange(0, 100);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   361
            volumeBox->setSingleStep(5);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   362
            GBAvollayout->addWidget(volumeBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   363
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   364
            CBEnableSound = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   365
            CBEnableSound->setText(QCheckBox::tr("Enable sound"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   366
            GBAlayout->addWidget(CBEnableSound);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   367
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   368
            CBEnableMusic = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   369
            CBEnableMusic->setText(QCheckBox::tr("Enable music"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   370
            GBAlayout->addWidget(CBEnableMusic);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   371
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   372
            hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   373
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   374
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   375
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   376
            GBAlayout->addWidget(hr);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   377
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   378
            QHBoxLayout * GBAfpslayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   379
            QLabel * maxfps = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   380
            maxfps->setText(QLabel::tr("FPS limit"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   381
            GBAfpslayout->addWidget(maxfps);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   382
            GBAlayout->addLayout(GBAfpslayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   383
            fpsedit = new FPSEdit(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   384
            GBAfpslayout->addWidget(fpsedit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   385
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   386
            CBShowFPS = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   387
            CBShowFPS->setText(QCheckBox::tr("Show FPS"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   388
            GBAlayout->addWidget(CBShowFPS);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   389
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   390
            hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   391
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   392
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   393
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   394
            GBAlayout->addWidget(hr);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   395
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   396
            QLabel *restartNote = new QLabel(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   397
            restartNote->setText(QString("* ") + QLabel::tr("Restart game to apply"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   398
            restartNote->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   399
            GBAlayout->addWidget(restartNote);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   400
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   401
            gbTBLayout->addWidget(AGGroupBox, 0, 1, 3, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   402
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   403
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   404
    BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 2, 2, true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   405
    BtnSaveOptions->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   406
6009
14f6fc9869f2 code cleanup/etc
sheepluva
parents: 5878
diff changeset
   407
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   408
    BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   409
    BtnBack->setFixedHeight(BtnSaveOptions->height());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   410
    BtnBack->setFixedWidth(BtnBack->width()+2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   411
    BtnBack->setStyleSheet("QPushButton{margin: 22px 0 9px 2px;}");
6009
14f6fc9869f2 code cleanup/etc
sheepluva
parents: 5878
diff changeset
   412
    connect(BtnBack, SIGNAL(clicked()), this, SIGNAL(goBack()));
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   413
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   414
    previousQuality = this->SLQuality->value();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   415
    previousResolutionIndex = this->CBResolution->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   416
    previousFullscreenValue = this->CBFullscreen->isChecked();
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   417
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   418
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   419
void PageOptions::forceFullscreen(int index)
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   420
{
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   421
    bool forced = (index == 7 || index == 8 || index == 9);
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   422
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   423
    if (index != 0) {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   424
        this->SLQuality->setValue(this->SLQuality->maximum());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   425
        this->SLQuality->setEnabled(false);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   426
        this->CBFullscreen->setEnabled(!forced);
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   427
        this->CBFullscreen->setChecked(forced ? true : previousFullscreenValue);
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   428
        this->CBResolution->setCurrentIndex(forced ? 0 : previousResolutionIndex);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   429
    } else {
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   430
        this->SLQuality->setEnabled(true);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   431
        this->CBFullscreen->setEnabled(true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   432
        this->SLQuality->setValue(previousQuality);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   433
        this->CBFullscreen->setChecked(previousFullscreenValue);
5877
514b639c40da remove the forced fullscreen resolution since everyone is hating it; kept it around only for stereo rendering (where it's mandatory)
koda
parents: 5745
diff changeset
   434
        this->CBResolution->setCurrentIndex(previousResolutionIndex);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   435
    }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   436
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   437
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   438
void PageOptions::setQuality(int value)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   439
{
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   440
    int index = this->CBStereoMode->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   441
    if (index == 0)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   442
        previousQuality = this->SLQuality->value();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   443
}
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   444
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   445
void PageOptions::setFullscreen(int state)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   446
{
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   447
    int index = this->CBStereoMode->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   448
    if (index != 7 && index != 8 && index != 9)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   449
        previousFullscreenValue = this->CBFullscreen->isChecked();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   450
}
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   451
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   452
void PageOptions::setResolution(int state)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   453
{
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   454
    int index = this->CBStereoMode->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   455
    if (index != 7 && index != 8 && index != 9)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   456
        previousResolutionIndex = this->CBResolution->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   457
}
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   458
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   459
void PageOptions::trimNetNick()
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   460
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   461
    editNetNick->setText(editNetNick->text().trimmed());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   462
}
6024
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   463
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   464
void PageOptions::requestEditSelectedTeam()
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   465
{
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   466
    emit editTeamRequested(CBTeamName->currentText());
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   467
}
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   468
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   469
void PageOptions::requestDeleteSelectedTeam()
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   470
{
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   471
    emit deleteTeamRequested(CBTeamName->currentText());
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   472
}
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   473
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   474
void PageOptions::setTeamOptionsEnabled(bool enabled)
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   475
{
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   476
    BtnNewTeam->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   477
    BtnEditTeam->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   478
    BtnDeleteTeam->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   479
    CBTeamName->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   480
    LblNoEditTeam->setVisible(!enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   481
}
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   482