QTfrontend/gameuiconfig.cpp
changeset 1812 3d4692e825e7
parent 1777 88674c291331
child 2098 c977d7f2aa09
equal deleted inserted replaced
1811:1b9e33623b7e 1812:3d4692e825e7
    42 	Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t);
    42 	Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t);
    43 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
    43 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
    44 	bool ffscr=value("video/frontendfullscreen", false).toBool();
    44 	bool ffscr=value("video/frontendfullscreen", false).toBool();
    45 	Form->ui.pageOptions->CBFrontendFullscreen->setChecked(ffscr);
    45 	Form->ui.pageOptions->CBFrontendFullscreen->setChecked(ffscr);
    46 
    46 
       
    47 	Form->ui.pageOptions->CBReduceQuality->setChecked(value("video/reducequality", false).toBool());
    47 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
    48 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
    48 	Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
    49 	Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
    49 	Form->ui.pageOptions->volumeBox->setValue(value("audio/volume", 100).toUInt());
    50 	Form->ui.pageOptions->volumeBox->setValue(value("audio/volume", 100).toUInt());
    50 
    51 
    51 	Form->ui.pageOptions->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
    52 	Form->ui.pageOptions->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
    86 
    87 
    87 void GameUIConfig::SaveOptions()
    88 void GameUIConfig::SaveOptions()
    88 {
    89 {
    89 	setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText());
    90 	setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText());
    90 	setValue("video/fullscreen", vid_Fullscreen());
    91 	setValue("video/fullscreen", vid_Fullscreen());
       
    92 
       
    93 	setValue("video/reducequality", isReducedQuality());
       
    94 
    91 	bool ffscr=isFrontendFullscreen();
    95 	bool ffscr=isFrontendFullscreen();
    92 	setValue("video/frontendfullscreen", ffscr);
    96 	setValue("video/frontendfullscreen", ffscr);
    93 	emit frontendFullscreen(ffscr);
    97 	emit frontendFullscreen(ffscr);
    94 	if (!ffscr) {
    98 	if (!ffscr) {
    95 	  setValue("window/width", Form->width());
    99 	  setValue("window/width", Form->width());
   128 }
   132 }
   129 
   133 
   130 bool GameUIConfig::vid_Fullscreen()
   134 bool GameUIConfig::vid_Fullscreen()
   131 {
   135 {
   132 	return Form->ui.pageOptions->CBFullscreen->isChecked();
   136 	return Form->ui.pageOptions->CBFullscreen->isChecked();
       
   137 }
       
   138 
       
   139 bool GameUIConfig::isReducedQuality() const
       
   140 {
       
   141   return Form->ui.pageOptions->CBReduceQuality->isChecked();
   133 }
   142 }
   134 
   143 
   135 bool GameUIConfig::isFrontendFullscreen() const
   144 bool GameUIConfig::isFrontendFullscreen() const
   136 {
   145 {
   137   return Form->ui.pageOptions->CBFrontendFullscreen->isChecked();
   146   return Form->ui.pageOptions->CBFrontendFullscreen->isChecked();