170 WeaponDelete->setIconSize(pmDelete.size()); |
170 WeaponDelete->setIconSize(pmDelete.size()); |
171 WeaponDelete->setIcon(pmDelete); |
171 WeaponDelete->setIcon(pmDelete); |
172 WeaponDelete->setMaximumWidth(pmDelete.width() + 6); |
172 WeaponDelete->setMaximumWidth(pmDelete.width() + 6); |
173 WeaponsLayout->addWidget(WeaponDelete, 2, 4); |
173 WeaponsLayout->addWidget(WeaponDelete, 2, 4); |
174 |
174 |
175 WeaponTooltip = new QCheckBox(this); |
|
176 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
|
177 WeaponsLayout->addWidget(WeaponTooltip, 3, 0, 1, 4); |
|
178 |
|
179 page1Layout->addWidget(groupWeapons, 1, 0); |
175 page1Layout->addWidget(groupWeapons, 1, 0); |
180 } |
176 } |
181 |
177 |
182 { |
178 { |
183 IconedGroupBox* groupMisc = new IconedGroupBox(this); |
179 IconedGroupBox* groupMisc = new IconedGroupBox(this); |
184 //groupMisc->setContentTopPadding(0); |
180 //groupMisc->setContentTopPadding(0); |
185 groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding); |
181 //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding); |
186 groupMisc->setIcon(QIcon(":/res/miscicon.png")); |
182 groupMisc->setIcon(QIcon(":/res/miscicon.png")); |
187 //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
183 //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
188 groupMisc->setTitle(QGroupBox::tr("Misc")); |
184 groupMisc->setTitle(QGroupBox::tr("Misc")); |
189 QGridLayout * MiscLayout = new QGridLayout(groupMisc); |
185 QGridLayout * MiscLayout = new QGridLayout(groupMisc); |
190 |
186 |
236 MiscLayout->addWidget(CBSavePassword, 2, 0); |
232 MiscLayout->addWidget(CBSavePassword, 2, 0); |
237 |
233 |
238 editNetPassword = new QLineEdit(groupMisc); |
234 editNetPassword = new QLineEdit(groupMisc); |
239 editNetPassword->setEchoMode(QLineEdit::Password); |
235 editNetPassword->setEchoMode(QLineEdit::Password); |
240 MiscLayout->addWidget(editNetPassword, 2, 1); |
236 MiscLayout->addWidget(editNetPassword, 2, 1); |
241 |
|
242 CBNameWithDate = new QCheckBox(groupMisc); |
|
243 CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); |
|
244 MiscLayout->addWidget(CBNameWithDate, 5, 0, 1, 2); |
|
245 |
|
246 BtnAssociateFiles = new QPushButton(groupMisc); |
|
247 BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions")); |
|
248 BtnAssociateFiles->setVisible(!custom_data && !custom_config); |
|
249 MiscLayout->addWidget(BtnAssociateFiles, 6, 0, 1, 2); |
|
250 |
237 |
251 #ifdef __APPLE__ |
238 #ifdef __APPLE__ |
252 #ifdef SPARKLE_ENABLED |
239 #ifdef SPARKLE_ENABLED |
253 CBAutoUpdate = new QCheckBox(groupMisc); |
240 CBAutoUpdate = new QCheckBox(groupMisc); |
254 CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup")); |
241 CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup")); |
340 CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale")); |
327 CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale")); |
341 |
328 |
342 GBAstereolayout->addWidget(CBStereoMode); |
329 GBAstereolayout->addWidget(CBStereoMode); |
343 GBAlayout->addLayout(GBAstereolayout); |
330 GBAlayout->addLayout(GBAstereolayout); |
344 |
331 |
345 QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
|
346 QLabel * maxfps = new QLabel(AGGroupBox); |
|
347 maxfps->setText(QLabel::tr("FPS limit")); |
|
348 GBAfpslayout->addWidget(maxfps); |
|
349 GBAlayout->addLayout(GBAfpslayout); |
|
350 fpsedit = new FPSEdit(AGGroupBox); |
|
351 GBAfpslayout->addWidget(fpsedit); |
|
352 |
|
353 CBShowFPS = new QCheckBox(AGGroupBox); |
|
354 CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
355 GBAfpslayout->addWidget(CBShowFPS); |
|
356 |
|
357 hr = new QFrame(AGGroupBox); |
332 hr = new QFrame(AGGroupBox); |
358 hr->setFrameStyle(QFrame::HLine); |
333 hr->setFrameStyle(QFrame::HLine); |
359 hr->setLineWidth(3); |
334 hr->setLineWidth(3); |
360 hr->setFixedHeight(10); |
335 hr->setFixedHeight(10); |
361 GBAlayout->addWidget(hr); |
336 GBAlayout->addWidget(hr); |
390 CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
365 CBAltDamage->setText(QCheckBox::tr("Alternative damage show")); |
391 GBAlayout->addWidget(CBAltDamage); |
366 GBAlayout->addWidget(CBAltDamage); |
392 |
367 |
393 page1Layout->addWidget(AGGroupBox, 0, 1, 3, 1); |
368 page1Layout->addWidget(AGGroupBox, 0, 1, 3, 1); |
394 } |
369 } |
|
370 |
|
371 page1Layout->addWidget(new QWidget(this), 3, 0); |
|
372 |
395 } |
373 } |
396 |
374 |
397 { // page 2 |
375 { // page 2 |
398 QGridLayout * page2Layout = new QGridLayout(page2); |
376 QGridLayout * page2Layout = new QGridLayout(page2); |
399 |
377 |
400 IconedGroupBox * gbColors = new IconedGroupBox(this); |
|
401 //gbColors->setIcon(QIcon(":/res/teamicon.png")); |
|
402 gbColors->setTitle(QGroupBox::tr("Custom colors")); |
|
403 page2Layout->addWidget(gbColors, 0, 0, 1, 3); |
|
404 QVBoxLayout * gbCLayout = new QVBoxLayout(gbColors); |
|
405 |
|
406 QSignalMapper * mapper = new QSignalMapper(this); |
|
407 |
|
408 QStandardItemModel * model = DataManager::instance().colorsModel(); |
|
409 |
|
410 connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(onColorModelDataChanged(QModelIndex,QModelIndex))); |
|
411 for(int i = 0; i < model->rowCount(); ++i) |
|
412 { |
378 { |
|
379 IconedGroupBox * gbColors = new IconedGroupBox(this); |
|
380 gbColors->setIcon(QIcon(":/res/lightbulb_on.png")); |
|
381 gbColors->setTitle(QGroupBox::tr("Custom colors")); |
|
382 page2Layout->addWidget(gbColors, 0, 0); |
|
383 QGridLayout * gbCLayout = new QGridLayout(gbColors); |
|
384 |
|
385 QSignalMapper * mapper = new QSignalMapper(this); |
|
386 |
|
387 QStandardItemModel * model = DataManager::instance().colorsModel(); |
|
388 |
|
389 connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(onColorModelDataChanged(QModelIndex,QModelIndex))); |
|
390 for(int i = 0; i < model->rowCount(); ++i) |
|
391 { |
|
392 QPushButton * btn = new QPushButton(this); |
|
393 btn->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); |
|
394 gbCLayout->addWidget(btn, i / 3, i % 3); |
|
395 btn->setStyleSheet(QString("background: %1").arg(model->item(i)->data().value<QColor>().name())); |
|
396 m_colorButtons.append(btn); |
|
397 connect(btn, SIGNAL(clicked()), mapper, SLOT(map())); |
|
398 mapper->setMapping(btn, i); |
|
399 } |
|
400 |
|
401 connect(mapper, SIGNAL(mapped(int)), this, SLOT(colorButtonClicked(int))); |
|
402 |
413 QPushButton * btn = new QPushButton(this); |
403 QPushButton * btn = new QPushButton(this); |
414 gbCLayout->addWidget(btn); |
404 gbCLayout->addWidget(btn, (model->rowCount() - 1) / 3 + 1, 0, 1, 3); |
415 btn->setStyleSheet(QString("background: %1").arg(model->item(i)->data().value<QColor>().name())); |
405 btn->setText(tr("Reset to default colors")); |
416 m_colorButtons.append(btn); |
406 connect(btn, SIGNAL(clicked()), &DataManager::instance(), SLOT(resetColors())); |
417 connect(btn, SIGNAL(clicked()), mapper, SLOT(map())); |
|
418 mapper->setMapping(btn, i); |
|
419 } |
407 } |
420 |
408 |
421 connect(mapper, SIGNAL(mapped(int)), this, SLOT(colorButtonClicked(int))); |
409 { |
|
410 IconedGroupBox * gbMisc = new IconedGroupBox(this); |
|
411 gbMisc->setIcon(QIcon(":/res/Settings.png")); |
|
412 gbMisc->setTitle(QGroupBox::tr("Miscellaneous")); |
|
413 page2Layout->addWidget(gbMisc, 0, 1); |
|
414 QVBoxLayout * gbCLayout = new QVBoxLayout(gbMisc); |
|
415 |
|
416 QHBoxLayout * GBAfpslayout = new QHBoxLayout(0); |
|
417 QLabel * maxfps = new QLabel(AGGroupBox); |
|
418 maxfps->setText(QLabel::tr("FPS limit")); |
|
419 GBAfpslayout->addWidget(maxfps); |
|
420 fpsedit = new FPSEdit(AGGroupBox); |
|
421 GBAfpslayout->addWidget(fpsedit); |
|
422 |
|
423 CBShowFPS = new QCheckBox(AGGroupBox); |
|
424 CBShowFPS->setText(QCheckBox::tr("Show FPS")); |
|
425 GBAfpslayout->addWidget(CBShowFPS); |
|
426 |
|
427 gbCLayout->addLayout(GBAfpslayout); |
|
428 |
|
429 |
|
430 WeaponTooltip = new QCheckBox(this); |
|
431 WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips")); |
|
432 gbCLayout->addWidget(WeaponTooltip); |
|
433 |
|
434 |
|
435 CBNameWithDate = new QCheckBox(this); |
|
436 CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name")); |
|
437 gbCLayout->addWidget(CBNameWithDate); |
|
438 |
|
439 BtnAssociateFiles = new QPushButton(this); |
|
440 BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions")); |
|
441 BtnAssociateFiles->setVisible(!custom_data && !custom_config); |
|
442 gbCLayout->addWidget(BtnAssociateFiles); |
|
443 } |
|
444 |
|
445 page2Layout->addWidget(new QWidget(this), 1, 0); |
422 } |
446 } |
423 |
447 |
424 previousQuality = this->SLQuality->value(); |
448 previousQuality = this->SLQuality->value(); |
425 previousResolutionIndex = this->CBResolution->currentIndex(); |
449 previousResolutionIndex = this->CBResolution->currentIndex(); |
426 previousFullscreenValue = this->CBFullscreen->isChecked(); |
450 previousFullscreenValue = this->CBFullscreen->isChecked(); |