diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/llfloateravatarpicker.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to 'linden/indra/newview/llfloateravatarpicker.cpp')
-rw-r--r-- | linden/indra/newview/llfloateravatarpicker.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/linden/indra/newview/llfloateravatarpicker.cpp b/linden/indra/newview/llfloateravatarpicker.cpp index cb9af67..6989084 100644 --- a/linden/indra/newview/llfloateravatarpicker.cpp +++ b/linden/indra/newview/llfloateravatarpicker.cpp | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (c) 2003-2007, Linden Research, Inc. | 4 | * Copyright (c) 2003-2007, Linden Research, Inc. |
5 | * | 5 | * |
6 | * Second Life Viewer Source Code | ||
6 | * The source code in this file ("Source Code") is provided by Linden Lab | 7 | * The source code in this file ("Source Code") is provided by Linden Lab |
7 | * to you under the terms of the GNU General Public License, version 2.0 | 8 | * to you under the terms of the GNU General Public License, version 2.0 |
8 | * ("GPL"), unless you have obtained a separate licensing agreement | 9 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -43,7 +44,7 @@ | |||
43 | const S32 MIN_WIDTH = 200; | 44 | const S32 MIN_WIDTH = 200; |
44 | const S32 MIN_HEIGHT = 340; | 45 | const S32 MIN_HEIGHT = 340; |
45 | const LLRect FLOATER_RECT(0, 380, 240, 0); | 46 | const LLRect FLOATER_RECT(0, 380, 240, 0); |
46 | const char FLOATER_TITLE[] = "Choose Person"; | 47 | const char FLOATER_TITLE[] = "Choose Resident"; |
47 | 48 | ||
48 | // static | 49 | // static |
49 | LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL; | 50 | LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL; |
@@ -108,9 +109,7 @@ BOOL LLFloaterAvatarPicker::postBuild() | |||
108 | 109 | ||
109 | if (mListNames) | 110 | if (mListNames) |
110 | { | 111 | { |
111 | LLScrollListItem* row = new LLScrollListItem( TRUE, NULL, LLUUID::null ); | 112 | mListNames->addSimpleElement("No results"); |
112 | row->addColumn("No results", LLFontGL::sSansSerif); | ||
113 | mListNames->addItem(row); | ||
114 | } | 113 | } |
115 | 114 | ||
116 | mInventoryPanel = (LLInventoryPanel*)this->getCtrlByNameAndType("Inventory Panel", WIDGET_TYPE_INVENTORY_PANEL); | 115 | mInventoryPanel = (LLInventoryPanel*)this->getCtrlByNameAndType("Inventory Panel", WIDGET_TYPE_INVENTORY_PANEL); |
@@ -188,11 +187,12 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) | |||
188 | } | 187 | } |
189 | 188 | ||
190 | std::vector<LLScrollListItem*> items = self->mListNames->getAllSelected(); | 189 | std::vector<LLScrollListItem*> items = self->mListNames->getAllSelected(); |
191 | std::vector<LLScrollListItem*>::iterator itor; | 190 | for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); |
192 | for (itor = items.begin(); itor != items.end(); ++itor) | 191 | iter != items.end(); ++iter) |
193 | { | 192 | { |
194 | self->mAvatarNames.push_back((*itor)->getColumn(0)->getText()); | 193 | LLScrollListItem* item = *iter; |
195 | self->mAvatarIDs.push_back((*itor)->getUUID()); | 194 | self->mAvatarNames.push_back(item->getColumn(0)->getText()); |
195 | self->mAvatarIDs.push_back(item->getUUID()); | ||
196 | self->childSetEnabled("Select", TRUE); | 196 | self->childSetEnabled("Select", TRUE); |
197 | } | 197 | } |
198 | } | 198 | } |
@@ -256,10 +256,7 @@ void LLFloaterAvatarPicker::find() | |||
256 | if (mListNames) | 256 | if (mListNames) |
257 | { | 257 | { |
258 | mListNames->deleteAllItems(); | 258 | mListNames->deleteAllItems(); |
259 | 259 | mListNames->addSimpleElement("Searching..."); | |
260 | LLScrollListItem* row = new LLScrollListItem( TRUE, NULL, LLUUID::null ); | ||
261 | row->addColumn("Searching...", LLFontGL::sSansSerif); | ||
262 | mListNames->addItem(row); | ||
263 | } | 260 | } |
264 | 261 | ||
265 | childSetEnabled("Select", FALSE); | 262 | childSetEnabled("Select", FALSE); |
@@ -324,23 +321,23 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* | |||
324 | msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, DB_FIRST_NAME_BUF_SIZE, first_name, i); | 321 | msg->getStringFast(_PREHASH_Data,_PREHASH_FirstName, DB_FIRST_NAME_BUF_SIZE, first_name, i); |
325 | msg->getStringFast(_PREHASH_Data,_PREHASH_LastName, DB_LAST_NAME_BUF_SIZE, last_name, i); | 322 | msg->getStringFast(_PREHASH_Data,_PREHASH_LastName, DB_LAST_NAME_BUF_SIZE, last_name, i); |
326 | 323 | ||
327 | LLScrollListItem* row = new LLScrollListItem( TRUE, NULL, avatar_id ); | 324 | LLString avatar_name; |
328 | |||
329 | if (avatar_id.isNull()) | 325 | if (avatar_id.isNull()) |
330 | { | 326 | { |
331 | self->childSetTextArg("NotFound", "[TEXT]", self->childGetText("Edit")); | 327 | self->childSetTextArg("NotFound", "[TEXT]", self->childGetText("Edit")); |
332 | LLString msg = self->childGetValue("NotFound").asString(); | 328 | avatar_name = self->childGetValue("NotFound").asString(); |
333 | row->addColumn(msg, LLFontGL::sSansSerif); | ||
334 | self->mListNames->setEnabled(FALSE); | 329 | self->mListNames->setEnabled(FALSE); |
335 | } | 330 | } |
336 | else | 331 | else |
337 | { | 332 | { |
338 | LLString buffer = LLString(first_name) + " " + last_name; | 333 | avatar_name = LLString(first_name) + " " + last_name; |
339 | row->addColumn(buffer, LLFontGL::sSansSerif); | ||
340 | self->mListNames->setEnabled(TRUE); | 334 | self->mListNames->setEnabled(TRUE); |
341 | found_one = TRUE; | 335 | found_one = TRUE; |
342 | } | 336 | } |
343 | self->mListNames->addItem(row); | 337 | LLSD element; |
338 | element["id"] = avatar_id; // value | ||
339 | element["columns"][0]["value"] = avatar_name; | ||
340 | self->mListNames->addElement(element); | ||
344 | } | 341 | } |
345 | 342 | ||
346 | if (found_one) | 343 | if (found_one) |