QTfrontend/ui/page/pageoptions.cpp
author vitiv <nikita.utiu@gmail.com>
Sat, 29 Dec 2012 14:40:20 +0200
changeset 8343 aa4ea3cade3c
parent 8284 a874d00df4a4
child 8350 14b938faec69
permissions -rw-r--r--
Added Support for variable windowed resolution.
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
6952
7f70f37bbf08 license header year range adjustments
sheepluva
parents: 6911
diff changeset
     3
 * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
5078
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>
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
    20
#include <QHBoxLayout>
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    21
#include <QPushButton>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    22
#include <QGroupBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    23
#include <QComboBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    24
#include <QCheckBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    25
#include <QLabel>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    26
#include <QLineEdit>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    27
#include <QSpinBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    28
#include <QTextBrowser>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    29
#include <QTableWidget>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    30
#include <QSlider>
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    31
#include <QSignalMapper>
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    32
#include <QColorDialog>
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    33
#include <QStandardItemModel>
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    34
5204
e1a5f4d5d86a split pages.h into several header files
koda
parents: 5078
diff changeset
    35
#include "pageoptions.h"
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    36
#include "gameuiconfig.h"
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    37
#include "hwconsts.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    38
#include "fpsedit.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    39
#include "igbox.h"
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    40
#include "DataManager.h"
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    41
#include "LibavInteraction.h"
8284
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    42
#include "AutoUpdater.h"
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    43
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    44
#ifdef __APPLE__
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    45
#ifdef SPARKLE_ENABLED
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    46
#include "SparkleAutoUpdater.h"
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    47
#endif
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
    48
#endif
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    49
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
    50
// TODO cleanup
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
    51
