From 36594400a2ea20d7a404172c3ab6a01b0228a29d Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 22 Aug 2018 18:02:31 +0300 Subject: MAINT-8985 FIXED User is able to send friendship request to a friend from the group menu --- indra/llui/llscrolllistctrl.cpp | 21 +++++++++++++++++++++ indra/llui/llscrolllistctrl.h | 5 +++++ 2 files changed, 26 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index ed65b1e45f..410436e3f2 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1836,6 +1836,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("add_friend"); + LLView* removeFriendButton = mPopupMenu->getChild("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 +3123,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); +} diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 699a8744e1..b35a8608e7 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -90,6 +90,7 @@ public: typedef boost::signals2::signal > sort_signal_t; + typedef boost::signals2::signal is_friend_signal_t; struct Params : public LLInitParam::Block { @@ -393,6 +394,8 @@ public: return mSortCallback->connect(cb); } + boost::signals2::connection setIsFriendCallback(const is_friend_signal_t::slot_type& cb); + protected: // "Full" interface: use this when you're creating a list that has one or more of the following: @@ -515,6 +518,8 @@ private: std::vector mSortColumns; sort_signal_t* mSortCallback; + + is_friend_signal_t* mIsFriendSignal; }; // end class LLScrollListCtrl #endif // LL_SCROLLLISTCTRL_H -- cgit v1.2.3 From cdef4175d4d382f5c4a3caecb0ab319a82ed3a20 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 23 Aug 2018 14:53:46 +0300 Subject: MAINT-8985 Added missed initialization --- indra/llui/llscrolllistctrl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 410436e3f2..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; } -- cgit v1.2.3