diff options
author | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-10-29 18:09:38 +0200 |
---|---|---|
committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-10-29 18:09:38 +0200 |
commit | 19e99af208f0dad118cf3029f409442bca5d3e21 (patch) | |
tree | 089f9e2768bdedc6bf3050efafefa743d8bafbad /indra/newview/llchathistory.cpp | |
parent | f04c96c540c6c1fe8d5f3b11e223d29d407f0e9f (diff) |
fix normal bug EXT-1712 Nearby Chat: change context menu for objects
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index aaca568320..a66196a2cb 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -43,6 +43,7 @@ #include "llagentdata.h" #include "llavataractions.h" #include "lltrans.h" +#include "llmutelist.h" static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history"); static const std::string MESSAGE_USERNAME_DATE_SEPARATOR(" ----- "); @@ -77,6 +78,19 @@ public: return LLPanel::handleMouseUp(x,y,mask); } + void onObjectIconContextMenuItemClicked(const LLSD& userdata) + { + std::string level = userdata.asString(); + + if (level == "profile") + { + } + else if (level == "block") + { + LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); + } + } + void onAvatarIconContextMenuItemClicked(const LLSD& userdata) { std::string level = userdata.asString(); @@ -109,11 +123,16 @@ public: LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); + registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mPopupMenuHandleAvatar = menu->getHandle(); + menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mPopupMenuHandleObject = menu->getHandle(); + + + return LLPanel::postBuild(); } @@ -163,7 +182,10 @@ public: LLTextBox* userName = getChild<LLTextBox>("user_name"); if(!chat.mFromName.empty()) + { userName->setValue(chat.mFromName); + mFrom = chat.mFromName; + } else { std::string SL = LLTrans::getString("SECOND_LIFE"); @@ -206,8 +228,12 @@ protected: void showSystemContextMenu(S32 x,S32 y) { } + void showObjectContextMenu(S32 x,S32 y) { + LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get(); + if(menu) + LLMenuGL::showPopup(this, menu, x, y); } void showAvatarContextMenu(S32 x,S32 y) @@ -238,11 +264,13 @@ protected: protected: LLHandle<LLView> mPopupMenuHandleAvatar; + LLHandle<LLView> mPopupMenuHandleObject; LLUUID mAvatarID; EChatSourceType mSourceType; std::string mFirstName; std::string mLastName; + std::string mFrom; }; |