aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldirpopular.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpaneldirpopular.cpp')
-rw-r--r--linden/indra/newview/llpaneldirpopular.cpp97
1 files changed, 5 insertions, 92 deletions
diff --git a/linden/indra/newview/llpaneldirpopular.cpp b/linden/indra/newview/llpaneldirpopular.cpp
index 5a94275..7cfc5b5 100644
--- a/linden/indra/newview/llpaneldirpopular.cpp
+++ b/linden/indra/newview/llpaneldirpopular.cpp
@@ -33,102 +33,15 @@
33 33
34#include "llpaneldirpopular.h" 34#include "llpaneldirpopular.h"
35 35
36// linden library includes
37#include "llfontgl.h"
38#include "message.h"
39#include "llqueryflags.h"
40
41// viewer project includes
42#include "llagent.h"
43#include "llcheckboxctrl.h"
44#include "llviewercontrol.h"
45#include "lluiconstants.h"
46#include "lltextbox.h"
47
48LLPanelDirPopular::LLPanelDirPopular(const std::string& name, LLFloaterDirectory* floater) 36LLPanelDirPopular::LLPanelDirPopular(const std::string& name, LLFloaterDirectory* floater)
49 : LLPanelDirBrowser(name, floater), 37: LLPanelDirFind(name, floater, "showcase_browser")
50 mRequested(false)
51{
52}
53
54BOOL LLPanelDirPopular::postBuild()
55{
56 LLPanelDirBrowser::postBuild();
57
58 childSetCommitCallback("incpictures", onCommitAny, this);
59 childSetCommitCallback("incmature", onCommitAny, this);
60
61 mCurrentSortColumn = "dwell";
62 mCurrentSortAscending = FALSE;
63
64 // Don't request popular until first drawn. JC
65 // requestPopular();
66
67 return TRUE;
68}
69
70LLPanelDirPopular::~LLPanelDirPopular()
71{ 38{
72 // Children all cleaned up by default view destructor. 39 // *NOTE: This is now the "Showcase" section
73} 40}
74 41
75
76// virtual 42// virtual
77void LLPanelDirPopular::draw() 43void LLPanelDirPopular::search(const std::string& search_text)
78{
79 // You only have a choice if you are mature]
80 childSetVisible("incmature", !gAgent.isTeen());
81 childSetValue("incmature", gSavedSettings.getBOOL("ShowMatureSims"));
82
83 LLPanelDirBrowser::draw();
84
85 if (!mRequested)
86 {
87 requestPopular();
88 mRequested = true;
89 }
90}
91
92
93void LLPanelDirPopular::requestPopular()
94{
95 LLMessageSystem* msg = gMessageSystem;
96 BOOL pg_only = !childGetValue("incmature").asBoolean() || gAgent.isTeen();
97 BOOL pictures_only = childGetValue("incpictures").asBoolean();
98
99 U32 flags = 0x0;
100 if (pg_only)
101 {
102 flags |= DFQ_PG_SIMS_ONLY;
103 }
104 if (pictures_only)
105 {
106 flags |= DFQ_PICTURES_ONLY;
107 }
108
109 setupNewSearch();
110
111 msg->newMessage("DirPopularQuery");
112 msg->nextBlock("AgentData");
113 msg->addUUID("AgentID", gAgent.getID());
114 msg->addUUID("SessionID", gAgent.getSessionID());
115 msg->nextBlock("QueryData");
116 msg->addUUID("QueryID", getSearchID());
117 msg->addU32("QueryFlags", flags);
118 gAgent.sendReliableMessage();
119}
120
121
122// static
123void LLPanelDirPopular::onClickSearch(void* data)
124{
125 LLPanelDirPopular* self = (LLPanelDirPopular*)data;
126 self->requestPopular();
127}
128
129// static
130void LLPanelDirPopular::onCommitAny(LLUICtrl* ctrl, void* data)
131{ 44{
132 LLPanelDirPopular* self = (LLPanelDirPopular*)data; 45 // no-op, initial page is loaded during construction and there
133 self->requestPopular(); 46 // is no search interface, just browse
134} 47}