summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-02 14:06:23 -0800
committerJames Cook <james@lindenlab.com>2010-03-02 14:06:23 -0800
commitfe8d015851f74d375776791aa1adec204799037b (patch)
tree644a0dfbd4cd750d69ccbf1a82fe1fc277842d2d /indra/newview/llpanelavatar.cpp
parent822d042e0c04dba2cdaced8c81b50840972a7286 (diff)
parent96da7000e34585d24b4b6946a30a3fb77d668f76 (diff)
Merge
Diffstat (limited to 'indra/newview/llpanelavatar.cpp')
-rw-r--r--indra/newview/llpanelavatar.cpp42
1 files changed, 17 insertions, 25 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 1cc16a14bb..a0bcd00867 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -454,18 +454,20 @@ void LLPanelProfileTab::onMapButtonClick()
void LLPanelProfileTab::updateButtons()
{
- bool is_avatar_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId());
+ bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId());
if(LLAvatarActions::isFriend(getAvatarId()))
{
- childSetEnabled("teleport", is_avatar_online);
+ childSetEnabled("teleport", is_buddy_online);
}
else
{
childSetEnabled("teleport", true);
}
- bool enable_map_btn = is_avatar_online && gAgent.isGodlike() || is_agent_mappable(getAvatarId());
+ bool enable_map_btn = (is_buddy_online &&
+ is_agent_mappable(getAvatarId()))
+ || gAgent.isGodlike();
childSetEnabled("show_on_map_btn", enable_map_btn);
}
@@ -506,8 +508,8 @@ BOOL LLPanelAvatarProfile::postBuild()
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
enable.add("Profile.EnableGod", boost::bind(&enable_god));
- enable.add("Profile.CheckItem", boost::bind(&LLPanelAvatarProfile::checkOverflowMenuItem, this, _2));
- enable.add("Profile.EnableItem", boost::bind(&LLPanelAvatarProfile::enableOverflowMenuItem, this, _2));
+ enable.add("Profile.EnableBlock", boost::bind(&LLPanelAvatarProfile::enableBlock, this));
+ enable.add("Profile.EnableUnblock", boost::bind(&LLPanelAvatarProfile::enableUnblock, this));
mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
@@ -684,26 +686,6 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data)
childSetValue("acc_status_text", caption_text);
}
-bool LLPanelAvatarProfile::checkOverflowMenuItem(const LLSD& param)
-{
- std::string item = param.asString();
-
- if (item == "is_blocked")
- return LLAvatarActions::isBlocked(getAvatarId());
-
- return false;
-}
-
-bool LLPanelAvatarProfile::enableOverflowMenuItem(const LLSD& param)
-{
- std::string item = param.asString();
-
- if (item == "can_block")
- return LLAvatarActions::canBlock(getAvatarId());
-
- return false;
-}
-
void LLPanelAvatarProfile::pay()
{
LLAvatarActions::pay(getAvatarId());
@@ -719,6 +701,16 @@ void LLPanelAvatarProfile::toggleBlock()
LLAvatarActions::toggleBlock(getAvatarId());
}
+bool LLPanelAvatarProfile::enableBlock()
+{
+ return LLAvatarActions::canBlock(getAvatarId()) && !LLAvatarActions::isBlocked(getAvatarId());
+}
+
+bool LLPanelAvatarProfile::enableUnblock()
+{
+ return LLAvatarActions::isBlocked(getAvatarId());
+}
+
void LLPanelAvatarProfile::kick()
{
LLAvatarActions::kick(getAvatarId());