QTfrontend/gameuiconfig.cpp
changeset 8098 4efee370e2de
parent 7794 ab7b94c03bc9
child 8151 25b95d6224fc
child 8179 a1ffcb559f99
equal deleted inserted replaced
8095:df61e150eb70 8098:4efee370e2de
    42     , QNetworkProxy::Socks5Proxy
    42     , QNetworkProxy::Socks5Proxy
    43     , QNetworkProxy::HttpProxy};
    43     , QNetworkProxy::HttpProxy};
    44 
    44 
    45 
    45 
    46 GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
    46 GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
    47     : QSettings(fileName, QSettings::IniFormat)
    47     : QSettings(fileName, QSettings::IniFormat, FormWidgets)
    48 {
    48 {
    49     Form = FormWidgets;
    49     Form = FormWidgets;
       
    50 
       
    51     setIniCodec("UTF-8");
    50 
    52 
    51     connect(Form->ui.pageOptions->CBEnableFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));
    53     connect(Form->ui.pageOptions->CBEnableFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));
    52 
    54 
    53     //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt());
    55     //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt());
    54     resizeToConfigValues();
    56     resizeToConfigValues();
    75     bool ffscr=value("frontend/fullscreen", false).toBool();
    77     bool ffscr=value("frontend/fullscreen", false).toBool();
    76     Form->ui.pageOptions->CBFrontendFullscreen->setChecked(ffscr);
    78     Form->ui.pageOptions->CBFrontendFullscreen->setChecked(ffscr);
    77 
    79 
    78     Form->ui.pageOptions->SLQuality->setValue(value("video/quality", 5).toUInt());
    80     Form->ui.pageOptions->SLQuality->setValue(value("video/quality", 5).toUInt());
    79     Form->ui.pageOptions->CBStereoMode->setCurrentIndex(value("video/stereo", 0).toUInt());
    81     Form->ui.pageOptions->CBStereoMode->setCurrentIndex(value("video/stereo", 0).toUInt());
    80     Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/effects", true).toBool());
    82     Form->ui.pageOptions->CBFrontendEffects->setChecked(value("frontend/effects", true).toBool());
    81     Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
    83     Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
    82     Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/sound", true).toBool());
    84     Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/sound", true).toBool());
    83     Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
    85     Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
    84     Form->ui.pageOptions->CBEnableFrontendMusic->setChecked(value("frontend/music", true).toBool());
    86     Form->ui.pageOptions->CBEnableFrontendMusic->setChecked(value("frontend/music", true).toBool());
    85     Form->ui.pageOptions->volumeBox->setValue(value("audio/volume", 100).toUInt());
    87     Form->ui.pageOptions->volumeBox->setValue(value("audio/volume", 100).toUInt());
    94     int passLength = value("net/passwordlength", 0).toInt();
    96     int passLength = value("net/passwordlength", 0).toInt();
    95     setNetPasswordLength(passLength);
    97     setNetPasswordLength(passLength);
    96     if (savePwd == false) {
    98     if (savePwd == false) {
    97         Form->ui.pageOptions->editNetPassword->setEnabled(savePwd);
    99         Form->ui.pageOptions->editNetPassword->setEnabled(savePwd);
    98         Form->ui.pageOptions->editNetPassword->setText("");
   100         Form->ui.pageOptions->editNetPassword->setText("");
    99         setNetPasswordLength(0);        
   101         setNetPasswordLength(0);
   100     }
   102     }
   101 
   103 
   102     delete netHost;
   104     delete netHost;
   103     netHost = new QString(value("net/ip", "").toString());
   105     netHost = new QString(value("net/ip", "").toString());
   104     netPort = value("net/port", 46631).toUInt();
   106     netPort = value("net/port", 46631).toUInt();