QLayout * PageOptions::bodyLayoutDefinition()
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    52
{
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    53
    QVBoxLayout * pageLayout = new QVBoxLayout();
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    54
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    55
    QTabWidget * tabs = new QTabWidget(this);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    56
    pageLayout->addWidget(tabs);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    57
    QWidget * page1 = new QWidget(this);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    58
    QWidget * page2 = new QWidget(this);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    59
    tabs->addTab(page1, tr("General"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    60
    tabs->addTab(page2, tr("Advanced"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    61
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    62
#ifdef VIDEOREC
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    63
    QWidget * page3 = new QWidget(this);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    64
    tabs->addTab(page3, tr("Video Recording"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    65
#endif
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
    66
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    67
    { // page 1
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    68
        QGridLayout * page1Layout = new QGridLayout(page1);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    69
        //gbTBLayout->setMargin(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    70
        page1Layout->setSpacing(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    71
        page1Layout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    72
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    73
        QPixmap pmNew(":/res/new.png");
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    74
        QPixmap pmEdit(":/res/edit.png");
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    75
        QPixmap pmDelete(":/res/delete.png");
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    76
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    77
        {
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    78
            teamsBox = new IconedGroupBox(this);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    79
            //teamsBox->setContentTopPadding(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    80
            //teamsBox->setAttribute(Qt::WA_PaintOnScreen, true);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    81
            teamsBox->setIcon(QIcon(":/res/teamicon.png"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    82
            teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    83
            teamsBox->setTitle(QGroupBox::tr("Teams"));
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
    84
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    85
            QGridLayout * GBTlayout = new QGridLayout(teamsBox);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
    86
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    87
            CBTeamName = new QComboBox(teamsBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    88
            GBTlayout->addWidget(CBTeamName, 0, 0);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    89
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    90
            BtnNewTeam = new QPushButton(teamsBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    91
            BtnNewTeam->setToolTip(tr("New team"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    92
            BtnNewTeam->setIconSize(pmNew.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    93
            BtnNewTeam->setIcon(pmNew);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    94
            BtnNewTeam->setMaximumWidth(pmNew.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    95
            connect(BtnNewTeam, SIGNAL(clicked()), this, SIGNAL(newTeamRequested()));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    96
            GBTlayout->addWidget(BtnNewTeam, 0, 1);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
    97
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    98
            BtnEditTeam = new QPushButton(teamsBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
    99
            BtnEditTeam->setToolTip(tr("Edit team"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   100
            BtnEditTeam->setIconSize(pmEdit.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   101
            BtnEditTeam->setIcon(pmEdit);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   102
            BtnEditTeam->setMaximumWidth(pmEdit.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   103
            connect(BtnEditTeam, SIGNAL(clicked()), this, SLOT(requestEditSelectedTeam()));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   104
            GBTlayout->addWidget(BtnEditTeam, 0, 2);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   105
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   106
            BtnDeleteTeam = new QPushButton(teamsBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   107
            BtnDeleteTeam->setToolTip(tr("Delete team"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   108
            BtnDeleteTeam->setIconSize(pmDelete.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   109
            BtnDeleteTeam->setIcon(pmDelete);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   110
            BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   111
            connect(BtnDeleteTeam, SIGNAL(clicked()), this, SLOT(requestDeleteSelectedTeam()));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   112
            GBTlayout->addWidget(BtnDeleteTeam, 0, 3);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   113
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   114
            LblNoEditTeam = new QLabel(teamsBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   115
            LblNoEditTeam->setText(tr("You can't edit teams from team selection. Go back to main menu to add, edit or delete teams."));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   116
            LblNoEditTeam->setWordWrap(true);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   117
            LblNoEditTeam->setVisible(false);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   118
            GBTlayout->addWidget(LblNoEditTeam, 0, 0);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   119
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   120
            page1Layout->addWidget(teamsBox, 0, 0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   121
        }
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   122
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   123
        {
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   124
            IconedGroupBox* groupWeapons = new IconedGroupBox(this);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   125
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   126
            //groupWeapons->setContentTopPadding(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   127
            //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   128
            groupWeapons->setIcon(QIcon(":/res/weaponsicon.png"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   129
            groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   130
            groupWeapons->setTitle(QGroupBox::tr("Schemes and Weapons"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   131
            QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   132
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   133
            QLabel* SchemeLabel = new QLabel(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   134
            SchemeLabel->setText(QLabel::tr("Game scheme"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   135
            WeaponsLayout->addWidget(SchemeLabel, 1, 0);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   136
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   137
            SchemesName = new QComboBox(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   138
            WeaponsLayout->addWidget(SchemesName, 1, 1);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   139
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   140
            SchemeNew = new QPushButton(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   141
            SchemeNew->setWhatsThis(tr("New scheme"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   142
            SchemeNew->setIconSize(pmNew.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   143
            SchemeNew->setIcon(pmNew);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   144
            SchemeNew->setMaximumWidth(pmNew.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   145
            WeaponsLayout->addWidget(SchemeNew, 1, 2);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   146
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   147
            SchemeEdit = new QPushButton(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   148
            SchemeEdit->setWhatsThis(tr("Edit scheme"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   149
            SchemeEdit->setIconSize(pmEdit.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   150
            SchemeEdit->setIcon(pmEdit);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   151
            SchemeEdit->setMaximumWidth(pmEdit.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   152
            WeaponsLayout->addWidget(SchemeEdit, 1, 3);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   153
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   154
            SchemeDelete = new QPushButton(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   155
            SchemeDelete->setWhatsThis(tr("Delete scheme"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   156
            SchemeDelete->setIconSize(pmDelete.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   157
            SchemeDelete->setIcon(pmDelete);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   158
            SchemeDelete->setMaximumWidth(pmDelete.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   159
            WeaponsLayout->addWidget(SchemeDelete, 1, 4);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   160
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   161
            QLabel* WeaponLabel = new QLabel(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   162
            WeaponLabel->setText(QLabel::tr("Weapons"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   163
            WeaponsLayout->addWidget(WeaponLabel, 2, 0);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   164
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   165
            WeaponsName = new QComboBox(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   166
            WeaponsLayout->addWidget(WeaponsName, 2, 1);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   167
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   168
            WeaponNew = new QPushButton(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   169
            WeaponNew->setWhatsThis(tr("New weapon set"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   170
            WeaponNew->setIconSize(pmNew.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   171
            WeaponNew->setIcon(pmNew);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   172
            WeaponNew->setMaximumWidth(pmNew.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   173
            WeaponsLayout->addWidget(WeaponNew, 2, 2);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   174
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   175
            WeaponEdit = new QPushButton(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   176
            WeaponEdit->setWhatsThis(tr("Edit weapon set"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   177
            WeaponEdit->setIconSize(pmEdit.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   178
            WeaponEdit->setIcon(pmEdit);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   179
            WeaponEdit->setMaximumWidth(pmEdit.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   180
            WeaponsLayout->addWidget(WeaponEdit, 2, 3);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   181
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   182
            WeaponDelete = new QPushButton(groupWeapons);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   183
            WeaponDelete->setWhatsThis(tr("Delete weapon set"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   184
            WeaponDelete->setIconSize(pmDelete.size());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   185
            WeaponDelete->setIcon(pmDelete);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   186
            WeaponDelete->setMaximumWidth(pmDelete.width() + 6);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   187
            WeaponsLayout->addWidget(WeaponDelete, 2, 4);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   188
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   189
            page1Layout->addWidget(groupWeapons, 1, 0);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   190
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   191
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   192
        {
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   193
            IconedGroupBox* groupMisc = new IconedGroupBox(this);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   194
            //groupMisc->setContentTopPadding(0);
7678
8aabba680598 Polish settings page a bit
unc0rr
parents: 7630
diff changeset
   195
            //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   196
            groupMisc->setIcon(QIcon(":/res/miscicon.png"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   197
            //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   198
            groupMisc->setTitle(QGroupBox::tr("Misc"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   199
            QGridLayout * MiscLayout = new QGridLayout(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   200
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   201
            // Label for "Language"
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   202
            QLabel *labelLanguage = new QLabel(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   203
            labelLanguage->setText(QLabel::tr("Locale") + " *");
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   204
            MiscLayout->addWidget(labelLanguage, 0, 0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   205
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   206
            // List of installed languages
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   207
            CBLanguage = new QComboBox(groupMisc);
8098
4efee370e2de - Fix saving .ini files
unc0rr
parents: 7703
diff changeset
   208
            QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm"));
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   209
            CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   210
            for(int i = 0; i < locs.count(); i++)
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   211
            {
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   212
                QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   213
                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   214
            }
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   215
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   216
            MiscLayout->addWidget(CBLanguage, 0, 1);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   217
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   218
            // Label and field for net nick
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   219
            labelNN = new QLabel(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   220
            labelNN->setText(QLabel::tr("Nickname"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   221
            MiscLayout->addWidget(labelNN, 1, 0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   222
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   223
            editNetNick = new QLineEdit(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   224
            editNetNick->setMaxLength(20);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   225
            editNetNick->setText(QLineEdit::tr("anonymous"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   226
            MiscLayout->addWidget(editNetNick, 1, 1);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   227
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   228
            // checkbox and field for password
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   229
            CBSavePassword = new QCheckBox(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   230
            CBSavePassword->setText(QCheckBox::tr("Save password"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   231
            MiscLayout->addWidget(CBSavePassword, 2, 0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   232
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   233
            editNetPassword = new QLineEdit(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   234
            editNetPassword->setEchoMode(QLineEdit::Password);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   235
            MiscLayout->addWidget(editNetPassword, 2, 1);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   236
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   237
    #ifdef __APPLE__
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   238
    #ifdef SPARKLE_ENABLED
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   239
            CBAutoUpdate = new QCheckBox(groupMisc);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   240
            CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup"));
8284
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   241
            MiscLayout->addWidget(CBAutoUpdate, 7, 0, 1, 1);
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   242
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   243
            btnUpdateNow = new QPushButton(groupMisc);
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   244
            connect(btnUpdateNow, SIGNAL(clicked()), this, SLOT(checkForUpdates()));
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   245
            btnUpdateNow->setToolTip(tr("Check for updates"));
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   246
            btnUpdateNow->setText("Check now");
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   247
            btnUpdateNow->setFixedSize(130, 30);
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   248
            MiscLayout->addWidget(btnUpdateNow, 7, 1, 1, 1);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   249
    #endif
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   250
    #endif
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   251
            page1Layout->addWidget(groupMisc, 2, 0);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   252
        }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   253
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   254
        {
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   255
            AGGroupBox = new IconedGroupBox(this);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   256
            //AGGroupBox->setContentTopPadding(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   257
            AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   258
            //AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   259
            AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   260
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   261
            QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   262
            QGridLayout * GBAfrontendlayout = new QGridLayout(0);
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   263
            QGridLayout * GBAreslayout = new QGridLayout(0);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   264
            QHBoxLayout * GBAfullreslayout = new QHBoxLayout(0);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   265
            QHBoxLayout * GBAwindowedreslayout = new QHBoxLayout(0);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   266
            QHBoxLayout * GBAstereolayout = new QHBoxLayout(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   267
            QHBoxLayout * GBAqualayout = new QHBoxLayout(0);
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   268
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   269
            QLabel * frontend = new QLabel(AGGroupBox);
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   270
            frontend->setText(QLabel::tr("Frontend"));
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   271
            frontend->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   272
            GBAfrontendlayout->addWidget(frontend, 0, 0, 1, 2);
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   273
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   274
            CBFrontendFullscreen = new QCheckBox(AGGroupBox);
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   275
            CBFrontendFullscreen->setText(QCheckBox::tr("Fullscreen"));
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   276
            GBAfrontendlayout->addWidget(CBFrontendFullscreen, 1, 0);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   277
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   278
            CBFrontendEffects = new QCheckBox(AGGroupBox);
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   279
            CBFrontendEffects->setText(QCheckBox::tr("Visual effects"));
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   280
            GBAfrontendlayout->addWidget(CBFrontendEffects, 2, 0);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   281
8226
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   282
            CBFrontendSound = new QCheckBox(AGGroupBox);
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   283
            CBFrontendSound->setText(QCheckBox::tr("Sound"));
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   284
            GBAfrontendlayout->addWidget(CBFrontendSound, 1, 1);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   285
8226
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   286
            CBFrontendMusic = new QCheckBox(AGGroupBox);
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   287
            CBFrontendMusic->setText(QCheckBox::tr("Music"));
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   288
            GBAfrontendlayout->addWidget(CBFrontendMusic, 2, 1);
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   289
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   290
            GBAlayout->addLayout(GBAfrontendlayout);
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   291
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   292
            QFrame * hr = new QFrame(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   293
            hr->setFrameStyle(QFrame::HLine);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   294
            hr->setLineWidth(3);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   295
            hr->setFixedHeight(10);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   296
            GBAlayout->addWidget(hr);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   297
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   298
            QLabel * resolution = new QLabel(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   299
            resolution->setText(QLabel::tr("Resolution"));
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   300
            GBAreslayout->addWidget(resolution, 0, 0);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   301
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   302
            CBResolution = new QComboBox(AGGroupBox);
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   303
            GBAfullreslayout->addWidget(CBResolution);
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   304
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   305
            CBFullscreen = new QCheckBox(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   306
            CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   307
            GBAfullreslayout->addWidget(CBFullscreen);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   308
            GBAreslayout->addLayout(GBAfullreslayout, 0, 1);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   309
            
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   310
            QLabel * windowedResolution = new QLabel(AGGroupBox);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   311
            windowedResolution->setText(QLabel::tr("Windowed Resolution"));
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   312
            GBAreslayout->addWidget(windowedResolution, 1, 0);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   313
            
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   314
            // decorational X
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   315
            QLabel *winLabelX = new QLabel(AGGroupBox);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   316
            winLabelX->setText("X");
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   317
            
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   318
            windowWidthEdit = new QLineEdit(AGGroupBox);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   319
            windowWidthEdit->setValidator(new QIntValidator(this));
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   320
            windowHeightEdit = new QLineEdit(AGGroupBox);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   321
            windowHeightEdit->setValidator(new QIntValidator(this));
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   322
            
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   323
            GBAwindowedreslayout->addWidget(windowWidthEdit);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   324
            GBAwindowedreslayout->addWidget(winLabelX);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   325
            GBAwindowedreslayout->addWidget(windowHeightEdit);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   326
            GBAreslayout->addLayout(GBAwindowedreslayout, 1, 1);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   327
            
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   328
            GBAlayout->addLayout(GBAreslayout);
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   329
            
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   330
            QLabel * quality = new QLabel(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   331
            quality->setText(QLabel::tr("Quality"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   332
            quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   333
            GBAqualayout->addWidget(quality);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   334
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   335
            SLQuality = new QSlider(Qt::Horizontal, AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   336
            SLQuality->setTickPosition(QSlider::TicksBelow);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   337
            SLQuality->setMaximum(5);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   338
            SLQuality->setMinimum(0);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   339
            SLQuality->setFixedWidth(150);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   340
            GBAqualayout->addWidget(SLQuality);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   341
            GBAlayout->addLayout(GBAqualayout);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   342
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   343
            QLabel * stereo = new QLabel(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   344
            stereo->setText(QLabel::tr("Stereo rendering"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   345
            GBAstereolayout->addWidget(stereo);
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   346
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   347
            CBStereoMode = new QComboBox(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   348
            CBStereoMode->addItem(QComboBox::tr("Disabled"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   349
            CBStereoMode->addItem(QComboBox::tr("Red/Cyan"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   350
            CBStereoMode->addItem(QComboBox::tr("Cyan/Red"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   351
            CBStereoMode->addItem(QComboBox::tr("Red/Blue"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   352
            CBStereoMode->addItem(QComboBox::tr("Blue/Red"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   353
            CBStereoMode->addItem(QComboBox::tr("Red/Green"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   354
            CBStereoMode->addItem(QComboBox::tr("Green/Red"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   355
            CBStereoMode->addItem(QComboBox::tr("Side-by-side"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   356
            CBStereoMode->addItem(QComboBox::tr("Top-Bottom"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   357
            CBStereoMode->addItem(QComboBox::tr("Wiggle"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   358
            CBStereoMode->addItem(QComboBox::tr("Red/Cyan grayscale"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   359
            CBStereoMode->addItem(QComboBox::tr("Cyan/Red grayscale"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   360
            CBStereoMode->addItem(QComboBox::tr("Red/Blue grayscale"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   361
            CBStereoMode->addItem(QComboBox::tr("Blue/Red grayscale"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   362
            CBStereoMode->addItem(QComboBox::tr("Red/Green grayscale"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   363
            CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale"));
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   364
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   365
            GBAstereolayout->addWidget(CBStereoMode);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   366
            GBAlayout->addLayout(GBAstereolayout);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   367
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   368
            hr = new QFrame(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   369
            hr->setFrameStyle(QFrame::HLine);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   370
            hr->setLineWidth(3);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   371
            hr->setFixedHeight(10);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   372
            GBAlayout->addWidget(hr);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   373
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   374
            QGridLayout * GBAvollayout = new QGridLayout();
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   375
            QLabel * vol = new QLabel(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   376
            vol->setText(QLabel::tr("Initial sound volume"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   377
            GBAvollayout->addWidget(vol, 0, 0, 1, 2);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   378
            GBAlayout->addLayout(GBAvollayout);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   379
            volumeBox = new QSpinBox(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   380
            volumeBox->setRange(0, 100);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   381
            volumeBox->setSingleStep(5);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   382
            GBAvollayout->addWidget(volumeBox, 0, 2);
5252
ded882439548 file association for mac!
koda
parents: 5238
diff changeset
   383
8226
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   384
            CBSound = new QCheckBox(AGGroupBox);
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   385
            CBSound->setText(QCheckBox::tr("Sound"));
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   386
            CBSound->setWhatsThis(QCheckBox::tr("In-game sound effects"));
8226
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   387
            GBAvollayout->addWidget(CBSound, 1, 0);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   388
8226
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   389
            CBMusic = new QCheckBox(AGGroupBox);
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   390
            CBMusic->setText(QCheckBox::tr("Music"));
8229
251f38da9935 Cleaned up frontend options a bit and added a couple WhatsThis messages.
Mitchell Kember <mk12360@gmail.com>
parents: 8226
diff changeset
   391
            CBMusic->setWhatsThis(QCheckBox::tr("In-game music"));
8226
67f07ff5b593 Removed redundant "enable"s on checkboxes and variable names.
Mitchell Kember <mk12360@gmail.com>
parents: 8192
diff changeset
   392
            GBAvollayout->addWidget(CBMusic, 1, 1, 1, 2);
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   393
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   394
            GBAvollayout->setSizeConstraint(QLayout::SetMinimumSize);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   395
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   396
            hr = new QFrame(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   397
            hr->setFrameStyle(QFrame::HLine);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   398
            hr->setLineWidth(3);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   399
            hr->setFixedHeight(10);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   400
            GBAlayout->addWidget(hr);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   401
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   402
            CBAltDamage = new QCheckBox(AGGroupBox);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   403
            CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   404
            GBAlayout->addWidget(CBAltDamage);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   405
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   406
            page1Layout->addWidget(AGGroupBox, 0, 1, 3, 1);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   407
        }
7678
8aabba680598 Polish settings page a bit
unc0rr
parents: 7630
diff changeset
   408
8aabba680598 Polish settings page a bit
unc0rr
parents: 7630
diff changeset
   409
        page1Layout->addWidget(new QWidget(this), 3, 0);
8aabba680598 Polish settings page a bit
unc0rr
parents: 7630
diff changeset
   410
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   411
    }
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   412
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   413
    { // page 2
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   414
        QGridLayout * page2Layout = new QGridLayout(page2);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   415
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   416
        {
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   417
            IconedGroupBox * gbColors = new IconedGroupBox(this);
7678
8aabba680598 Polish settings page a bit
unc0rr
parents: 7630
diff changeset
   418
            gbColors->setIcon(QIcon(":/res/lightbulb_on.png"));
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   419
            gbColors->setTitle(QGroupBox::tr("Custom colors"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   420
            page2Layout->addWidget(gbColors, 0, 0);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   421
            QGridLayout * gbCLayout = new QGridLayout(gbColors);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   422
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   423
            QSignalMapper * mapper = new QSignalMapper(this);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   424
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   425
            QStandardItemModel * model = DataManager::instance().colorsModel();
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   426
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   427
            connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(onColorModelDataChanged(QModelIndex,QModelIndex)));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   428
            for(int i = 0; i < model->rowCount(); ++i)
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   429
            {
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   430
                QPushButton * btn = new QPushButton(this);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   431
                btn->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   432
                gbCLayout->addWidget(btn, i / 3, i % 3);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   433
                btn->setStyleSheet(QString("background: %1").arg(model->item(i)->data().value<QColor>().name()));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   434
                m_colorButtons.append(btn);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   435
                connect(btn, SIGNAL(clicked()), mapper, SLOT(map()));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   436
                mapper->setMapping(btn, i);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   437
            }
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   438
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   439
            connect(mapper, SIGNAL(mapped(int)), this, SLOT(colorButtonClicked(int)));
7680
46a91cbed8db - Some improvements to tr() calls
unc0rr
parents: 7678
diff changeset
   440
46a91cbed8db - Some improvements to tr() calls
unc0rr
parents: 7678
diff changeset
   441
            QPushButton * btn = new QPushButton(this);
46a91cbed8db - Some improvements to tr() calls
unc0rr
parents: 7678
diff changeset
   442
            gbCLayout->addWidget(btn, (model->rowCount() - 1) / 3 + 1, 0, 1, 3);
46a91cbed8db - Some improvements to tr() calls
unc0rr
parents: 7678
diff changeset
   443
            btn->setText(tr("Reset to default colors"));
7681
26978d581070 Reset to default colors button
unc0rr
parents: 7680
diff changeset
   444
            connect(btn, SIGNAL(clicked()), &DataManager::instance(), SLOT(resetColors()));
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   445
        }
7153
f0d055645ab2 minor tweaks for options page; should improve readability at small window size... a bit...
sheepluva
parents: 6952
diff changeset
   446
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   447
        {
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   448
            IconedGroupBox * gbMisc = new IconedGroupBox(this);
7678
8aabba680598 Polish settings page a bit
unc0rr
parents: 7630
diff changeset
   449
            gbMisc->setIcon(QIcon(":/res/Settings.png"));
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   450
            gbMisc->setTitle(QGroupBox::tr("Miscellaneous"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   451
            page2Layout->addWidget(gbMisc, 0, 1);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   452
            QVBoxLayout * gbCLayout = new QVBoxLayout(gbMisc);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   453
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   454
            QHBoxLayout * GBAfpslayout = new QHBoxLayout(0);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   455
            QLabel * maxfps = new QLabel(AGGroupBox);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   456
            maxfps->setText(QLabel::tr("FPS limit"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   457
            GBAfpslayout->addWidget(maxfps);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   458
            fpsedit = new FPSEdit(AGGroupBox);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   459
            GBAfpslayout->addWidget(fpsedit);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   460
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   461
            CBShowFPS = new QCheckBox(AGGroupBox);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   462
            CBShowFPS->setText(QCheckBox::tr("Show FPS"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   463
            GBAfpslayout->addWidget(CBShowFPS);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   464
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   465
            gbCLayout->addLayout(GBAfpslayout);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   466
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   467
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   468
            WeaponTooltip = new QCheckBox(this);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   469
            WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   470
            gbCLayout->addWidget(WeaponTooltip);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   471
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   472
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   473
            CBNameWithDate = new QCheckBox(this);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   474
            CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   475
            gbCLayout->addWidget(CBNameWithDate);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   476
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   477
            BtnAssociateFiles = new QPushButton(this);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   478
            BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions"));
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   479
            BtnAssociateFiles->setVisible(!custom_data && !custom_config);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   480
            gbCLayout->addWidget(BtnAssociateFiles);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   481
        }
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   482
7700
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   483
        {
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   484
            IconedGroupBox * gbProxy = new IconedGroupBox(this);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   485
            gbProxy->setIcon(QIcon(":/res/Settings.png"));
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   486
            gbProxy->setTitle(QGroupBox::tr("Proxy settings"));
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   487
            page2Layout->addWidget(gbProxy, 1, 0);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   488
            QGridLayout * gbLayout = new QGridLayout(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   489
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   490
            QStringList sl;
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   491
            sl
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   492
                    << tr("Proxy host")
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   493
                    << tr("Proxy port")
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   494
                    << tr("Proxy login")
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   495
                    << tr("Proxy password")
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   496
                       ;
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   497
            for(int i = 0; i < sl.size(); ++i)
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   498
            {
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   499
                QLabel * l = new QLabel(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   500
                l->setText(sl[i]);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   501
                gbLayout->addWidget(l, i + 1, 0);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   502
            }
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   503
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   504
            cbProxyType = new QComboBox(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   505
            cbProxyType->addItems(QStringList()
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   506
                                  << tr("No proxy")
7702
c8906c3a2aeb Allow using system proxy settings
unc0rr
parents: 7701
diff changeset
   507
                                  << tr("System proxy settings")
7700
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   508
                                  << tr("Socks5 proxy")
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   509
                                  << tr("HTTP proxy"));
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   510
            gbLayout->addWidget(cbProxyType, 0, 1);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   511
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   512
            leProxy = new QLineEdit(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   513
            gbLayout->addWidget(leProxy, 1, 1);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   514
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   515
            sbProxyPort = new QSpinBox(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   516
            sbProxyPort->setMaximum(65535);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   517
            gbLayout->addWidget(sbProxyPort, 2, 1);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   518
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   519
            leProxyLogin = new QLineEdit(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   520
            gbLayout->addWidget(leProxyLogin, 3, 1);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   521
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   522
            leProxyPassword = new QLineEdit(gbProxy);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   523
            leProxyPassword->setEchoMode(QLineEdit::Password);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   524
            gbLayout->addWidget(leProxyPassword, 4, 1);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   525
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   526
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   527
            connect(cbProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(onProxyTypeChanged()));
7701
2b9017ffc72f - Small fix
unc0rr
parents: 7700
diff changeset
   528
            onProxyTypeChanged();
7700
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   529
        }
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   530
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   531
        page2Layout->addWidget(new QWidget(this), 2, 0);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   532
    }
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   533
#ifdef VIDEOREC
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   534
    { // page 3
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   535
        QGridLayout * page3Layout = new QGridLayout(page3);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   536
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   537
        IconedGroupBox* pOptionsGroup = new IconedGroupBox(this);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   538
        pOptionsGroup->setIcon(QIcon(":/res/Settings.png")); // FIXME
8192
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   539
        pOptionsGroup->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   540
        pOptionsGroup->setTitle(QGroupBox::tr("Video recording options"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   541
        QGridLayout * pOptLayout = new QGridLayout(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   542
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   543
        // label for format
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   544
        QLabel *labelFormat = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   545
        labelFormat->setText(QLabel::tr("Format"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   546
        pOptLayout->addWidget(labelFormat, 0, 0);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   547
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   548
        // list of supported formats
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   549
        comboAVFormats = new QComboBox(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   550
        pOptLayout->addWidget(comboAVFormats, 0, 1, 1, 4);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   551
        LibavInteraction::instance().fillFormats(comboAVFormats);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   552
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   553
        // separator
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   554
        QFrame * hr = new QFrame(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   555
        hr->setFrameStyle(QFrame::HLine);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   556
        hr->setLineWidth(3);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   557
        hr->setFixedHeight(10);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   558
        pOptLayout->addWidget(hr, 1, 0, 1, 5);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   559
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   560
        // label for audio codec
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   561
        QLabel *labelACodec = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   562
        labelACodec->setText(QLabel::tr("Audio codec"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   563
        pOptLayout->addWidget(labelACodec, 2, 0);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   564
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   565
        // list of supported audio codecs
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   566
        comboAudioCodecs = new QComboBox(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   567
        pOptLayout->addWidget(comboAudioCodecs, 2, 1, 1, 3);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   568
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   569
        // checkbox 'record audio'
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   570
        checkRecordAudio = new QCheckBox(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   571
        checkRecordAudio->setText(QCheckBox::tr("Record audio"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   572
        pOptLayout->addWidget(checkRecordAudio, 2, 4);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   573
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   574
        // separator
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   575
        hr = new QFrame(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   576
        hr->setFrameStyle(QFrame::HLine);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   577
        hr->setLineWidth(3);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   578
        hr->setFixedHeight(10);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   579
        pOptLayout->addWidget(hr, 3, 0, 1, 5);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   580
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   581
        // label for video codec
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   582
        QLabel *labelVCodec = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   583
        labelVCodec->setText(QLabel::tr("Video codec"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   584
        pOptLayout->addWidget(labelVCodec, 4, 0);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   585
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   586
        // list of supported video codecs
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   587
        comboVideoCodecs = new QComboBox(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   588
        pOptLayout->addWidget(comboVideoCodecs, 4, 1, 1, 4);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   589
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   590
        // label for resolution
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   591
        QLabel *labelRes = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   592
        labelRes->setText(QLabel::tr("Resolution"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   593
        pOptLayout->addWidget(labelRes, 5, 0);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   594
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   595
        // width
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   596
        widthEdit = new QLineEdit(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   597
        widthEdit->setValidator(new QIntValidator(this));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   598
        pOptLayout->addWidget(widthEdit, 5, 1);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   599
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   600
        // x
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   601
        QLabel *labelX = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   602
        labelX->setText("X");
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   603
        pOptLayout->addWidget(labelX, 5, 2);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   604
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   605
        // height
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   606
        heightEdit = new QLineEdit(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   607
        heightEdit->setValidator(new QIntValidator(pOptionsGroup));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   608
        pOptLayout->addWidget(heightEdit, 5, 3);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   609
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   610
        // checkbox 'use game resolution'
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   611
        checkUseGameRes = new QCheckBox(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   612
        checkUseGameRes->setText(QCheckBox::tr("Use game resolution"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   613
        pOptLayout->addWidget(checkUseGameRes, 5, 4);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   614
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   615
        // label for framerate
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   616
        QLabel *labelFramerate = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   617
        labelFramerate->setText(QLabel::tr("Framerate"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   618
        pOptLayout->addWidget(labelFramerate, 6, 0);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   619
8192
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   620
        framerateBox = new QComboBox(pOptionsGroup);
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   621
        framerateBox->addItem("24 fps", 24);
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   622
        framerateBox->addItem("25 fps", 25);
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   623
        framerateBox->addItem("30 fps", 30);
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   624
        framerateBox->addItem("50 fps", 50);
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   625
        framerateBox->addItem("60 fps", 60);
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   626
        pOptLayout->addWidget(framerateBox, 6, 1);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   627
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   628
        // label for Bitrate
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   629
        QLabel *labelBitrate = new QLabel(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   630
        labelBitrate->setText(QLabel::tr("Bitrate (Kbps)"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   631
        pOptLayout->addWidget(labelBitrate, 6, 2);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   632
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   633
        // bitrate
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   634
        bitrateBox = new QSpinBox(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   635
        bitrateBox->setRange(100, 5000);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   636
        bitrateBox->setSingleStep(100);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   637
        pOptLayout->addWidget(bitrateBox, 6, 3);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   638
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   639
        // button 'set default options'
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   640
        btnDefaults = new QPushButton(pOptionsGroup);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   641
        btnDefaults->setText(QPushButton::tr("Set default options"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   642
        btnDefaults->setWhatsThis(QPushButton::tr("Restore default coding parameters"));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   643
        pOptLayout->addWidget(btnDefaults, 7, 0, 1, 5);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   644
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   645
        page3Layout->addWidget(pOptionsGroup, 1, 0);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   646
    }
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   647
#endif
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   648
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   649
    previousQuality = this->SLQuality->value();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   650
    previousResolutionIndex = this->CBResolution->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   651
    previousFullscreenValue = this->CBFullscreen->isChecked();
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   652
    // mutually exclude window and fullscreen resolution
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   653
    CBResolution->setEnabled(this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   654
    windowHeightEdit->setEnabled(!this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   655
    windowWidthEdit->setEnabled(!this->CBFullscreen->isChecked());
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   656
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   657
    return pageLayout;
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   658
}
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   659
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   660
QLayout * PageOptions::footerLayoutDefinition()
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   661
{
6525
6c97379c584b [GCI] backz task: unify the back button functionality, avoid using the save button
m4tx
parents: 6218
diff changeset
   662
    return NULL;
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   663
}
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   664
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   665
void PageOptions::connectSignals()
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   666
{
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   667
#ifdef VIDEOREC
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   668
    connect(checkUseGameRes, SIGNAL(stateChanged(int)), this, SLOT(changeUseGameRes(int)));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   669
    connect(checkRecordAudio, SIGNAL(stateChanged(int)), this, SLOT(changeRecordAudio(int)));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   670
    connect(comboAVFormats, SIGNAL(currentIndexChanged(int)), this, SLOT(changeAVFormat(int)));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   671
    connect(btnDefaults, SIGNAL(clicked()), this, SLOT(setDefaultOptions()));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   672
#endif
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   673
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   674
    connect(SLQuality, SIGNAL(valueChanged(int)), this, SLOT(setQuality(int)));
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   675
    connect(CBResolution, SIGNAL(currentIndexChanged(int)), this, SLOT(setResolution(int)));
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   676
    connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(int)));
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   677
    connect(CBStereoMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceFullscreen(int)));
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   678
    connect(editNetNick, SIGNAL(editingFinished()), this, SLOT(trimNetNick()));
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   679
    connect(CBSavePassword, SIGNAL(stateChanged(int)), this, SLOT(savePwdChanged(int)));
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   680
}
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   681
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   682
PageOptions::PageOptions(QWidget* parent) : AbstractPage(parent), config(0)
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   683
{
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6024
diff changeset
   684
    initPage();
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   685
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   686
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   687
void PageOptions::forceFullscreen(int index)
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   688
{
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   689
    bool forced = (index == 7 || index == 8 || index == 9);
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   690
    CBResolution->setEnabled(this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   691
    windowHeightEdit->setEnabled(!this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   692
    windowWidthEdit->setEnabled(!this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   693
    
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   694
    if (index != 0)
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   695
    {
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   696
        this->SLQuality->setValue(this->SLQuality->maximum());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   697
        this->SLQuality->setEnabled(false);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   698
        this->CBFullscreen->setEnabled(!forced);
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   699
        this->CBFullscreen->setChecked(forced ? true : previousFullscreenValue);
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   700
        this->CBResolution->setCurrentIndex(forced ? 0 : previousResolutionIndex);
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   701
    }
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   702
    else
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6575
diff changeset
   703
    {
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   704
        this->SLQuality->setEnabled(true);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   705
        this->CBFullscreen->setEnabled(true);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   706
        this->SLQuality->setValue(previousQuality);
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   707
        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
   708
        this->CBResolution->setCurrentIndex(previousResolutionIndex);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   709
    }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   710
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   711
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   712
void PageOptions::setQuality(int value)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   713
{
6218
999215ca87d7 actually the those if(...); weren't supposed to be if statements in the first place, since the result is always true at that point of code anyway.
sheepluva
parents: 6217
diff changeset
   714
    Q_UNUSED(value);
6217
ef53ba841791 - Remove some old unused code
unc0rr
parents: 6060
diff changeset
   715
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   716
    int index = this->CBStereoMode->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   717
    if (index == 0)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   718
        previousQuality = this->SLQuality->value();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   719
}
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   720
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   721
void PageOptions::setFullscreen(int state)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   722
{
6218
999215ca87d7 actually the those if(...); weren't supposed to be if statements in the first place, since the result is always true at that point of code anyway.
sheepluva
parents: 6217
diff changeset
   723
    Q_UNUSED(state);
8343
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   724
    CBResolution->setEnabled(this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   725
    windowHeightEdit->setEnabled(!this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   726
    windowWidthEdit->setEnabled(!this->CBFullscreen->isChecked());
aa4ea3cade3c Added Support for variable windowed resolution.
vitiv <nikita.utiu@gmail.com>
parents: 8284
diff changeset
   727
    
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   728
    int index = this->CBStereoMode->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   729
    if (index != 7 && index != 8 && index != 9)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   730
        previousFullscreenValue = this->CBFullscreen->isChecked();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   731
}
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   732
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   733
void PageOptions::setResolution(int state)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   734
{
6218
999215ca87d7 actually the those if(...); weren't supposed to be if statements in the first place, since the result is always true at that point of code anyway.
sheepluva
parents: 6217
diff changeset
   735
    Q_UNUSED(state);
6217
ef53ba841791 - Remove some old unused code
unc0rr
parents: 6060
diff changeset
   736
5878
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   737
    int index = this->CBStereoMode->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   738
    if (index != 7 && index != 8 && index != 9)
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   739
        previousResolutionIndex = this->CBResolution->currentIndex();
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   740
}
404ca990793a I.Fight.For.The.Users
koda
parents: 5877
diff changeset
   741
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   742
void PageOptions::trimNetNick()
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   743
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   744
    editNetNick->setText(editNetNick->text().trimmed());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   745
}
6024
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   746
6911
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   747
void PageOptions::savePwdChanged(int state) {
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   748
    if (state == 0) {
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   749
        editNetPassword->setEnabled(false);
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   750
        editNetPassword->setText("");
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   751
    } else
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   752
        editNetPassword->setEnabled(true);
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   753
}
1cda333286e0 added savepassword checkbox to options page, which now reloads values at every acces
koda
parents: 6700
diff changeset
   754
6024
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   755
void PageOptions::requestEditSelectedTeam()
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   756
{
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   757
    emit editTeamRequested(CBTeamName->currentText());
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   758
}
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   759
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   760
void PageOptions::requestDeleteSelectedTeam()
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   761
{
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   762
    emit deleteTeamRequested(CBTeamName->currentText());
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   763
}
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   764
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   765
void PageOptions::setTeamOptionsEnabled(bool enabled)
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   766
{
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   767
    BtnNewTeam->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   768
    BtnEditTeam->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   769
    BtnDeleteTeam->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   770
    CBTeamName->setVisible(enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   771
    LblNoEditTeam->setVisible(!enabled);
d38da7c19e43 some more cleanups and refactoring.
sheepluva
parents: 6009
diff changeset
   772
}
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   773
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   774
void PageOptions::colorButtonClicked(int i)
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   775
{
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   776
    if(i < 0 || i >= m_colorButtons.size())
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   777
        return;
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   778
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   779
    QPalette p = m_colorButtons[i]->palette();
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   780
    QColor c = QColorDialog::getColor(p.color(QPalette::Button));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   781
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   782
    if(c.isValid())
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   783
    {
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   784
        DataManager::instance().colorsModel()->item(i)->setData(c);
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   785
        m_colorButtons[i]->setStyleSheet(QString("background: %1").arg(c.name()));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   786
    }
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   787
}
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   788
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   789
void PageOptions::onColorModelDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight)
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   790
{
7630
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   791
    Q_UNUSED(bottomRight);
13fa53bb3134 Move some options to the second page so first page doesn't look ugly on low resolution
unc0rr
parents: 7541
diff changeset
   792
7541
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   793
    QStandardItemModel * model = DataManager::instance().colorsModel();
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   794
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   795
    m_colorButtons[topLeft.row()]->setStyleSheet(QString("background: %1").arg(model->item(topLeft.row())->data().value<QColor>().name()));
e51b11349637 Allow customization of colors in ui, store custom colors in config
unc0rr
parents: 7153
diff changeset
   796
}
7700
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   797
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   798
void PageOptions::onProxyTypeChanged()
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   799
{
7703
78d2ac987f41 Make sheepluva happy
unc0rr
parents: 7702
diff changeset
   800
    bool b = cbProxyType->currentIndex() != NoProxy && cbProxyType->currentIndex() != SystemProxy ;
7700
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   801
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   802
    sbProxyPort->setEnabled(b);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   803
    leProxy->setEnabled(b);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   804
    leProxyLogin->setEnabled(b);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   805
    leProxyPassword->setEnabled(b);
fc44e4e33d1c Support for proxies (not tested)
unc0rr
parents: 7681
diff changeset
   806
}
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   807
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   808
// Video Recording
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   809
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   810
void PageOptions::setConfig(GameUIConfig * config)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   811
{
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   812
    this->config = config;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   813
}
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   814
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   815
// user changed file format, we need to update list of codecs
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   816
void PageOptions::changeAVFormat(int index)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   817
{
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   818
    // remember selected codecs
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   819
    QString prevVCodec = videoCodec();
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   820
    QString prevACodec = audioCodec();
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   821
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   822
    // clear lists of codecs
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   823
    comboVideoCodecs->clear();
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   824
    comboAudioCodecs->clear();
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   825
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   826
    // get list of codecs for specified format
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   827
    LibavInteraction::instance().fillCodecs(comboAVFormats->itemData(index).toString(), comboVideoCodecs, comboAudioCodecs);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   828
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   829
    // disable audio if there is no audio codec
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   830
    if (comboAudioCodecs->count() == 0)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   831
    {
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   832
        checkRecordAudio->setChecked(false);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   833
        checkRecordAudio->setEnabled(false);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   834
    }
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   835
    else
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   836
        checkRecordAudio->setEnabled(true);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   837
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   838
    // restore selected codecs if possible
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   839
    int iVCodec = comboVideoCodecs->findData(prevVCodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   840
    if (iVCodec != -1)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   841
        comboVideoCodecs->setCurrentIndex(iVCodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   842
    int iACodec = comboAudioCodecs->findData(prevACodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   843
    if (iACodec != -1)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   844
        comboAudioCodecs->setCurrentIndex(iACodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   845
}
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   846
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   847
// user switched checkbox 'use game resolution'
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   848
void PageOptions::changeUseGameRes(int state)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   849
{
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   850
    if (state && config)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   851
    {
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   852
        // set resolution to game resolution
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   853
        QRect resolution = config->vid_Resolution();
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   854
        widthEdit->setText(QString::number(resolution.width()));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   855
        heightEdit->setText(QString::number(resolution.height()));
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   856
    }
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   857
    widthEdit->setEnabled(!state);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   858
    heightEdit->setEnabled(!state);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   859
}
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   860
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   861
// user switched checkbox 'record audio'
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   862
void PageOptions::changeRecordAudio(int state)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   863
{
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   864
    comboAudioCodecs->setEnabled(!!state);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   865
}
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   866
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   867
void PageOptions::setDefaultCodecs()
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   868
{
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   869
    // VLC should be able to handle any of these configurations
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   870
    // Quicktime X only opens the first one
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   871
    // Windows Media Player TODO
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   872
    if (tryCodecs("mp4", "libx264", "aac"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   873
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   874
    if (tryCodecs("mp4", "libx264", "libfaac"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   875
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   876
    if (tryCodecs("mp4", "libx264", "libmp3lame"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   877
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   878
    if (tryCodecs("mp4", "libx264", "mp2"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   879
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   880
    if (tryCodecs("avi", "libxvid", "libmp3lame"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   881
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   882
    if (tryCodecs("avi", "libxvid", "ac3_fixed"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   883
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   884
    if (tryCodecs("avi", "libxvid", "mp2"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   885
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   886
    if (tryCodecs("avi", "mpeg4", "libmp3lame"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   887
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   888
    if (tryCodecs("avi", "mpeg4", "ac3_fixed"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   889
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   890
    if (tryCodecs("avi", "mpeg4", "mp2"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   891
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   892
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   893
    // this shouldn't happen, just in case
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   894
    if (tryCodecs("ogg", "libtheora", "libvorbis"))
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   895
        return;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   896
    tryCodecs("ogg", "libtheora", "flac");
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   897
}
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   898
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   899
void PageOptions::setDefaultOptions()
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   900
{
8192
81da6576b0c3 Make video recording options have fixed size and merge with spinbox->combobox change.
Mitchell Kember <mk12360@gmail.com>
parents: 8151
diff changeset
   901
    framerateBox->setCurrentIndex(2);
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   902
    bitrateBox->setValue(1000);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   903
    checkRecordAudio->setChecked(true);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   904
    checkUseGameRes->setChecked(true);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   905
    setDefaultCodecs();
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   906
}
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   907
8284
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   908
void PageOptions::checkForUpdates()
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   909
{
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   910
    AutoUpdater *updater = NULL;
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   911
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   912
#ifdef __APPLE__
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   913
#ifdef SPARKLE_ENABLED
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   914
    updater = new SparkleAutoUpdater();
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   915
#endif
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   916
#endif
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   917
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   918
    if (updater)
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   919
    {
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   920
        updater->checkForUpdatesNow();
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   921
        delete updater;
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   922
    }
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   923
}
a874d00df4a4 GCI2012: Autoupdate Button in Settings
Drew Gottlieb
parents: 8229
diff changeset
   924
8151
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   925
bool PageOptions::tryCodecs(const QString & format, const QString & vcodec, const QString & acodec)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   926
{
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   927
    // first we should change format
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   928
    int iFormat = comboAVFormats->findData(format);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   929
    if (iFormat == -1)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   930
        return false;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   931
    comboAVFormats->setCurrentIndex(iFormat);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   932
    // format was changed, so lists of codecs were automatically updated to codecs supported by this format
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   933
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   934
    // try to find video codec
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   935
    int iVCodec = comboVideoCodecs->findData(vcodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   936
    if (iVCodec == -1)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   937
        return false;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   938
    comboVideoCodecs->setCurrentIndex(iVCodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   939
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   940
    // try to find audio codec
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   941
    int iACodec = comboAudioCodecs->findData(acodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   942
    if (iACodec == -1 && checkRecordAudio->isChecked())
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   943
        return false;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   944
    if (iACodec != -1)
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   945
        comboAudioCodecs->setCurrentIndex(iACodec);
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   946
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   947
    return true;
25b95d6224fc Google Code-in: Move video preferences in settings tab
Mitchell Kember <mk12360@gmail.com>
parents: 8098
diff changeset
   948
}