QTfrontend/ui/page/pageoptions.cpp
changeset 8343 aa4ea3cade3c
parent 8284 a874d00df4a4
child 8350 14b938faec69
equal deleted inserted replaced
8342:44d65d9bfda4 8343:aa4ea3cade3c
   258             //AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
   258             //AGGroupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
   259             AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
   259             AGGroupBox->setTitle(QGroupBox::tr("Audio/Graphic options"));
   260 
   260 
   261             QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
   261             QVBoxLayout * GBAlayout = new QVBoxLayout(AGGroupBox);
   262             QGridLayout * GBAfrontendlayout = new QGridLayout(0);
   262             QGridLayout * GBAfrontendlayout = new QGridLayout(0);
   263             QHBoxLayout * GBAreslayout = new QHBoxLayout(0);
   263             QGridLayout * GBAreslayout = new QGridLayout(0);
       
   264             QHBoxLayout * GBAfullreslayout = new QHBoxLayout(0);
       
   265             QHBoxLayout * GBAwindowedreslayout = new QHBoxLayout(0);
   264             QHBoxLayout * GBAstereolayout = new QHBoxLayout(0);
   266             QHBoxLayout * GBAstereolayout = new QHBoxLayout(0);
   265             QHBoxLayout * GBAqualayout = new QHBoxLayout(0);
   267             QHBoxLayout * GBAqualayout = new QHBoxLayout(0);
   266 
   268 
   267             QLabel * frontend = new QLabel(AGGroupBox);
   269             QLabel * frontend = new QLabel(AGGroupBox);
   268             frontend->setText(QLabel::tr("Frontend"));
   270             frontend->setText(QLabel::tr("Frontend"));
   293             hr->setFixedHeight(10);
   295             hr->setFixedHeight(10);
   294             GBAlayout->addWidget(hr);
   296             GBAlayout->addWidget(hr);
   295 
   297 
   296             QLabel * resolution = new QLabel(AGGroupBox);
   298             QLabel * resolution = new QLabel(AGGroupBox);
   297             resolution->setText(QLabel::tr("Resolution"));
   299             resolution->setText(QLabel::tr("Resolution"));
   298             GBAreslayout->addWidget(resolution);
   300             GBAreslayout->addWidget(resolution, 0, 0);
   299 
   301 
   300             CBResolution = new QComboBox(AGGroupBox);
   302             CBResolution = new QComboBox(AGGroupBox);
   301             GBAreslayout->addWidget(CBResolution);
   303             GBAfullreslayout->addWidget(CBResolution);
   302             GBAlayout->addLayout(GBAreslayout);
       
   303 
   304 
   304             CBFullscreen = new QCheckBox(AGGroupBox);
   305             CBFullscreen = new QCheckBox(AGGroupBox);
   305             CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
   306             CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
   306             GBAreslayout->addWidget(CBFullscreen);
   307             GBAfullreslayout->addWidget(CBFullscreen);
   307 
   308             GBAreslayout->addLayout(GBAfullreslayout, 0, 1);
       
   309             
       
   310             QLabel * windowedResolution = new QLabel(AGGroupBox);
       
   311             windowedResolution->setText(QLabel::tr("Windowed Resolution"));
       
   312             GBAreslayout->addWidget(windowedResolution, 1, 0);
       
   313             
       
   314             // decorational X
       
   315             QLabel *winLabelX = new QLabel(AGGroupBox);
       
   316             winLabelX->setText("X");
       
   317             
       
   318             windowWidthEdit = new QLineEdit(AGGroupBox);
       
   319             windowWidthEdit->setValidator(new QIntValidator(this));
       
   320             windowHeightEdit = new QLineEdit(AGGroupBox);
       
   321             windowHeightEdit->setValidator(new QIntValidator(this));
       
   322             
       
   323             GBAwindowedreslayout->addWidget(windowWidthEdit);
       
   324             GBAwindowedreslayout->addWidget(winLabelX);
       
   325             GBAwindowedreslayout->addWidget(windowHeightEdit);
       
   326             GBAreslayout->addLayout(GBAwindowedreslayout, 1, 1);
       
   327             
       
   328             GBAlayout->addLayout(GBAreslayout);
       
   329             
   308             QLabel * quality = new QLabel(AGGroupBox);
   330             QLabel * quality = new QLabel(AGGroupBox);
   309             quality->setText(QLabel::tr("Quality"));
   331             quality->setText(QLabel::tr("Quality"));
   310             quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   332             quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
   311             GBAqualayout->addWidget(quality);
   333             GBAqualayout->addWidget(quality);
   312 
   334 
   625 #endif
   647 #endif
   626 
   648 
   627     previousQuality = this->SLQuality->value();
   649     previousQuality = this->SLQuality->value();
   628     previousResolutionIndex = this->CBResolution->currentIndex();
   650     previousResolutionIndex = this->CBResolution->currentIndex();
   629     previousFullscreenValue = this->CBFullscreen->isChecked();
   651     previousFullscreenValue = this->CBFullscreen->isChecked();
       
   652     // mutually exclude window and fullscreen resolution
       
   653     CBResolution->setEnabled(this->CBFullscreen->isChecked());
       
   654     windowHeightEdit->setEnabled(!this->CBFullscreen->isChecked());
       
   655     windowWidthEdit->setEnabled(!this->CBFullscreen->isChecked());
   630 
   656 
   631     return pageLayout;
   657     return pageLayout;
   632 }
   658 }
   633 
   659 
   634 QLayout * PageOptions::footerLayoutDefinition()
   660 QLayout * PageOptions::footerLayoutDefinition()
   659 }
   685 }
   660 
   686 
   661 void PageOptions::forceFullscreen(int index)
   687 void PageOptions::forceFullscreen(int index)
   662 {
   688 {
   663     bool forced = (index == 7 || index == 8 || index == 9);
   689     bool forced = (index == 7 || index == 8 || index == 9);
   664 
   690     CBResolution->setEnabled(this->CBFullscreen->isChecked());
       
   691     windowHeightEdit->setEnabled(!this->CBFullscreen->isChecked());
       
   692     windowWidthEdit->setEnabled(!this->CBFullscreen->isChecked());
       
   693     
   665     if (index != 0)
   694     if (index != 0)
   666     {
   695     {
   667         this->SLQuality->setValue(this->SLQuality->maximum());
   696         this->SLQuality->setValue(this->SLQuality->maximum());
   668         this->SLQuality->setEnabled(false);
   697         this->SLQuality->setEnabled(false);
   669         this->CBFullscreen->setEnabled(!forced);
   698         this->CBFullscreen->setEnabled(!forced);
   690 }
   719 }
   691 
   720 
   692 void PageOptions::setFullscreen(int state)
   721 void PageOptions::setFullscreen(int state)
   693 {
   722 {
   694     Q_UNUSED(state);
   723     Q_UNUSED(state);
   695 
   724     CBResolution->setEnabled(this->CBFullscreen->isChecked());
       
   725     windowHeightEdit->setEnabled(!this->CBFullscreen->isChecked());
       
   726     windowWidthEdit->setEnabled(!this->CBFullscreen->isChecked());
       
   727     
   696     int index = this->CBStereoMode->currentIndex();
   728     int index = this->CBStereoMode->currentIndex();
   697     if (index != 7 && index != 8 && index != 9)
   729     if (index != 7 && index != 8 && index != 9)
   698         previousFullscreenValue = this->CBFullscreen->isChecked();
   730         previousFullscreenValue = this->CBFullscreen->isChecked();
   699 }
   731 }
   700 
   732