summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-05-18 19:29:31 +0300
committerandreykproductengine <akleshchev@productengine.com>2016-05-18 19:29:31 +0300
commitefa716b5fcaa0f0faa4003e072747898a223e983 (patch)
treed2febedf61a98fc08535c3ad8f59137ec244aec1 /indra/llui/lltextbase.cpp
parent9ffc67ef8498823db2dc386ebdd0812fe4f54cb8 (diff)
MAINT-2129 "Block" button doesn't become disabled
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 616c42895c..3e4680de24 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -177,6 +177,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
: LLUICtrl(p, LLTextViewModelPtr(new LLTextViewModel)),
mURLClickSignal(NULL),
mIsFriendSignal(NULL),
+ mIsObjectBlockedSignal(NULL),
mMaxTextByteLength( p.max_text_length ),
mFont(p.font),
mFontShadow(p.font_shadow),
@@ -1942,6 +1943,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url));
registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url, true));
registrar.add("Url.Block", boost::bind(&LLUrlAction::blockObject, url));
+ registrar.add("Url.Unblock", boost::bind(&LLUrlAction::unblockObject, url));
registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url));
registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url));
registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url));
@@ -1968,6 +1970,19 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
removeFriendButton->setEnabled(isFriend);
}
}
+
+ if (mIsObjectBlockedSignal)
+ {
+ bool is_blocked = *(*mIsObjectBlockedSignal)(LLUUID(LLUrlAction::getObjectId(url)), LLUrlAction::getObjectName(url));
+ LLView* blockButton = mPopupMenu->getChild<LLView>("block_object");
+ LLView* unblockButton = mPopupMenu->getChild<LLView>("unblock_object");
+
+ if (blockButton && unblockButton)
+ {
+ blockButton->setVisible(!is_blocked);
+ unblockButton->setVisible(is_blocked);
+ }
+ }
if (mPopupMenu)
{
@@ -3022,6 +3037,15 @@ boost::signals2::connection LLTextBase::setIsFriendCallback(const is_friend_sign
return mIsFriendSignal->connect(cb);
}
+boost::signals2::connection LLTextBase::setIsObjectBlockedCallback(const is_blocked_signal_t::slot_type& cb)
+{
+ if (!mIsObjectBlockedSignal)
+ {
+ mIsObjectBlockedSignal = new is_blocked_signal_t();
+ }
+ return mIsObjectBlockedSignal->connect(cb);
+}
+
//
// LLTextSegment
//