diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index efb2c1f2f..7e7f91153 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -246,6 +246,7 @@ set(viewer_SOURCE_FILES llfloaterreporter.cpp llfloaterscriptdebug.cpp llfloaterscriptlimits.cpp + llfloatersearch.cpp llfloatersearchreplace.cpp llfloatersellland.cpp llfloatersettingsdebug.cpp @@ -757,6 +758,7 @@ set(viewer_HEADER_FILES llfloaterreporter.h llfloaterscriptdebug.h llfloaterscriptlimits.h + llfloatersearch.h llfloatersearchreplace.h llfloatersellland.h llfloatersettingsdebug.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e6c86b8fb..bd0d92026 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7310,6 +7310,22 @@ This should be as low as possible, but too low may break functionality 0 + FloaterSearchRect + + Comment + Rectangle for web search browser window + Persist + 1 + Type + Rect + Value + + 16 + 650 + 600 + 128 + + FloaterSnapshotRect Comment @@ -8215,6 +8231,17 @@ This should be as low as possible, but too low may break functionality Value help/index.html + SearchURL + + Comment + URL for Search website, displayed in the Find floater + Persist + 0 + Type + String + Value + http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + WebProfileURL Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index dc52afbf3..526a4a9c8 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -620,5 +620,27 @@ Value 0 + UseWebSearch + + Comment + Always use web-based search instead of legacy search. + Persist + 1 + Type + Boolean + Value + 0 + + UseWebSearchSLURL + + Comment + When clicking search SLURLs, or using an SLapp that uses these, display the web-based search (When false, some search SLURLs may display somewhat improperly). + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index cb37291f5..aaafd84ae 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -53,7 +53,6 @@ LLPrefsAscentSys::LLPrefsAscentSys() //General ----------------------------------------------------------------------------- getChild("speed_rez_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2)); getChild("double_click_teleport_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2)); - getChild("system_folder_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2)); getChild("show_look_at_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2)); getChild("enable_clouds")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2)); getChild("power_user_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2)); @@ -111,10 +110,6 @@ void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value) childSetEnabled("center_after_teleport_check", enabled); childSetEnabled("offset_teleport_check", enabled); } - else if (name == "system_folder_check") - { - childSetEnabled("temp_in_system_check", enabled); - } else if (name == "enable_clouds") { childSetEnabled("enable_classic_clouds", enabled); @@ -225,6 +220,7 @@ void LLPrefsAscentSys::refreshValues() mSpeedRez = gSavedSettings.getBOOL("SpeedRez"); mSpeedRezInterval = gSavedSettings.getU32("SpeedRezInterval"); mUseWebProfiles = gSavedSettings.getBOOL("UseWebProfiles"); + mUseWebSearch = gSavedSettings.getBOOL("UseWebSearch"); //Command Line ------------------------------------------------------------------------ mCmdLine = gSavedSettings.getBOOL("AscentCmdLine"); @@ -376,6 +372,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("SpeedRez", mSpeedRez); gSavedSettings.setU32("SpeedRezInterval", mSpeedRezInterval); gSavedSettings.setBOOL("UseWebProfiles", mUseWebProfiles); + gSavedSettings.setBOOL("UseWebSearch", mUseWebSearch); //Command Line ------------------------------------------------------------------------ gSavedSettings.setBOOL("AscentCmdLine", mCmdLine); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 8bc0f0d7f..7e60d42c9 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -73,6 +73,7 @@ protected: BOOL mSpeedRez; U32 mSpeedRezInterval; bool mUseWebProfiles; + bool mUseWebSearch; //Command Line ------------------------------------------------------------------------ BOOL mCmdLine; diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index a696e61ff..2d04c3919 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -34,6 +34,7 @@ #include "llfloaterdirectory.h" +#include "llfloatersearch.h" // For callback to open web search #include "llpaneldirfind.h" #include "llpaneldirevents.h" #include "llpaneldirland.h" @@ -42,36 +43,19 @@ #include "llpaneldirgroups.h" #include "llpaneldirplaces.h" #include "llpaneldirclassified.h" -#include "llresizehandle.h" -#include "llresmgr.h" -#include "llscrollbar.h" -#include "llbutton.h" - -#include "llkeyboard.h" -#include "llscrollcontainer.h" -#include "llcheckboxctrl.h" -#include "lluiconstants.h" -#include "llviewercontrol.h" #include "llagent.h" #include "llpanelavatar.h" #include "llpanelevent.h" #include "llpanelclassified.h" #include "llpanelgroup.h" -#include "llpanelpick.h" #include "llpanelplace.h" -#include "llpaneldirland.h" -#include "llfloateravatarinfo.h" -#include "lldir.h" #include "lluictrlfactory.h" #include "hippogridmanager.h" #include "llenvmanager.h" #include "llnotificationsutil.h" #include "llviewerregion.h" -#include "llwindow.h" - -#include "llnotifications.h" const char* market_panel = "market_panel"; @@ -140,7 +124,7 @@ public: else { LLNotificationsUtil::add("MarketplaceURLChanged", LLSD(), LLSD(), - boost::bind(&LLPanelDirMarket::onConfirmChangeMarketplaceURL, this, boost::bind(LLNotification::getSelectedOption, _1, _2), url)); + boost::bind(&LLPanelDirMarket::onConfirmChangeMarketplaceURL, this, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2), url)); } } else if (!mMarketplaceURL.empty()) @@ -239,6 +223,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) if (enableWebSearch) { + mCommitCallbackRegistrar.add("Search.WebFloater", boost::bind(&LLFloaterSearch::open, boost::bind(LLFloaterSearch::getInstance))); if (enableClassicAllSearch) LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory3.xml", &factory_map); else @@ -452,6 +437,11 @@ void LLFloaterDirectory::showClassified(const LLUUID& classified_id) } } +// static +void LLFloaterDirectory::showClassified(const std::string& search_text) +{ + performQueryOn("classified_panel", search_text); +} // static void LLFloaterDirectory::showEvents(S32 event_id) @@ -470,6 +460,12 @@ void LLFloaterDirectory::showEvents(S32 event_id) } } +// static +void LLFloaterDirectory::showEvents(const std::string& search_text) +{ + performQueryOn("events_panel", search_text); +} + // static void LLFloaterDirectory::showLandForSale(const LLUUID& parcel_id) { @@ -482,9 +478,37 @@ void LLFloaterDirectory::showLandForSale(const LLUUID& parcel_id) } // static -void LLFloaterDirectory::showGroups() +void LLFloaterDirectory::showDestinations() { - showPanel("groups_panel"); + showPanel("showcase_panel"); +} + +// static +void LLFloaterDirectory::showGroups(const std::string& search_text) +{ + performQueryOn("groups_panel", search_text); +} + +// static +void LLFloaterDirectory::showPeople(const std::string& search_text) +{ + performQueryOn("people_panel", search_text); +} + +// static +void LLFloaterDirectory::showPlaces(const std::string& search_text) +{ + performQueryOn("places_panel", search_text); +} + +//static +void LLFloaterDirectory::performQueryOn(const std::string& name, const std::string& search_text) +{ + showPanel(name); + if (search_text.empty()) return; // We're done here. + LLPanelDirBrowser* panel = sInstance->getChild(name); + panel->getChild("name")->setValue(search_text); + panel->performQuery(); } // static diff --git a/indra/newview/llfloaterdirectory.h b/indra/newview/llfloaterdirectory.h index 0f57b0ff7..b4cbf1f18 100644 --- a/indra/newview/llfloaterdirectory.h +++ b/indra/newview/llfloaterdirectory.h @@ -73,9 +73,14 @@ public: // selected. static void showFindAll(const std::string& search_text); static void showClassified(const LLUUID& classified_id); + static void showClassified(const std::string& search_text = ""); static void showEvents(S32 event_id); + static void showEvents(const std::string& search_text = ""); static void showLandForSale(const LLUUID& parcel_id); - static void showGroups(); + static void showDestinations(); + static void showGroups(const std::string& search_text = ""); + static void showPeople(const std::string& search_text = ""); + static void showPlaces(const std::string& search_text = ""); static void refreshGroup(const LLUUID& group_id); static void hide(void*); @@ -86,6 +91,7 @@ public: void hideAllDetailPanels(); private: + static void performQueryOn(const std::string& name, const std::string& search_text); static void showPanel(const std::string& tabname); /*virtual*/ void onClose(bool app_quitting); void focusCurrentPanel(); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp new file mode 100755 index 000000000..6aa2d1ecc --- /dev/null +++ b/indra/newview/llfloatersearch.cpp @@ -0,0 +1,279 @@ +/** + * @file llfloatersearch.cpp + * @author Martin Reddy + * @brief Search floater - uses an embedded web browser control + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcommandhandler.h" +#include "llfloatersearch.h" +#include "llfloaterdirectory.h" +#include "llmediactrl.h" +#include "llnotificationsutil.h" +#include "lluserauth.h" +#include "lluri.h" +#include "llagent.h" +#include "llui.h" +#include "lluictrlfactory.h" +#include "llviewercontrol.h" +#include "llweb.h" + +void toggle_search_floater() +{ + if (!gSavedSettings.getString("SearchURL").empty() && gSavedSettings.getBOOL("UseWebSearch")) + { + if (LLFloaterSearch::instanceExists() && LLFloaterSearch::instance().getVisible()) + LLFloaterSearch::instance().close(); + else + LLFloaterSearch::getInstance()->open(); + } + else + { + LLFloaterDirectory::toggleFind(0); + } +} + +// 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) + { + /*if (!LLUI::sSettingGroups["config"]->getBOOL("EnableSearch")) + { + LLNotificationsUtil::add("NoSearch", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); + return true; + }*/ + + 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 + LLFloaterSearch::Params p; + p.search.category = category; + p.search.query = LLURI::unescape(search_text); + + // open the search floater and perform the requested search + //LLFloaterReg::showInstance("search", p); + LLFloaterSearch::showInstance(p.search, gSavedSettings.getBOOL("UseWebSearchSLURL")); + return true; + } +}; +LLSearchHandler gSearchHandler; + +LLFloaterSearch::SearchQuery::SearchQuery() +: category("category", ""), + query("query") +{} + +// Singu Note: We use changeDefault instead of setting these in onOpen +LLFloaterSearch::_Params::_Params() +{ + changeDefault(trusted_content, true); + changeDefault(allow_address_entry, false); + changeDefault(window_class, "search"); // Don't include this in the count with "web_content" +} + +LLFloaterSearch::LLFloaterSearch(const Params& key) : + LLFloaterWebContent(key), + mSearchGodLevel(0) +{ + // declare a map that transforms a category name into + // the URL suffix that is used to search that category + mCategoryPaths = LLSD::emptyMap(); + mCategoryPaths["all"] = "search"; + mCategoryPaths["people"] = "search/people"; + mCategoryPaths["places"] = "search/places"; + mCategoryPaths["events"] = "search/events"; + mCategoryPaths["groups"] = "search/groups"; + mCategoryPaths["wiki"] = "search/wiki"; + mCategoryPaths["destinations"] = "destinations"; + mCategoryPaths["classifieds"] = "classifieds"; + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_web_content.xml"); +} + +BOOL LLFloaterSearch::postBuild() +{ + LLFloaterWebContent::postBuild(); + mWebBrowser->addObserver(this); + // Singu Note: Initialize ui and browser now + mWebBrowser->setTrustedContent(true); + mWebBrowser->setFocus(true); + getChild("status_bar")->setVisible(true); + getChild("nav_controls")->setVisible(true); + getChildView("address")->setEnabled(false); + getChildView("popexternal")->setEnabled(false); + setRectControl("FloaterSearchRect"); + applyRectControl(); + search(SearchQuery()); + + return TRUE; +} + +//static +void LLFloaterSearch::showInstance(const SearchQuery& search, bool web) +{ + if (!gSavedSettings.getString("SearchURL").empty() && (web || gSavedSettings.getBOOL("UseWebSearch"))) + { + LLFloaterSearch* floater = getInstance(); + floater->open(); // May not be open + floater->search(search); + } + else + { + const std::string category(search.category()); + if (category.empty() || category == "all") + LLFloaterDirectory::showFindAll(search.query); + else if (category == "people") + LLFloaterDirectory::showPeople(search.query); + else if (category == "places") + LLFloaterDirectory::showPlaces(search.query); + else if (category == "events") + LLFloaterDirectory::showEvents(search.query); + else if (category == "groups") + LLFloaterDirectory::showGroups(search.query); + /* Singu TODO: Wiki tab in secondlife legacy search floater? + else if (category == "wiki") + LLFloaterDirectory::showWiki(search.query);*/ + else if (category == "destinations") + LLFloaterDirectory::showDestinations(); + else if (category == "classifieds") + LLFloaterDirectory::showClassified(search.query); + else + LLNotificationsUtil::add("UnsupportedCommandSLURL"); // Singu Note: Perhaps we should use a special notification here? + } +} + +/*void LLFloaterSearch::onOpen(const LLSD& 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) +{ + if (!app_quitting) // Singu Note: Copy the behavior of the legacy search singleton retaining last search when reopened + { + setVisible(false); + return; + } + 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::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). + + //FIXME: set status bar text + + //getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); +} + +void LLFloaterSearch::search(const SearchQuery &p) +{ + if (! mWebBrowser || !p.validateBlock()) + { + return; + } + + // reset the god level warning as we're sending the latest state + //getChildView("refresh_search")->setVisible(FALSE); + mSearchGodLevel = gAgent.getGodLevel(); + + // work out the subdir to use based on the requested category + LLSD subs; + if (mCategoryPaths.has(p.category)) + { + subs["CATEGORY"] = mCategoryPaths[p.category].asString(); + } + else + { + subs["CATEGORY"] = mCategoryPaths["all"].asString(); + } + + // add the search query string + 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. + LLSD search_token = LLUserAuth::getInstance()->getResponse("search_token"); + if (search_token.asString().empty()) + { + search_token = LLUserAuth::getInstance()->getResponse("auth_token"); + } + subs["AUTH_TOKEN"] = search_token.asString(); + + // add the user's preferred maturity (can be changed via prefs) + std::string maturity; + if (gAgent.prefersAdult()) + { + maturity = "42"; // PG,Mature,Adult + } + else if (gAgent.prefersMature()) + { + maturity = "21"; // PG,Mature + } + else + { + maturity = "13"; // PG + } + subs["MATURITY"] = maturity; + + // add the user's god status + subs["GODLIKE"] = gAgent.isGodlike() ? "1" : "0"; + + // get the search URL and expand all of the substitutions + // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) + std::string url = gSavedSettings.getString("SearchURL"); + url = LLWeb::expandURLSubstitutions(url, subs); + + // and load the URL in the web view + mWebBrowser->navigateTo(url, "text/html"); +} diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h new file mode 100755 index 000000000..8cba06a1e --- /dev/null +++ b/indra/newview/llfloatersearch.h @@ -0,0 +1,97 @@ +/** + * @file llfloatersearch.h + * @author Martin Reddy + * @brief Search floater - uses an embedded web browser control + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERSEARCH_H +#define LL_LLFLOATERSEARCH_H + +#include "llfloaterwebcontent.h" +#include "llviewermediaobserver.h" + +#include + +class LLMediaCtrl; + +/// +/// The search floater allows users to perform all search operations. +/// All search functionality is now implemented via web services and +/// so this floater simply embeds a web view and displays the search +/// web page. The browser control is explicitly marked as "trusted" +/// so that the user can click on teleport links in search results. +/// +class LLFloaterSearch : + public LLFloaterWebContent, public LLSingleton +{ +public: + struct SearchQuery : public LLInitParam::Block + { + Optional category; + Optional query; + + SearchQuery(); + }; + + struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params> + { + Optional search; + _Params(); // Singu Note: We use changeDefault instead of setting these in onOpen + }; + + typedef LLSDParamAdapter<_Params> Params; + + LLFloaterSearch(const Params& key = Params()); + + using LLSingleton::getInstance; + static void showInstance(const SearchQuery& p, bool web = false); + + /// show the search floater with a new search + /// see search() for details on the key parameter. + /// Singu Note: Leave the browser (and position) alone, here, we'll call search() directly with a SearchQuery if opening the floater through showInstance() + /*virtual*/ void onOpen(/*const LLSD& key*/) {} + + /*virtual*/ void onClose(bool app_quitting); + + /// perform a search with the specific search term. + /// The key should be a map that can contain the following keys: + /// - "id": specifies the text phrase to search for + /// - "category": one of "all" (default), "people", "places", + /// "events", "groups", "wiki", "destinations", "classifieds" + void search(const SearchQuery &query); + + /// changing godmode can affect the search results that are + /// returned by the search website - use this method to tell the + /// search floater that the user has changed god level. + void godLevelChanged(U8 godlevel); + +private: + /*virtual*/ BOOL postBuild(); + + LLSD mCategoryPaths; + U8 mSearchGodLevel; +}; + +#endif // LL_LLFLOATERSEARCH_H + diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 7537e9e56..fcaaa2f42 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1718,11 +1718,9 @@ void LLFloaterWorldMap::onChangeMaturity() bool can_access_adult = gAgent.canAccessAdult(); getChildView("events_mature_icon")->setVisible( can_access_mature); - getChildView("event_mature_label")->setVisible( can_access_mature); getChildView("event_mature_chk")->setVisible( can_access_mature); getChildView("events_adult_icon")->setVisible( can_access_adult); - getChildView("event_adult_label")->setVisible( can_access_adult); getChildView("event_adult_chk")->setVisible( can_access_adult); // disable mature / adult events. diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index ade7e1d1f..60a4a6caf 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -32,8 +32,8 @@ #include "llagent.h" #include "llcommandhandler.h" #include "llfloaterchatterbox.h" // for LLFloaterMyFriends -#include "llfloaterdirectory.h" #include "llfloatergroupinfo.h" +#include "llfloatersearch.h" #include "llgroupmgr.h" #include "llimview.h" // for gIMMgr #include "llnotificationsutil.h" @@ -125,7 +125,9 @@ LLGroupHandler gGroupHandler; void LLGroupActions::search() { //LLFloaterReg::showInstance("search", LLSD().with("category", "groups")); - LLFloaterDirectory::showGroups(); + LLFloaterSearch::SearchQuery search; + search.category = "groups"; + LLFloaterSearch::showInstance(search); } // static diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 94f70d379..652b3ed31 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -70,6 +70,8 @@ #include "llworldmap.h" #include "llfocusmgr.h" +void toggle_search_floater(); + void handle_track_avatar(const LLUUID& agent_id, const std::string& name) { LLAvatarTracker::instance().track(agent_id, name); @@ -97,7 +99,7 @@ void handle_mini_map(void*) void handle_find(void*) { - LLFloaterDirectory::toggleFind(NULL); + toggle_search_floater(); } diff --git a/indra/newview/llpaneldirevents.cpp b/indra/newview/llpaneldirevents.cpp index 347cf5b62..8b7453b1b 100644 --- a/indra/newview/llpaneldirevents.cpp +++ b/indra/newview/llpaneldirevents.cpp @@ -215,7 +215,7 @@ void LLPanelDirEvents::performQueryOrDelete(U32 event_id) U32 cat_id = childGetValue("category combo").asInteger(); params << cat_id << "|"; - params << childGetValue("event_search_text").asString(); + params << childGetValue("name").asString(); // send the message if (0 == event_id) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 85f7e673e..f3f55ca45 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -4151,6 +4151,7 @@ bool process_login_success_response(std::string& password) if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); tmp = response["search"].asString(); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); + if (gHippoGridManager->getConnectedGrid()->isOpenSimulator()) gSavedSettings.setString("SearchURL", tmp); // Singu Note: For web search purposes, always set this setting tmp = response["currency"].asString(); if (!tmp.empty()) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index e5f14641e..fcec44e4b 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -41,12 +41,12 @@ #include "llenvmanager.h" #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" -#include "llfloaterdirectory.h" // to spawn search #include "llfloaterinventory.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" +#include "llfloatersearch.h" #include "llhudicon.h" #include "llkeyboard.h" #include "lllineeditor.h" @@ -994,8 +994,9 @@ void LLStatusBar::onCommitSearch(LLUICtrl*, void* data) void LLStatusBar::onClickSearch(void* data) { LLStatusBar* self = (LLStatusBar*)data; - std::string search_text = self->childGetText("search_editor"); - LLFloaterDirectory::showFindAll(search_text); + LLFloaterSearch::SearchQuery search; + search.query = self->childGetText("search_editor"); + LLFloaterSearch::showInstance(search); } // static diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 8df0599dd..84f4f7775 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -188,6 +188,8 @@ #include "hippogridmanager.h" +void toggle_search_floater(); + using namespace LLOldEvents; using namespace LLAvatarAppearanceDefines; void init_client_menu(LLMenuGL* menu); @@ -5546,7 +5548,7 @@ class LLEditSearch : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLFloaterDirectory::toggleFind(NULL); + toggle_search_floater(); return true; } }; diff --git a/indra/newview/skins/default/xui/en-us/floater_directory.xml b/indra/newview/skins/default/xui/en-us/floater_directory.xml index bb88ba00c..32bd66d31 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory.xml @@ -196,7 +196,7 @@ + max_length="63" mouse_opaque="true" name="name" width="160" spell_check="true" /> + max_length="63" mouse_opaque="true" name="name" width="160" spell_check="true" /> + max_length="63" mouse_opaque="true" name="name" width="160" spell_check="true" /> seconds + diff --git a/indra/newview/skins/default/xui/fr/floater_directory.xml b/indra/newview/skins/default/xui/fr/floater_directory.xml index 8e5f3e1a6..9dcbfd105 100644 --- a/indra/newview/skins/default/xui/fr/floater_directory.xml +++ b/indra/newview/skins/default/xui/fr/floater_directory.xml @@ -116,7 +116,6 @@ Trouver - En cours et futurs diff --git a/indra/newview/skins/default/xui/pt/floater_directory.xml b/indra/newview/skins/default/xui/pt/floater_directory.xml index 6263332cf..38b156474 100644 --- a/indra/newview/skins/default/xui/pt/floater_directory.xml +++ b/indra/newview/skins/default/xui/pt/floater_directory.xml @@ -110,7 +110,7 @@ Encontrar: - + Em progresso e processando