QTfrontend/gameuiconfig.cpp
changeset 8358 274afc318dca
parent 8354 c25bee85d6f8
child 8385 9e8924ff9813
equal deleted inserted replaced
8357:d7bef04c99d4 8358:274afc318dca
    72 
    72 
    73 void GameUIConfig::reloadValues(void)
    73 void GameUIConfig::reloadValues(void)
    74 {
    74 {
    75     Form->ui.pageOptions->WeaponTooltip->setChecked(value("misc/weaponTooltips", true).toBool());
    75     Form->ui.pageOptions->WeaponTooltip->setChecked(value("misc/weaponTooltips", true).toBool());
    76 
    76 
    77     int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString());
    77     int t = Form->ui.pageOptions->CBResolution->findText(value("video/fullscreenResolution").toString());
    78     if (t < 0)
    78     if (t < 0)
    79     {
    79     {
    80         if (Form->ui.pageOptions->CBResolution->count() > 1)
    80         if (Form->ui.pageOptions->CBResolution->count() > 1)
    81             Form->ui.pageOptions->CBResolution->setCurrentIndex(1);
    81             Form->ui.pageOptions->CBResolution->setCurrentIndex(1);
    82         else
    82         else
    83             Form->ui.pageOptions->CBResolution->setCurrentIndex(0);
    83             Form->ui.pageOptions->CBResolution->setCurrentIndex(0);
    84     }
    84     }
    85     else Form->ui.pageOptions->CBResolution->setCurrentIndex(t);
    85     else Form->ui.pageOptions->CBResolution->setCurrentIndex(t);
    86     
    86     
    87     // Default the windowed resolution to 2/3 of the screen size
    87     // Default the windowed resolution to 5/6 of the screen size
    88     int screenWidth = SDL_GetVideoInfo()->current_w * 2 / 3; 
    88     int screenWidth = SDL_GetVideoInfo()->current_w * 5 / 6;
    89     int screenHeight = SDL_GetVideoInfo()->current_h * 2 / 3; 
    89     int screenHeight = SDL_GetVideoInfo()->current_h * 5 / 6;
    90     QString widthStr; widthStr.setNum(screenWidth);
    90     QString widthStr; widthStr.setNum(screenWidth);
    91     QString heightStr; heightStr.setNum(screenHeight);
    91     QString heightStr; heightStr.setNum(screenHeight);
    92     QString wWidth = value("video/windowedWidth", widthStr).toString();
    92     QString wWidth = value("video/windowedWidth", widthStr).toString();
    93     QString wHeight = value("video/windowedHeight", heightStr).toString();
    93     QString wHeight = value("video/windowedHeight", heightStr).toString();
    94     // If left blank reset the resolution to the default
    94     // If left blank reset the resolution to the default
   229     Form->move(center);
   229     Form->move(center);
   230 }
   230 }
   231 
   231 
   232 void GameUIConfig::SaveOptions()
   232 void GameUIConfig::SaveOptions()
   233 {
   233 {
   234     setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText());
   234     setValue("video/fullscreenResolution", Form->ui.pageOptions->CBResolution->currentText());
   235     setValue("video/windowedWidth", Form->ui.pageOptions->windowWidthEdit->text());
   235     setValue("video/windowedWidth", Form->ui.pageOptions->windowWidthEdit->text());
   236     setValue("video/windowedHeight", Form->ui.pageOptions->windowHeightEdit->text());
   236     setValue("video/windowedHeight", Form->ui.pageOptions->windowHeightEdit->text());
   237     setValue("video/fullscreen", vid_Fullscreen());
   237     setValue("video/fullscreen", vid_Fullscreen());
   238 
   238 
   239     setValue("video/quality", Form->ui.pageOptions->SLQuality->value());
   239     setValue("video/quality", Form->ui.pageOptions->SLQuality->value());