aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldirplaces.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llpaneldirplaces.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llpaneldirplaces.cpp')
-rw-r--r--linden/indra/newview/llpaneldirplaces.cpp98
1 files changed, 74 insertions, 24 deletions
diff --git a/linden/indra/newview/llpaneldirplaces.cpp b/linden/indra/newview/llpaneldirplaces.cpp
index d97b2df..67414e7 100644
--- a/linden/indra/newview/llpaneldirplaces.cpp
+++ b/linden/indra/newview/llpaneldirplaces.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -55,6 +56,7 @@
55#include "llviewercontrol.h" 56#include "llviewercontrol.h"
56#include "llviewermessage.h" 57#include "llviewermessage.h"
57#include "llworldmap.h" 58#include "llworldmap.h"
59#include "llnotify.h"
58 60
59LLPanelDirPlaces::LLPanelDirPlaces(const std::string& name, LLFloaterDirectory* floater) 61LLPanelDirPlaces::LLPanelDirPlaces(const std::string& name, LLFloaterDirectory* floater)
60 : LLPanelDirBrowser(name, floater) 62 : LLPanelDirBrowser(name, floater)
@@ -79,7 +81,22 @@ BOOL LLPanelDirPlaces::postBuild()
79 81
80 mCurrentSortColumn = "dwell"; 82 mCurrentSortColumn = "dwell";
81 mCurrentSortAscending = FALSE; 83 mCurrentSortAscending = FALSE;
82 84
85 if (gAgent.getAgentAccess().isInTransition())
86 {
87 // during the AO transition, this combo has an Adult item.
88 // Post-transition, it goes away. We can remove this conditional
89 // after the transition and just use the "else" clause.
90 childSetVisible("Category_Adult", true);
91 childSetEnabled("Category_Adult", true);
92 }
93 else
94 {
95 // this is the code that should be preserved post-transition
96 childSetVisible("Category", true);
97 childSetEnabled("Category", true);
98 }
99
83 // Don't prepopulate the places list, as it hurts the database as of 2006-12-04. JC 100 // Don't prepopulate the places list, as it hurts the database as of 2006-12-04. JC
84 // initialQuery(); 101 // initialQuery();
85 102
@@ -101,10 +118,8 @@ LLPanelDirPlaces::~LLPanelDirPlaces()
101// virtual 118// virtual
102void LLPanelDirPlaces::draw() 119void LLPanelDirPlaces::draw()
103{ 120{
104 // You only have a choice if you are mature 121 updateMaturityCheckbox();
105 childSetVisible("incmature", !gAgent.isTeen()); 122
106 childSetValue("incmature", gSavedSettings.getBOOL("ShowMatureSims"));
107
108 LLPanelDirBrowser::draw(); 123 LLPanelDirBrowser::draw();
109} 124}
110 125
@@ -125,19 +140,32 @@ void LLPanelDirPlaces::performQuery()
125 // possible we threw away all the short words in the query so check length 140 // possible we threw away all the short words in the query so check length
126 if ( query_string.length() < mMinSearchChars ) 141 if ( query_string.length() < mMinSearchChars )
127 { 142 {
128 gViewerWindow->alertXml("SeachFilteredOnShortWordsEmpty"); 143 LLNotifications::instance().add("SeachFilteredOnShortWordsEmpty");
129 return; 144 return;
130 }; 145 };
131 146
132 // if we filtered something out, display a popup 147 // if we filtered something out, display a popup
133 if ( query_was_filtered ) 148 if ( query_was_filtered )
134 { 149 {
135 LLStringUtil::format_map_t args; 150 LLSD args;
136 args["[FINALQUERY]"] = query_string; 151 args["FINALQUERY"] = query_string;
137 gViewerWindow->alertXml("SeachFilteredOnShortWords", args); 152 LLNotifications::instance().add("SeachFilteredOnShortWords", args);
138 }; 153 };
139 154
140 std::string catstring = childGetValue("Category").asString(); 155 std::string catstring = childGetValue("Category").asString();
156 if (gAgent.getAgentAccess().isInTransition())
157 {
158 // during the AO transition, this combo has an Adult item.
159 // Post-transition, it goes away. We can remove this conditional
160 // after the transition and just use the "else" clause.
161 catstring = childGetValue("Category_Adult").asString();
162 }
163 else
164 {
165 // this is the code that should be preserved post-transition
166 catstring = childGetValue("Category").asString();
167 }
168
141 169
142 // Because LLParcel::C_ANY is -1, must do special check 170 // Because LLParcel::C_ANY is -1, must do special check
143 S32 category = 0; 171 S32 category = 0;
@@ -150,33 +178,53 @@ void LLPanelDirPlaces::performQuery()
150 category = LLParcel::getCategoryFromString(catstring); 178 category = LLParcel::getCategoryFromString(catstring);
151 } 179 }
152 180
153 BOOL pg_only = !gSavedSettings.getBOOL("ShowMatureSims") 181 U32 flags = 0x0;
154 || gAgent.isTeen(); 182 bool adult_enabled = gAgent.canAccessAdult();
183 bool mature_enabled = gAgent.canAccessMature();
184
185 if( gSavedSettings.getBOOL("ShowPGSims"))
186 {
187 flags |= DFQ_INC_PG;
188 }
189
190 if( gSavedSettings.getBOOL("ShowMatureSims") && mature_enabled)
191 {
192 flags |= DFQ_INC_MATURE;
193 }
155 194
156 queryCore(query_string, category, pg_only); 195 if( gSavedSettings.getBOOL("ShowAdultSims") && adult_enabled)
196 {
197 flags |= DFQ_INC_ADULT;
198 }
199
200 // Pack old query flag in case we are talking to an old server
201 if ( ((flags & DFQ_INC_PG) == DFQ_INC_PG) && !((flags & DFQ_INC_MATURE) == DFQ_INC_MATURE) )
202 {
203 flags |= DFQ_PG_PARCELS_ONLY;
204 }
205
206 if (0x0 == flags)
207 {
208 LLNotifications::instance().add("NoContentToSearch");
209 return;
210 }
211
212 queryCore(query_string, category, flags);
157} 213}
158 214
159void LLPanelDirPlaces::initialQuery() 215void LLPanelDirPlaces::initialQuery()
160{ 216{
161 // All Linden locations in PG/Mature sims, any name. 217 // All Linden locations in PG/Mature sims, any name.
162 const BOOL pg_only = FALSE; 218 U32 flags = DFQ_INC_PG | DFQ_INC_MATURE;
163 queryCore(LLStringUtil::null, LLParcel::C_LINDEN, pg_only); 219 queryCore(LLStringUtil::null, LLParcel::C_LINDEN, flags);
164} 220}
165 221
166void LLPanelDirPlaces::queryCore(const std::string& name, 222void LLPanelDirPlaces::queryCore(const std::string& name,
167 S32 category, 223 S32 category,
168 BOOL pg_only) 224 U32 flags)
169{ 225{
170 setupNewSearch(); 226 setupNewSearch();
171 227
172 // send the message
173 U32 flags = 0x0;
174
175 if (pg_only)
176 {
177 flags |= DFQ_PG_PARCELS_ONLY;
178 }
179
180// JC: Sorting by dwell severely impacts the performance of the query. 228// JC: Sorting by dwell severely impacts the performance of the query.
181// Instead of sorting on the dataserver, we sort locally once the results 229// Instead of sorting on the dataserver, we sort locally once the results
182// are received. 230// are received.
@@ -203,3 +251,5 @@ void LLPanelDirPlaces::queryCore(const std::string& name,
203 gAgent.sendReliableMessage(); 251 gAgent.sendReliableMessage();
204} 252}
205 253
254
255