QTfrontend/gameuiconfig.cpp
changeset 2898 c53636f556f8
parent 2776 9572aae13d49
child 2913 865ae941d59e
equal deleted inserted replaced
2897:5eda7b3cc24f 2898:c53636f556f8
    37 	connect(Form->ui.pageOptions->CBEnableFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));
    37 	connect(Form->ui.pageOptions->CBEnableFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool)));
    38 
    38 
    39 	//Form->resize(value("window/width", 640).toUInt(), value("window/height", 450).toUInt());
    39 	//Form->resize(value("window/width", 640).toUInt(), value("window/height", 450).toUInt());
    40 	resizeToConfigValues();
    40 	resizeToConfigValues();
    41 
    41 
    42 	Form->ui.pageOptions->WeaponTooltip->setChecked(value("misc/WeaponTooltip", true).toBool());
    42 	Form->ui.pageOptions->WeaponTooltip->setChecked(value("misc/weaponTooltip", true).toBool());
    43 
    43 
    44 	int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString());
    44 	int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString());
    45 	Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t);
    45 	Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t);
    46 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
    46 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
    47 	bool ffscr=value("video/frontendfullscreen", false).toBool();
    47 	bool ffscr=value("video/frontendfullscreen", false).toBool();
    83 
    83 
    84 #ifdef SPARKLE_ENABLED
    84 #ifdef SPARKLE_ENABLED
    85         Form->ui.pageOptions->CBAutoUpdate->setChecked(value("misc/autoUpdate", true).toBool());
    85         Form->ui.pageOptions->CBAutoUpdate->setChecked(value("misc/autoUpdate", true).toBool());
    86 #endif
    86 #endif
    87 
    87 
       
    88 	Form->ui.pageOptions->CBLanguage->setCurrentIndex(Form->ui.pageOptions->CBLanguage->findData(value("misc/locale", QLocale::system().name())));
       
    89 
    88 	depth = QApplication::desktop()->depth();
    90 	depth = QApplication::desktop()->depth();
    89 	if (depth < 16) depth = 16;
    91 	if (depth < 16) depth = 16;
    90 	else if (depth > 16) depth = 32;
    92 	else if (depth > 16) depth = 32;
    91 }
    93 }
    92 
    94 
   113 
   115 
   114 	setValue("video/reducequality", isReducedQuality());
   116 	setValue("video/reducequality", isReducedQuality());
   115 
   117 
   116 	setValue("video/frontendeffects", isFrontendEffects());
   118 	setValue("video/frontendeffects", isFrontendEffects());
   117 
   119 
   118 	setValue("misc/WeaponTooltip", isWeaponTooltip());
   120 	setValue("misc/weaponTooltip", isWeaponTooltip());
   119 
   121 
   120 	bool ffscr = isFrontendFullscreen();
   122 	bool ffscr = isFrontendFullscreen();
   121 	setValue("video/frontendfullscreen", ffscr);
   123 	setValue("video/frontendfullscreen", ffscr);
   122 	emit frontendFullscreen(ffscr);
   124 	emit frontendFullscreen(ffscr);
   123 	if (!ffscr) {
   125 	if (!ffscr) {
   145 	setValue("fps/show", isShowFPSEnabled());
   147 	setValue("fps/show", isShowFPSEnabled());
   146 	setValue("fps/interval", Form->ui.pageOptions->fpsedit->value());
   148 	setValue("fps/interval", Form->ui.pageOptions->fpsedit->value());
   147 
   149 
   148 	setValue("misc/altdamage", isAltDamageEnabled());
   150 	setValue("misc/altdamage", isAltDamageEnabled());
   149 	setValue("misc/appendTimeToRecords", appendDateTimeToRecordName());
   151 	setValue("misc/appendTimeToRecords", appendDateTimeToRecordName());
       
   152 	setValue("misc/locale", language());
   150 
   153 
   151 #ifdef SPARKLE_ENABLED
   154 #ifdef SPARKLE_ENABLED
   152         setValue("misc/autoUpdate", isAutoUpdateEnabled());
   155         setValue("misc/autoUpdate", isAutoUpdateEnabled());
   153 #endif
   156 #endif
   154     Form->gameSettings->sync();
   157     Form->gameSettings->sync();
       
   158 }
       
   159 
       
   160 QString GameUIConfig::language()
       
   161 {
       
   162 	return Form->ui.pageOptions->CBLanguage->itemData(Form->ui.pageOptions->CBLanguage->currentIndex()).toString();
   155 }
   163 }
   156 
   164 
   157 QRect GameUIConfig::vid_Resolution()
   165 QRect GameUIConfig::vid_Resolution()
   158 {
   166 {
   159 	QRect result(0, 0, 640, 480);
   167 	QRect result(0, 0, 640, 480);