diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llpaneldirland.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-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 '')
-rw-r--r-- | linden/indra/newview/llpaneldirland.cpp | 68 |
1 files changed, 54 insertions, 14 deletions
diff --git a/linden/indra/newview/llpaneldirland.cpp b/linden/indra/newview/llpaneldirland.cpp index 52dace0..8f4aa9f 100644 --- a/linden/indra/newview/llpaneldirland.cpp +++ b/linden/indra/newview/llpaneldirland.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, |
@@ -50,7 +51,7 @@ | |||
50 | #include "lltextbox.h" | 51 | #include "lltextbox.h" |
51 | #include "llviewercontrol.h" | 52 | #include "llviewercontrol.h" |
52 | #include "llviewermessage.h" | 53 | #include "llviewermessage.h" |
53 | 54 | #include "llnotify.h" | |
54 | //----------------------------------------------------------------------------- | 55 | //----------------------------------------------------------------------------- |
55 | // Constants | 56 | // Constants |
56 | //----------------------------------------------------------------------------- | 57 | //----------------------------------------------------------------------------- |
@@ -60,10 +61,6 @@ static const char FIND_AUCTION[] = "Auction"; | |||
60 | static const char FIND_MAINLANDSALES[] = "Mainland Sales"; | 61 | static const char FIND_MAINLANDSALES[] = "Mainland Sales"; |
61 | static const char FIND_ESTATESALES[] = "Estate Sales"; | 62 | static const char FIND_ESTATESALES[] = "Estate Sales"; |
62 | 63 | ||
63 | const char PG_ONLY[] = "PG only"; | ||
64 | const char MATURE_ONLY[] = "Mature only"; | ||
65 | const char PG_MATURE[] = "PG & Mature"; | ||
66 | |||
67 | LLPanelDirLand::LLPanelDirLand(const std::string& name, LLFloaterDirectory* floater) | 64 | LLPanelDirLand::LLPanelDirLand(const std::string& name, LLFloaterDirectory* floater) |
68 | : LLPanelDirBrowser(name, floater) | 65 | : LLPanelDirBrowser(name, floater) |
69 | { | 66 | { |
@@ -75,10 +72,18 @@ BOOL LLPanelDirLand::postBuild() | |||
75 | 72 | ||
76 | childSetValue("type", gSavedSettings.getString("FindLandType")); | 73 | childSetValue("type", gSavedSettings.getString("FindLandType")); |
77 | 74 | ||
78 | if (gAgent.isTeen()) | 75 | bool adult_enabled = gAgent.canAccessAdult(); |
76 | bool mature_enabled = gAgent.canAccessMature(); | ||
77 | childSetVisible("incpg", true); | ||
78 | if (!mature_enabled) | ||
79 | { | ||
80 | childSetValue("incmature", FALSE); | ||
81 | childDisable("incmature"); | ||
82 | } | ||
83 | if (!adult_enabled) | ||
79 | { | 84 | { |
80 | childSetValue("rating", PG_ONLY); | 85 | childSetValue("incadult", FALSE); |
81 | childDisable("rating"); | 86 | childDisable("incadult"); |
82 | } | 87 | } |
83 | 88 | ||
84 | childSetCommitCallback("pricecheck", onCommitPrice, this); | 89 | childSetCommitCallback("pricecheck", onCommitPrice, this); |
@@ -111,6 +116,13 @@ LLPanelDirLand::~LLPanelDirLand() | |||
111 | // Children all cleaned up by default view destructor. | 116 | // Children all cleaned up by default view destructor. |
112 | } | 117 | } |
113 | 118 | ||
119 | // virtual | ||
120 | void LLPanelDirLand::draw() | ||
121 | { | ||
122 | updateMaturityCheckbox(); | ||
123 | |||
124 | LLPanelDirBrowser::draw(); | ||
125 | } | ||
114 | 126 | ||
115 | void LLPanelDirLand::onClickSort(void* data) | 127 | void LLPanelDirLand::onClickSort(void* data) |
116 | { | 128 | { |
@@ -141,6 +153,15 @@ void LLPanelDirLand::onCommitArea(LLUICtrl* ctrl, void* data) | |||
141 | 153 | ||
142 | void LLPanelDirLand::performQuery() | 154 | void LLPanelDirLand::performQuery() |
143 | { | 155 | { |
156 | BOOL inc_pg = childGetValue("incpg").asBoolean(); | ||
157 | BOOL inc_mature = childGetValue("incmature").asBoolean(); | ||
158 | BOOL inc_adult = childGetValue("incadult").asBoolean(); | ||
159 | if (!(inc_pg || inc_mature || inc_adult)) | ||
160 | { | ||
161 | LLNotifications::instance().add("NoContentToSearch"); | ||
162 | return; | ||
163 | } | ||
164 | |||
144 | LLMessageSystem* msg = gMessageSystem; | 165 | LLMessageSystem* msg = gMessageSystem; |
145 | 166 | ||
146 | setupNewSearch(); | 167 | setupNewSearch(); |
@@ -156,16 +177,35 @@ void LLPanelDirLand::performQuery() | |||
156 | } | 177 | } |
157 | 178 | ||
158 | U32 query_flags = 0x0; | 179 | U32 query_flags = 0x0; |
159 | if (gAgent.isTeen()) query_flags |= DFQ_PG_SIMS_ONLY; | 180 | if (gAgent.wantsPGOnly()) query_flags |= DFQ_PG_SIMS_ONLY; |
181 | |||
182 | bool adult_enabled = gAgent.canAccessAdult(); | ||
183 | bool mature_enabled = gAgent.canAccessMature(); | ||
160 | 184 | ||
161 | const std::string& rating = childGetValue("rating").asString(); | 185 | if (inc_pg) |
162 | if (rating == PG_ONLY) | 186 | { |
187 | query_flags |= DFQ_INC_PG; | ||
188 | } | ||
189 | |||
190 | if (inc_mature && mature_enabled) | ||
191 | { | ||
192 | query_flags |= DFQ_INC_MATURE; | ||
193 | } | ||
194 | |||
195 | if (inc_adult && adult_enabled) | ||
196 | { | ||
197 | query_flags |= DFQ_INC_ADULT; | ||
198 | } | ||
199 | |||
200 | // Add old flags in case we are talking to an old dataserver | ||
201 | if (inc_pg && !inc_mature) | ||
163 | { | 202 | { |
164 | query_flags |= DFQ_PG_SIMS_ONLY; | 203 | query_flags |= DFQ_PG_SIMS_ONLY; |
165 | } | 204 | } |
166 | else if (rating == MATURE_ONLY) | 205 | |
206 | if (!inc_pg && inc_mature) | ||
167 | { | 207 | { |
168 | query_flags |= DFQ_MATURE_SIMS_ONLY; | 208 | query_flags |= DFQ_MATURE_SIMS_ONLY; |
169 | } | 209 | } |
170 | 210 | ||
171 | LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results"); | 211 | LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results"); |