diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7d9d1615..3ba271f23 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -552,7 +552,7 @@ Comment URL to load for the Showcase tab in Second Life Persist - 1 + 0 Type String Value diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index b0fd2b254..6f01c2a86 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -260,99 +260,6 @@ void HippoGridInfo::setDirectoryFee(int fee) // ******************************************************************** // Grid Info -std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const -{ - // Don't worry about whether or not mSearchUrl is empty here anymore -- MC - if (is_web) - { - if (mPlatform == PLATFORM_SECONDLIFE) - { - // Second Life defaults - if (ty == SEARCH_ALL_EMPTY) - { - return gSavedSettings.getString("SearchURLDefault"); - } - else if (ty == SEARCH_ALL_QUERY) - { - return gSavedSettings.getString("SearchURLQuery"); - } - else if (ty == SEARCH_ALL_TEMPLATE) - { - return gSavedSettings.getString("SearchURLSuffix2"); - } - else - { - llinfos << "Illegal search URL type " << ty << llendl; - return ""; - } - } - else if (!mSearchUrl.empty()) - { - // Search url sent to us in the login response - if (ty == SEARCH_ALL_EMPTY) - { - return (mSearchUrl); - } - else if (ty == SEARCH_ALL_QUERY) - { - return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&"); - } - else if (ty == SEARCH_ALL_TEMPLATE) - { - return "lang=[LANG]&mat=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]"; - } - else - { - llinfos << "Illegal search URL type " << ty << llendl; - return ""; - } - } - else - { - // OpenSim and other web search defaults - if (ty == SEARCH_ALL_EMPTY) - { - return gSavedSettings.getString("SearchURLDefaultOpenSim"); - } - else if (ty == SEARCH_ALL_QUERY) - { - return gSavedSettings.getString("SearchURLQueryOpenSim"); - } - else if (ty == SEARCH_ALL_TEMPLATE) - { - return gSavedSettings.getString("SearchURLSuffixOpenSim"); - } - else - { - llinfos << "Illegal search URL type " << ty << llendl; - return ""; - } - } - } - else - { - // Use the old search all - if (ty == SEARCH_ALL_EMPTY) - { - return (mSearchUrl + "panel=All&"); - } - else if (ty == SEARCH_ALL_QUERY) - { - return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&"); - } - else if (ty == SEARCH_ALL_TEMPLATE) - { - return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]"; - } - else - { - llinfos << "Illegal search URL type " << ty << llendl; - return ""; - } - } -} - - //static void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts) { diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index 4416e8598..a33970e28 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -31,11 +31,6 @@ public: PLATFORM_SECONDLIFE, PLATFORM_LAST }; - enum SearchType { - SEARCH_ALL_EMPTY, - SEARCH_ALL_QUERY, - SEARCH_ALL_TEMPLATE - }; explicit HippoGridInfo(const std::string& gridName); @@ -58,7 +53,6 @@ public: const std::string& getSearchUrl() const { return mSearchUrl; } const std::string& getGridMessage() const { return mGridMessage; } const std::string& getVoiceConnector() const { return mVoiceConnector; } - std::string getSearchUrl(SearchType ty, bool is_web) const; bool isRenderCompat() const { return mRenderCompat; } std::string getGridNick() const; int getMaxAgentGroups() const { return mMaxAgentGroups; } diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index e4b6408e2..897dbe655 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -26,6 +26,8 @@ LFSimFeatureHandler::LFSimFeatureHandler() : mSupportsExport(false) +, mDestinationGuideURL(gSavedSettings.getString("ShowcaseURLDefault")) +, mSearchURL(gSavedSettings.getString("SearchURL")) , mSayRange(20) , mShoutRange(100) , mWhisperRange(10) @@ -66,6 +68,7 @@ void LFSimFeatureHandler::setSupportedFeatures() // http://opensimulator.org/wiki/SimulatorFeatures_Extras const LLSD& extras(info["OpenSimExtras"]); mSupportsExport = extras.has("ExportSupported") ? extras["ExportSupported"].asBoolean() : false; + mDestinationGuideURL = extras.has("destination-guide-url") ? extras["destination-guide-url"].asString() : ""; mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : ""; mSearchURL = extras.has("search-server-url") ? extras["search-server-url"].asString() : ""; mSayRange = extras.has("say-range") ? extras["say-range"].asInteger() : 20; @@ -84,27 +87,32 @@ void LFSimFeatureHandler::setSupportedFeatures() } } -boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const boost::signals2::signal::slot_type& slot) +boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const SignaledType::slot_t& slot) { return mSupportsExport.connect(slot); } -boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const boost::signals2::signal::slot_type& slot) +boost::signals2::connection LFSimFeatureHandler::setDestinationGuideURLCallback(const SignaledType::slot_t& slot) +{ + return mDestinationGuideURL.connect(slot); +} + +boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const SignaledType::slot_t& slot) { return mSearchURL.connect(slot); } -boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const boost::signals2::signal::slot_type& slot) +boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const SignaledType::slot_t& slot) { return mSayRange.connect(slot); } -boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const boost::signals2::signal::slot_type& slot) +boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const SignaledType::slot_t& slot) { return mShoutRange.connect(slot); } -boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const boost::signals2::signal::slot_type& slot) +boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const SignaledType::slot_t& slot) { return mWhisperRange.connect(slot); } diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index d26983fcd..371ec5e0c 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -21,21 +21,22 @@ #include "llsingleton.h" #include "llpermissions.h" // ExportPolicy -template > +template > class SignaledType { public: SignaledType() : mValue() {} SignaledType(Type b) : mValue(b) {} - boost::signals2::connection connect(const typename Signal::slot_type& slot) { return mSignal.connect(slot); } + typedef typename Signal::slot_type slot_t; + boost::signals2::connection connect(const slot_t& slot) { return mSignal.connect(slot); } SignaledType& operator =(Type val) { if (val != mValue) { mValue = val; - mSignal(); + mSignal(val); } return *this; } @@ -57,14 +58,16 @@ public: void setSupportedFeatures(); // Connection setters - boost::signals2::connection setSupportsExportCallback(const boost::signals2::signal::slot_type& slot); - boost::signals2::connection setSearchURLCallback(const boost::signals2::signal::slot_type& slot); - boost::signals2::connection setSayRangeCallback(const boost::signals2::signal::slot_type& slot); - boost::signals2::connection setShoutRangeCallback(const boost::signals2::signal::slot_type& slot); - boost::signals2::connection setWhisperRangeCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setSupportsExportCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setDestinationGuideURLCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setSearchURLCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setSayRangeCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setShoutRangeCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setWhisperRangeCallback(const SignaledType::slot_t& slot); // Accessors bool simSupportsExport() const { return mSupportsExport; } + std::string destinationGuideURL() const { return mDestinationGuideURL; } std::string mapServerURL() const { return mMapServerURL; } std::string searchURL() const { return mSearchURL; } U32 sayRange() const { return mSayRange; } @@ -75,6 +78,7 @@ public: private: // SignaledTypes SignaledType mSupportsExport; + SignaledType mDestinationGuideURL; std::string mMapServerURL; SignaledType mSearchURL; SignaledType mSayRange; diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index 3bd2932d9..ce2f71e16 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -53,12 +53,26 @@ #include "lluictrlfactory.h" #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" #include "llenvmanager.h" #include "llnotificationsutil.h" #include "llviewerregion.h" const char* market_panel = "market_panel"; +void set_tab_visible(LLTabContainer* container, LLPanel* tab, bool visible, LLPanel* prev_tab) +{ + if (visible) + { + if (prev_tab) + container->lockTabs(container->getIndexForPanel(prev_tab) + 1); + container->addTabPanel(tab, tab->getLabel(), false, 0, false, LLTabContainer::START); + if (prev_tab) + container->unlockTabs(); + } + else container->removeTabPanel(tab); +} + class LLPanelDirMarket : public LLPanelDirFind { public: @@ -205,10 +219,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) mPanelClassifiedp = NULL; // Build the floater with our tab panel classes - - bool enableWebSearch = gHippoGridManager->getConnectedGrid()->isSecondLife() || - !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty(); - bool enableClassicAllSearch = !gHippoGridManager->getConnectedGrid()->isSecondLife(); + bool secondlife = gHippoGridManager->getConnectedGrid()->isSecondLife(); LLCallbackMap::map_t factory_map; factory_map["classified_panel"] = LLCallbackMap(createClassified, this); @@ -218,15 +229,13 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) factory_map["people_panel"] = LLCallbackMap(createPeople, this); factory_map["groups_panel"] = LLCallbackMap(createGroups, this); factory_map[market_panel] = LLCallbackMap(LLPanelDirMarket::create, this); - if (enableWebSearch) + factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); + factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this); + if (secondlife) { - // web search and showcase only for SecondLife - factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); - factory_map["showcase_panel"] = LLCallbackMap(createShowcase, this); - if (!enableClassicAllSearch) factory_map["web_panel"] = LLCallbackMap(createWebPanel, this); + factory_map["web_panel"] = LLCallbackMap(createWebPanel, this); } - - if (enableClassicAllSearch) + else { factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this); } @@ -240,28 +249,33 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this); - 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 - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory.xml", &factory_map); - } - else - { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory2.xml", &factory_map); - } + mCommitCallbackRegistrar.add("Search.WebFloater", boost::bind(&LLFloaterSearch::open, boost::bind(LLFloaterSearch::getInstance))); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_directory.xml", &factory_map); moveResizeHandlesToFront(); - if(mPanelAvatarp) + if (mPanelAvatarp) { mPanelAvatarp->selectTab(0); } LLTabContainer* container = getChild("Directory Tabs"); - if (enableClassicAllSearch) + if (secondlife) { + container->removeTabPanel(getChild("find_all_old_panel")); // Not used + } + else + { + container->removeTabPanel(getChild("web_panel")); // Not needed + LLPanel* panel(getChild("find_all_panel")); + LLPanel* prev_tab(getChild("find_all_old_panel")); + LFSimFeatureHandler& inst(LFSimFeatureHandler::instance()); + set_tab_visible(container, panel, !inst.searchURL().empty(), prev_tab); + inst.setSearchURLCallback(boost::bind(set_tab_visible, container, panel, !boost::bind(&std::string::empty, _1), prev_tab)); + panel = getChild("showcase_panel"); + prev_tab = getChild("events_panel"); + set_tab_visible(container, panel, !inst.destinationGuideURL().empty(), prev_tab); + inst.setDestinationGuideURLCallback(boost::bind(set_tab_visible, container, panel, !boost::bind(&std::string::empty, _1), prev_tab)); + LLPanelDirMarket* marketp = static_cast(container->getPanelByName(market_panel)); container->removeTabPanel(marketp); // Until we get a MarketPlace URL, tab is removed. marketp->handleRegionChange(container); @@ -452,7 +466,7 @@ void LLFloaterDirectory::searchInAll(const std::string& search_text) void LLFloaterDirectory::showFindAll(const std::string& search_text) { - showPanel("find_all_panel"); + showPanel(LFSimFeatureHandler::instance().searchURL().empty() ? "find_all_old_panel" : "find_all_panel"); LLPanelDirFindAllInterface::search(sInstance->mFindAllPanel, search_text); } @@ -589,12 +603,16 @@ void LLFloaterDirectory::toggleFind(void*) if (!sInstance) { std::string panel = gSavedSettings.getString("LastFindPanel"); - bool hasWebSearch = gHippoGridManager->getConnectedGrid()->isSecondLife() || - !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty(); - if (hasWebSearch && (panel == "find_all_panel" || panel == "showcase_panel")) + if (!gHippoGridManager->getConnectedGrid()->isSecondLife()) { - panel = "find_all_old_panel"; + LFSimFeatureHandler& inst(LFSimFeatureHandler::instance()); + if (panel == "web_panel" + || (inst.searchURL().empty() && panel == "find_all_panel") + || (inst.destinationGuideURL().empty() && panel == "showcase_panel")) + panel = "find_all_old_panel"; } + else if (panel == "find_all_old_panel") panel = "find_all_panel"; + showPanel(panel); // HACK: force query for today's events diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 5d51959d3..67e9421a5 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -144,6 +144,7 @@ BOOL LLFloaterSearch::postBuild() setRectControl("FloaterSearchRect"); applyRectControl(); search(SearchQuery()); + gSavedSettings.getControl("SearchURL")->getSignal()->connect(boost::bind(&LLFloaterSearch::search, this, SearchQuery())); return TRUE; } diff --git a/indra/newview/llpaneldirfind.cpp b/indra/newview/llpaneldirfind.cpp index 2903355f5..9d862afd8 100644 --- a/indra/newview/llpaneldirfind.cpp +++ b/indra/newview/llpaneldirfind.cpp @@ -65,6 +65,7 @@ #include "llpaneldirbrowser.h" #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -76,6 +77,92 @@ //--------------------------------------------------------------------------- // LLPanelDirFindAll - Google search appliance based search //--------------------------------------------------------------------------- +namespace +{ + std::string getSearchUrl() + { + return LFSimFeatureHandler::instance().searchURL(); + } + enum SearchType + { + SEARCH_ALL_EMPTY, + SEARCH_ALL_QUERY, + SEARCH_ALL_TEMPLATE + }; + std::string getSearchUrl(SearchType ty, bool is_web) + { + const std::string mSearchUrl(getSearchUrl()); + if (is_web) + { + if (gHippoGridManager->getConnectedGrid()->isSecondLife()) + { + // Second Life defaults + if (ty == SEARCH_ALL_EMPTY) + { + return gSavedSettings.getString("SearchURLDefault"); + } + else if (ty == SEARCH_ALL_QUERY) + { + return gSavedSettings.getString("SearchURLQuery"); + } + else if (ty == SEARCH_ALL_TEMPLATE) + { + return gSavedSettings.getString("SearchURLSuffix2"); + } + } + else if (!mSearchUrl.empty()) + { + // Search url sent to us in the login response + if (ty == SEARCH_ALL_EMPTY) + { + return mSearchUrl; + } + else if (ty == SEARCH_ALL_QUERY) + { + return mSearchUrl + "q=[QUERY]&s=[COLLECTION]&"; + } + else if (ty == SEARCH_ALL_TEMPLATE) + { + return "lang=[LANG]&mat=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]"; + } + } + else + { + // OpenSim and other web search defaults + if (ty == SEARCH_ALL_EMPTY) + { + return gSavedSettings.getString("SearchURLDefaultOpenSim"); + } + else if (ty == SEARCH_ALL_QUERY) + { + return gSavedSettings.getString("SearchURLQueryOpenSim"); + } + else if (ty == SEARCH_ALL_TEMPLATE) + { + return gSavedSettings.getString("SearchURLSuffixOpenSim"); + } + } + } + else + { + // Use the old search all + if (ty == SEARCH_ALL_EMPTY) + { + return mSearchUrl + "panel=All&"; + } + else if (ty == SEARCH_ALL_QUERY) + { + return mSearchUrl + "q=[QUERY]&s=[COLLECTION]&"; + } + else if (ty == SEARCH_ALL_TEMPLATE) + { + return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]&dice=[DICE]"; + } + } + llinfos << "Illegal search URL type " << ty << llendl; + return ""; + } +} class LLPanelDirFindAll : public LLPanelDirFind @@ -90,6 +177,7 @@ public: LLPanelDirFindAll::LLPanelDirFindAll(const std::string& name, LLFloaterDirectory* floater) : LLPanelDirFind(name, floater, "find_browser") { + LFSimFeatureHandler::getInstance()->setSearchURLCallback(boost::bind(&LLPanelDirFindAll::navigateToDefaultPage, this)); } //--------------------------------------------------------------------------- @@ -264,48 +352,38 @@ void LLPanelDirFind::focus() void LLPanelDirFind::navigateToDefaultPage() { - std::string start_url = ""; + bool showcase(mBrowserName == "showcase_browser"); + std::string start_url = showcase ? LFSimFeatureHandler::instance().destinationGuideURL() : getSearchUrl(); + bool secondlife(gHippoGridManager->getConnectedGrid()->isSecondLife()); // Note: we use the web panel in OpenSim as well as Second Life -- MC - if (gHippoGridManager->getConnectedGrid()->getSearchUrl().empty() && - !gHippoGridManager->getConnectedGrid()->isSecondLife()) + if (start_url.empty() && !secondlife) { // OS-based but doesn't have its own web search url -- MC start_url = gSavedSettings.getString("SearchURLDefaultOpenSim"); } else { - if (gHippoGridManager->getConnectedGrid()->isSecondLife()) + if (!showcase) { - if (mBrowserName == "showcase_browser") - { - // note that the showcase URL in floater_directory.xml is no longer used - start_url = gSavedSettings.getString("ShowcaseURLDefault"); - } - else - { + if (secondlife) // Legacy Web Search start_url = gSavedSettings.getString("SearchURLDefault"); - } - } - else - { - // OS-based but has its own web search url -- MC - start_url = gHippoGridManager->getConnectedGrid()->getSearchUrl(); - start_url += "panel=" + getName() + "&"; - } + else // OS-based but has its own web search url -- MC + start_url += "panel=" + getName() + "&"; - if (hasChild("incmature")) - { - bool inc_pg = childGetValue("incpg").asBoolean(); - bool inc_mature = childGetValue("incmature").asBoolean(); - bool inc_adult = childGetValue("incadult").asBoolean(); - if (!(inc_pg || inc_mature || inc_adult)) + if (hasChild("incmature")) { - // if nothing's checked, just go for pg; we don't notify in - // this case because it's a default page. - inc_pg = true; + bool inc_pg = getChildView("incpg")->getValue().asBoolean(); + bool inc_mature = getChildView("incmature")->getValue().asBoolean(); + bool inc_adult = getChildView("incadult")->getValue().asBoolean(); + if (!(inc_pg || inc_mature || inc_adult)) + { + // if nothing's checked, just go for pg; we don't notify in + // this case because it's a default page. + inc_pg = true; + } + + start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); } - - start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); } } @@ -323,7 +401,7 @@ const std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, std::string url; if (search_text.empty()) { - url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_EMPTY, is_web); + url = getSearchUrl(SEARCH_ALL_EMPTY, is_web); } else { @@ -348,7 +426,7 @@ const std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, "-._~$+!*'()"; std::string query = LLURI::escape(search_text_with_plus, allowed); - url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_QUERY, is_web); + url = getSearchUrl(SEARCH_ALL_QUERY, is_web); std::string substring = "[QUERY]"; std::string::size_type where = url.find(substring); if (where != std::string::npos) @@ -373,14 +451,13 @@ const std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) const { - std::string url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_TEMPLATE, is_web); + std::string url = getSearchUrl(SEARCH_ALL_TEMPLATE, is_web); llinfos << "Suffix template " << url << llendl; if (!url.empty()) { // Note: opensim's default template (SearchURLSuffixOpenSim) is currently empty -- MC - if (gHippoGridManager->getConnectedGrid()->isSecondLife() || - !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty()) + if (gHippoGridManager->getConnectedGrid()->isSecondLife() || !getSearchUrl().empty()) { // if the mature checkbox is unchecked, modify query to remove // terms with given phrase from the result set @@ -524,11 +601,14 @@ LLPanelDirFindAll* LLPanelDirFindAllInterface::create(LLFloaterDirectory* floate return new LLPanelDirFindAll("find_all_panel", floater); } +static LLPanelDirFindAllOld* sFindAllOld = NULL; // static void LLPanelDirFindAllInterface::search(LLPanelDirFindAll* panel, const std::string& search_text) { - panel->search(search_text); + bool secondlife(gHippoGridManager->getConnectedGrid()->isSecondLife()); + if (secondlife || !getSearchUrl().empty()) panel->search(search_text); + if (!secondlife && sFindAllOld) sFindAllOld->search(search_text); } // static @@ -544,6 +624,7 @@ void LLPanelDirFindAllInterface::focus(LLPanelDirFindAll* panel) LLPanelDirFindAllOld::LLPanelDirFindAllOld(const std::string& name, LLFloaterDirectory* floater) : LLPanelDirBrowser(name, floater) { + sFindAllOld = this; mMinSearchChars = 3; } @@ -565,6 +646,7 @@ BOOL LLPanelDirFindAllOld::postBuild() LLPanelDirFindAllOld::~LLPanelDirFindAllOld() { + sFindAllOld = NULL; // Children all cleaned up by default view destructor. } @@ -575,12 +657,18 @@ void LLPanelDirFindAllOld::draw() LLPanelDirBrowser::draw(); } +void LLPanelDirFindAllOld::search(const std::string& query) +{ + getChildView("name")->setValue(query); + onClickSearch(); +} + void LLPanelDirFindAllOld::onClickSearch() { if (childGetValue("name").asString().length() < mMinSearchChars) { return; - }; + } BOOL inc_pg = childGetValue("incpg").asBoolean(); BOOL inc_mature = childGetValue("incmature").asBoolean(); diff --git a/indra/newview/llpaneldirfind.h b/indra/newview/llpaneldirfind.h index 8ec0e51aa..866c330a8 100644 --- a/indra/newview/llpaneldirfind.h +++ b/indra/newview/llpaneldirfind.h @@ -99,6 +99,7 @@ public: /*virtual*/ void draw(); + void search(const std::string& query); void onClickSearch(); }; diff --git a/indra/newview/llpaneldirpopular.cpp b/indra/newview/llpaneldirpopular.cpp index ddb9d3aa5..fa678d416 100644 --- a/indra/newview/llpaneldirpopular.cpp +++ b/indra/newview/llpaneldirpopular.cpp @@ -33,11 +33,13 @@ #include "llviewerprecompiledheaders.h" #include "llpaneldirpopular.h" +#include "lfsimfeaturehandler.h" LLPanelDirPopular::LLPanelDirPopular(const std::string& name, LLFloaterDirectory* floater) : LLPanelDirFind(name, floater, "showcase_browser") { // *NOTE: This is now the "Showcase" section + LFSimFeatureHandler::instance().setSearchURLCallback(boost::bind(&LLPanelDirPopular::navigateToDefaultPage, this)); } // virtual diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f76e3fa7d..df84f6917 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -60,6 +60,7 @@ #include "hippolimits.h" #include "floaterao.h" #include "statemachine/aifilepicker.h" +#include "lfsimfeaturehandler.h" #include "llares.h" #include "llavatarnamecache.h" @@ -326,6 +327,12 @@ void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is dialog_refresh_all(); } +void simfeature_debug_update(const std::string& val, const std::string& setting) +{ + //if (!val.empty()) // Singu Note: Should we only update the setting if not empty? + gSavedSettings.setString(setting, val); +} + // // exported functionality // @@ -1257,6 +1264,9 @@ bool idle_startup() requested_options.push_back("tutorial_setting"); requested_options.push_back("login-flags"); requested_options.push_back("global-textures"); + // Opensim requested options + requested_options.push_back("destination_guide_url"); + // if(gSavedSettings.getBOOL("ConnectAsGod")) { gSavedSettings.setBOOL("UseDebugMenus", TRUE); @@ -1575,7 +1585,8 @@ bool idle_startup() if (process_login_success_response(password, first_sim_size_x, first_sim_size_y)) { std::string name = firstname; - if (!gHippoGridManager->getCurrentGrid()->isSecondLife() || + bool secondlife(gHippoGridManager->getCurrentGrid()->isSecondLife()); + if (!secondlife || !boost::algorithm::iequals(lastname, "Resident")) { name += " " + lastname; @@ -1583,6 +1594,13 @@ bool idle_startup() if (gSavedSettings.getBOOL("LiruGridInTitle")) gWindowTitle += "- " + gHippoGridManager->getCurrentGrid()->getGridName() + " "; gViewerWindow->getWindow()->setTitle(gWindowTitle += "- " + name); + if (!secondlife) + { + LFSimFeatureHandler& inst(LFSimFeatureHandler::instance()); + inst.setDestinationGuideURLCallback(boost::bind(simfeature_debug_update, _1, "ShowcaseURLDefault")); + inst.setSearchURLCallback(boost::bind(simfeature_debug_update, _1, "SearchURL")); + } + // Pass the user information to the voice chat server interface. LLVoiceClient::getInstance()->userAuthorized(name, gAgentID); // create the default proximal channel @@ -4083,7 +4101,8 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x LLWorldMap::gotMapServerURL(true); } - if(gHippoGridManager->getConnectedGrid()->isOpenSimulator()) + bool opensim = gHippoGridManager->getConnectedGrid()->isOpenSimulator(); + if (opensim) { std::string web_profile_url = response["web_profile_url"]; //if(!web_profile_url.empty()) // Singu Note: We're using this to check if this grid supports web profiles at all, so set empty if empty. @@ -4176,7 +4195,12 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x 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 + else if (opensim) tmp = gHippoGridManager->getConnectedGrid()->getSearchUrl(); // Fallback from grid info response for setting + if (opensim) + { + gSavedSettings.setString("SearchURL", tmp); // Singu Note: For web search purposes, always set this setting + gSavedSettings.setString("ShowcaseURLDefault", response["destination_guide_url"].asString()); + } tmp = response["currency"].asString(); if (!tmp.empty()) { diff --git a/indra/newview/skins/default/xui/de/floater_directory.xml b/indra/newview/skins/default/xui/de/floater_directory.xml index 4aaf3e691..7dfa569bd 100644 --- a/indra/newview/skins/default/xui/de/floater_directory.xml +++ b/indra/newview/skins/default/xui/de/floater_directory.xml @@ -1,6 +1,31 @@ + + Suchen... + Nicht gefunden. + + Loading... Done - http://search.secondlife.com/ + [APP_SITE]/404 http://search.secondlife.com/ diff --git a/indra/newview/skins/default/xui/en-us/floater_directory2.xml b/indra/newview/skins/default/xui/en-us/floater_directory2.xml deleted file mode 100644 index 21afeea9c..000000000 --- a/indra/newview/skins/default/xui/en-us/floater_directory2.xml +++ /dev/null @@ -1,652 +0,0 @@ - - - - - - Searching... - - - None Found. - -