QTfrontend/gameuiconfig.cpp
changeset 12237 76fa467b6833
parent 11362 ed5a6478e710
child 13080 23a498a2b5b8
equal deleted inserted replaced
12236:a0ed4caa6d35 12237:76fa467b6833
   181 {
   181 {
   182     // one pass with default values
   182     // one pass with default values
   183     Form->ui.pageOptions->setDefaultOptions();
   183     Form->ui.pageOptions->setDefaultOptions();
   184 
   184 
   185     // then load user configuration
   185     // then load user configuration
   186     Form->ui.pageOptions->framerateBox->setCurrentIndex(
   186     int framerateBoxIndex = Form->ui.pageOptions->framerateBox->findData(value("videorec/framerate", rec_Framerate()).toUInt());
   187             Form->ui.pageOptions->framerateBox->findData(
   187     if(framerateBoxIndex != -1)
   188                         value("videorec/framerate", rec_Framerate()).toString() + " fps",
   188         Form->ui.pageOptions->framerateBox->setCurrentIndex(framerateBoxIndex);
   189                     Qt::MatchExactly) );
       
   190     Form->ui.pageOptions->bitrateBox->setValue(value("videorec/bitrate", rec_Bitrate()).toUInt());
   189     Form->ui.pageOptions->bitrateBox->setValue(value("videorec/bitrate", rec_Bitrate()).toUInt());
   191     bool useGameRes = value("videorec/usegameres",Form->ui.pageOptions->checkUseGameRes->isChecked()).toBool();
   190     bool useGameRes = value("videorec/usegameres",Form->ui.pageOptions->checkUseGameRes->isChecked()).toBool();
   192     if (useGameRes)
   191     if (useGameRes)
   193     {
   192     {
   194         QRect res = vid_Resolution();
   193         QRect res = vid_Resolution();
   623     return res;
   622     return res;
   624 }
   623 }
   625 
   624 
   626 int GameUIConfig::rec_Framerate()
   625 int GameUIConfig::rec_Framerate()
   627 {
   626 {
   628     // remove the "fps" label
   627     return Form->ui.pageOptions->framerateBox->itemData(Form->ui.pageOptions->framerateBox->currentIndex()).toInt();
   629     QString fpsText = Form->ui.pageOptions->framerateBox->currentText();
       
   630     QStringList fpsList = fpsText.split(" ");
       
   631     return fpsList.first().toInt();
       
   632 }
   628 }
   633 
   629 
   634 int GameUIConfig::rec_Bitrate()
   630 int GameUIConfig::rec_Bitrate()
   635 {
   631 {
   636     return Form->ui.pageOptions->bitrateBox->value();
   632     return Form->ui.pageOptions->bitrateBox->value();