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 | |
parent | f04c96c540c6c1fe8d5f3b11e223d29d407f0e9f (diff) |
fix normal bug EXT-1712 Nearby Chat: change context menu for objects
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llchathistory.cpp | 30 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_object_icon.xml | 27 |
2 files changed, 56 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; }; diff --git a/indra/newview/skins/default/xui/en/menu_object_icon.xml b/indra/newview/skins/default/xui/en/menu_object_icon.xml new file mode 100644 index 0000000000..0c8a2af002 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_object_icon.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="Object Icon Menu" + top="724" + visible="false" + width="128"> + <menu_item_call + label="Object Profile..." + layout="topleft" + name="Object Profile"> + <menu_item_call.on_click + function="ObjectIcon.Action" + parameter="profile" /> + </menu_item_call> + <menu_item_call + label="Block..." + layout="topleft" + name="Block"> + <menu_item_call.on_click + function="ObjectIcon.Action" + parameter="block" /> + </menu_item_call> +</menu> |