From a14a19e33ac2a28b640ebbad514e9829f999a5f3 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Tue, 30 Jun 2009 12:08:24 -0400 Subject: Added a new setSetting listener. --- indra/newview/llappviewerlistener.cpp | 13 +++++++++++++ indra/newview/llappviewerlistener.h | 1 + 2 files changed, 14 insertions(+) (limited to 'indra/newview') 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; }; -- cgit v1.2.3 From df9a52cd2e7e43214343afe55c6af7e696afc92c Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Tue, 30 Jun 2009 12:08:43 -0400 Subject: Added loading of evenhost module to viewer. --- indra/newview/app_settings/settings.xml | 11 +++++++ indra/newview/llappviewer.cpp | 51 +++++++++++++++++++++++++++++++++ indra/newview/llappviewer.h | 2 ++ 3 files changed, 64 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index afa7f707f1..71878d02db 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5123,6 +5123,17 @@ Value 0 + QAModeEventHostPort + + Comment + Enable Testing Features. + Persist + 0 + Type + S32 + Value + -1 + QuietSnapshotsToDisk Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f9e6db52c3..b61e75f60d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -93,6 +93,10 @@ # include // For initMarkerFile support #endif +#include "llapr.h" +#include "apr_dso.h" +#include + #include "llnotify.h" #include "llviewerkeyboard.h" #include "lllfsthread.h" @@ -860,6 +864,11 @@ bool LLAppViewer::init() LLViewerJoystick::getInstance()->init(false); + if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0) + { + loadEventHostModule(gSavedSettings.getS32("QAModeEventHostPort")); + } + return true; } @@ -4085,3 +4094,45 @@ void LLAppViewer::handleLoginComplete() } writeDebugInfo(); } + +// *TODO - generalize this and move DSO wrangling to a helper class -brad +void LLAppViewer::loadEventHostModule(S32 listen_port) const +{ + std::string dso_name("liblleventhost"); + +#if LL_WINDOWS + dso_name += ".dll"; +#elif LL_DARWIN + dso_name += ".dylib"; +#else + dso_name += ".so"; +#endif + + std::string dso_path = gDirUtilp->findFile(dso_name, + gDirUtilp->getAppRODataDir(), + gDirUtilp->getExecutableDir()); + + apr_dso_handle_t * eventhost_dso_handle = NULL; + apr_pool_t * eventhost_dso_memory_pool = NULL; + + //attempt to load the shared library + apr_pool_create(&eventhost_dso_memory_pool, NULL); + apr_status_t rv = apr_dso_load(&eventhost_dso_handle, + dso_path.c_str(), + eventhost_dso_memory_pool); + ll_apr_assert_status(rv); + llassert_always(eventhost_dso_handle != NULL); + + int (*ll_plugin_start_func)(char const * const *, char const * const *) = NULL; + rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_start_func, eventhost_dso_handle, "ll_plugin_start"); + + ll_apr_assert_status(rv); + llassert_always(ll_plugin_start_func != NULL); + + std::string port_text = boost::lexical_cast(listen_port); + std::vector args; + args.push_back("-L"); + args.push_back(port_text.c_str()); + + ll_plugin_start_func(&args[0], &args[0] + args.size()); +} diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 540c878543..1227ab470f 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -204,6 +204,8 @@ private: void sendLogoutRequest(); void disconnectViewer(); + void loadEventHostModule(S32 listen_port) const; + // *FIX: the app viewer class should be some sort of singleton, no? // Perhaps its child class is the singleton and this should be an abstract base. static LLAppViewer* sInstance; -- cgit v1.2.3