summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kondrashev <ekondrashev@productengine.com>2009-11-09 19:14:34 +0200
committerEugene Kondrashev <ekondrashev@productengine.com>2009-11-09 19:14:34 +0200
commit53094499529a665706c3670a628eaf8b77e8c62d (patch)
tree2cfef41365a7764d4844d4cc98d7a9f49187bd29
parent7e3cc1374795bc43646aecd29a0d4152b750c68e (diff)
Fixed Nice to have bug EXT-1907-Context menu for avatar in Friends tab appears only if right mouse click was performed over avatar's icon area. Remove default avatar context menu.
--HG-- branch : product-engine
-rw-r--r--indra/newview/llavatariconctrl.cpp73
-rw-r--r--indra/newview/llavatariconctrl.h5
-rw-r--r--indra/newview/llpanelpeople.cpp2
3 files changed, 2 insertions, 78 deletions
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 0ee3e78409..46902006a6 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -195,14 +195,6 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p)
{
LLIconCtrl::setValue("default_profile_picture.j2c");
}
-
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
-
- registrar.add("AvatarIcon.Action", boost::bind(&LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked, this, _2));
-
- LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
-
- mPopupMenuHandle = menu->getHandle();
}
LLAvatarIconCtrl::~LLAvatarIconCtrl()
@@ -212,8 +204,6 @@ LLAvatarIconCtrl::~LLAvatarIconCtrl()
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this);
// Name callbacks will be automatically disconnected since LLUICtrl is trackable
}
-
- LLView::deleteViewByHandle(mPopupMenuHandle);
}
//virtual
@@ -295,32 +285,6 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
}
}
-BOOL LLAvatarIconCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
-{
- LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
-
- if(menu)
- {
- bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarId) != NULL;
-
- menu->setItemEnabled("Add Friend", !is_friend);
- menu->setItemEnabled("Remove Friend", is_friend);
-
- if(gAgentID == mAvatarId)
- {
- menu->setItemEnabled("Add Friend", false);
- menu->setItemEnabled("Send IM", false);
- menu->setItemEnabled("Remove Friend", false);
- }
-
- menu->buildDrawLabels();
- menu->updateParent(LLMenuGL::sMenuContainer);
- LLMenuGL::showPopup(this, menu, x, y);
- }
-
- return TRUE;
-}
-
void LLAvatarIconCtrl::nameUpdatedCallback(
const LLUUID& id,
const std::string& first,
@@ -338,40 +302,3 @@ void LLAvatarIconCtrl::nameUpdatedCallback(
}
}
}
-
-void LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked(const LLSD& userdata)
-{
- std::string level = userdata.asString();
- LLUUID id = getAvatarId();
-
- if (level == "profile")
- {
- LLAvatarActions::showProfile(id);
- }
- else if (level == "im")
- {
- std::string name;
- name.assign(getFirstName());
- name.append(" ");
- name.append(getLastName());
-
- LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
- if (session_id != LLUUID::null)
- {
- LLIMFloater::show(session_id);
- }
- }
- else if (level == "add")
- {
- std::string name;
- name.assign(getFirstName());
- name.append(" ");
- name.append(getLastName());
-
- LLAvatarActions::requestFriendshipDialog(id, name);
- }
- else if (level == "remove")
- {
- LLAvatarActions::removeFriendDialog(id);
- }
-}
diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h
index 65b5c86ed5..5eb830df4b 100644
--- a/indra/newview/llavatariconctrl.h
+++ b/indra/newview/llavatariconctrl.h
@@ -81,8 +81,6 @@ protected:
LLAvatarIconCtrl(const Params&);
friend class LLUICtrlFactory;
- void onAvatarIconContextMenuItemClicked(const LLSD& userdata);
-
public:
virtual ~LLAvatarIconCtrl();
@@ -91,8 +89,6 @@ public:
// LLAvatarPropertiesProcessor observer trigger
virtual void processProperties(void* data, EAvatarProcessorType type);
- BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
-
void nameUpdatedCallback(
const LLUUID& id,
const std::string& first,
@@ -109,7 +105,6 @@ protected:
LLUUID mAvatarId;
std::string mFirstName;
std::string mLastName;
- LLHandle<LLView> mPopupMenuHandle;
bool mDrawTooltip;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f20ffa7559..fd643cdcc9 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -508,6 +508,8 @@ BOOL LLPanelPeople::postBuild()
mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+ mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+ mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false);
setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false);