diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-02-15 10:51:43 +0200 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-02-15 10:51:43 +0200 |
commit | 75a060497c06d0143a0515f4d5665097da34a3e3 (patch) | |
tree | 6e44cb956c84459f3a08ec3e471f0a9a7b029b26 /indra/newview/llpanelavatar.cpp | |
parent | e890055da3a4635af1a033411e83a96b14aa6f99 (diff) |
Fixed low bug EXT-5069 (Bad user experience while blocking avatar from view profile panel). Replaced using of menu_item_check with menu_item_call
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llpanelavatar.cpp')
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index d7c558d188..91eab9f4f1 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -507,8 +507,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()); @@ -685,26 +685,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()); @@ -720,6 +700,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()); |