diff options
author | Josh Bell <josh@lindenlab.com> | 2007-04-11 17:54:18 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-04-11 17:54:18 +0000 |
commit | 0277259455c4354f81ea8a24c8ab93f27567bc6f (patch) | |
tree | f1411dab563dcf697f794e9e8a592a6d3e5c4d2d /indra/newview/llpanelavatar.cpp | |
parent | 568397bbcc4fca307ebc010ec7f815422b9ba80a (diff) |
svn merge -r 59968:60342 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/newview/llpanelavatar.cpp')
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 05bd59593d..1b0c731ea9 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -10,6 +10,7 @@ #include "llpanelavatar.h" +#include "llclassifiedflags.h" #include "llfontgl.h" #include "llcachename.h" @@ -24,6 +25,8 @@ #include "llcallingcard.h" #include "llcheckboxctrl.h" #include "llfloater.h" + +#include "llfloaterfriends.h" #include "llfloatergroupinfo.h" #include "llfloaterworldmap.h" #include "llfloatermute.h" @@ -446,7 +449,8 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); - childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); + //childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); + childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() ); @@ -839,9 +843,9 @@ void LLPanelAvatarClassified::refresh() S32 tab_count = tabs ? tabs->getTabCount() : 0; - BOOL allow_new = TRUE; //tab_count < MAX_CLASSIFIEDS; - BOOL allow_delete = (tab_count > 0); - BOOL show_help = (tab_count == 0); + bool allow_new = tab_count < MAX_CLASSIFIEDS; + bool allow_delete = (tab_count > 0); + bool show_help = (tab_count == 0); childSetEnabled("New...",self && allow_new); childSetEnabled("Delete...",self && allow_delete); @@ -904,9 +908,8 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab"); - // Clear out all the old panels. - // We'll replace them with the correct number of new panels. - deleteClassifiedPanels(); + // Don't remove old panels. We need to be able to process multiple + // packets for people who have lots of classifieds. JC block_count = msg->getNumberOfBlocksFast(_PREHASH_Data); for (block = 0; block < block_count; block++) @@ -1434,6 +1437,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, childSetEnabled("Show on Map",FALSE); childSetVisible("Rate...",FALSE); childSetEnabled("Rate...",FALSE); + childSetVisible("Add Friend...",FALSE); + childSetEnabled("Add Friend...",FALSE); childSetVisible("Pay...",FALSE); childSetEnabled("Pay...",FALSE); } @@ -1472,6 +1477,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, } childSetVisible("Rate...",TRUE); childSetEnabled("Rate...",FALSE); + childSetVisible("Add Friend...", true); + childSetEnabled("Add Friend...", true); childSetVisible("Pay...",TRUE); childSetEnabled("Pay...",FALSE); } @@ -1580,6 +1587,18 @@ void LLPanelAvatar::onClickRate(void *userdata) LLFloaterRate::show(self->mAvatarID); } +// static +void LLPanelAvatar::onClickAddFriend(void* userdata) +{ + LLPanelAvatar* self = (LLPanelAvatar*) userdata; + LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); + if (name_edit) + { + LLFloaterFriends::requestFriendshipDialog(self->getAvatarID(), + name_edit->getText()); + } +} + //----------------------------------------------------------------------------- // onClickMute() //----------------------------------------------------------------------------- |