diff options
author | James Cook <james@lindenlab.com> | 2010-05-25 15:45:45 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-05-25 15:45:45 -0700 |
commit | d8f2e1d820e717f267375773407110bec1e9dae2 (patch) | |
tree | 8d8acf246549b22c06d9e6fdd7306fa1c4b18591 /indra | |
parent | 659163c15cb0bb52ca960ddf417b9c6b874c357a (diff) | |
parent | a70d9363dadd23f5304013f87d47e5251d62c575 (diff) |
Merge
Diffstat (limited to 'indra')
22 files changed, 170 insertions, 149 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 6cef0b5119..6534f7921c 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -490,26 +490,24 @@ namespace action_give_inventory * @param avatar_names - avatar names request to be sent. * @param avatar_uuids - avatar names request to be sent. */ - static void give_inventory(const std::vector<std::string>& avatar_names, const uuid_vec_t& avatar_uuids) + static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names) { - llassert(avatar_names.size() == avatar_uuids.size()); - LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); if (NULL == active_panel) return; const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); if (inventory_selected_uuids.empty()) return; - S32 count = llmin(avatar_names.size(), avatar_uuids.size()); + S32 count = avatar_uuids.size(); // iterate through avatars for(S32 i = 0; i < count; ++i) { - const std::string& avatar_name = avatar_names[i]; + LLAvatarName av_name = avatar_names[i]; const LLUUID& avatar_uuid = avatar_uuids[i]; // Start up IM before give the item - const LLUUID session_id = gIMMgr->addSession(avatar_name, IM_NOTHING_SPECIAL, avatar_uuid); + const LLUUID session_id = gIMMgr->addSession(av_name.getCompleteName(), IM_NOTHING_SPECIAL, avatar_uuid); uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 645ff1f3e9..9d22ac0652 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -51,6 +51,7 @@ #include "message.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llbutton.h" #include "llinventoryobserver.h" #include "llinventorymodel.h" @@ -873,8 +874,9 @@ bool LLCollectProxyBuddies::operator()(const LLUUID& buddy_id, LLRelationship* b bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getFullName(buddy_id, mFullName); - buddy_map_t::value_type value(mFullName, buddy_id); + LLAvatarName av_name; + LLAvatarNameCache::get( buddy_id, &av_name); + buddy_map_t::value_type value(av_name.mDisplayName, buddy_id); if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) { mMappable.insert(value); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 16a8f244ee..a838746a56 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -36,8 +36,6 @@ // Viewer includes #include "llagent.h" #include "llcallingcard.h" -#include "lldate.h" // split() -#include "lldateutil.h" // ageFromDate() #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llimview.h" // for gIMMgr @@ -61,6 +59,9 @@ //#include "llsdserialize.h" +//put it back as a member once the legacy path is out? +static std::map<LLUUID, LLAvatarName> sAvatarNameMap; + LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, BOOL allow_multiple, BOOL closeOnSelect) @@ -167,7 +168,7 @@ void LLFloaterAvatarPicker::onBtnFind() find(); } -static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, uuid_vec_t& avatar_ids) +static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names) { std::vector<LLScrollListItem*> items = from->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter) @@ -175,8 +176,8 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std: LLScrollListItem* item = *iter; if (item->getUUID().notNull()) { - avatar_names.push_back(item->getColumn(0)->getValue().asString()); avatar_ids.push_back(item->getUUID()); + avatar_names.push_back(sAvatarNameMap[item->getUUID()]); } } } @@ -212,10 +213,10 @@ void LLFloaterAvatarPicker::onBtnSelect() if(list) { - std::vector<std::string> avatar_names; uuid_vec_t avatar_ids; - getSelectedAvatarData(list, avatar_names, avatar_ids); - mSelectionCallback(avatar_names, avatar_ids); + std::vector<LLAvatarName> avatar_names; + getSelectedAvatarData(list, avatar_ids, avatar_names); + mSelectionCallback(avatar_ids, avatar_names); } } getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); @@ -392,6 +393,9 @@ public: void LLFloaterAvatarPicker::find() { + //clear our stored LLAvatarNames + sAvatarNameMap.clear(); + std::string text = childGetValue("Edit").asString(); mQueryID.generate(); @@ -559,6 +563,14 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* avatar_name = LLCacheName::buildFullName(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; + + LLAvatarName av_name; + av_name.mLegacyFirstName = first_name; + av_name.mLegacyLastName = last_name; + av_name.mDisplayName = avatar_name; + const LLUUID& agent_id = avatar_id; + sAvatarNameMap[agent_id] = av_name; + } LLSD element; element["id"] = avatar_id; // value @@ -606,20 +618,18 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& for ( ; it != agents.endArray(); ++it) { const LLSD& row = *it; - item["id"] = row["agent_id"]; + item["id"] = row["id"]; LLSD& columns = item["columns"]; columns[0]["column"] = "name"; columns[0]["value"] = row["display_name"]; - columns[1]["column"] = "slid"; - columns[1]["value"] = row["sl_id"]; - LLDate account_created = row["account_created"].asDate(); - S32 year, month, day; - account_created.split(&year, &month, &day); - std::string age = - LLDateUtil::ageFromDate(account_created, LLDate::now()); - columns[2]["column"] = "age"; - columns[2]["value"] = age; + columns[1]["column"] = "username"; + columns[1]["value"] = row["username"]; search_results->addElement(item); + + // add the avatar name to our list + LLAvatarName avatar_name; + avatar_name.fromLLSD(row); + sAvatarNameMap[row["id"].asUUID()] = avatar_name; } childEnable("ok_btn"); @@ -690,8 +700,8 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() if(list) { uuid_vec_t avatar_ids; - std::vector<std::string> avatar_names; - getSelectedAvatarData(list, avatar_names, avatar_ids); + std::vector<LLAvatarName> avatar_names; + getSelectedAvatarData(list, avatar_ids, avatar_names); return mOkButtonValidateSignal(avatar_ids); } } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index e355b38457..c6f96bee24 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -37,6 +37,7 @@ #include <vector> +class LLAvatarName; class LLScrollListCtrl; class LLFloaterAvatarPicker : public LLFloater @@ -46,7 +47,7 @@ public: typedef validate_signal_t::slot_type validate_callback_t; // The callback function will be called with an avatar name and UUID. - typedef boost::function<void (const std::vector<std::string>&, const uuid_vec_t&)> select_callback_t; + typedef boost::function<void (const uuid_vec_t&, const std::vector<LLAvatarName>&)> select_callback_t; // Call this to select an avatar. static LLFloaterAvatarPicker* show(select_callback_t callback, BOOL allow_multiple = FALSE, diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index bd07cfdfbf..44f104d687 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -34,6 +34,7 @@ #include "llfloatergodtools.h" +#include "llavatarnamecache.h" #include "llcoord.h" #include "llfontgl.h" #include "llframetimer.h" @@ -1151,11 +1152,11 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) panelp->childSetValue("target_avatar_name", name); } -void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelObjectTools::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; - childSetValue("target_avatar_name", names[0]); + childSetValue("target_avatar_name", names[0].getCompleteName()); refresh(); } diff --git a/indra/newview/llfloatergodtools.h b/indra/newview/llfloatergodtools.h index aee9db78a3..438f1024ce 100644 --- a/indra/newview/llfloatergodtools.h +++ b/indra/newview/llfloatergodtools.h @@ -41,6 +41,7 @@ #include "llpanel.h" #include <vector> +class LLAvatarName; class LLButton; class LLCheckBoxCtrl; class LLComboBox; @@ -231,7 +232,7 @@ public: void onChangeAnything(); void onApplyChanges(); void onClickSet(); - void callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); void onClickDeletePublicOwnedBy(); void onClickDeleteAllScriptedOwnedBy(); void onClickDeleteAllOwnedBy(); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 81dea58607..167d4b09f7 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -586,8 +586,6 @@ void LLPanelLandGeneral::refresh() parcel, GP_LAND_SET_SALE_INFO); BOOL can_be_sold = owner_sellable || estate_manager_sellable; - can_be_sold = true; - const LLUUID &owner_id = parcel->getOwnerID(); BOOL is_public = parcel->isPublic(); @@ -2772,12 +2770,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) void LLPanelLandAccess::onClickAddAccess() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1,_2)) ); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)) ); } -void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) { - if (!names.empty() && !ids.empty()) + if (!ids.empty()) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); @@ -2816,13 +2814,13 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) // static void LLPanelLandAccess::onClickAddBanned() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1,_2))); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1))); } // static -void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids) { - if (!names.empty() && !ids.empty()) + if (!ids.empty()) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 0a743e5215..e742d04aa0 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -379,8 +379,8 @@ public: void onClickAddAccess(); void onClickAddBanned(); - void callbackAvatarCBBanned(const std::vector<std::string>& names, const uuid_vec_t& ids); - void callbackAvatarCBAccess(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarCBBanned(const uuid_vec_t& ids); + void callbackAvatarCBAccess(const uuid_vec_t& ids); protected: LLNameListCtrl* mListAccess; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index fa146342ad..df400b65d6 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -49,6 +49,7 @@ #include "llagent.h" #include "llappviewer.h" +#include "llavatarname.h" #include "llfloateravatarpicker.h" #include "llbutton.h" #include "llcheckboxctrl.h" @@ -606,13 +607,13 @@ void LLPanelRegionGeneralInfo::onClickKick() // this depends on the grandparent view being a floater // in order to set up floater dependency LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1,_2), FALSE, TRUE); + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1), FALSE, TRUE); parent_floater->addDependentFloater(child_floater); } -void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids) { - if (names.empty() || ids.empty()) return; + if (ids.empty()) return; if(ids[0].notNull()) { strings_t strings; @@ -848,11 +849,11 @@ void LLPanelRegionDebugInfo::onClickChooseAvatar() } -void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelRegionDebugInfo::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; - childSetValue("target_avatar_name", LLSD(names[0])); + childSetValue("target_avatar_name", names[0].getCompleteName()); refreshFromRegion( gAgent.getRegion() ); } @@ -1527,24 +1528,17 @@ void LLPanelEstateInfo::onClickKickUser() // this depends on the grandparent view being a floater // in order to set up floater dependency LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1, _2), FALSE, TRUE); + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1), FALSE, TRUE); parent_floater->addDependentFloater(child_floater); } -void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids) { - if (names.empty() || ids.empty()) return; + if (ids.empty()) return; - //check to make sure there is one valid user and id - if( (ids[0].isNull()) || - (names[0].length() == 0) ) - { - return; - } - //Bring up a confirmation dialog LLSD args; - args["EVIL_USER"] = names[0]; + args["EVIL_USER"] = LLSLURL("agent", ids[0], "inspect").getSLURLString(); LLSD payload; payload["agent_id"] = ids[0]; LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, this, _1, _2)); @@ -1710,12 +1704,12 @@ bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& res LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); // avatar picker yes multi-select, yes close-on-select - LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, _2, (void*)change_info), TRUE, TRUE); + LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, (void*)change_info), TRUE, TRUE); return false; } // static -void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, const uuid_vec_t& ids, void* data) +void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, void* data) { LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; if (!change_info) return; diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 482ebb3303..13c2e46639 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -40,6 +40,7 @@ #include "llhost.h" #include "llpanel.h" +class LLAvatarName; class LLDispatcher; class LLLineEditor; class LLMessageSystem; @@ -168,7 +169,7 @@ public: protected: virtual BOOL sendUpdate(); void onClickKick(); - void onKickCommit(const std::vector<std::string>& names, const uuid_vec_t& ids); + void onKickCommit(const uuid_vec_t& ids); static void onClickKickAll(void* userdata); bool onKickAllCommit(const LLSD& notification, const LLSD& response); static void onClickMessage(void* userdata); @@ -193,7 +194,7 @@ protected: virtual BOOL sendUpdate(); void onClickChooseAvatar(); - void callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); static void onClickReturn(void *); bool callbackReturn(const LLSD& notification, const LLSD& response); static void onClickTopColliders(void*); @@ -284,7 +285,7 @@ public: // Core methods for all above add/remove button clicks static void accessAddCore(U32 operation_flag, const std::string& dialog_name); static bool accessAddCore2(const LLSD& notification, const LLSD& response); - static void accessAddCore3(const std::vector<std::string>& names, const uuid_vec_t& ids, void* data); + static void accessAddCore3(const uuid_vec_t& ids, void* data); static void accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name); static bool accessRemoveCore2(const LLSD& notification, const LLSD& response); @@ -296,7 +297,7 @@ public: // Send the actual EstateOwnerRequest "estateaccessdelta" message static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id); - void onKickUserCommit(const std::vector<std::string>& names, const uuid_vec_t& ids); + void onKickUserCommit(const uuid_vec_t& ids); static void onClickMessageEstate(void* data); bool onMessageCommit(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index bdaf036d0e..195b3e22d9 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -39,6 +39,7 @@ // linden library includes #include "llassetstorage.h" +#include "llavatarnamecache.h" #include "llcachename.h" #include "llfontgl.h" #include "llimagej2c.h" @@ -183,9 +184,8 @@ BOOL LLFloaterReporter::postBuild() childSetAction("cancel_btn", onClickCancel, this); // grab the user's name - std::string fullname; - LLAgentUI::buildFullname(fullname); - childSetText("reporter_field", fullname); + std::string reporter = LLSLURL("agent", gAgent.getID(), "inspect").getSLURLString(); + childSetText("reporter_field", reporter); center(); @@ -268,21 +268,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) if (objectp->isAvatar()) { - // we have the information we need - std::string object_owner; - - LLNameValue* firstname = objectp->getNVPair("FirstName"); - LLNameValue* lastname = objectp->getNVPair("LastName"); - if (firstname && lastname) - { - object_owner = LLCacheName::buildFullName( - firstname->getString(), lastname->getString()); - } - else - { - object_owner.append("Unknown"); - } - setFromAvatar(mObjectID, object_owner); + setFromAvatarID(mObjectID); } else { @@ -309,11 +295,11 @@ void LLFloaterReporter::onClickSelectAbuser() gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE )); } -void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; - childSetText("abuser_name_edit", names[0] ); + childSetText("abuser_name_edit", names[0].getCompleteName()); mAbuserID = ids[0]; @@ -321,18 +307,27 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, } -void LLFloaterReporter::setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name) +void LLFloaterReporter::setFromAvatarID(const LLUUID& avatar_id) { mAbuserID = mObjectID = avatar_id; - mOwnerName = avatar_name; - - std::string avatar_link = - LLSLURL("agent", mObjectID, "inspect").getSLURLString(); + std::string avatar_link = LLSLURL("agent", mObjectID, "inspect").getSLURLString(); childSetText("owner_name", avatar_link); - childSetText("object_name", avatar_name); - childSetText("abuser_name_edit", avatar_name); + + LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2)); } +void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) +{ + if (mObjectID == avatar_id) + { + mOwnerName = av_name.getCompleteName(); + childSetText("object_name", av_name.getCompleteName()); + childSetToolTip("object_name", av_name.getCompleteName()); + childSetText("abuser_name_edit", av_name.getCompleteName()); + } +} + + // static void LLFloaterReporter::onClickSend(void *userdata) { @@ -472,16 +467,11 @@ void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_ { LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter"); - // grab the user's name - std::string fullname; - LLAgentUI::buildFullname(fullname); - f->childSetText("reporter_field", fullname); - if (avatar_name.empty()) // Request info for this object f->getObjectInfo(object_id); else - f->setFromAvatar(object_id, avatar_name); + f->setFromAvatarID(object_id); // Need to deselect on close f->mDeselectOnClose = TRUE; diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 23784b7650..1f8526b1de 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -38,6 +38,7 @@ #include "lluuid.h" #include "v3math.h" +class LLAvatarName; class LLMessageSystem; class LLViewerTexture; class LLInventoryItem; @@ -123,8 +124,9 @@ private: void setPosBox(const LLVector3d &pos); void enableControls(BOOL own_avatar); void getObjectInfo(const LLUUID& object_id); - void callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids); - void setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name = LLStringUtil::null); + void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); + void setFromAvatarID(const LLUUID& avatar_id); + void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name); private: EReportType mReportType; diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index e214b58a9a..186debe40e 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -98,7 +98,7 @@ private: bool onConfirmSale(const LLSD& notification, const LLSD& response); static void doShowObjects(void *userdata); - void callbackAvatarPick(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); void onBuyerNameCache(const LLAvatarName& av_name); @@ -401,7 +401,7 @@ void LLFloaterSellLandUI::doSelectAgent() addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE)); } -void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLFloaterSellLandUI::callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { LLParcel* parcel = mParcelSelection->getParcel(); @@ -412,7 +412,7 @@ void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& nam mAuthorizedBuyer = ids[0]; - childSetText("sell_to_agent", names[0]); + childSetText("sell_to_agent", names[0].getCompleteName()); refreshUI(); } diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index c4144c9844..a9b9557027 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -150,7 +150,7 @@ private: private: LLUUID mAvatarID; // Need avatar name information to spawn friend add request - std::string mLegacyName; + LLAvatarName mAvatarName; // an in-flight request for avatar properties from LLAvatarPropertiesProcessor // is represented by this object LLFetchAvatarData* mPropertiesRequest; @@ -205,7 +205,7 @@ public: LLInspectAvatar::LLInspectAvatar(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key mAvatarID(), // set in onOpen() *Note: we used to show partner's name but we dont anymore --angela 3rd Dec* - mLegacyName(), + mAvatarName(), mPropertiesRequest(NULL) { mCommitCallbackRegistrar.add("InspectAvatar.ViewProfile", boost::bind(&LLInspectAvatar::onClickViewProfile, this)); @@ -560,7 +560,7 @@ void LLInspectAvatar::updateVolumeSlider() LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn"); - bool is_linden = LLStringUtil::endsWith(mLegacyName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden"); mute_btn->setEnabled( !is_linden); mute_btn->setValue( is_muted ); @@ -591,7 +591,7 @@ void LLInspectAvatar::onClickMuteVolume() LLMuteList* mute_list = LLMuteList::getInstance(); bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); - LLMute mute(mAvatarID, mLegacyName, LLMute::AGENT); + LLMute mute(mAvatarID, mAvatarName.getLegacyName(), LLMute::AGENT); if (!is_muted) { mute_list->add(mute, LLMute::flagVoiceChat); @@ -618,13 +618,13 @@ void LLInspectAvatar::onAvatarNameCache( { getChild<LLUICtrl>("user_name")->setValue(av_name.mDisplayName); getChild<LLUICtrl>("user_slid")->setValue(av_name.mUsername); - mLegacyName = av_name.getLegacyName(); + mAvatarName = av_name; } } void LLInspectAvatar::onClickAddFriend() { - LLAvatarActions::requestFriendshipDialog(mAvatarID, mLegacyName); + LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName.getLegacyName()); closeFloater(); } @@ -692,7 +692,7 @@ void LLInspectAvatar::onClickShare() void LLInspectAvatar::onToggleMute() { - LLMute mute(mAvatarID, mLegacyName, LLMute::AGENT); + LLMute mute(mAvatarID, mAvatarName.getLegacyName(), LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { @@ -709,7 +709,7 @@ void LLInspectAvatar::onToggleMute() void LLInspectAvatar::onClickReport() { - LLFloaterReporter::showFromAvatar(mAvatarID, mLegacyName); + LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName.getCompleteName()); closeFloater(); } @@ -733,17 +733,17 @@ void LLInspectAvatar::onClickZoomIn() void LLInspectAvatar::onClickFindOnMap() { - gFloaterWorldMap->trackAvatar(mAvatarID, mLegacyName); + gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName.getLegacyName()); LLFloaterReg::showInstance("world_map"); } bool LLInspectAvatar::enableMute() { - bool is_linden = LLStringUtil::endsWith(mLegacyName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden"); bool is_self = mAvatarID == gAgent.getID(); - if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mLegacyName)) + if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName.getLegacyName())) { return true; } @@ -755,10 +755,10 @@ bool LLInspectAvatar::enableMute() bool LLInspectAvatar::enableUnmute() { - bool is_linden = LLStringUtil::endsWith(mLegacyName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden"); bool is_self = mAvatarID == gAgent.getID(); - if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mLegacyName)) + if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName.getLegacyName())) { return true; } diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index c72f0f8012..c3c0af6d9e 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -35,6 +35,7 @@ #include "llpanelblockedlist.h" // library include +#include "llavatarname.h" #include "llfloater.h" #include "llfloaterreg.h" #include "llnotificationsutil.h" @@ -186,10 +187,10 @@ void LLPanelBlockedList::onBlockByNameClick() LLFloaterGetBlockedObjectName::show(&LLPanelBlockedList::callbackBlockByName); } -void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelBlockedList::callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (names.empty() || ids.empty()) return; - LLMute mute(ids[0], names[0], LLMute::AGENT); + LLMute mute(ids[0], names[0].getLegacyName(), LLMute::AGENT); LLMuteList::getInstance()->add(mute); showPanelAndSelect(mute.mID); } diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index a100577e43..88c1edb1f8 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -42,7 +42,8 @@ // class LLLineEditor; // class LLMessageSystem; // class LLUUID; - class LLScrollListCtrl; +class LLAvatarName; +class LLScrollListCtrl; class LLPanelBlockedList : public LLPanel, public LLMuteListObserver @@ -78,7 +79,7 @@ private: void onPickBtnClick(); void onBlockByNameClick(); - void callbackBlockPicked(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); static void callbackBlockByName(const std::string& text); private: diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 38922e1b99..a28e0c2123 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -34,6 +34,7 @@ #include "llpanelgroupinvite.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llfloateravatarpicker.h" #include "llbutton.h" #include "llcallingcard.h" @@ -68,9 +69,13 @@ public: static void callbackClickAdd(void* userdata); static void callbackClickRemove(void* userdata); static void callbackSelect(LLUICtrl* ctrl, void* userdata); - static void callbackAddUsers(const std::vector<std::string>& names, - const uuid_vec_t& agent_ids, + static void callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data); + + static void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + void* user_data); + bool inviteOwnerCallback(const LLSD& notification, const LLSD& response); public: @@ -293,7 +298,7 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata) LLFloater* parentp; parentp = gFloaterView->getParentFloater(panelp); - parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, _2, + parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE)); } @@ -359,16 +364,38 @@ void LLPanelGroupInvite::impl::callbackClickOK(void* userdata) if ( selfp ) selfp->submitInvitations(); } + + //static -void LLPanelGroupInvite::impl::callbackAddUsers(const std::vector<std::string>& names, - const uuid_vec_t& ids, - void* user_data) +void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data) +{ + std::vector<std::string> names; + for (S32 i = 0; i < (S32)agent_ids.size(); i++) + { + LLAvatarNameCache::get(agent_ids[i], + boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, _1, _2, user_data)); + } + +} + +void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + void* user_data) { impl* selfp = (impl*) user_data; - if ( selfp) selfp->addUsers(names, ids); + if (selfp) + { + std::vector<std::string> names; + uuid_vec_t agent_ids; + agent_ids.push_back(agent_id); + names.push_back(av_name.getCompleteName()); + + selfp->addUsers(names, agent_ids); + } } + LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id) : LLPanel(), mImplementation(new impl(group_id)), diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 0a4af00f78..7f20079d14 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" // libs +#include "llavatarname.h" #include "llfloaterreg.h" #include "llmenugl.h" #include "llnotificationsutil.h" @@ -1161,12 +1162,10 @@ void LLPanelPeople::onActivateButtonClicked() } // static -void LLPanelPeople::onAvatarPicked( - const std::vector<std::string>& names, - const uuid_vec_t& ids) +void LLPanelPeople::onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (!names.empty() && !ids.empty()) - LLAvatarActions::requestFriendshipDialog(ids[0], names[0]); + LLAvatarActions::requestFriendshipDialog(ids[0], names[0].getCompleteName()); } void LLPanelPeople::onGroupPlusButtonClicked() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 17c45a034b..54b53fc12c 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -38,10 +38,11 @@ #include "llcallingcard.h" // for avatar tracker #include "llvoiceclient.h" -class LLFilterEditor; -class LLTabContainer; class LLAvatarList; +class LLAvatarName; +class LLFilterEditor; class LLGroupList; +class LLTabContainer; class LLPanelPeople : public LLPanel @@ -133,9 +134,7 @@ private: bool onNearbyViewSortMenuItemCheck(const LLSD& userdata); // misc callbacks - static void onAvatarPicked( - const std::vector<std::string>& names, - const uuid_vec_t& ids); + static void onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); void onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list); diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index 489b7c0536..7ffafe26a2 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -97,12 +97,8 @@ name="name" width="100" /> <columns - label="SL ID" - name="slid" - width="100" /> - <columns - label="Age" - name="age" + label="Username" + name="username" width="100" /> </scroll_list> </panel> diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index df44b61632..d8a929eee2 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -564,7 +564,7 @@ sold with objects name="US$6.00/month,billedannually" /> </combo_box> <locate - height="10" + height="5" layout="topleft" /> <icon follows="top|left" @@ -584,7 +584,7 @@ sold with objects left="72" name="land_use_action" right="438" - top="284" + top="279" width="218"> Increase your monthly land use fees to US$ 40/month. </text> @@ -603,7 +603,7 @@ sold with objects This parcel is 512 m² of land. </text> <locate - height="10" + height="5" layout="topleft" /> <icon follows="top|left" @@ -616,14 +616,15 @@ This parcel is 512 m² of land. <text type="string" length="1" - bottom_delta="-38" + top_delta="10" follows="top|left" font="SansSerifBig" - height="16" + height="32" layout="topleft" left="72" name="purchase_action" - right="438"> + right="438" + wrap="true"> Pay Joe Resident L$ 4000 for the land </text> <text @@ -646,7 +647,7 @@ This parcel is 512 m² of land. left_delta="0" name="currency_action" top_pad="9" - width="90"> + width="95"> Buy additional L$ </text> <locate @@ -661,7 +662,7 @@ This parcel is 512 m² of land. layout="topleft" left="170" name="currency_amt" - top="408" + top_pad="-25" width="80"> 1000 </line_editor> diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index 21c0bfef48..47383c8010 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -373,7 +373,6 @@ height="23" layout="topleft" left_delta="0" - max_length="32" name="abuser_name_edit" top_pad="0" width="195" /> |