diff options
author | McCabe Maxsted | 2010-08-11 05:57:33 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-08-26 11:19:26 -0700 |
commit | 54607d12837acac1b88cc3602e041362340796f8 (patch) | |
tree | b814b112af2e7ab6b0333a8002b377fd31f11e31 /linden/indra/newview/llpaneldirfind.cpp | |
parent | Applied patch by Altair Memo for VWR-19947: Nvidia gpu_table.txt updated (diff) | |
download | meta-impy-54607d12837acac1b88cc3602e041362340796f8.zip meta-impy-54607d12837acac1b88cc3602e041362340796f8.tar.gz meta-impy-54607d12837acac1b88cc3602e041362340796f8.tar.bz2 meta-impy-54607d12837acac1b88cc3602e041362340796f8.tar.xz |
Re-enabled search url fetching in the grid manager and fixed up web search to support them (fetched urls are equivalent to SearchURLDefault and searches follow the SL web search formatting)
Diffstat (limited to 'linden/indra/newview/llpaneldirfind.cpp')
-rw-r--r-- | linden/indra/newview/llpaneldirfind.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/linden/indra/newview/llpaneldirfind.cpp b/linden/indra/newview/llpaneldirfind.cpp index ed22477..4ad75fa 100644 --- a/linden/indra/newview/llpaneldirfind.cpp +++ b/linden/indra/newview/llpaneldirfind.cpp | |||
@@ -262,11 +262,25 @@ void LLPanelDirFind::focus() | |||
262 | 262 | ||
263 | void LLPanelDirFind::navigateToDefaultPage() | 263 | void LLPanelDirFind::navigateToDefaultPage() |
264 | { | 264 | { |
265 | std::string start_url; | 265 | std::string start_url = ""; |
266 | // Note: we use the web panel in OpenSim as well as Second Life -- MC | 266 | // Note: we use the web panel in OpenSim as well as Second Life -- MC |
267 | if (gHippoGridManager->getConnectedGrid()->isSecondLife()) | 267 | if (gHippoGridManager->getConnectedGrid()->getSearchUrl().empty() && |
268 | !gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
268 | { | 269 | { |
269 | start_url = gSavedSettings.getString("SearchURLDefault"); | 270 | // OS-based but doesn't have its own web search url -- MC |
271 | start_url = gSavedSettings.getString("SearchURLDefaultOpenSim"); | ||
272 | } | ||
273 | else | ||
274 | { | ||
275 | if (gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
276 | { | ||
277 | start_url = gSavedSettings.getString("SearchURLDefault"); | ||
278 | } | ||
279 | else | ||
280 | { | ||
281 | // OS-based but has its own web search url -- MC | ||
282 | start_url = gHippoGridManager->getConnectedGrid()->getSearchUrl(); | ||
283 | } | ||
270 | 284 | ||
271 | BOOL inc_pg = childGetValue("incpg").asBoolean(); | 285 | BOOL inc_pg = childGetValue("incpg").asBoolean(); |
272 | BOOL inc_mature = childGetValue("incmature").asBoolean(); | 286 | BOOL inc_mature = childGetValue("incmature").asBoolean(); |
@@ -279,13 +293,9 @@ void LLPanelDirFind::navigateToDefaultPage() | |||
279 | } | 293 | } |
280 | 294 | ||
281 | start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); | 295 | start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); |
282 | } | ||
283 | else | ||
284 | { | ||
285 | start_url = gSavedSettings.getString("SearchURLDefaultOpenSim"); | ||
286 | } | 296 | } |
287 | 297 | ||
288 | llinfos << "default url: " << start_url << llendl; | 298 | llinfos << "default web search url: " << start_url << llendl; |
289 | 299 | ||
290 | if (mWebBrowser) | 300 | if (mWebBrowser) |
291 | { | 301 | { |
@@ -297,9 +307,12 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const | |||
297 | bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) | 307 | bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) |
298 | { | 308 | { |
299 | std::string url; | 309 | std::string url; |
300 | if (search_text.empty()) { | 310 | if (search_text.empty()) |
311 | { | ||
301 | url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_EMPTY, is_web); | 312 | url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_EMPTY, is_web); |
302 | } else { | 313 | } |
314 | else | ||
315 | { | ||
303 | // Replace spaces with "+" for use by Google search appliance | 316 | // Replace spaces with "+" for use by Google search appliance |
304 | // Yes, this actually works for double-spaces | 317 | // Yes, this actually works for double-spaces |
305 | // " foo bar" becomes "+foo++bar" and works fine. JC | 318 | // " foo bar" becomes "+foo++bar" and works fine. JC |
@@ -340,7 +353,7 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const | |||
340 | 353 | ||
341 | } | 354 | } |
342 | url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, is_web); | 355 | url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, is_web); |
343 | llinfos << "search url " << url << llendl; | 356 | llinfos << "web search url " << url << llendl; |
344 | return url; | 357 | return url; |
345 | } | 358 | } |
346 | // static | 359 | // static |
@@ -350,8 +363,9 @@ std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, boo | |||
350 | 363 | ||
351 | if (!url.empty()) | 364 | if (!url.empty()) |
352 | { | 365 | { |
353 | // Note: opensim's template (SearchURLSuffixOpenSim) is currently empty -- MC | 366 | // Note: opensim's default template (SearchURLSuffixOpenSim) is currently empty -- MC |
354 | if (gHippoGridManager->getConnectedGrid()->isSecondLife()) | 367 | if (gHippoGridManager->getConnectedGrid()->isSecondLife() || |
368 | !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty()) | ||
355 | { | 369 | { |
356 | // if the mature checkbox is unchecked, modify query to remove | 370 | // if the mature checkbox is unchecked, modify query to remove |
357 | // terms with given phrase from the result set | 371 | // terms with given phrase from the result set |