1 /* |
|
2 * Hedgewars, a free turn based strategy game |
|
3 * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
4 * |
|
5 * This program is free software; you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License as published by |
|
7 * the Free Software Foundation; version 2 of the License |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU General Public License |
|
15 * along with this program; if not, write to the Free Software |
|
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 */ |
|
18 |
|
19 #include <QGridLayout> |
|
20 #include <QPushButton> |
|
21 #include <QGroupBox> |
|
22 #include <QComboBox> |
|
23 #include <QCheckBox> |
|
24 #include <QLabel> |
|
25 #include <QLineEdit> |
|
26 #include <QSpinBox> |
|
27 #include <QTextBrowser> |
|
28 #include <QTableWidget> |
|
29 #include <QSlider> |
|
30 |
|
31 #include "pageoptions.h" |
|
32 #include "hwconsts.h" |
|
33 #include "fpsedit.h" |
|
34 #include "igbox.h" |
|
35 |
|
36 PageOptions::PageOptions(QWidget* parent) : |
|
37 AbstractPage(parent) |
|
38 { |
|
39 QGridLayout * pageLayout = new QGridLayout(this); |
|
40 pageLayout->setColumnStretch(0, 100); |
|
41 pageLayout->setColumnStretch(1, 100); |
|
42 pageLayout->setColumnStretch(2, 100); |
|
43 pageLayout->setRowStretch(0, 0); |
|
44 //pageLayout->setRowStretch(1, 100); |
|
45 pageLayout->setRowStretch(2, 0); |
|
46 pageLayout->setContentsMargins(7, 7, 7, 0); |
|
47 pageLayout->setSpacing(0); |
|
48 |
|
49 |
|
50 QGroupBox * gbTwoBoxes = new QGroupBox(this); |
|
51 pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3); |
|
52 QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes); |
|
53 gbTBLayout->setMargin(0); |
|
54 gbTBLayout->setSpacing(0); |
|
55 gbTBLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); |
|
56 |
|
57 QPixmap pmNew(":/res/new.png"); |
|
58 QPixmap pmEdit(":/res/edit.png"); |
|
59 QPixmap pmDelete(":/res/delete.png"); |
|
60 |
|
61 { |
|
62 teamsBox = new IconedGroupBox(this); |
|
63 //teamsBox->setContentTopPadding(0); |
|
64 //teamsBox->setAttribute(Qt::WA_PaintOnScreen, true); |
|
65 teamsBox->setIcon(QIcon(":/res/teamicon.png")); |
|
66 teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
67 teamsBox->setTitle(QGroupBox::tr("Teams")); |
|
68 |
|
69 QGridLayout * GBTlayout = new QGridLayout(teamsBox); |
|
70 |
|
71 CBTeamName = new QComboBox(teamsBox); |
|
72 GBTlayout->addWidget(CBTeamName, 0, 0); |
|
73 |
|
74 BtnNewTeam = new QPushButton(teamsBox); |
|
75 BtnNewTeam->setToolTip(tr("New team")); |
|
76 BtnNewTeam->setIconSize(pmNew.size()); |
|
77 BtnNewTeam->setIcon(pmNew); |
|
78 BtnNewTeam->setMaximumWidth(pmNew.width() + 6); |
|
79 GBTlayout->addWidget(BtnNewTeam, 0, 1); |
|
80 |
|
81 BtnEditTeam = new QPushButton(teamsBox); |
|
82 BtnEditTeam->setToolTip(tr("Edit team")); |
|
83 BtnEditTeam->setIconSize(pmEdit.size()); |
|
84 BtnEditTeam->setIcon(pmEdit); |
|
85 BtnEditTeam->setMaximumWidth(pmEdit.width() + 6); |
|
86 GBTlayout->addWidget(BtnEditTeam, 0, 2); |
|
87 |
|
88 BtnDeleteTeam = new QPushButton(teamsBox); |
|
89 BtnDeleteTeam->setToolTip(tr("Delete team")); |
|
90 BtnDeleteTeam->setIconSize(pmDelete.size()); |
|
91 BtnDeleteTeam->setIcon(pmDelete); |
|
92 BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6); |
|
93 GBTlayout->addWidget(BtnDeleteTeam, 0, 3); |
|
94 |
|
95 LblNoEditTeam = new QLabel(teamsBox); |
|
96 LblNoEditTeam->setText(tr("You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.")); |
|
97 LblNoEditTeam->setWordWrap(true); |
|
98 LblNoEditTeam->setVisible(false); |
|
99 GBTlayout->addWidget(LblNoEditTeam, 0, 0); |
|
100 |
|
101 gbTBLayout->addWidget(teamsBox, 0, 0); |
|
102 } |
|
103 |
|
104 { |
|
105 IconedGroupBox* groupWeapons = new IconedGroupBox(this); |
|
106 |
|
107 //groupWeapons->setContentTopPadding(0); |
|
108 //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
109 groupWeapons->setIcon(QIcon(":/res/weaponsicon.png")); |
|
110 groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
111 groupWeapons->setTitle(QGroupBox::tr("Schemes and Weapons")); |
|
112 QGridLayout * WeaponsLayout = new QGridLayout(groupWeapons); |
|
113 |
|
114 QLabel* SchemeLabel = new QLabel(groupWeapons); |
|
115 SchemeLabel->setText(QLabel::tr("Game scheme")); |
|
116 WeaponsLayout->addWidget(SchemeLabel, 1, 0); |
|
117 |
|
118 SchemesName = new QComboBox(groupWeapons); |
|
119 WeaponsLayout->addWidget(SchemesName, 1, 1); |
|
120 |
|
121 SchemeNew = new QPushButton(groupWeapons); |
|
122 SchemeNew->setToolTip(tr("New scheme")); |
|
123 SchemeNew->setIconSize(pmNew.size()); |
|
124 SchemeNew->setIcon(pmNew); |
|
125 SchemeNew->setMaximumWidth(pmNew.width() + 6); |
|
126 WeaponsLayout->addWidget(SchemeNew, 1, 2); |
|
127 |
|
128 SchemeEdit = new QPushButton(groupWeapons); |
|
129 SchemeEdit->setToolTip(tr("Edit scheme")); |
|
130 SchemeEdit->setIconSize(pmEdit.size()); |
|
131 SchemeEdit->setIcon(pmEdit); |
|
132 SchemeEdit->setMaximumWidth(pmEdit.width() + 6); |
|
133 WeaponsLayout->addWidget(SchemeEdit, 1, 3); |
|
134 |
|
135 SchemeDelete = new QPushButton(groupWeapons); |
|
136 SchemeDelete->setToolTip(tr("Delete scheme")); |
|
137 SchemeDelete->setIconSize(pmDelete.size()); |
|
138 SchemeDelete->setIcon(pmDelete); |
|
139 SchemeDelete->setMaximumWidth(pmDelete.width() + 6); |
|
140 WeaponsLayout->addWidget(SchemeDelete, 1, 4); |
|
141 |
|
142 QLabel* WeaponLabel = new QLabel(groupWeapons); |
|
143 WeaponLabel->setText(QLabel::tr("Weapons")); |
|
144 WeaponsLayout->addWidget(WeaponLabel, 2, 0); |
|
145 |
|
146 WeaponsName = new QComboBox(groupWeapons); |
|
147 WeaponsLayout->addWidget(WeaponsName, 2, 1); |
|
148 |
|
149 WeaponNew = new QPushButton(groupWeapons); |
|
150 WeaponNew->setToolTip(tr("New weapon set")); |
|
151 WeaponNew->setIconSize(pmNew.size()); |
|
152 WeaponNew->setIcon(pmNew); |
|
153 WeaponNew->setMaximumWidth(pmNew.width() + 6); |
|
154 WeaponsLayout->addWidget(WeaponNew, 2, 2); |
|
155 |
|
156 WeaponEdit = new QPushButton(groupWeapons); |
|
157 WeaponEdit->setToolTip(tr("Edit weapon set")); |
|
158 WeaponEdit->setIconSize(pmEdit.size()); |
|
159 WeaponEdit->setIcon(pmEdit); |
|
160 WeaponEdit->setMaximumWidth(pmEdit.width() + 6); |
|
161 WeaponsLayout->addWidget(WeaponEdit, 2, 3); |
|
162 |
|
163 WeaponDelete = new QPushButton(groupWeapons); |
|
164 WeaponDelete->setToolTip(tr("Delete weapon set")); |
|
165 WeaponDelete->setIconSize(pmDelete.size()); |
|
166 WeaponDelete->setIcon(pmDelete); |
|
167 WeaponDelete->setMaximumWidth(pmDelete.width() + 6); |
|
168 WeaponsLayout->addWidget(WeaponDelete, 2, 4); |
|
169 |
|
170 WeaponTooltip = new QCheckBox(this); |
|
171 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
|
172 WeaponsLayout->addWidget(WeaponTooltip, 3, 0, 1, 4); |
|
173 |
|
174 gbTBLayout->addWidget(groupWeapons, 1, 0); |
|
175 } |
|
176 |
|
177 { |
|
178 IconedGroupBox* groupMisc = new IconedGroupBox(this); |
|
179 //groupMisc->setContentTopPadding(0); |
|
180 groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
181 groupMisc->setIcon(QIcon(":/res/miscicon.png")); |
|
182 //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
183 groupMisc->setTitle(QGroupBox::tr("Misc")); |
|
184 QGridLayout * MiscLayout = new QGridLayout(groupMisc); |
|
185 |
|
186 labelNN = new QLabel(groupMisc); |
|
187 labelNN->setText(QLabel::tr("Net nick")); |
|
188 MiscLayout->addWidget(labelNN, 0, 0); |
|
189 |
|
190 editNetNick = new QLineEdit(groupMisc); |
|
191 editNetNick->setMaxLength(20); |
|
192 editNetNick->setText(QLineEdit::tr("unnamed")); |
|
193 connect(editNetNick, SIGNAL(editingFinished()), this, SLOT(trimNetNick())); |
|
194 MiscLayout->addWidget(editNetNick, 0, 1); |
|
195 |
|
196 labelNetPassword = new QLabel(groupMisc); |
|
197 labelNetPassword->setText(QLabel::tr("Password")); |
|
198 MiscLayout->addWidget(labelNetPassword, 1, 0); |
|
199 |
|
200 editNetPassword = new QLineEdit(groupMisc); |
|
201 editNetPassword->setEchoMode(QLineEdit::Password); |
|
202 MiscLayout->addWidget(editNetPassword, 1, 1); |
|
203 |
|
204 QLabel *labelLanguage = new QLabel(groupMisc); |
|
205 labelLanguage->setText(QLabel::tr("Locale") + " *"); |
|
206 MiscLayout->addWidget(labelLanguage, 2, 0); |
|
207 |
|
208 CBLanguage = new QComboBox(groupMisc); |
|
209 QDir tmpdir; |
|
210 tmpdir.cd(cfgdir->absolutePath()); |
|
211 tmpdir.cd("Data/Locale"); |
|
212 tmpdir.setFilter(QDir::Files); |
|
213 QStringList locs = tmpdir.entryList(QStringList("hedgewars_*.qm")); |
|
214 CBLanguage->addItem(QComboBox::tr("(System default)"), QString("")); |
|
215 for(int i = 0; i < locs.count(); i++) |
|
216 { |
|
217 QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1")); |
|
218 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name()); |
|
219 } |
|
220 |
|
221 tmpdir.cd(datadir->absolutePath()); |
|
222 tmpdir.cd("Locale"); |
|
223 tmpdir.setFilter(QDir::Files); |
|
224 QStringList tmplist = tmpdir.entryList(QStringList("hedgewars_*.qm")); |
|
225 for(int i = 0; i < tmplist.count(); i++) |
|
226 { |
|
227 if (locs.contains(tmplist[i])) continue; |
|
228 QLocale loc(tmplist[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1")); |
|
229 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name()); |
|
230 } |
|
231 |
|
232 MiscLayout->addWidget(CBLanguage, 2, 1); |
|
233 |
|
234 CBAltDamage = new QCheckBox(groupMisc); |
|
235 CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
|
236 MiscLayout->addWidget(CBAltDamage, 3, 0, 1, 2); |
|
237 |
|
238 CBNameWithDate = new QCheckBox(groupMisc); |
|
239 CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); |
|
240 MiscLayout->addWidget(CBNameWithDate, 4, 0, 1, 2); |
|
241 |
|
242 BtnAssociateFiles = new QPushButton(groupMisc); |
|
243 BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions")); |
|
244 BtnAssociateFiles->setEnabled(!custom_data && !custom_config); |
|
245 MiscLayout->addWidget(BtnAssociateFiles, 5, 0, 1, 2); |
|
246 |
|
247 #ifdef __APPLE__ |
|
248 #ifdef SPARKLE_ENABLED |
|
249 CBAutoUpdate = new QCheckBox(groupMisc); |
|
250 CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup")); |
|
251 MiscLayout->addWidget(CBAutoUpdate, 6, 0, 1, 3); |
|
252 #endif |
|
253 #endif |
|
254 gbTBLayout->addWidget(groupMisc, 2, 0); |
|
255 } |
|
256 |
|
257 { |
|
258 AGGroupBox = new IconedGroupBox(this); |
|
259 //AGGroupBox->setContentTopPadding(0); |
|
260 AGGroupBox->setIcon(QIcon(":/res/graphicsicon.png")); |
|
261 //AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
262 AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options")); |
|
263 |
|
264 QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox); |
|
265 QHBoxLayout * GBAreslayout = new QHBoxLayout(0); |
|
266 QHBoxLayout * GBAstereolayout = new QHBoxLayout(0); |
|
267 QHBoxLayout * GBAqualayout = new QHBoxLayout(0); |
|
268 |
|
269 CBFrontendFullscreen = new QCheckBox(AGGroupBox); |
|
270 CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen")); |
|
271 GBAlayout->addWidget(CBFrontendFullscreen); |
|
272 |
|
273 CBFrontendEffects = new QCheckBox(AGGroupBox); |
|
274 CBFrontendEffects->setText(QCheckBox::tr("Frontend effects") + " *"); |
|
275 GBAlayout->addWidget(CBFrontendEffects); |
|
276 |
|
277 CBEnableFrontendSound = new QCheckBox(AGGroupBox); |
|
278 CBEnableFrontendSound->setText(QCheckBox::tr("Enable frontend sounds")); |
|
279 GBAlayout->addWidget(CBEnableFrontendSound); |
|
280 |
|
281 CBEnableFrontendMusic = new QCheckBox(AGGroupBox); |
|
282 CBEnableFrontendMusic->setText(QCheckBox::tr("Enable frontend music")); |
|
283 GBAlayout->addWidget(CBEnableFrontendMusic); |
|
284 |
|
285 QFrame * hr = new QFrame(AGGroupBox); |
|
286 hr->setFrameStyle(QFrame::HLine); |
|
287 hr->setLineWidth(3); |
|
288 hr->setFixedHeight(10); |
|
289 GBAlayout->addWidget(hr); |
|
290 |
|
291 QLabel * resolution = new QLabel(AGGroupBox); |
|
292 resolution->setText(QLabel::tr("Resolution")); |
|
293 GBAreslayout->addWidget(resolution); |
|
294 |
|
295 CBResolution = new QComboBox(AGGroupBox); |
|
296 GBAreslayout->addWidget(CBResolution); |
|
297 GBAlayout->addLayout(GBAreslayout); |
|
298 |
|
299 CBFullscreen = new QCheckBox(AGGroupBox); |
|
300 CBFullscreen->setText(QCheckBox::tr("Fullscreen")); |
|
301 GBAlayout->addWidget(CBFullscreen); |
|
302 connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(void))); |
|
303 |
|
304 QLabel * quality = new QLabel(AGGroupBox); |
|
305 quality->setText(QLabel::tr("Quality")); |
|
306 quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
307 GBAqualayout->addWidget(quality); |
|
308 |
|
309 SLQuality = new QSlider(Qt::Horizontal, AGGroupBox); |
|
310 SLQuality->setTickPosition(QSlider::TicksBelow); |
|
311 SLQuality->setMaximum(5); |
|
312 SLQuality->setMinimum(0); |
|
313 SLQuality->setFixedWidth(150); |
|
314 GBAqualayout->addWidget(SLQuality); |
|
315 GBAlayout->addLayout(GBAqualayout); |
|
316 QLabel * stereo = new QLabel(AGGroupBox); |
|
317 stereo->setText(QLabel::tr("Stereo rendering")); |
|
318 GBAstereolayout->addWidget(stereo); |
|
319 |
|
320 CBStereoMode = new QComboBox(AGGroupBox); |
|
321 CBStereoMode->addItem(QComboBox::tr("Disabled")); |
|
322 CBStereoMode->addItem(QComboBox::tr("Red/Cyan")); |
|
323 CBStereoMode->addItem(QComboBox::tr("Cyan/Red")); |
|
324 CBStereoMode->addItem(QComboBox::tr("Red/Blue")); |
|
325 CBStereoMode->addItem(QComboBox::tr("Blue/Red")); |
|
326 CBStereoMode->addItem(QComboBox::tr("Red/Green")); |
|
327 CBStereoMode->addItem(QComboBox::tr("Green/Red")); |
|
328 CBStereoMode->addItem(QComboBox::tr("Side-by-side")); |
|
329 CBStereoMode->addItem(QComboBox::tr("Top-Bottom")); |
|
330 CBStereoMode->addItem(QComboBox::tr("Wiggle")); |
|
331 CBStereoMode->addItem(QComboBox::tr("Red/Cyan grayscale")); |
|
332 CBStereoMode->addItem(QComboBox::tr("Cyan/Red grayscale")); |
|
333 CBStereoMode->addItem(QComboBox::tr("Red/Blue grayscale")); |
|
334 CBStereoMode->addItem(QComboBox::tr("Blue/Red grayscale")); |
|
335 CBStereoMode->addItem(QComboBox::tr("Red/Green grayscale")); |
|
336 CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale")); |
|
337 connect(CBStereoMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceFullscreen(int))); |
|
338 |
|
339 GBAstereolayout->addWidget(CBStereoMode); |
|
340 GBAlayout->addLayout(GBAstereolayout); |
|
341 |
|
342 hr = new QFrame(AGGroupBox); |
|
343 hr->setFrameStyle(QFrame::HLine); |
|
344 hr->setLineWidth(3); |
|
345 hr->setFixedHeight(10); |
|
346 GBAlayout->addWidget(hr); |
|
347 |
|
348 QHBoxLayout * GBAvollayout = new QHBoxLayout(0); |
|
349 QLabel * vol = new QLabel(AGGroupBox); |
|
350 vol->setText(QLabel::tr("Initial sound volume")); |
|
351 GBAvollayout->addWidget(vol); |
|
352 GBAlayout->addLayout(GBAvollayout); |
|
353 volumeBox = new QSpinBox(AGGroupBox); |
|
354 volumeBox->setRange(0, 100); |
|
355 volumeBox->setSingleStep(5); |
|
356 GBAvollayout->addWidget(volumeBox); |
|
357 |
|
358 CBEnableSound = new QCheckBox(AGGroupBox); |
|
359 CBEnableSound->setText(QCheckBox::tr("Enable sound")); |
|
360 GBAlayout->addWidget(CBEnableSound); |
|
361 |
|
362 CBEnableMusic = new QCheckBox(AGGroupBox); |
|
363 CBEnableMusic->setText(QCheckBox::tr("Enable music")); |
|
364 GBAlayout->addWidget(CBEnableMusic); |
|
365 |
|
366 hr = new QFrame(AGGroupBox); |
|
367 hr->setFrameStyle(QFrame::HLine); |
|
368 hr->setLineWidth(3); |
|
369 hr->setFixedHeight(10); |
|
370 GBAlayout->addWidget(hr); |
|
371 |
|
372 QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
|
373 QLabel * maxfps = new QLabel(AGGroupBox); |
|
374 maxfps->setText(QLabel::tr("FPS limit")); |
|
375 GBAfpslayout->addWidget(maxfps); |
|
376 GBAlayout->addLayout(GBAfpslayout); |
|
377 fpsedit = new FPSEdit(AGGroupBox); |
|
378 GBAfpslayout->addWidget(fpsedit); |
|
379 |
|
380 CBShowFPS = new QCheckBox(AGGroupBox); |
|
381 CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
382 GBAlayout->addWidget(CBShowFPS); |
|
383 |
|
384 hr = new QFrame(AGGroupBox); |
|
385 hr->setFrameStyle(QFrame::HLine); |
|
386 hr->setLineWidth(3); |
|
387 hr->setFixedHeight(10); |
|
388 GBAlayout->addWidget(hr); |
|
389 |
|
390 QLabel *restartNote = new QLabel(this); |
|
391 restartNote->setText(QString("* ") + QLabel::tr("Restart game to apply")); |
|
392 restartNote->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); |
|
393 GBAlayout->addWidget(restartNote); |
|
394 |
|
395 gbTBLayout->addWidget(AGGroupBox, 0, 1, 3, 1); |
|
396 } |
|
397 |
|
398 BtnSaveOptions = addButton(":/res/Save.png", pageLayout, 2, 2, true); |
|
399 BtnSaveOptions->setStyleSheet("QPushButton{margin: 12px 0px 12px 0px;}"); |
|
400 |
|
401 BtnBack = addButton(":/res/Exit.png", pageLayout, 2, 0, true); |
|
402 BtnBack->setFixedHeight(BtnSaveOptions->height()); |
|
403 BtnBack->setFixedWidth(BtnBack->width()+2); |
|
404 BtnBack->setStyleSheet("QPushButton{margin: 22px 0 9px 2px;}"); |
|
405 } |
|
406 |
|
407 void PageOptions::forceFullscreen(int index) |
|
408 { |
|
409 if (index != 0) { |
|
410 previousFullscreenValue = this->CBFullscreen->isChecked(); |
|
411 this->CBFullscreen->setChecked(true); |
|
412 this->CBFullscreen->setEnabled(false); |
|
413 previousQuality = this->SLQuality->value(); |
|
414 this->SLQuality->setValue(this->SLQuality->maximum()); |
|
415 this->SLQuality->setEnabled(false); |
|
416 } else { |
|
417 this->CBFullscreen->setChecked(previousFullscreenValue); |
|
418 this->CBFullscreen->setEnabled(true); |
|
419 this->SLQuality->setValue(previousQuality); |
|
420 this->SLQuality->setEnabled(true); |
|
421 } |
|
422 } |
|
423 |
|
424 void PageOptions::setFullscreen(void) |
|
425 { |
|
426 int tmp = this->CBResolution->currentIndex(); |
|
427 if (this->CBFullscreen->isChecked()) |
|
428 this->CBResolution->setCurrentIndex(0); |
|
429 else |
|
430 this->CBResolution->setCurrentIndex(previousResolutionIndex); |
|
431 previousResolutionIndex = tmp; |
|
432 } |
|
433 |
|
434 void PageOptions::trimNetNick() |
|
435 { |
|
436 editNetNick->setText(editNetNick->text().trimmed()); |
|
437 } |
|