QTfrontend/ui/page/pageoptions.cpp
changeset 8434 4821897a0f10
parent 8387 f9d1191476ce
child 8880 71ed64b18540
child 8902 a94c074fd483
equal deleted inserted replaced
8432:f2d57e987ba9 8434:4821897a0f10
   197         }
   197         }
   198 
   198 
   199         { // group: weapons
   199         { // group: weapons
   200             OptionGroupBox * groupWeapons = new OptionGroupBox(":/res/weaponsicon.png", tr("Weapons"), this);
   200             OptionGroupBox * groupWeapons = new OptionGroupBox(":/res/weaponsicon.png", tr("Weapons"), this);
   201             leftColumn->addWidget(groupWeapons);
   201             leftColumn->addWidget(groupWeapons);
   202             
   202 
   203             groupWeapons->layout()->setColumnStretch(0, 1);
   203             groupWeapons->layout()->setColumnStretch(0, 1);
   204 
   204 
   205             WeaponsName = new QComboBox(groupWeapons);
   205             WeaponsName = new QComboBox(groupWeapons);
   206             groupWeapons->layout()->addWidget(WeaponsName, 0, 0);
   206             groupWeapons->layout()->addWidget(WeaponsName, 0, 0);
   207 
   207 
   248             CBFullscreen = new QCheckBox(groupGame);
   248             CBFullscreen = new QCheckBox(groupGame);
   249             groupGame->layout()->addWidget(CBFullscreen, 0, 0, 1, 2);
   249             groupGame->layout()->addWidget(CBFullscreen, 0, 0, 1, 2);
   250             CBFullscreen->setText(QLabel::tr("Fullscreen"));
   250             CBFullscreen->setText(QLabel::tr("Fullscreen"));
   251 
   251 
   252             // Fullscreen resolution
   252             // Fullscreen resolution
   253             
   253 
   254             lblFullScreenRes = new QLabel(groupGame);
   254             lblFullScreenRes = new QLabel(groupGame);
   255             lblFullScreenRes->setText(QLabel::tr("Fullscreen Resolution"));
   255             lblFullScreenRes->setText(QLabel::tr("Fullscreen Resolution"));
   256             groupGame->layout()->addWidget(lblFullScreenRes, 1, 0);
   256             groupGame->layout()->addWidget(lblFullScreenRes, 1, 0);
   257 
   257 
   258             CBResolution = new QComboBox(groupGame);
   258             CBResolution = new QComboBox(groupGame);
   259             CBResolution->setFixedWidth(200);
   259             CBResolution->setFixedWidth(200);
   260             groupGame->layout()->addWidget(CBResolution, 1, 1, Qt::AlignLeft);
   260             groupGame->layout()->addWidget(CBResolution, 1, 1, Qt::AlignLeft);
   261 
   261 
   262             // Windowed resolution
   262             // Windowed resolution
   263             
   263 
   264             lblWinScreenRes = new QLabel(groupGame);
   264             lblWinScreenRes = new QLabel(groupGame);
   265             lblWinScreenRes->setText(QLabel::tr("Windowed Resolution"));
   265             lblWinScreenRes->setText(QLabel::tr("Windowed Resolution"));
   266             groupGame->layout()->addWidget(lblWinScreenRes, 2, 0);
   266             groupGame->layout()->addWidget(lblWinScreenRes, 2, 0);
   267                         
   267 
   268             winResContainer = new QWidget();
   268             winResContainer = new QWidget();
   269             QHBoxLayout * winResLayout = new QHBoxLayout(winResContainer);
   269             QHBoxLayout * winResLayout = new QHBoxLayout(winResContainer);
   270             winResLayout->setSpacing(0);
   270             winResLayout->setSpacing(0);
   271             groupGame->layout()->addWidget(winResContainer, 2, 1);
   271             groupGame->layout()->addWidget(winResContainer, 2, 1);
   272             
   272 
   273             QLabel *winLabelX = new QLabel(groupGame);
   273             QLabel *winLabelX = new QLabel(groupGame);
   274             winLabelX->setText("x"); // decorational x
   274             winLabelX->setText("x"); // decorational x
   275             winLabelX->setFixedWidth(40);
   275             winLabelX->setFixedWidth(40);
   276             winLabelX->setAlignment(Qt::AlignCenter);
   276             winLabelX->setAlignment(Qt::AlignCenter);
   277             
   277 
   278             windowWidthEdit = new QLineEdit(groupGame);
   278             windowWidthEdit = new QLineEdit(groupGame);
   279             windowWidthEdit->setValidator(new QIntValidator(this));
   279             windowWidthEdit->setValidator(new QIntValidator(this));
   280             windowWidthEdit->setFixedSize(55, CBResolution->height());
   280             windowWidthEdit->setFixedSize(55, CBResolution->height());
   281             windowHeightEdit = new QLineEdit(groupGame);
   281             windowHeightEdit = new QLineEdit(groupGame);
   282             windowHeightEdit->setValidator(new QIntValidator(this));
   282             windowHeightEdit->setValidator(new QIntValidator(this));
   283             windowHeightEdit->setFixedSize(55, CBResolution->height());
   283             windowHeightEdit->setFixedSize(55, CBResolution->height());
   284             
   284 
   285             winResLayout->addWidget(windowWidthEdit, 0);
   285             winResLayout->addWidget(windowWidthEdit, 0);
   286             winResLayout->addWidget(winLabelX, 0);
   286             winResLayout->addWidget(winLabelX, 0);
   287             winResLayout->addWidget(windowHeightEdit, 0);
   287             winResLayout->addWidget(windowHeightEdit, 0);
   288             winResLayout->addStretch(1);
   288             winResLayout->addStretch(1);
   289 
   289 
   828 }
   828 }
   829 
   829 
   830 void PageOptions::forceFullscreen(int index)
   830 void PageOptions::forceFullscreen(int index)
   831 {
   831 {
   832     bool forced = (index == 7 || index == 8 || index == 9);
   832     bool forced = (index == 7 || index == 8 || index == 9);
   833     
   833 
   834     if (index != 0)
   834     if (index != 0)
   835     {
   835     {
   836         this->SLQuality->setValue(this->SLQuality->maximum());
   836         this->SLQuality->setValue(this->SLQuality->maximum());
   837         this->SLQuality->setEnabled(false);
   837         this->SLQuality->setEnabled(false);
   838         this->CBFullscreen->setChecked(forced ? true : previousFullscreenValue);
   838         this->CBFullscreen->setChecked(forced ? true : previousFullscreenValue);
  1112 
  1112 
  1113 // When a key bind combobox is changed
  1113 // When a key bind combobox is changed
  1114 void PageOptions::bindUpdated(int bindID)
  1114 void PageOptions::bindUpdated(int bindID)
  1115 {
  1115 {
  1116     int bindIndex = binder->bindIndex(bindID);
  1116     int bindIndex = binder->bindIndex(bindID);
  1117     
  1117 
  1118     if (bindIndex == 0) bindIndex = resetBindToDefault(bindID);
  1118     if (bindIndex == 0) bindIndex = resetBindToDefault(bindID);
  1119 
  1119 
  1120     // Save bind
  1120     // Save bind
  1121     QStandardItemModel * binds = DataManager::instance().bindsModel();
  1121     QStandardItemModel * binds = DataManager::instance().bindsModel();
  1122     QString strbind = binds->index(binder->bindIndex(bindID), 0).data(Qt::UserRole + 1).toString();
  1122     QString strbind = binds->index(binder->bindIndex(bindID), 0).data(Qt::UserRole + 1).toString();