# HG changeset patch # User koda # Date 1315846408 -7200 # Node ID 404ca990793a94b299ac46a380008342c49aed01 # Parent 514b639c40da4ce694168f7203a2faca738d959f I.Fight.For.The.Users diff -r 514b639c40da -r 404ca990793a QTfrontend/pageoptions.cpp --- a/QTfrontend/pageoptions.cpp Mon Sep 12 15:58:59 2011 +0200 +++ b/QTfrontend/pageoptions.cpp Mon Sep 12 18:53:28 2011 +0200 @@ -295,10 +295,12 @@ CBResolution = new QComboBox(AGGroupBox); GBAreslayout->addWidget(CBResolution); GBAlayout->addLayout(GBAreslayout); + connect(CBResolution, SIGNAL(currentIndexChanged(int)), this, SLOT(setResolution(int))); CBFullscreen = new QCheckBox(AGGroupBox); CBFullscreen->setText(QCheckBox::tr("Fullscreen")); GBAlayout->addWidget(CBFullscreen); + connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(int))); QLabel * quality = new QLabel(AGGroupBox); quality->setText(QLabel::tr("Quality")); @@ -312,6 +314,8 @@ SLQuality->setFixedWidth(150); GBAqualayout->addWidget(SLQuality); GBAlayout->addLayout(GBAqualayout); + connect(SLQuality, SIGNAL(valueChanged(int)), this, SLOT(setQuality(int))); + QLabel * stereo = new QLabel(AGGroupBox); stereo->setText(QLabel::tr("Stereo rendering")); GBAstereolayout->addWidget(stereo); @@ -401,30 +405,52 @@ BtnBack->setFixedHeight(BtnSaveOptions->height()); BtnBack->setFixedWidth(BtnBack->width()+2); BtnBack->setStyleSheet("QPushButton{margin: 22px 0 9px 2px;}"); + + previousQuality = this->SLQuality->value(); + previousResolutionIndex = this->CBResolution->currentIndex(); + previousFullscreenValue = this->CBFullscreen->isChecked(); } void PageOptions::forceFullscreen(int index) { + bool forced = (index == 7 || index == 8 || index == 9); + if (index != 0) { - previousFullscreenValue = this->CBFullscreen->isChecked(); - this->CBFullscreen->setChecked(true); - this->CBFullscreen->setEnabled(false); - previousQuality = this->SLQuality->value(); this->SLQuality->setValue(this->SLQuality->maximum()); this->SLQuality->setEnabled(false); - previousResolutionIndex = this->CBResolution->currentIndex(); - this->CBResolution->setCurrentIndex(0); - this->CBResolution->setEnabled(false); + this->CBFullscreen->setEnabled(!forced); + this->CBFullscreen->setChecked(forced ? true : previousFullscreenValue); + this->CBResolution->setCurrentIndex(forced ? 0 : previousResolutionIndex); } else { - this->CBFullscreen->setChecked(previousFullscreenValue); + this->SLQuality->setEnabled(true); this->CBFullscreen->setEnabled(true); this->SLQuality->setValue(previousQuality); - this->SLQuality->setEnabled(true); + this->CBFullscreen->setChecked(previousFullscreenValue); this->CBResolution->setCurrentIndex(previousResolutionIndex); - this->CBResolution->setEnabled(true); } } +void PageOptions::setQuality(int value) +{ + int index = this->CBStereoMode->currentIndex(); + if (index == 0) + previousQuality = this->SLQuality->value(); +} + +void PageOptions::setFullscreen(int state) +{ + int index = this->CBStereoMode->currentIndex(); + if (index != 7 && index != 8 && index != 9) + previousFullscreenValue = this->CBFullscreen->isChecked(); +} + +void PageOptions::setResolution(int state) +{ + int index = this->CBStereoMode->currentIndex(); + if (index != 7 && index != 8 && index != 9) + previousResolutionIndex = this->CBResolution->currentIndex(); +} + void PageOptions::trimNetNick() { editNetNick->setText(editNetNick->text().trimmed()); diff -r 514b639c40da -r 404ca990793a QTfrontend/pageoptions.h --- a/QTfrontend/pageoptions.h Mon Sep 12 15:58:59 2011 +0200 +++ b/QTfrontend/pageoptions.h Mon Sep 12 18:53:28 2011 +0200 @@ -84,6 +84,9 @@ private slots: void forceFullscreen(int index); + void setFullscreen(int state); + void setResolution(int state); + void setQuality(int value); void trimNetNick(); };