QTfrontend/pageoptions.cpp
author Zorg <zorgiepoo@gmail.com>
Wed, 08 Jun 2011 03:36:54 -0400
changeset 5229 148d581b17ab
parent 5204 e1a5f4d5d86a
child 5238 46ddaf14509d
permissions -rw-r--r--
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.
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);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    79
            GBTlayout->addWidget(BtnNewTeam, 0, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    80
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    81
            BtnEditTeam = new QPushButton(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    82
            BtnEditTeam->setToolTip(tr("Edit team"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    83
            BtnEditTeam->setIconSize(pmEdit.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    84
            BtnEditTeam->setIcon(pmEdit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    85
            BtnEditTeam->setMaximumWidth(pmEdit.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    86
            GBTlayout->addWidget(BtnEditTeam, 0, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    87
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    88
            BtnDeleteTeam = new QPushButton(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    89
            BtnDeleteTeam->setToolTip(tr("Delete team"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    90
            BtnDeleteTeam->setIconSize(pmDelete.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    91
            BtnDeleteTeam->setIcon(pmDelete);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    92
            BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    93
            GBTlayout->addWidget(BtnDeleteTeam, 0, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    94
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    95
            LblNoEditTeam = new QLabel(teamsBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    96
            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
    97
            LblNoEditTeam->setWordWrap(true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    98
            LblNoEditTeam->setVisible(false);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    99
            GBTlayout->addWidget(LblNoEditTeam, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   100
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   101
            gbTBLayout->addWidget(teamsBox, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   102
        }
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
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   105
            IconedGroupBox* groupWeapons = new IconedGroupBox(this);
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
            //groupWeapons->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   108
            //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   109
            groupWeapons->setIcon(QIcon(":/res/weaponsicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   110
            groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   111
            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
   112
            QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   113
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   114
            QLabel* SchemeLabel = new QLabel(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   115
            SchemeLabel->setText(QLabel::tr("Game scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   116
            WeaponsLayout->addWidget(SchemeLabel, 1, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   117
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   118
            SchemesName = new QComboBox(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   119
            WeaponsLayout->addWidget(SchemesName, 1, 1);
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
            SchemeNew = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   122
            SchemeNew->setToolTip(tr("New scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   123
            SchemeNew->setIconSize(pmNew.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   124
            SchemeNew->setIcon(pmNew);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   125
            SchemeNew->setMaximumWidth(pmNew.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   126
            WeaponsLayout->addWidget(SchemeNew, 1, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   127
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   128
            SchemeEdit = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   129
            SchemeEdit->setToolTip(tr("Edit scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   130
            SchemeEdit->setIconSize(pmEdit.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   131
            SchemeEdit->setIcon(pmEdit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   132
            SchemeEdit->setMaximumWidth(pmEdit.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   133
            WeaponsLayout->addWidget(SchemeEdit, 1, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   134
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   135
            SchemeDelete = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   136
            SchemeDelete->setToolTip(tr("Delete scheme"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   137
            SchemeDelete->setIconSize(pmDelete.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   138
            SchemeDelete->setIcon(pmDelete);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   139
            SchemeDelete->setMaximumWidth(pmDelete.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   140
            WeaponsLayout->addWidget(SchemeDelete, 1, 4);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   141
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   142
            QLabel* WeaponLabel = new QLabel(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   143
            WeaponLabel->setText(QLabel::tr("Weapons"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   144
            WeaponsLayout->addWidget(WeaponLabel, 2, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   145
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   146
            WeaponsName = new QComboBox(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   147
            WeaponsLayout->addWidget(WeaponsName, 2, 1);
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
            WeaponNew = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   150
            WeaponNew->setToolTip(tr("New weapon set"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   151
            WeaponNew->setIconSize(pmNew.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   152
            WeaponNew->setIcon(pmNew);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   153
            WeaponNew->setMaximumWidth(pmNew.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   154
            WeaponsLayout->addWidget(WeaponNew, 2, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   155
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   156
            WeaponEdit = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   157
            WeaponEdit->setToolTip(tr("Edit weapon set"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   158
            WeaponEdit->setIconSize(pmEdit.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   159
            WeaponEdit->setIcon(pmEdit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   160
            WeaponEdit->setMaximumWidth(pmEdit.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   161
            WeaponsLayout->addWidget(WeaponEdit, 2, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   162
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   163
            WeaponDelete = new QPushButton(groupWeapons);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   164
            WeaponDelete->setToolTip(tr("Delete weapon set"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   165
            WeaponDelete->setIconSize(pmDelete.size());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   166
            WeaponDelete->setIcon(pmDelete);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   167
            WeaponDelete->setMaximumWidth(pmDelete.width() + 6);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   168
            WeaponsLayout->addWidget(WeaponDelete, 2, 4);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   169
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   170
            WeaponTooltip = new QCheckBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   171
            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
   172
            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
   173
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   174
            gbTBLayout->addWidget(groupWeapons, 1, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   175
        }
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
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   178
            IconedGroupBox* groupMisc = new IconedGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   179
            //groupMisc->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   180
            groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   181
            groupMisc->setIcon(QIcon(":/res/miscicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   182
            //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   183
            groupMisc->setTitle(QGroupBox::tr("Misc"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   184
            QGridLayout * MiscLayout = new QGridLayout(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   185
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   186
            labelNN = new QLabel(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   187
            labelNN->setText(QLabel::tr("Net nick"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   188
            MiscLayout->addWidget(labelNN, 0, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   189
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   190
            editNetNick = new QLineEdit(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   191
            editNetNick->setMaxLength(20);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   192
            editNetNick->setText(QLineEdit::tr("unnamed"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   193
            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
   194
            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
   195
            
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
   196
            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
   197
            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
   198
            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
   199
            
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
            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
   201
            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
   202
            MiscLayout->addWidget(editNetPassword, 1, 1);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   203
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   204
            QLabel *labelLanguage = new QLabel(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   205
            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
   206
            MiscLayout->addWidget(labelLanguage, 2, 0);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   207
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   208
            CBLanguage = new QComboBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   209
            QDir tmpdir;
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   210
            tmpdir.cd(datadir->absolutePath());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   211
            tmpdir.cd("Locale");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   212
            tmpdir.setFilter(QDir::Files);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   213
            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
   214
            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
   215
            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
   216
            {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   217
                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
   218
                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
   219
            }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   220
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
   221
            MiscLayout->addWidget(CBLanguage, 2, 1);
5078
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
            CBAltDamage = new QCheckBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   224
            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
   225
            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
   226
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   227
            CBNameWithDate = new QCheckBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   228
            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
   229
            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
   230
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   231
#ifdef SPARKLE_ENABLED
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   232
            CBAutoUpdate = new QCheckBox(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   233
            CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup"));
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
   234
            MiscLayout->addWidget(CBAutoUpdate, 5, 0, 1, 2);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   235
#endif
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   236
#ifndef __APPLE__
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   237
            BtnAssociateFiles = new QPushButton(groupMisc);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   238
            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
   239
            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
   240
            MiscLayout->addWidget(BtnAssociateFiles, 5, 0, 1, 2);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   241
#endif
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   242
            gbTBLayout->addWidget(groupMisc, 2, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   243
        }
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
        {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   246
            AGGroupBox = new IconedGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   247
            //AGGroupBox->setContentTopPadding(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   248
            AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   249
            //AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   250
            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
   251
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   252
            QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   253
            QHBoxLayout * GBAreslayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   254
            QHBoxLayout * GBAstereolayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   255
            QHBoxLayout * GBAqualayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   256
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   257
            CBFrontendFullscreen = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   258
            CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   259
            GBAlayout->addWidget(CBFrontendFullscreen);
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
            CBFrontendEffects = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   262
            CBFrontendEffects->setText(QCheckBox::tr("Frontend effects") + " *");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   263
            GBAlayout->addWidget(CBFrontendEffects);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   264
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   265
            CBEnableFrontendSound = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   266
            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
   267
            GBAlayout->addWidget(CBEnableFrontendSound);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   268
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   269
            CBEnableFrontendMusic = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   270
            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
   271
            GBAlayout->addWidget(CBEnableFrontendMusic);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   272
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   273
            QFrame * hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   274
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   275
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   276
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   277
            GBAlayout->addWidget(hr);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   278
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   279
            QLabel * resolution = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   280
            resolution->setText(QLabel::tr("Resolution"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   281
            GBAreslayout->addWidget(resolution);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   282
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   283
            CBResolution = new QComboBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   284
            GBAreslayout->addWidget(CBResolution);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   285
            GBAlayout->addLayout(GBAreslayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   286
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   287
            CBFullscreen = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   288
            CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   289
            GBAlayout->addWidget(CBFullscreen);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   290
            connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(void)));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   291
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   292
            QLabel * quality = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   293
            quality->setText(QLabel::tr("Quality"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   294
            quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   295
            GBAqualayout->addWidget(quality);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   296
            
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   297
            SLQuality = new QSlider(Qt::Horizontal, AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   298
            SLQuality->setTickPosition(QSlider::TicksBelow);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   299
            SLQuality->setMaximum(5);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   300
            SLQuality->setMinimum(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   301
            SLQuality->setFixedWidth(150);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   302
            GBAqualayout->addWidget(SLQuality);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   303
            GBAlayout->addLayout(GBAqualayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   304
            QLabel * stereo = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   305
            stereo->setText(QLabel::tr("Stereo rendering"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   306
            GBAstereolayout->addWidget(stereo);
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
            CBStereoMode = new QComboBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   309
            CBStereoMode->addItem(QComboBox::tr("Disabled"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   310
            CBStereoMode->addItem(QComboBox::tr("Red/Cyan"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   311
            CBStereoMode->addItem(QComboBox::tr("Cyan/Red"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   312
            CBStereoMode->addItem(QComboBox::tr("Red/Blue"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   313
            CBStereoMode->addItem(QComboBox::tr("Blue/Red"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   314
            CBStereoMode->addItem(QComboBox::tr("Red/Green"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   315
            CBStereoMode->addItem(QComboBox::tr("Green/Red"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   316
            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
   317
            CBStereoMode->addItem(QComboBox::tr("Top-Bottom"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   318
            CBStereoMode->addItem(QComboBox::tr("Wiggle"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   319
            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
   320
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   321
            GBAstereolayout->addWidget(CBStereoMode);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   322
            GBAlayout->addLayout(GBAstereolayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   323
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   324
            hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   325
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   326
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   327
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   328
            GBAlayout->addWidget(hr);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   329
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   330
            QHBoxLayout * GBAvollayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   331
            QLabel * vol = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   332
            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
   333
            GBAvollayout->addWidget(vol);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   334
            GBAlayout->addLayout(GBAvollayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   335
            volumeBox = new QSpinBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   336
            volumeBox->setRange(0, 100);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   337
            volumeBox->setSingleStep(5);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   338
            GBAvollayout->addWidget(volumeBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   339
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   340
            CBEnableSound = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   341
            CBEnableSound->setText(QCheckBox::tr("Enable sound"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   342
            GBAlayout->addWidget(CBEnableSound);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   343
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   344
            CBEnableMusic = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   345
            CBEnableMusic->setText(QCheckBox::tr("Enable music"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   346
            GBAlayout->addWidget(CBEnableMusic);
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 * GBAfpslayout = new QHBoxLayout(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   355
            QLabel * maxfps = new QLabel(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   356
            maxfps->setText(QLabel::tr("FPS limit"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   357
            GBAfpslayout->addWidget(maxfps);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   358
            GBAlayout->addLayout(GBAfpslayout);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   359
            fpsedit = new FPSEdit(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   360
            GBAfpslayout->addWidget(fpsedit);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   361
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   362
            CBShowFPS = new QCheckBox(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   363
            CBShowFPS->setText(QCheckBox::tr("Show FPS"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   364
            GBAlayout->addWidget(CBShowFPS);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   365
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   366
            hr = new QFrame(AGGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   367
            hr->setFrameStyle(QFrame::HLine);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   368
            hr->setLineWidth(3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   369
            hr->setFixedHeight(10);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   370
            GBAlayout->addWidget(hr);
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
            QLabel *restartNote = new QLabel(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   373
            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
   374
            restartNote->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   375
            GBAlayout->addWidget(restartNote);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   376
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   377
            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
   378
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   379
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   380
    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
   381
    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
   382
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   383
    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
   384
    BtnBack->setFixedHeight(BtnSaveOptions->height());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   385
    BtnBack->setFixedWidth(BtnBack->width()+2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   386
    BtnBack->setStyleSheet("QPushButton{margin: 22px 0 9px 2px;}");
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   387
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   388
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   389
void PageOptions::forceFullscreen(int index)
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   390
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   391
    if (index != 0) {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   392
        previousFullscreenValue = this->CBFullscreen->isChecked();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   393
        this->CBFullscreen->setChecked(true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   394
        this->CBFullscreen->setEnabled(false);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   395
        previousQuality = this->SLQuality->value();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   396
        this->SLQuality->setValue(this->SLQuality->maximum());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   397
        this->SLQuality->setEnabled(false);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   398
    } else {
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   399
        this->CBFullscreen->setChecked(previousFullscreenValue);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   400
        this->CBFullscreen->setEnabled(true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   401
        this->SLQuality->setValue(previousQuality);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   402
        this->SLQuality->setEnabled(true);
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
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   405
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   406
void PageOptions::setFullscreen(void)
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   407
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   408
    int tmp = this->CBResolution->currentIndex();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   409
    if (this->CBFullscreen->isChecked())
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   410
        this->CBResolution->setCurrentIndex(0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   411
    else
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   412
        this->CBResolution->setCurrentIndex(previousResolutionIndex);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   413
    previousResolutionIndex = tmp;
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   414
    this->CBResolution->setEnabled(!this->CBFullscreen->isChecked());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   415
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   416
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   417
void PageOptions::trimNetNick()
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
    editNetNick->setText(editNetNick->text().trimmed());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   420
}