summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2009-06-30 12:08:24 -0400
committerbrad kittenbrink <brad@lindenlab.com>2009-06-30 12:08:24 -0400
commita14a19e33ac2a28b640ebbad514e9829f999a5f3 (patch)
tree979e9a0966fbebc17320d07527eb6f0ecc6e74ec /indra
parent726ac3ed0f70900edbeeacece866a21ff90534d4 (diff)
Added a new setSetting listener.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llappviewerlistener.cpp13
-rw-r--r--indra/newview/llappviewerlistener.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp
index a8c98b17a7..befebae88e 100644
--- a/indra/newview/llappviewerlistener.cpp
+++ b/indra/newview/llappviewerlistener.cpp
@@ -18,6 +18,7 @@
// external library headers
// other Linden headers
#include "llappviewer.h"
+#include "llviewercontrol.h"
LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer):
LLDispatchListener(pumpname, "op"),
@@ -25,9 +26,21 @@ LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewe
{
// add() every method we want to be able to invoke via this event API.
add("requestQuit", &LLAppViewerListener::requestQuit);
+ add("setSetting", &LLAppViewerListener::setSetting);
}
void LLAppViewerListener::requestQuit(const LLSD& event) const
{
mAppViewer->requestQuit();
}
+
+void LLAppViewerListener::setSetting(const LLSD & event) const
+{
+ std::string control_name = event["name"].asString();
+ if (gSavedSettings.controlExists(control_name))
+ {
+ LLControlVariable* control = gSavedSettings.getControl(control_name);
+
+ control->set(event["value"]);
+ }
+}
diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h
index ab17dd1d90..ff63b69c13 100644
--- a/indra/newview/llappviewerlistener.h
+++ b/indra/newview/llappviewerlistener.h
@@ -27,6 +27,7 @@ public:
private:
void requestQuit(const LLSD& event) const;
+ void setSetting(const LLSD & event) const;
LLAppViewer* mAppViewer;
};