aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llxml/llcontrol.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp
index d9ed45a..8bd04d7 100644
--- a/linden/indra/llxml/llcontrol.cpp
+++ b/linden/indra/llxml/llcontrol.cpp
@@ -309,10 +309,13 @@ BOOL LLControlGroup::declareControl(const std::string& name, eControlType type,
309 { 309 {
310 if (persist && existing_control->isType(type)) 310 if (persist && existing_control->isType(type))
311 { 311 {
312 // Sometimes we need to declare a control *after* it has been loaded from a settings file. 312 if (!existing_control->llsd_compare(existing_control->getDefault(), initial_val))
313 LLSD cur_value = existing_control->getValue(); // get the current value 313 {
314 existing_control->setDefaultValue(initial_val); // set the default to the declared value 314 // Sometimes we need to declare a control *after* it has been loaded from a settings file.
315 existing_control->setValue(cur_value); // now set to the loaded value 315 LLSD cur_value = existing_control->getValue(); // get the current value
316 existing_control->setDefaultValue(initial_val); // set the default to the declared value
317 existing_control->setValue(cur_value); // now set to the loaded value
318 }
316 } 319 }
317 else 320 else
318 { 321 {
@@ -1059,10 +1062,10 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
1059 } 1062 }
1060 1063
1061 U32 validitems = 0; 1064 U32 validitems = 0;
1062 bool persist = true;
1063 bool hidefromsettingseditor = false; 1065 bool hidefromsettingseditor = false;
1064 for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr) 1066 for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr)
1065 { 1067 {
1068 bool persist = true;
1066 name = (*itr).first; 1069 name = (*itr).first;
1067 control_map = (*itr).second; 1070 control_map = (*itr).second;
1068 1071
@@ -1171,13 +1174,13 @@ static std::string get_warn_name(const std::string& name)
1171 1174
1172void LLControlGroup::addWarning(const std::string& name) 1175void LLControlGroup::addWarning(const std::string& name)
1173{ 1176{
1177 // Note: may get called more than once per warning
1178 // (e.g. if allready loaded from a settings file),
1179 // but that is OK, declareBOOL will handle it
1174 std::string warnname = get_warn_name(name); 1180 std::string warnname = get_warn_name(name);
1175 if(mNameTable.find(warnname) == mNameTable.end()) 1181 std::string comment = std::string("Enables ") + name + std::string(" warning dialog");
1176 { 1182 declareBOOL(warnname, TRUE, comment);
1177 std::string comment = std::string("Enables ") + name + std::string(" warning dialog"); 1183 mWarnings.insert(warnname);
1178 declareBOOL(warnname, TRUE, comment);
1179 mWarnings.insert(warnname);
1180 }
1181} 1184}
1182 1185
1183BOOL LLControlGroup::getWarning(const std::string& name) 1186BOOL LLControlGroup::getWarning(const std::string& name)