diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c8b404b6cf..138dc50151 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1575,6 +1575,40 @@ 1 + DebugSearch + + Comment + If TRUE use search url as given in SearchURLDebug + Persist + 1 + Type + Boolean + Value + 0 + + SearchURLDebug + + Comment + Debug URL for Search website. Overrides any other search URL if DebugSearch is true. Displayed in the Find floater + Persist + 1 + Type + String + Value + + + SearchURLOpenSim + + Comment + Fallback URL for Search website if the loginservice doesn't provide a search URL. Displayed in the Find floater + Persist + 0 + Type + String + Value + http://search.metaverseink.com/opensim/results.jsp?query=[QUERY]&submit=[CATEGORY] + + CrashHostUrl Comment diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index bb4fc5f54c..1723d6c461 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -128,6 +128,8 @@ #include "llhunspell.h" // [/SL:KB] +#include "llviewernetwork.h" // + const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; // FIRE-6340, FIRE-6567 - Setting Bandwidth issues @@ -210,6 +212,10 @@ void handleFlightAssistOptionChanged(const LLSD& newvalue); bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response); bool callback_clear_cache(const LLSD& notification, const LLSD& response); bool callback_clear_settings(const LLSD& notification, const LLSD& response); +// +bool callback_clear_debug_search(const LLSD& notification, const LLSD& response); +bool callback_pick_debug_search(const LLSD& notification, const LLSD& response); +// //bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); //bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); @@ -258,6 +264,46 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response return false; } +// +bool callback_clear_debug_search(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( option == 0 ) // YES + { + gSavedSettings.setString("SearchURLDebug",""); + } + + return false; +} + +bool callback_pick_debug_search(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( option == 0 ) // YES + { + std::string url; +#ifdef HAS_OPENSIM_SUPPORT // + if(LLGridManager::getInstance()->isInOpenSim()) + { + url = LLLoginInstance::getInstance()->hasResponse("search") + ? LLLoginInstance::getInstance()->getResponse("search").asString() + : gSavedSettings.getString("SearchURLOpenSim"); + } + else // we are in SL or SL beta +#endif // HAS_OPENSIM_SUPPORT // + { + //not in OpenSim means we are in SL or SL beta + url = gSavedSettings.getString("SearchURL"); + } + + gSavedSettings.setString("SearchURLDebug", url); + + } + + return false; +} +// + void handleNameTagOptionChanged(const LLSD& newvalue) { LLVOAvatar::invalidateNameTags(); @@ -392,6 +438,10 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this)); mCommitCallbackRegistrar.add("Pref.Proxy", boost::bind(&LLFloaterPreference::onClickProxySettings, this)); mCommitCallbackRegistrar.add("Pref.TranslationSettings", boost::bind(&LLFloaterPreference::onClickTranslationSettings, this)); +// + mCommitCallbackRegistrar.add("Pref.ClearDebugSearchURL", boost::bind(&LLFloaterPreference::onClickClearDebugSearchURL, this)); + mCommitCallbackRegistrar.add("Pref.PickDebugSearchURL", boost::bind(&LLFloaterPreference::onClickPickDebugSearchURL, this)); +// mCommitCallbackRegistrar.add("FS.ToggleSortContacts", boost::bind(&LLFloaterPreference::onClickSortContacts, this)); mCommitCallbackRegistrar.add("NACL.AntiSpamUnblock", boost::bind(&LLFloaterPreference::onClickClearSpamList, this)); mCommitCallbackRegistrar.add("NACL.SetPreprocInclude", boost::bind(&LLFloaterPreference::setPreprocInclude, this)); @@ -1017,6 +1067,20 @@ void LLFloaterPreference::onClickSetCache() gSavedSettings.setString("CacheLocationTopFolder", top_folder); } } + +// +void LLFloaterPreference::onClickClearDebugSearchURL() +{ + LLNotificationsUtil::add("ConfirmClearDebugSearchURL", LLSD(), LLSD(), callback_clear_debug_search); +} + +void LLFloaterPreference::onClickPickDebugSearchURL() +{ + + LLNotificationsUtil::add("ConfirmPickDebugSearchURL", LLSD(), LLSD(),callback_pick_debug_search ); +} +// + void LLFloaterPreference::onClickBrowseCache() { gViewerWindow->getWindow()->openFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"")); @@ -1359,8 +1423,21 @@ void LLFloaterPreference::refreshEnabledState() // now turn off any features that are unavailable disableUnavailableSettings(); +// +// getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); + bool logged_in = LLLoginInstance::getInstance()->authSuccess(); + getChildView("block_list")->setEnabled(logged_in); +#ifdef HAS_OPENSIM_SUPPORT // + getChildView("pick_current_search_url")->setEnabled(logged_in); + getChildView("DebugSearch")->setEnabled(logged_in); + getChildView("debug_search_panel")->setEnabled(logged_in); +// +#else // HAS_OPENSIM_SUPPORT + getChildView("debug_search_panel")->setVisible(false); +#endif // HAS_OPENSIM_SUPPORT +// - getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); +// } void LLFloaterPreference::disableUnavailableSettings() diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 583d4de848..570ba1b165 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -93,6 +93,11 @@ protected: void onLanguageChange(); void onNameTagOpacityChange(const LLSD& newvalue); +// + void onClickClearDebugSearchURL(); + void onClickPickDebugSearchURL(); +// + // ## Zi: Pie menu // make sure controls get greyed out or enabled when pie color override is toggled void onPieColorsOverrideChanged(); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index ed68d259bc..427a9917a2 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -38,6 +38,8 @@ #include "llui.h" #include "llviewercontrol.h" #include "llweb.h" +#include "llviewernetwork.h"// + // support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps class LLSearchHandler : public LLCommandHandler @@ -118,8 +120,18 @@ void LLFloaterSearch::onOpen(const LLSD& key) { Params p(key); p.trusted_content = true; +// +// p.allow_address_entry = false; +#ifdef HAS_OPENSIM_SUPPORT // + bool debug = gSavedSettings.getBOOL("DebugSearch"); + p.allow_address_entry = debug; +// +#else // HAS_OPENSIM_SUPPORT p.allow_address_entry = false; +#endif // HAS_OPENSIM_SUPPORT +// +// LLFloaterWebContent::onOpen(p); search(p.search); } @@ -199,7 +211,29 @@ void LLFloaterSearch::search(const SearchQuery &p) // get the search URL and expand all of the substitutions // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) - std::string url = gSavedSettings.getString("SearchURL"); +// +// std::string url = gSavedSettings.getString("SearchURL"); + std::string url; + +#ifdef HAS_OPENSIM_SUPPORT // + std::string debug_url = gSavedSettings.getString("SearchURLDebug"); + if (gSavedSettings.getBOOL("DebugSearch") && !debug_url.empty()) + { + url = debug_url; + } + else if(LLGridManager::getInstance()->isInOpenSim()) + { + url = LLLoginInstance::getInstance()->hasResponse("search") + ? LLLoginInstance::getInstance()->getResponse("search").asString() + : gSavedSettings.getString("SearchURLOpenSim"); + } + else // we are in SL or SL beta +#endif // HAS_OPENSIM_SUPPORT // + { + url = gSavedSettings.getString("SearchURL"); + } +// + url = LLWeb::expandURLSubstitutions(url, subs); // and load the URL in the web view diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 2b736ce32f..b41d555475 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -584,20 +584,20 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia requested_options.append("god-connect"); } -// +// #ifdef HAS_OPENSIM_SUPPORT // //TODO: make this more flexible if (LLGridManager::getInstance()->isInOpenSim()) { - requested_options.append("currency"); + requested_options.append("currency");// + requested_options.append("search"); // //not in this patch //requested_options.append("max_groups"); //requested_options.append("profile-server-url"); - //requested_options.append("search"); //requested_options.append("web-profile-url"); } #endif // HAS_OPENSIM_SUPPORT // -// +// // (re)initialize the request params with creds. LLSD request_params = user_credential->getLoginParams(); diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 8b53431219..d36e42c46e 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -57,6 +57,9 @@ public: const std::string& getLoginState() { return mLoginState; } LLSD getResponse(const std::string& key) { return getResponse()[key]; } LLSD getResponse(); +// + bool hasResponse(const std::string& key) { return mResponseData.has(key); } +// // Only valid when authSuccess == true. const F64 getLastTransferRateBPS() { return mTransferRate; } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5517c05d75..75b7a3b1ae 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8187,6 +8187,30 @@ Otherwise, you can look at the Map and find places marked "Infohub". You died and have been teleported to your home location. + + +Are you sure you want to clear the debug search url? + confirm + + + +Are you sure you want to pick the current search url as debug search url? + confirm + + + - + + + + Override current search url: (no override if empty) + + + + + +