diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llpaneldirpopular.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpaneldirpopular.cpp | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/linden/indra/newview/llpaneldirpopular.cpp b/linden/indra/newview/llpaneldirpopular.cpp new file mode 100644 index 0000000..24f87e4 --- /dev/null +++ b/linden/indra/newview/llpaneldirpopular.cpp | |||
@@ -0,0 +1,130 @@ | |||
1 | /** | ||
2 | * @file llpaneldirpopular.cpp | ||
3 | * @brief Popular places as measured by dwell. | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #include "llviewerprecompiledheaders.h" | ||
29 | |||
30 | #include "llpaneldirpopular.h" | ||
31 | |||
32 | // linden library includes | ||
33 | #include "llfontgl.h" | ||
34 | #include "message.h" | ||
35 | #include "llqueryflags.h" | ||
36 | |||
37 | // viewer project includes | ||
38 | #include "llagent.h" | ||
39 | #include "llcheckboxctrl.h" | ||
40 | #include "llviewercontrol.h" | ||
41 | #include "lluiconstants.h" | ||
42 | #include "lltextbox.h" | ||
43 | |||
44 | LLPanelDirPopular::LLPanelDirPopular(const std::string& name, LLFloaterDirectory* floater) | ||
45 | : LLPanelDirBrowser(name, floater), | ||
46 | mRequested(false) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | BOOL LLPanelDirPopular::postBuild() | ||
51 | { | ||
52 | LLPanelDirBrowser::postBuild(); | ||
53 | |||
54 | childSetCommitCallback("incpictures", onCommitAny, this); | ||
55 | childSetCommitCallback("incmature", onCommitAny, this); | ||
56 | |||
57 | mCurrentSortColumn = "dwell"; | ||
58 | mCurrentSortAscending = FALSE; | ||
59 | |||
60 | // Don't request popular until first drawn. JC | ||
61 | // requestPopular(); | ||
62 | |||
63 | return TRUE; | ||
64 | } | ||
65 | |||
66 | LLPanelDirPopular::~LLPanelDirPopular() | ||
67 | { | ||
68 | // Children all cleaned up by default view destructor. | ||
69 | } | ||
70 | |||
71 | |||
72 | // virtual | ||
73 | void LLPanelDirPopular::draw() | ||
74 | { | ||
75 | // You only have a choice if you are mature] | ||
76 | childSetVisible("incmature", gAgent.mAccess >= SIM_ACCESS_MATURE); | ||
77 | childSetValue("incmature", gSavedSettings.getBOOL("ShowMatureSims")); | ||
78 | |||
79 | LLPanelDirBrowser::draw(); | ||
80 | |||
81 | if (!mRequested) | ||
82 | { | ||
83 | requestPopular(); | ||
84 | mRequested = true; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | |||
89 | void LLPanelDirPopular::requestPopular() | ||
90 | { | ||
91 | LLMessageSystem* msg = gMessageSystem; | ||
92 | BOOL pg_only = !childGetValue("incmature").asBoolean() || gAgent.mAccess <= SIM_ACCESS_PG; | ||
93 | BOOL pictures_only = childGetValue("incpictures").asBoolean(); | ||
94 | |||
95 | U32 flags = 0x0; | ||
96 | if (pg_only) | ||
97 | { | ||
98 | flags |= DFQ_PG_SIMS_ONLY; | ||
99 | } | ||
100 | if (pictures_only) | ||
101 | { | ||
102 | flags |= DFQ_PICTURES_ONLY; | ||
103 | } | ||
104 | |||
105 | setupNewSearch(); | ||
106 | |||
107 | msg->newMessage("DirPopularQuery"); | ||
108 | msg->nextBlock("AgentData"); | ||
109 | msg->addUUID("AgentID", gAgent.getID()); | ||
110 | msg->addUUID("SessionID", gAgent.getSessionID()); | ||
111 | msg->nextBlock("QueryData"); | ||
112 | msg->addUUID("QueryID", getSearchID()); | ||
113 | msg->addU32("QueryFlags", flags); | ||
114 | gAgent.sendReliableMessage(); | ||
115 | } | ||
116 | |||
117 | |||
118 | // static | ||
119 | void LLPanelDirPopular::onClickSearch(void* data) | ||
120 | { | ||
121 | LLPanelDirPopular* self = (LLPanelDirPopular*)data; | ||
122 | self->requestPopular(); | ||
123 | } | ||
124 | |||
125 | // static | ||
126 | void LLPanelDirPopular::onCommitAny(LLUICtrl* ctrl, void* data) | ||
127 | { | ||
128 | LLPanelDirPopular* self = (LLPanelDirPopular*)data; | ||
129 | self->requestPopular(); | ||
130 | } | ||