rename two rendering methods and performe some interface tricks about fullscreen experimental3D
authorkoda
Thu, 26 Aug 2010 23:59:18 +0200
branchexperimental3D
changeset 3698 793386610068
parent 3696 6009d8378422
child 4004 b1c2c2f6fc5e
rename two rendering methods and performe some interface tricks about fullscreen
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/pages.cpp	Wed Aug 18 20:29:41 2010 +0200
+++ b/QTfrontend/pages.cpp	Thu Aug 26 23:59:18 2010 +0200
@@ -609,6 +609,7 @@
             CBFullscreen = new QCheckBox(AGGroupBox);
             CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
             GBAlayout->addWidget(CBFullscreen);
+            connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(void)));
 
             QLabel * quality = new QLabel(AGGroupBox);
             quality->setText(QLabel::tr("Quality"));
@@ -634,9 +635,10 @@
             CBStereoMode->addItem(QComboBox::tr("Blue/Red"));
             CBStereoMode->addItem(QComboBox::tr("Red/Green"));
             CBStereoMode->addItem(QComboBox::tr("Green/Red"));
-            CBStereoMode->addItem(QComboBox::tr("Side-by-side (horizontal)"));
-            CBStereoMode->addItem(QComboBox::tr("Side-by-side (vertical)"));
-            CBStereoMode->addItem(QComboBox::tr("Alternate frame rendering"));
+            CBStereoMode->addItem(QComboBox::tr("Side-by-side"));
+            CBStereoMode->addItem(QComboBox::tr("Top-Bottom"));
+            CBStereoMode->addItem(QComboBox::tr("Frame Alternate"));
+            connect(CBStereoMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceFullscreen(int)));
 
             GBAstereolayout->addWidget(CBStereoMode);
             GBAlayout->addLayout(GBAstereolayout);
@@ -689,7 +691,7 @@
             hr->setFixedHeight(10);
             GBAlayout->addWidget(hr);
 
-                QLabel *restartNote = new QLabel(this);
+            QLabel *restartNote = new QLabel(this);
             restartNote->setText(QString("* ") + QLabel::tr("Restart game to apply"));
             restartNote->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
             GBAlayout->addWidget(restartNote);
@@ -706,6 +708,23 @@
     BtnBack->setStyleSheet("QPushButton{margin: 22px 0 9px 2px;}");
 }
 
+void PageOptions::forceFullscreen(int index)
+{
+    if (index != 0) {
+        previousFullscreenValue = this->CBFullscreen->isChecked();
+        this->CBFullscreen->setChecked(true);
+        this->CBFullscreen->setEnabled(false);
+    } else {
+        this->CBFullscreen->setChecked(previousFullscreenValue);
+        this->CBFullscreen->setEnabled(true);
+    }
+}
+
+void PageOptions::setFullscreen(void)
+{
+    this->CBResolution->setEnabled(!this->CBFullscreen->isChecked());
+}
+
 PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
 {
     QFont * font14 = new QFont("MS Shell Dlg", 14);
--- a/QTfrontend/pages.h	Wed Aug 18 20:29:41 2010 +0200
+++ b/QTfrontend/pages.h	Thu Aug 26 23:59:18 2010 +0200
@@ -241,6 +241,11 @@
     QLineEdit *editNetNick;
     QSlider *SLQuality;
     QCheckBox *CBFrontendEffects;
+    bool previousFullscreenValue;
+
+private slots:
+    void forceFullscreen(int index);
+    void setFullscreen(void);
 };
 
 class PageNet : public AbstractPage