summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-08 11:59:20 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-08 11:59:20 -0700
commitbb585d95b5955effb813621942e10429ea97df1f (patch)
tree7e1364e8313052b53c5e2b4e19733d6b59b33867
parent65cb4b6d20b52ffebdc93e0e19f99520f6364dde (diff)
Fix merge by putting back loadFromFilename.
-rw-r--r--indra/newview/llfloaterpreference.cpp46
-rw-r--r--indra/newview/llfloaterpreference.h1
2 files changed, 47 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 927124f333..28e77deec2 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -849,6 +849,13 @@ void LLFloaterPreference::onOpen(const LLSD& key)
save_camera_btn->setEnabled(started);
delete_camera_btn->setEnabled(started);
}
+
+ collectSearchableItems();
+ if (!mFilterEdit->getText().empty())
+ {
+ mFilterEdit->setText(LLStringExplicit(""));
+ onUpdateFilterTerm(true);
+ }
}
void LLFloaterPreference::onVertexShaderEnable()
@@ -2029,6 +2036,45 @@ void LLFloaterPreference::updateMaxComplexity()
getChild<LLTextBox>("IndirectMaxComplexityText"));
}
+bool LLFloaterPreference::loadFromFilename(const std::string& filename, std::map<std::string, std::string> &label_map)
+{
+ LLXMLNodePtr root;
+
+ if (!LLXMLNode::parseFile(filename, root, NULL))
+ {
+ LL_WARNS() << "Unable to parse file " << filename << LL_ENDL;
+ return false;
+ }
+
+ if (!root->hasName("labels"))
+ {
+ LL_WARNS() << filename << " is not a valid definition file" << LL_ENDL;
+ return false;
+ }
+
+ LabelTable params;
+ LLXUIParser parser;
+ parser.readXUI(root, params, filename);
+
+ if (params.validateBlock())
+ {
+ for (LLInitParam::ParamIterator<LabelDef>::const_iterator it = params.labels.begin();
+ it != params.labels.end();
+ ++it)
+ {
+ LabelDef label_entry = *it;
+ label_map[label_entry.name] = label_entry.value;
+ }
+ }
+ else
+ {
+ LL_WARNS() << filename << " failed to load" << LL_ENDL;
+ return false;
+ }
+
+ return true;
+}
+
void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity()
{
// Called when the IndirectMaxComplexity control changes
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 54f985193a..fd6ce0239f 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -199,6 +199,7 @@ private:
void onDeleteTranscriptsResponse(const LLSD& notification, const LLSD& response);
void updateDeleteTranscriptsButton();
void updateMaxComplexity();
+ static bool loadFromFilename(const std::string& filename, std::map<std::string, std::string> &label_map);
static std::string sSkin;
notifications_map mNotificationOptions;