summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersearch.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-01-11 14:06:09 -0800
committerJames Cook <james@lindenlab.com>2010-01-11 14:06:09 -0800
commita36087f5c1851b0bd5eec5788609f35b8a524384 (patch)
treed7057930083ba9499fc8b3783a531b24ac9ea7f1 /indra/newview/llfloatersearch.cpp
parenta570c39bd3ca9ca567ef6a778305b8231535eb70 (diff)
parent370a8592ac4c3b6eb6fd9f6ddd35960b763e634f (diff)
Merge, sync from viewer-2-0, fixed conflict in llinspectavatar.cpp
Diffstat (limited to 'indra/newview/llfloatersearch.cpp')
-rw-r--r--indra/newview/llfloatersearch.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp
index c6d9fee630..a7401fdb6f 100644
--- a/indra/newview/llfloatersearch.cpp
+++ b/indra/newview/llfloatersearch.cpp
@@ -32,6 +32,9 @@
*/
#include "llviewerprecompiledheaders.h"
+
+#include "llcommandhandler.h"
+#include "llfloaterreg.h"
#include "llfloatersearch.h"
#include "llmediactrl.h"
#include "lllogininstance.h"
@@ -41,6 +44,42 @@
#include "llviewercontrol.h"
#include "llweb.h"
+// support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps
+class LLSearchHandler : public LLCommandHandler
+{
+public:
+ // requires trusted browser to trigger
+ LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { }
+ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ const size_t parts = tokens.size();
+
+ // get the (optional) category for the search
+ std::string category;
+ if (parts > 0)
+ {
+ category = tokens[0].asString();
+ }
+
+ // get the (optional) search string
+ std::string search_text;
+ if (parts > 1)
+ {
+ search_text = tokens[1].asString();
+ }
+
+ // create the LLSD arguments for the search floater
+ LLSD args;
+ args["category"] = category;
+ args["id"] = LLURI::unescape(search_text);
+
+ // open the search floater and perform the requested search
+ LLFloaterReg::showInstance("search", args);
+ return true;
+ }
+};
+LLSearchHandler gSearchHandler;
+
LLFloaterSearch::LLFloaterSearch(const LLSD& key) :
LLFloater(key),
LLViewerMediaObserver(),