aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldirclassified.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/llpaneldirclassified.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/llpaneldirclassified.cpp')
-rw-r--r--linden/indra/newview/llpaneldirclassified.cpp39
1 files changed, 35 insertions, 4 deletions
diff --git a/linden/indra/newview/llpaneldirclassified.cpp b/linden/indra/newview/llpaneldirclassified.cpp
index c58b887..6703ec3 100644
--- a/linden/indra/newview/llpaneldirclassified.cpp
+++ b/linden/indra/newview/llpaneldirclassified.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,
@@ -64,6 +65,7 @@
64// 65//
65#include "llfloateravatarinfo.h" 66#include "llfloateravatarinfo.h"
66#include "llviewermenu.h" 67#include "llviewermenu.h"
68#include "llnotify.h"
67 69
68//----------------------------------------------------------------------------- 70//-----------------------------------------------------------------------------
69// Constants 71// Constants
@@ -79,10 +81,28 @@ BOOL LLPanelDirClassified::postBuild()
79 LLPanelDirBrowser::postBuild(); 81 LLPanelDirBrowser::postBuild();
80 82
81 // Teens don't get mature checkbox 83 // Teens don't get mature checkbox
82 if (gAgent.isTeen()) 84 if (gAgent.wantsPGOnly())
83 { 85 {
84 childSetValue("incmature", FALSE); 86 childSetValue("incmature", FALSE);
87 childSetValue("incadult", FALSE);
85 childHide("incmature"); 88 childHide("incmature");
89 childHide("incadult");
90 childSetValue("incpg", TRUE);
91 childDisable("incpg");
92 }
93
94 bool mature_enabled = gAgent.canAccessMature();
95 if (!mature_enabled)
96 {
97 childSetValue("incmature", FALSE);
98 childDisable("incmature");
99 }
100
101 bool adult_enabled = gAgent.canAccessAdult();
102 if (!adult_enabled)
103 {
104 childSetValue("incadult", FALSE);
105 childDisable("incadult");
86 } 106 }
87 107
88 // 0 or 3+ character searches allowed, exciting 108 // 0 or 3+ character searches allowed, exciting
@@ -123,6 +143,8 @@ void LLPanelDirClassified::refresh()
123 BOOL godlike = gAgent.isGodlike(); 143 BOOL godlike = gAgent.isGodlike();
124 childSetVisible("Delete", godlike); 144 childSetVisible("Delete", godlike);
125 childSetEnabled("Delete", godlike); 145 childSetEnabled("Delete", godlike);
146
147 updateMaturityCheckbox();
126} 148}
127 149
128//Open Profile to Classifieds tab 150//Open Profile to Classifieds tab
@@ -161,6 +183,16 @@ void LLPanelDirClassified::onClickDelete(void *userdata)
161void LLPanelDirClassified::performQuery() 183void LLPanelDirClassified::performQuery()
162{ 184{
163 lldebugs << "LLPanelDirClassified::performQuery()" << llendl; 185 lldebugs << "LLPanelDirClassified::performQuery()" << llendl;
186
187 BOOL inc_pg = childGetValue("incpg").asBoolean();
188 BOOL inc_mature = childGetValue("incmature").asBoolean();
189 BOOL inc_adult = childGetValue("incadult").asBoolean();
190 if (!(inc_pg || inc_mature || inc_adult))
191 {
192 LLNotifications::instance().add("NoContentToSearch");
193 return;
194 }
195
164 // This sets mSearchID and clears the list of results 196 // This sets mSearchID and clears the list of results
165 setupNewSearch(); 197 setupNewSearch();
166 198
@@ -171,9 +203,8 @@ void LLPanelDirClassified::performQuery()
171 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); 203 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
172 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 204 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
173 205
174 BOOL filter_mature = !childGetValue("incmature").asBoolean();
175 BOOL filter_auto_renew = FALSE; 206 BOOL filter_auto_renew = FALSE;
176 U32 query_flags = pack_classified_flags(filter_mature, filter_auto_renew); 207 U32 query_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, inc_mature, inc_adult);
177 //if (gAgent.isTeen()) query_flags |= DFQ_PG_SIMS_ONLY; 208 //if (gAgent.isTeen()) query_flags |= DFQ_PG_SIMS_ONLY;
178 209
179 U32 category = childGetValue("Category").asInteger(); 210 U32 category = childGetValue("Category").asInteger();