From fa3f4d11665af44234f8e0ae3e8d8c0ce31d356d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 12 Jul 2011 20:58:30 -0700 Subject: EXP-880 FIX Enable navigation chrome for Search floater search floater derives from floater_web_content all web content now uses floater_web_content instead of media_browser --- indra/newview/llfloatersearch.cpp | 60 +++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 34 deletions(-) (limited to 'indra/newview/llfloatersearch.cpp') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index d5806e375c..e9710c41a1 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -70,21 +70,25 @@ public: } // create the LLSD arguments for the search floater - LLSD args; - args["category"] = category; - args["id"] = LLURI::unescape(search_text); + LLFloaterSearch::Params p; + p.category = category; + p.query = LLURI::unescape(search_text); // open the search floater and perform the requested search - LLFloaterReg::showInstance("search", args); + LLFloaterReg::showInstance("search", p); return true; } }; LLSearchHandler gSearchHandler; +LLFloaterSearch::_Params::_Params() +: category("category", ""), + query("query") +{} + + LLFloaterSearch::LLFloaterSearch(const LLSD& key) : - LLFloater(key), - LLViewerMediaObserver(), - mBrowser(NULL), + LLFloaterWebContent(key), mSearchGodLevel(0) { // declare a map that transforms a category name into @@ -102,53 +106,43 @@ LLFloaterSearch::LLFloaterSearch(const LLSD& key) : BOOL LLFloaterSearch::postBuild() { - mBrowser = getChild("browser"); - mBrowser->addObserver(this); + LLFloaterWebContent::postBuild(); + mWebBrowser->addObserver(this); return TRUE; } void LLFloaterSearch::onOpen(const LLSD& key) { + LLFloaterWebContent::onOpen(key); search(key); } void LLFloaterSearch::onClose(bool app_quitting) { + LLFloaterWebContent::onClose(app_quitting); // tear down the web view so we don't show the previous search // result when the floater is opened next time destroy(); } -void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) -{ - switch (event) - { - case MEDIA_EVENT_NAVIGATE_BEGIN: - getChild("status_text")->setValue(getString("loading_text")); - break; - - case MEDIA_EVENT_NAVIGATE_COMPLETE: - getChild("status_text")->setValue(getString("done_text")); - break; - - default: - break; - } -} - void LLFloaterSearch::godLevelChanged(U8 godlevel) { // search results can change based upon god level - if the user // changes god level, then give them a warning (we don't refresh // the search as this might undo any page navigation or // AJAX-driven changes since the last search). - getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); + + //FIXME: set status bar text + + //getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); } void LLFloaterSearch::search(const LLSD &key) { - if (! mBrowser) + Params p(key); + + if (! mWebBrowser || !p.validateBlock()) { return; } @@ -159,10 +153,9 @@ void LLFloaterSearch::search(const LLSD &key) // work out the subdir to use based on the requested category LLSD subs; - std::string category = key.has("category") ? key["category"].asString() : ""; - if (mCategoryPaths.has(category)) + if (mCategoryPaths.has(p.category)) { - subs["CATEGORY"] = mCategoryPaths[category].asString(); + subs["CATEGORY"] = mCategoryPaths[p.category].asString(); } else { @@ -170,8 +163,7 @@ void LLFloaterSearch::search(const LLSD &key) } // add the search query string - std::string search_text = key.has("id") ? key["id"].asString() : ""; - subs["QUERY"] = LLURI::escape(search_text); + subs["QUERY"] = LLURI::escape(p.query); // add the permissions token that login.cgi gave us // We use "search_token", and fallback to "auth_token" if not present. @@ -207,5 +199,5 @@ void LLFloaterSearch::search(const LLSD &key) url = LLWeb::expandURLSubstitutions(url, subs); // and load the URL in the web view - mBrowser->navigateTo(url, "text/html"); + mWebBrowser->navigateTo(url, "text/html"); } -- cgit v1.2.3 From 38ba526cc57799211c4d926a6b4009cef32d21cd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 13 Jul 2011 17:59:53 -0700 Subject: EXP-1009 WIP Teleport links from Search floater and destination guide in viewer fail with intrusted browser error in viewer --- indra/newview/llfloatersearch.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatersearch.cpp') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index e9710c41a1..ce0bba802d 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -84,10 +84,13 @@ LLSearchHandler gSearchHandler; LLFloaterSearch::_Params::_Params() : category("category", ""), query("query") -{} +{ + trusted_content = true; + allow_address_entry = false; +} -LLFloaterSearch::LLFloaterSearch(const LLSD& key) : +LLFloaterSearch::LLFloaterSearch(const Params& key) : LLFloaterWebContent(key), mSearchGodLevel(0) { -- cgit v1.2.3 From 63a857f0c7f09c45eca9034c41ca1fdfc1ae95b5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Jul 2011 19:09:48 -0700 Subject: EXP-1054 FIX Entering search term in search box in Viewer UI does not produce search results if search window is already open use new parameters when opening existing floater --- indra/newview/llfloatersearch.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloatersearch.cpp') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index ce0bba802d..2a946b1edf 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -71,8 +71,8 @@ public: // create the LLSD arguments for the search floater LLFloaterSearch::Params p; - p.category = category; - p.query = LLURI::unescape(search_text); + p.search.category = category; + p.search.query = LLURI::unescape(search_text); // open the search floater and perform the requested search LLFloaterReg::showInstance("search", p); @@ -81,14 +81,10 @@ public: }; LLSearchHandler gSearchHandler; -LLFloaterSearch::_Params::_Params() +LLFloaterSearch::SearchQuery::SearchQuery() : category("category", ""), query("query") -{ - trusted_content = true; - allow_address_entry = false; -} - +{} LLFloaterSearch::LLFloaterSearch(const Params& key) : LLFloaterWebContent(key), @@ -117,8 +113,12 @@ BOOL LLFloaterSearch::postBuild() void LLFloaterSearch::onOpen(const LLSD& key) { - LLFloaterWebContent::onOpen(key); - search(key); + Params p(key); + p.trusted_content = true; + p.allow_address_entry = false; + + LLFloaterWebContent::onOpen(p); + search(p.search); } void LLFloaterSearch::onClose(bool app_quitting) @@ -141,10 +141,8 @@ void LLFloaterSearch::godLevelChanged(U8 godlevel) //getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); } -void LLFloaterSearch::search(const LLSD &key) +void LLFloaterSearch::search(const SearchQuery &p) { - Params p(key); - if (! mWebBrowser || !p.validateBlock()) { return; -- cgit v1.2.3