1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

Apply sh::Factory settings immediately.

This commit is contained in:
cc9cii 2014-09-28 11:05:27 +10:00
parent a25cffc242
commit 9902e08773

View file

@ -12,6 +12,8 @@
#include <QTextCodec> #include <QTextCodec>
#include <QDebug> #include <QDebug>
#include <extern/shiny/Main/Factory.hpp>
/** /**
* Workaround for problems with whitespaces in paths in older versions of Boost library * Workaround for problems with whitespaces in paths in older versions of Boost library
*/ */
@ -104,7 +106,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
{ {
Setting *maxSubView = createSetting (Type_SpinBox, section, "max subviews"); Setting *maxSubView = createSetting (Type_SpinBox, section, "max subviews");
maxSubView->setDefaultValue(256); maxSubView->setDefaultValue(256);
maxSubView->setEditorSetting(false); maxSubView->setEditorSetting(true);
maxSubView->setColumnSpan (1); maxSubView->setColumnSpan (1);
maxSubView->setMinimum (1); maxSubView->setMinimum (1);
maxSubView->setMaximum (256); // FIXME: not sure what the max value should be maxSubView->setMaximum (256); // FIXME: not sure what the max value should be
@ -113,7 +115,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
Setting *minWidth = createSetting (Type_SpinBox, section, "minimum width"); Setting *minWidth = createSetting (Type_SpinBox, section, "minimum width");
minWidth->setDefaultValue(325); minWidth->setDefaultValue(325);
minWidth->setEditorSetting(false); minWidth->setEditorSetting(true);
minWidth->setColumnSpan (1); minWidth->setColumnSpan (1);
minWidth->setMinimum (50); minWidth->setMinimum (50);
minWidth->setMaximum (10000); // FIXME: not sure what the max value should be minWidth->setMaximum (10000); // FIXME: not sure what the max value should be
@ -123,7 +125,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
Setting *reuse = createSetting (Type_CheckBox, section, "reuse"); Setting *reuse = createSetting (Type_CheckBox, section, "reuse");
reuse->setDeclaredValues(QStringList() << "true" << "false"); reuse->setDeclaredValues(QStringList() << "true" << "false");
reuse->setDefaultValue("true"); reuse->setDefaultValue("true");
reuse->setEditorSetting(false); reuse->setEditorSetting(true);
reuse->setSpecialValueText("Reuse SubView"); reuse->setSpecialValueText("Reuse SubView");
reuse->setWidgetWidth(25); reuse->setWidgetWidth(25);
reuse->setColumnSpan (3); reuse->setColumnSpan (3);
@ -142,8 +144,8 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
width->setDefaultValues (QStringList() << "1024"); width->setDefaultValues (QStringList() << "1024");
height->setDefaultValues (QStringList() << "768"); height->setDefaultValues (QStringList() << "768");
width->setEditorSetting (false); width->setEditorSetting (true);
height->setEditorSetting (false); height->setEditorSetting (true);
height->setViewLocation (2,2); height->setViewLocation (2,2);
width->setViewLocation (2,1); width->setViewLocation (2,1);
@ -186,8 +188,8 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
rsd->setDeclaredValues (values); rsd->setDeclaredValues (values);
ritd->setDeclaredValues (values); ritd->setDeclaredValues (values);
rsd->setEditorSetting (false); rsd->setEditorSetting (true);
ritd->setEditorSetting (false); ritd->setEditorSetting (true);
} }
section = "Proxy Selection Test"; section = "Proxy Selection Test";
@ -470,7 +472,18 @@ void CSMSettings::UserSettings::updateUserSetting(const QString &settingKey,
{ {
mSettingDefinitions->setValue (settingKey ,list); mSettingDefinitions->setValue (settingKey ,list);
emit userSettingUpdated (settingKey, list); if(settingKey == "Objects/num_lights"
&& mSettingDefinitions->value(settingKey).toString() != list.at(0))
{
sh::Factory::getInstance ().setGlobalSetting ("num_lights", list.at(0).toStdString());
}
else if(settingKey == "Objects/shaders"
&& mSettingDefinitions->value(settingKey).toString() != list.at(0))
{
sh::Factory::getInstance ().setShadersEnabled (list.at(0) == "true" ? true : false);
}
emit userSettingUpdated (settingKey, list); // TODO: isn't this circular?
} }
CSMSettings::Setting *CSMSettings::UserSettings::findSetting CSMSettings::Setting *CSMSettings::UserSettings::findSetting