diff options
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/llfloaterdirectory.cpp | 13 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterdirectory.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/llpaneldirfind.cpp | 155 | ||||
-rw-r--r-- | linden/indra/newview/llpaneldirfind.h | 18 | ||||
-rw-r--r-- | linden/indra/newview/llpaneldirgroups.cpp | 122 | ||||
-rw-r--r-- | linden/indra/newview/llpaneldirgroups.h | 14 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_directory.xml | 167 |
7 files changed, 386 insertions, 106 deletions
diff --git a/linden/indra/newview/llfloaterdirectory.cpp b/linden/indra/newview/llfloaterdirectory.cpp index 76cb26b..8018c31 100644 --- a/linden/indra/newview/llfloaterdirectory.cpp +++ b/linden/indra/newview/llfloaterdirectory.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2002-2009, Linden Research, Inc. | 7 | * Copyright (c) 2002-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -93,6 +93,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) | |||
93 | // Build the floater with our tab panel classes | 93 | // Build the floater with our tab panel classes |
94 | 94 | ||
95 | LLCallbackMap::map_t factory_map; | 95 | LLCallbackMap::map_t factory_map; |
96 | factory_map["find_all_old_panel"] = LLCallbackMap(createFindAllOld, this); | ||
96 | factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); | 97 | factory_map["find_all_panel"] = LLCallbackMap(createFindAll, this); |
97 | factory_map["classified_panel"] = LLCallbackMap(createClassified, this); | 98 | factory_map["classified_panel"] = LLCallbackMap(createClassified, this); |
98 | factory_map["events_panel"] = LLCallbackMap(createEvents, this); | 99 | factory_map["events_panel"] = LLCallbackMap(createEvents, this); |
@@ -119,6 +120,7 @@ LLFloaterDirectory::LLFloaterDirectory(const std::string& name) | |||
119 | mPanelAvatarp->selectTab(0); | 120 | mPanelAvatarp->selectTab(0); |
120 | } | 121 | } |
121 | 122 | ||
123 | childSetTabChangeCallback("Directory Tabs", "find_all_old_panel", onTabChanged, this); | ||
122 | childSetTabChangeCallback("Directory Tabs", "find_all_panel", onTabChanged, this); | 124 | childSetTabChangeCallback("Directory Tabs", "find_all_panel", onTabChanged, this); |
123 | childSetTabChangeCallback("Directory Tabs", "classified_panel", onTabChanged, this); | 125 | childSetTabChangeCallback("Directory Tabs", "classified_panel", onTabChanged, this); |
124 | childSetTabChangeCallback("Directory Tabs", "events_panel", onTabChanged, this); | 126 | childSetTabChangeCallback("Directory Tabs", "events_panel", onTabChanged, this); |
@@ -206,7 +208,14 @@ void* LLFloaterDirectory::createPeople(void* userdata) | |||
206 | void* LLFloaterDirectory::createGroups(void* userdata) | 208 | void* LLFloaterDirectory::createGroups(void* userdata) |
207 | { | 209 | { |
208 | LLFloaterDirectory *self = (LLFloaterDirectory*)userdata; | 210 | LLFloaterDirectory *self = (LLFloaterDirectory*)userdata; |
209 | return new LLPanelDirGroups("people_groups", self); | 211 | return new LLPanelDirGroups("groups_panel", self); |
212 | } | ||
213 | |||
214 | // static | ||
215 | void *LLFloaterDirectory::createFindAllOld(void* userdata) | ||
216 | { | ||
217 | LLFloaterDirectory *self = (LLFloaterDirectory*)userdata; | ||
218 | return new LLPanelDirFindAllOld("find_all_old_panel", self); | ||
210 | } | 219 | } |
211 | 220 | ||
212 | // static | 221 | // static |
diff --git a/linden/indra/newview/llfloaterdirectory.h b/linden/indra/newview/llfloaterdirectory.h index d8f8399..dd6a5e9 100644 --- a/linden/indra/newview/llfloaterdirectory.h +++ b/linden/indra/newview/llfloaterdirectory.h | |||
@@ -106,7 +106,8 @@ private: | |||
106 | static void* createLand(void* userdata); | 106 | static void* createLand(void* userdata); |
107 | static void* createPeople(void* userdata); | 107 | static void* createPeople(void* userdata); |
108 | static void* createGroups(void* userdata); | 108 | static void* createGroups(void* userdata); |
109 | 109 | static void* createFindAllOld(void* userdata); | |
110 | |||
110 | static void* createClassifiedDetail(void* userdata); | 111 | static void* createClassifiedDetail(void* userdata); |
111 | static void* createAvatarDetail(void* userdata); | 112 | static void* createAvatarDetail(void* userdata); |
112 | static void* createEventDetail(void* userdata); | 113 | static void* createEventDetail(void* userdata); |
diff --git a/linden/indra/newview/llpaneldirfind.cpp b/linden/indra/newview/llpaneldirfind.cpp index ee9aa69..cb83ee1 100644 --- a/linden/indra/newview/llpaneldirfind.cpp +++ b/linden/indra/newview/llpaneldirfind.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2009, Linden Research, Inc. | 7 | * Copyright (c) 2001-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -72,6 +72,8 @@ | |||
72 | #include "boost/lexical_cast.hpp" | 72 | #include "boost/lexical_cast.hpp" |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | #include "hippoGridManager.h" | ||
76 | |||
75 | //--------------------------------------------------------------------------- | 77 | //--------------------------------------------------------------------------- |
76 | // LLPanelDirFindAll - Google search appliance based search | 78 | // LLPanelDirFindAll - Google search appliance based search |
77 | //--------------------------------------------------------------------------- | 79 | //--------------------------------------------------------------------------- |
@@ -248,7 +250,15 @@ void LLPanelDirFind::focus() | |||
248 | 250 | ||
249 | void LLPanelDirFind::navigateToDefaultPage() | 251 | void LLPanelDirFind::navigateToDefaultPage() |
250 | { | 252 | { |
251 | std::string start_url = getString("default_search_page"); | 253 | std::string start_url = gSavedSettings.getString("SearchURLDefault"); |
254 | // Note: beware porting stuff like below. We use the web panel in OpenSim as well as Second Life -- MC | ||
255 | /*if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) { | ||
256 | start_url = getString("default_search_page"); | ||
257 | } else { | ||
258 | start_url = gHippoGridManager->getConnectedGrid()->getSearchUrl(); | ||
259 | start_url += "panel=" + getLabel() + "&"; | ||
260 | }*/ | ||
261 | |||
252 | BOOL inc_pg = childGetValue("incpg").asBoolean(); | 262 | BOOL inc_pg = childGetValue("incpg").asBoolean(); |
253 | BOOL inc_mature = childGetValue("incmature").asBoolean(); | 263 | BOOL inc_mature = childGetValue("incmature").asBoolean(); |
254 | BOOL inc_adult = childGetValue("incadult").asBoolean(); | 264 | BOOL inc_adult = childGetValue("incadult").asBoolean(); |
@@ -272,9 +282,10 @@ void LLPanelDirFind::navigateToDefaultPage() | |||
272 | std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string& collection, | 282 | std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string& collection, |
273 | bool inc_pg, bool inc_mature, bool inc_adult) | 283 | bool inc_pg, bool inc_mature, bool inc_adult) |
274 | { | 284 | { |
275 | std::string url = gSavedSettings.getString("SearchURLDefault"); | 285 | std::string url; |
276 | if (!search_text.empty()) | 286 | if (search_text.empty()) { |
277 | { | 287 | url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_EMPTY); |
288 | } else { | ||
278 | // Replace spaces with "+" for use by Google search appliance | 289 | // Replace spaces with "+" for use by Google search appliance |
279 | // Yes, this actually works for double-spaces | 290 | // Yes, this actually works for double-spaces |
280 | // " foo bar" becomes "+foo++bar" and works fine. JC | 291 | // " foo bar" becomes "+foo++bar" and works fine. JC |
@@ -296,7 +307,7 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const | |||
296 | "-._~$+!*'()"; | 307 | "-._~$+!*'()"; |
297 | std::string query = LLURI::escape(search_text_with_plus, allowed); | 308 | std::string query = LLURI::escape(search_text_with_plus, allowed); |
298 | 309 | ||
299 | url = gSavedSettings.getString("SearchURLQuery"); | 310 | url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_QUERY); |
300 | std::string substring = "[QUERY]"; | 311 | std::string substring = "[QUERY]"; |
301 | std::string::size_type where = url.find(substring); | 312 | std::string::size_type where = url.find(substring); |
302 | if (where != std::string::npos) | 313 | if (where != std::string::npos) |
@@ -321,7 +332,7 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const | |||
321 | // static | 332 | // static |
322 | std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult) | 333 | std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult) |
323 | { | 334 | { |
324 | std::string url = gSavedSettings.getString("SearchURLSuffix2"); | 335 | std::string url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_TEMPLATE); |
325 | 336 | ||
326 | // if the mature checkbox is unchecked, modify query to remove | 337 | // if the mature checkbox is unchecked, modify query to remove |
327 | // terms with given phrase from the result set | 338 | // terms with given phrase from the result set |
@@ -469,3 +480,133 @@ void LLPanelDirFindAllInterface::focus(LLPanelDirFindAll* panel) | |||
469 | panel->focus(); | 480 | panel->focus(); |
470 | } | 481 | } |
471 | 482 | ||
483 | //--------------------------------------------------------------------------- | ||
484 | // LLPanelDirFindAllOld - deprecated if new Google search works out. JC | ||
485 | //--------------------------------------------------------------------------- | ||
486 | |||
487 | LLPanelDirFindAllOld::LLPanelDirFindAllOld(const std::string& name, LLFloaterDirectory* floater) | ||
488 | : LLPanelDirBrowser(name, floater) | ||
489 | { | ||
490 | mMinSearchChars = 3; | ||
491 | } | ||
492 | |||
493 | BOOL LLPanelDirFindAllOld::postBuild() | ||
494 | { | ||
495 | LLPanelDirBrowser::postBuild(); | ||
496 | |||
497 | childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this); | ||
498 | |||
499 | childSetAction("Search", onClickSearch, this); | ||
500 | childDisable("Search"); | ||
501 | setDefaultBtn( "Search" ); | ||
502 | |||
503 | return TRUE; | ||
504 | } | ||
505 | |||
506 | LLPanelDirFindAllOld::~LLPanelDirFindAllOld() | ||
507 | { | ||
508 | // Children all cleaned up by default view destructor. | ||
509 | } | ||
510 | |||
511 | // virtual | ||
512 | void LLPanelDirFindAllOld::draw() | ||
513 | { | ||
514 | updateMaturityCheckbox(); | ||
515 | LLPanelDirBrowser::draw(); | ||
516 | } | ||
517 | |||
518 | // static | ||
519 | void LLPanelDirFindAllOld::onCommitScope(LLUICtrl* ctrl, void* data) | ||
520 | { | ||
521 | LLPanelDirFindAllOld* self = (LLPanelDirFindAllOld*)data; | ||
522 | self->setFocus(TRUE); | ||
523 | } | ||
524 | |||
525 | // static | ||
526 | void LLPanelDirFindAllOld::onClickSearch(void *userdata) | ||
527 | { | ||
528 | LLPanelDirFindAllOld *self = (LLPanelDirFindAllOld *)userdata; | ||
529 | |||
530 | if (self->childGetValue("name").asString().length() < self->mMinSearchChars) | ||
531 | { | ||
532 | return; | ||
533 | }; | ||
534 | |||
535 | BOOL inc_pg = self->childGetValue("incpg").asBoolean(); | ||
536 | BOOL inc_mature = self->childGetValue("incmature").asBoolean(); | ||
537 | BOOL inc_adult = self->childGetValue("incadult").asBoolean(); | ||
538 | if (!(inc_pg || inc_mature || inc_adult)) | ||
539 | { | ||
540 | LLNotifications::instance().add("NoContentToSearch"); | ||
541 | return; | ||
542 | } | ||
543 | |||
544 | self->setupNewSearch(); | ||
545 | |||
546 | // Figure out scope | ||
547 | U32 scope = 0x0; | ||
548 | scope |= DFQ_PEOPLE; // people (not just online = 0x01 | 0x02) | ||
549 | // places handled below | ||
550 | scope |= DFQ_EVENTS; // events | ||
551 | scope |= DFQ_GROUPS; // groups | ||
552 | if (inc_pg) | ||
553 | { | ||
554 | scope |= DFQ_INC_PG; | ||
555 | } | ||
556 | if (inc_mature) | ||
557 | { | ||
558 | scope |= DFQ_INC_MATURE; | ||
559 | } | ||
560 | if (inc_adult) | ||
561 | { | ||
562 | scope |= DFQ_INC_ADULT; | ||
563 | } | ||
564 | |||
565 | // send the message | ||
566 | LLMessageSystem *msg = gMessageSystem; | ||
567 | S32 start_row = 0; | ||
568 | sendDirFindQuery(msg, self->mSearchID, self->childGetValue("name").asString(), scope, start_row); | ||
569 | |||
570 | // Also look up classified ads. JC 12/2005 | ||
571 | BOOL filter_auto_renew = FALSE; | ||
572 | U32 classified_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, inc_mature, inc_adult); | ||
573 | msg->newMessage("DirClassifiedQuery"); | ||
574 | msg->nextBlock("AgentData"); | ||
575 | msg->addUUID("AgentID", gAgent.getID()); | ||
576 | msg->addUUID("SessionID", gAgent.getSessionID()); | ||
577 | msg->nextBlock("QueryData"); | ||
578 | msg->addUUID("QueryID", self->mSearchID); | ||
579 | msg->addString("QueryText", self->childGetValue("name").asString()); | ||
580 | msg->addU32("QueryFlags", classified_flags); | ||
581 | msg->addU32("Category", 0); // all categories | ||
582 | msg->addS32("QueryStart", 0); | ||
583 | gAgent.sendReliableMessage(); | ||
584 | |||
585 | // Need to use separate find places query because places are | ||
586 | // sent using the more compact DirPlacesReply message. | ||
587 | U32 query_flags = DFQ_DWELL_SORT; | ||
588 | if (inc_pg) | ||
589 | { | ||
590 | query_flags |= DFQ_INC_PG; | ||
591 | } | ||
592 | if (inc_mature) | ||
593 | { | ||
594 | query_flags |= DFQ_INC_MATURE; | ||
595 | } | ||
596 | if (inc_adult) | ||
597 | { | ||
598 | query_flags |= DFQ_INC_ADULT; | ||
599 | } | ||
600 | msg->newMessage("DirPlacesQuery"); | ||
601 | msg->nextBlock("AgentData"); | ||
602 | msg->addUUID("AgentID", gAgent.getID() ); | ||
603 | msg->addUUID("SessionID", gAgent.getSessionID()); | ||
604 | msg->nextBlock("QueryData"); | ||
605 | msg->addUUID("QueryID", self->mSearchID ); | ||
606 | msg->addString("QueryText", self->childGetValue("name").asString()); | ||
607 | msg->addU32("QueryFlags", query_flags ); | ||
608 | msg->addS32("QueryStart", 0 ); // Always get the first 100 when using find ALL | ||
609 | msg->addS8("Category", LLParcel::C_ANY); | ||
610 | msg->addString("SimName", NULL); | ||
611 | gAgent.sendReliableMessage(); | ||
612 | } | ||
diff --git a/linden/indra/newview/llpaneldirfind.h b/linden/indra/newview/llpaneldirfind.h index a813d33..299060c 100644 --- a/linden/indra/newview/llpaneldirfind.h +++ b/linden/indra/newview/llpaneldirfind.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2009, Linden Research, Inc. | 7 | * Copyright (c) 2001-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -93,4 +93,20 @@ public: | |||
93 | static void focus(LLPanelDirFindAll* panel); | 93 | static void focus(LLPanelDirFindAll* panel); |
94 | }; | 94 | }; |
95 | 95 | ||
96 | |||
97 | class LLPanelDirFindAllOld : public LLPanelDirBrowser | ||
98 | { | ||
99 | public: | ||
100 | LLPanelDirFindAllOld(const std::string& name, LLFloaterDirectory* floater); | ||
101 | /*virtual*/ ~LLPanelDirFindAllOld(); | ||
102 | |||
103 | /*virtual*/ BOOL postBuild(); | ||
104 | |||
105 | /*virtual*/ void draw(); | ||
106 | |||
107 | static void onClickSearch(void *userdata); | ||
108 | static void onCommitScope(LLUICtrl* ctrl, void* data); | ||
109 | static void onKeystrokeName(LLLineEditor* line, void* data); | ||
110 | }; | ||
111 | |||
96 | #endif | 112 | #endif |
diff --git a/linden/indra/newview/llpaneldirgroups.cpp b/linden/indra/newview/llpaneldirgroups.cpp index e775952..1aa2e86 100644 --- a/linden/indra/newview/llpaneldirgroups.cpp +++ b/linden/indra/newview/llpaneldirgroups.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2009, Linden Research, Inc. | 7 | * Copyright (c) 2001-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -33,47 +33,111 @@ | |||
33 | #include "llviewerprecompiledheaders.h" | 33 | #include "llviewerprecompiledheaders.h" |
34 | 34 | ||
35 | #include "llpaneldirgroups.h" | 35 | #include "llpaneldirgroups.h" |
36 | #include "llnotifications.h" | ||
37 | 36 | ||
38 | #include "llwebbrowserctrl.h" | 37 | // linden library includes |
38 | #include "llagent.h" | ||
39 | //#include "llfontgl.h" | ||
40 | #include "message.h" | ||
41 | #include "llqueryflags.h" | ||
42 | #include "llviewercontrol.h" | ||
43 | #include "llviewerwindow.h" | ||
39 | 44 | ||
40 | LLPanelDirGroups::LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater) | 45 | LLPanelDirGroups::LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater) |
41 | : LLPanelDirFind(name, floater, "groups_browser") | 46 | : LLPanelDirBrowser(name, floater) |
42 | { | 47 | { |
48 | mMinSearchChars = 3; | ||
43 | } | 49 | } |
44 | 50 | ||
45 | 51 | ||
46 | void LLPanelDirGroups::search(const std::string& search_text) | 52 | BOOL LLPanelDirGroups::postBuild() |
47 | { | 53 | { |
48 | if (!search_text.empty()) | 54 | LLPanelDirBrowser::postBuild(); |
49 | { | 55 | |
50 | BOOL inc_pg = childGetValue("incpg").asBoolean(); | 56 | childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this); |
51 | BOOL inc_mature = childGetValue("incmature").asBoolean(); | ||
52 | BOOL inc_adult = childGetValue("incadult").asBoolean(); | ||
53 | if (!(inc_pg || inc_mature || inc_adult)) | ||
54 | { | ||
55 | LLNotifications::instance().add("NoContentToSearch"); | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | std::string selected_collection = "Groups"; | ||
60 | std::string url = buildSearchURL(search_text, selected_collection, inc_pg, inc_mature, inc_adult); | ||
61 | if (mWebBrowser) | ||
62 | { | ||
63 | mWebBrowser->navigateTo(url); | ||
64 | } | ||
65 | } | ||
66 | else | ||
67 | { | ||
68 | // empty search text | ||
69 | navigateToDefaultPage(); | ||
70 | } | ||
71 | 57 | ||
72 | childSetText("search_editor", search_text); | 58 | childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this); |
59 | childDisable("Search"); | ||
60 | setDefaultBtn( "Search" ); | ||
61 | |||
62 | return TRUE; | ||
63 | } | ||
64 | |||
65 | LLPanelDirGroups::~LLPanelDirGroups() | ||
66 | { | ||
67 | // Children all cleaned up by default view destructor. | ||
73 | } | 68 | } |
74 | 69 | ||
70 | // virtual | ||
75 | void LLPanelDirGroups::draw() | 71 | void LLPanelDirGroups::draw() |
76 | { | 72 | { |
77 | updateMaturityCheckbox(); | 73 | updateMaturityCheckbox(); |
78 | LLPanelDirBrowser::draw(); | 74 | LLPanelDirBrowser::draw(); |
79 | } | 75 | } |
76 | |||
77 | |||
78 | // virtual | ||
79 | void LLPanelDirGroups::performQuery() | ||
80 | { | ||
81 | std::string group_name = childGetValue("name").asString(); | ||
82 | if (group_name.length() < mMinSearchChars) | ||
83 | { | ||
84 | return; | ||
85 | } | ||
86 | |||
87 | // "hi " is three chars but not a long-enough search | ||
88 | std::string query_string = group_name; | ||
89 | LLStringUtil::trim( query_string ); | ||
90 | bool query_was_filtered = (query_string != group_name); | ||
91 | |||
92 | // possible we threw away all the short words in the query so check length | ||
93 | if ( query_string.length() < mMinSearchChars ) | ||
94 | { | ||
95 | LLNotifications::instance().add("SeachFilteredOnShortWordsEmpty"); | ||
96 | return; | ||
97 | }; | ||
98 | |||
99 | BOOL inc_pg = childGetValue("incpg").asBoolean(); | ||
100 | BOOL inc_mature = childGetValue("incmature").asBoolean(); | ||
101 | BOOL inc_adult = childGetValue("incadult").asBoolean(); | ||
102 | if (!(inc_pg || inc_mature || inc_adult)) | ||
103 | { | ||
104 | LLNotifications::instance().add("NoContentToSearch"); | ||
105 | return; | ||
106 | } | ||
107 | |||
108 | // if we filtered something out, display a popup | ||
109 | if ( query_was_filtered ) | ||
110 | { | ||
111 | LLSD args; | ||
112 | args["[FINALQUERY]"] = query_string; | ||
113 | LLNotifications::instance().add("SeachFilteredOnShortWords", args); | ||
114 | }; | ||
115 | |||
116 | setupNewSearch(); | ||
117 | |||
118 | // groups | ||
119 | U32 scope = DFQ_GROUPS; | ||
120 | if (inc_pg) | ||
121 | { | ||
122 | scope |= DFQ_INC_PG; | ||
123 | } | ||
124 | if (inc_mature) | ||
125 | { | ||
126 | scope |= DFQ_INC_MATURE; | ||
127 | } | ||
128 | if (inc_adult) | ||
129 | { | ||
130 | scope |= DFQ_INC_ADULT; | ||
131 | } | ||
132 | |||
133 | mCurrentSortColumn = "score"; | ||
134 | mCurrentSortAscending = FALSE; | ||
135 | |||
136 | // send the message | ||
137 | sendDirFindQuery( | ||
138 | gMessageSystem, | ||
139 | mSearchID, | ||
140 | query_string, | ||
141 | scope, | ||
142 | mSearchStart); | ||
143 | } | ||
diff --git a/linden/indra/newview/llpaneldirgroups.h b/linden/indra/newview/llpaneldirgroups.h index d1248c0..5edb34d 100644 --- a/linden/indra/newview/llpaneldirgroups.h +++ b/linden/indra/newview/llpaneldirgroups.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2009, Linden Research, Inc. | 7 | * Copyright (c) 2001-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -33,15 +33,21 @@ | |||
33 | #ifndef LLPANELDIRGROUPS_H | 33 | #ifndef LLPANELDIRGROUPS_H |
34 | #define LLPANELDIRGROUPS_H | 34 | #define LLPANELDIRGROUPS_H |
35 | 35 | ||
36 | #include "llpaneldirfind.h" | 36 | #include "llpaneldirbrowser.h" |
37 | 37 | ||
38 | class LLPanelDirGroups : public LLPanelDirFind | 38 | class LLPanelDirGroups : public LLPanelDirBrowser |
39 | { | 39 | { |
40 | public: | 40 | public: |
41 | LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater); | 41 | LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater); |
42 | virtual ~LLPanelDirGroups(); | ||
42 | 43 | ||
43 | /*virtual*/ void search(const std::string& search_text); | ||
44 | /*virtual*/ void draw(); | 44 | /*virtual*/ void draw(); |
45 | |||
46 | /*virtual*/ BOOL postBuild(); | ||
47 | |||
48 | /*virtual*/ void performQuery(); | ||
49 | |||
50 | static void onClickSearch(void *userdata); | ||
45 | }; | 51 | }; |
46 | 52 | ||
47 | #endif | 53 | #endif |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml b/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml index a600c86..039c4f8 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml | |||
@@ -1,12 +1,70 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | 1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
2 | <floater can_close="true" can_drag_on_left="false" can_minimize="true" | 2 | <floater can_close="true" can_drag_on_left="false" can_minimize="true" |
3 | can_resize="true" height="590" min_height="590" min_width="780" | 3 | can_resize="true" height="590" min_height="590" min_width="780" |
4 | name="directory" rect_control="FloaterFindRect2" title="Search Second Life" | 4 | name="directory" rect_control="FloaterFindRect2" title="Search" |
5 | width="780"> | 5 | width="780"> |
6 | <tab_container bottom="-590" follows="left|top|right|bottom" height="570" left="0" | 6 | <tab_container bottom="-590" follows="left|top|right|bottom" height="570" left="0" |
7 | mouse_opaque="false" name="Directory Tabs" tab_position="top" width="780"> | 7 | mouse_opaque="false" name="Directory Tabs" tab_position="top" width="780"> |
8 | <panel border="true" bottom="-569" follows="left|top|right|bottom" height="553" | 8 | <panel border="true" bottom="-569" follows="left|top|right|bottom" height="553" |
9 | label="All" left="1" mouse_opaque="false" name="find_all_panel" width="778"> | 9 | label="All" left="1" mouse_opaque="false" name="find_all_old_panel" width="778"> |
10 | <string name="searching_text"> | ||
11 | Searching... | ||
12 | </string> | ||
13 | <string name="not_found_text"> | ||
14 | None Found. | ||
15 | </string> | ||
16 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" | ||
17 | height="20" label="< Prev" label_selected="< Prev" left="80" | ||
18 | mouse_opaque="true" name="< Prev" width="60" /> | ||
19 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" | ||
20 | height="20" label="Next >" label_selected="Next >" | ||
21 | mouse_opaque="true" name="Next >" width="60" /> | ||
22 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
23 | bottom="-24" drop_shadow_visible="true" follows="left|top" font="SansSerif" | ||
24 | h_pad="0" halign="left" height="16" left="4" mouse_opaque="true" | ||
25 | name="find" v_pad="0" width="50"> | ||
26 | Find: | ||
27 | </text> | ||
28 | <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-24" | ||
29 | follows="left|top" font="SansSerif" height="18" left_delta="38" | ||
30 | max_length="63" mouse_opaque="true" name="name" width="128" /> | ||
31 | <button bottom="-26" follows="left|top" font="SansSerif" halign="center" height="20" | ||
32 | label="Search" label_selected="Search" left_delta="136" mouse_opaque="true" | ||
33 | name="Search" width="70" /> | ||
34 | <check_box bottom="-22" control_name="ShowPGSearchAll" follows="left|top" | ||
35 | font="SansSerifSmall" height="16" initial_value="true" | ||
36 | label="PG content" left_delta="78" mouse_opaque="true" | ||
37 | name="incpg" width="156" /> | ||
38 | <check_box bottom="-22" control_name="ShowMatureSearchAll" follows="left|top" | ||
39 | font="SansSerifSmall" height="16" initial_value="false" | ||
40 | label="Mature content" left_delta="100" mouse_opaque="true" | ||
41 | name="incmature" width="156" /> | ||
42 | <check_box bottom="-22" control_name="ShowAdultSearchAll" follows="left|top" | ||
43 | font="SansSerifSmall" height="16" initial_value="false" | ||
44 | label="Adult content" left_delta="120" mouse_opaque="true" | ||
45 | name="incadult" width="156" /> | ||
46 | <scroll_list background_visible="true" bottom="-533" column_padding="0" draw_border="true" | ||
47 | draw_heading="false" fg_disable_color="1, 1, 1, 1" | ||
48 | follows="left|top|right|bottom" height="484" left="4" mouse_opaque="true" | ||
49 | multi_select="false" name="results" search_column="1" width="339"> | ||
50 | <column label="" name="icon" width="24" /> | ||
51 | <column label="Name" name="name" width="235" /> | ||
52 | <column label="Price" name="price" width="90" /> | ||
53 | <column label="Time (PT)" name="date" width="90" /> | ||
54 | <column label="Time" name="time" width="-1" /> | ||
55 | <column label="Traffic" name="dwell" width="90" /> | ||
56 | <column label="Area" name="area" width="90" /> | ||
57 | <column label="[CURRENCY]/sq.m" name="per_meter" width="90" /> | ||
58 | <column label="Online" name="online" width="90" /> | ||
59 | <column label="Members" name="members" width="90" /> | ||
60 | </scroll_list> | ||
61 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
62 | bottom_delta="-20" drop_shadow_visible="true" follows="left|bottom" | ||
63 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" | ||
64 | mouse_opaque="true" name="result_text" v_pad="0" width="328" /> | ||
65 | </panel> | ||
66 | <panel border="true" bottom="-569" follows="left|top|right|bottom" height="553" | ||
67 | label="All (web)" left="1" mouse_opaque="false" name="find_all_panel" width="778"> | ||
10 | <string name="searching_text"> | 68 | <string name="searching_text"> |
11 | Searching... | 69 | Searching... |
12 | </string> | 70 | </string> |
@@ -616,72 +674,57 @@ To buy direct, visit the land and click on the place name in the title bar. | |||
616 | label="Groups" left="1" mouse_opaque="false" | 674 | label="Groups" left="1" mouse_opaque="false" |
617 | name="groups_panel" | 675 | name="groups_panel" |
618 | width="778"> | 676 | width="778"> |
619 | <string name="searching_text">Searching...</string> | 677 | <string name="searching_text"> |
620 | <string name="not_found_text">None Found.</string> | 678 | Searching... |
679 | </string> | ||
680 | <string name="not_found_text"> | ||
681 | None Found. | ||
682 | </string> | ||
683 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" | ||
684 | height="20" label="Next >" label_selected="Next >" | ||
685 | mouse_opaque="true" name="Next >" right="344" width="80" /> | ||
686 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" | ||
687 | height="20" label="< Prev" label_selected="< Prev" | ||
688 | mouse_opaque="true" name="< Prev" right="258" width="80" /> | ||
621 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 689 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
622 | bottom="-24" drop_shadow_visible="true" follows="left|top" font="SansSerif" | 690 | bottom="-24" drop_shadow_visible="true" follows="left|top" font="SansSerif" |
623 | h_pad="0" halign="left" height="16" left="4" mouse_opaque="true" | 691 | h_pad="0" halign="left" height="16" left="4" mouse_opaque="true" |
624 | name="find" v_pad="0" width="50"> | 692 | name="find" v_pad="0" width="50"> |
625 | Find: | 693 | Find: |
626 | </text> | 694 | </text> |
627 | <line_editor bevel_style="in" | 695 | <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-24" |
628 | border_style="line" | 696 | follows="left|top" font="SansSerif" height="18" left_delta="38" |
629 | border_thickness="1" | 697 | max_length="63" mouse_opaque="true" name="name" width="200" /> |
630 | bottom="-24" | 698 | <button bottom="-26" follows="left|top" font="SansSerif" halign="center" height="20" |
631 | enabled="true" | 699 | label="Search" label_selected="Search" left_delta="210" mouse_opaque="true" |
632 | follows="top|left|right" | 700 | name="Search" width="70" /> |
633 | font="SansSerif" | 701 | <check_box bottom="-46" control_name="ShowPGGroups" follows="left|top" |
634 | handle_edit_keys_directly="false" | 702 | font="SansSerifSmall" height="16" initial_value="true" |
635 | commit_on_focus_lost="false" | 703 | label="PG content" left="4" mouse_opaque="true" |
636 | height="18" | 704 | name="incpg" width="204" /> |
637 | hidden="false" | 705 | <check_box bottom="-46" control_name="ShowMatureGroups" follows="left|top" |
638 | label="Search" | 706 | font="SansSerifSmall" height="16" initial_value="true" |
639 | left_delta="56" | 707 | label="Mature content" left_delta="90" mouse_opaque="true" |
640 | width="160" | 708 | name="incmature" width="204" /> |
641 | max_length="254" | 709 | <check_box bottom="-46" control_name="ShowAdultGroups" follows="left|top" |
642 | mouse_opaque="true" | 710 | font="SansSerifSmall" height="16" initial_value="false" |
643 | name="search_editor" | 711 | label="Adult content" left_delta="110" mouse_opaque="true" |
644 | select_all_on_focus_received="false" | 712 | name="incadult" width="204" /> |
645 | select_on_focus="false" | 713 | <scroll_list background_visible="true" bottom="-533" column_padding="0" draw_border="true" |
646 | tab_group="1" | 714 | draw_heading="true" |
647 | tool_tip="Search Second Life" /> | 715 | follows="left|top|right|bottom" height="484" left="4" mouse_opaque="true" |
648 | <button bottom="-26" follows="top|right" font="SansSerifSmall" height="20" label="Back" | 716 | multi_select="false" name="results" search_column="2" width="339"> |
649 | left="230" name="back_btn" width="70" /> | 717 | <column label="" name="icon" sort="score" sort_ascending="false" width="24" /> |
650 | <button bottom="-26" follows="top|right" font="SansSerifSmall" height="20" | 718 | <column label="" name="type" width="-1" /> |
651 | label="Forward" left="304" name="forward_btn" width="70" /> | 719 | <column dynamicwidth="true" label="Name" name="name" /> |
652 | <button bottom="-48" follows="top|right" font="SansSerif" height="20" | 720 | <column halign="left" label="Members" name="members" sort_ascending="false" width="100" /> |
653 | label="Search" left="121" name="search_btn" width="95" /> | 721 | <column label="" name="score" width="-1" /> |
654 | <check_box bottom="-22" control_name="ShowPGGroups" follows="right|top" | 722 | </scroll_list> |
655 | font="SansSerifSmall" height="16" initial_value="true" | 723 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
656 | label="PG content" left="420" mouse_opaque="true" | 724 | bottom_delta="-20" drop_shadow_visible="true" follows="left|bottom" |
657 | name="incpg" width="156" /> | 725 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" |
658 | <check_box bottom="-40" control_name="ShowMatureGroups" follows="right|top" | 726 | mouse_opaque="true" name="result_text" v_pad="0" width="328" /> |
659 | font="SansSerifSmall" height="16" initial_value="true" | 727 | </panel> |
660 | label="Mature content" left="420" mouse_opaque="true" | ||
661 | name="incmature" width="156" /> | ||
662 | <check_box bottom="-58" control_name="ShowAdultGroups" follows="right|top" | ||
663 | font="SansSerifSmall" height="16" initial_value="false" | ||
664 | label="Adult content" left="420" mouse_opaque="true" | ||
665 | name="incadult" width="156" /> | ||
666 | <web_browser name="groups_browser" | ||
667 | bottom="25" | ||
668 | follows="top|left|bottom|right" | ||
669 | font="SansSerifSmall" | ||
670 | left="10" | ||
671 | right="-10" | ||
672 | top="-60" /> | ||
673 | <text bottom="5" | ||
674 | follows="bottom|left" | ||
675 | halign="left" | ||
676 | left="10" | ||
677 | width="150" | ||
678 | name="status_text" | ||
679 | height="16" /> | ||
680 | <string name="loading_text">Loading...</string> | ||
681 | <string name="done_text">Done</string> | ||
682 | <string name="redirect_404_url">http://secondlife.com/app/search/notfound.html</string> | ||
683 | <string name="default_search_page">"http://secondlife.com/app/search/index_groups.php?"</string> | ||
684 | </panel> | ||
685 | </tab_container> | 728 | </tab_container> |
686 | <panel bottom="-580" follows="right|top" height="490" left="340" | 729 | <panel bottom="-580" follows="right|top" height="490" left="340" |
687 | name="classified_details_panel" width="440" /> | 730 | name="classified_details_panel" width="440" /> |