summaryrefslogtreecommitdiff
path: root/indra/llui/llscrolllistctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llscrolllistctrl.cpp')
-rw-r--r--indra/llui/llscrolllistctrl.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index ed65b1e45f..f4028057e8 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -199,7 +199,8 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
mHoveredColor(p.hovered_color()),
mSearchColumn(p.search_column),
mColumnPadding(p.column_padding),
- mContextMenuType(MENU_NONE)
+ mContextMenuType(MENU_NONE),
+ mIsFriendSignal(NULL)
{
mItemListRect.setOriginAndSize(
mBorderThickness,
@@ -323,6 +324,7 @@ LLScrollListCtrl::~LLScrollListCtrl()
mItemList.clear();
std::for_each(mColumns.begin(), mColumns.end(), DeletePairedPointer());
mColumns.clear();
+ delete mIsFriendSignal;
}
@@ -1836,6 +1838,19 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
menu_name, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
if (mPopupMenu)
{
+ if (mIsFriendSignal)
+ {
+ bool isFriend = *(*mIsFriendSignal)(uuid);
+ LLView* addFriendButton = mPopupMenu->getChild<LLView>("add_friend");
+ LLView* removeFriendButton = mPopupMenu->getChild<LLView>("remove_friend");
+
+ if (addFriendButton && removeFriendButton)
+ {
+ addFriendButton->setEnabled(!isFriend);
+ removeFriendButton->setEnabled(isFriend);
+ }
+ }
+
mPopupMenu->show(x, y);
LLMenuGL::showPopup(this, mPopupMenu, x, y);
return TRUE;
@@ -3110,3 +3125,11 @@ void LLScrollListCtrl::onFocusLost()
LLUICtrl::onFocusLost();
}
+boost::signals2::connection LLScrollListCtrl::setIsFriendCallback(const is_friend_signal_t::slot_type& cb)
+{
+ if (!mIsFriendSignal)
+ {
+ mIsFriendSignal = new is_friend_signal_t();
+ }
+ return mIsFriendSignal->connect(cb);
+}