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