aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelpick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanelpick.cpp')
-rw-r--r--linden/indra/newview/llpanelpick.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/linden/indra/newview/llpanelpick.cpp b/linden/indra/newview/llpanelpick.cpp
index ddd7934..9dc0aea 100644
--- a/linden/indra/newview/llpanelpick.cpp
+++ b/linden/indra/newview/llpanelpick.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2004-2007, Linden Research, Inc. 5 * Copyright (c) 2004-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * 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 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -47,6 +48,7 @@
47#include "llviewertexteditor.h" 48#include "llviewertexteditor.h"
48#include "lltexturectrl.h" 49#include "lltexturectrl.h"
49#include "lluiconstants.h" 50#include "lluiconstants.h"
51#include "llviewergenericmessage.h"
50#include "llvieweruictrlfactory.h" 52#include "llvieweruictrlfactory.h"
51#include "llviewerparcelmgr.h" 53#include "llviewerparcelmgr.h"
52#include "llworldmap.h" 54#include "llworldmap.h"
@@ -55,7 +57,7 @@
55#include "llviewerwindow.h" 57#include "llviewerwindow.h"
56 58
57//static 59//static
58LLLinkedList<LLPanelPick> LLPanelPick::sAllPanels; 60std::list<LLPanelPick*> LLPanelPick::sAllPanels;
59 61
60LLPanelPick::LLPanelPick(BOOL top_pick) 62LLPanelPick::LLPanelPick(BOOL top_pick)
61: LLPanel("Top Picks Panel"), 63: LLPanel("Top Picks Panel"),
@@ -78,7 +80,7 @@ LLPanelPick::LLPanelPick(BOOL top_pick)
78 mEnabledCheck(NULL), 80 mEnabledCheck(NULL),
79 mSetBtn(NULL) 81 mSetBtn(NULL)
80{ 82{
81 sAllPanels.addData(this); 83 sAllPanels.push_back(this);
82 84
83 std::string pick_def_file; 85 std::string pick_def_file;
84 if (top_pick) 86 if (top_pick)
@@ -94,7 +96,7 @@ LLPanelPick::LLPanelPick(BOOL top_pick)
94 96
95LLPanelPick::~LLPanelPick() 97LLPanelPick::~LLPanelPick()
96{ 98{
97 sAllPanels.removeData(this); 99 sAllPanels.remove(this);
98} 100}
99 101
100 102
@@ -184,9 +186,10 @@ void LLPanelPick::initNewPick()
184} 186}
185 187
186 188
187void LLPanelPick::setPickID(const LLUUID& id) 189void LLPanelPick::setPickID(const LLUUID& pick_id, const LLUUID& creator_id)
188{ 190{
189 mPickID = id; 191 mPickID = pick_id;
192 mCreatorID = creator_id;
190} 193}
191 194
192 195
@@ -207,15 +210,12 @@ std::string LLPanelPick::getPickName()
207 210
208void LLPanelPick::sendPickInfoRequest() 211void LLPanelPick::sendPickInfoRequest()
209{ 212{
210 LLMessageSystem *msg = gMessageSystem; 213 // Must ask for a pick based on the creator id because
211 214 // the pick database is distributed to the inventory cluster. JC
212 msg->newMessage("PickInfoRequest"); 215 std::vector<std::string> strings;
213 msg->nextBlock("AgentData"); 216 strings.push_back( mCreatorID.asString() );
214 msg->addUUID("AgentID", gAgent.getID() ); 217 strings.push_back( mPickID.asString() );
215 msg->addUUID("SessionID", gAgent.getSessionID()); 218 send_generic_message("pickinforequest", strings);
216 msg->nextBlock("Data");
217 msg->addUUID("PickID", mPickID);
218 gAgent.sendReliableMessage();
219 219
220 mDataRequested = TRUE; 220 mDataRequested = TRUE;
221} 221}
@@ -324,7 +324,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
324 S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; 324 S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
325 S32 region_z = llround((F32)pos_global.mdV[VZ]); 325 S32 region_z = llround((F32)pos_global.mdV[VZ]);
326 326
327 snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /*Flawfinder: ignore*/ 327 snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /* Flawfinder: ignore */
328 location_text.append(buffer); 328 location_text.append(buffer);
329 329
330 S32 sort_order; 330 S32 sort_order;
@@ -334,9 +334,9 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
334 msg->getBOOL("Data", "Enabled", enabled); 334 msg->getBOOL("Data", "Enabled", enabled);
335 335
336 // Look up the panel to fill in 336 // Look up the panel to fill in
337 LLPanelPick *self = NULL; 337 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
338 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData()) 338 {
339 { 339 LLPanelPick* self = *iter;
340 // For top picks, must match pick id 340 // For top picks, must match pick id
341 if (self->mPickID != pick_id) 341 if (self->mPickID != pick_id)
342 { 342 {
@@ -359,7 +359,7 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **)
359 self->mLocationEditor->setText(location_text); 359 self->mLocationEditor->setText(location_text);
360 self->mEnabledCheck->set(enabled); 360 self->mEnabledCheck->set(enabled);
361 361
362 snprintf(buffer, sizeof(buffer), "%d", sort_order); /*Flawfinder: ignore*/ 362 snprintf(buffer, sizeof(buffer), "%d", sort_order); /* Flawfinder: ignore */
363 self->mSortOrderEditor->setText(buffer); 363 self->mSortOrderEditor->setText(buffer);
364 } 364 }
365} 365}