Skip to content
Snippets Groups Projects
Commit a14a19e3 authored by brad kittenbrink's avatar brad kittenbrink
Browse files

Added a new setSetting listener.

parent 726ac3ed
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
// external library headers // external library headers
// other Linden headers // other Linden headers
#include "llappviewer.h" #include "llappviewer.h"
#include "llviewercontrol.h"
LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer): LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer):
LLDispatchListener(pumpname, "op"), LLDispatchListener(pumpname, "op"),
...@@ -25,9 +26,21 @@ LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewe ...@@ -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() every method we want to be able to invoke via this event API.
add("requestQuit", &LLAppViewerListener::requestQuit); add("requestQuit", &LLAppViewerListener::requestQuit);
add("setSetting", &LLAppViewerListener::setSetting);
} }
void LLAppViewerListener::requestQuit(const LLSD& event) const void LLAppViewerListener::requestQuit(const LLSD& event) const
{ {
mAppViewer->requestQuit(); 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"]);
}
}
...@@ -27,6 +27,7 @@ class LLAppViewerListener: public LLDispatchListener ...@@ -27,6 +27,7 @@ class LLAppViewerListener: public LLDispatchListener
private: private:
void requestQuit(const LLSD& event) const; void requestQuit(const LLSD& event) const;
void setSetting(const LLSD & event) const;
LLAppViewer* mAppViewer; LLAppViewer* mAppViewer;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment