summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llpanelavatar.cpp34
-rw-r--r--indra/newview/llpanelavatar.h4
-rw-r--r--indra/newview/skins/default/xui/en/menu_profile_overflow.xml29
3 files changed, 30 insertions, 37 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());
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index 52b4255e34..babbe534b4 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -202,8 +202,8 @@ protected:
void unfreeze();
void csr();
- bool checkOverflowMenuItem(const LLSD& param);
- bool enableOverflowMenuItem(const LLSD& param);
+ bool enableBlock();
+ bool enableUnblock();
bool enableGod();
diff --git a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
index 407ce14e81..5162a4902f 100644
--- a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
+++ b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
@@ -19,19 +19,22 @@
<menu_item_call.on_click
function="Profile.Share" />
</menu_item_call>
- <menu_item_check
- label="Block/Unblock"
- layout="topleft"
- name="block_unblock">
- <menu_item_check.on_click
- function="Profile.BlockUnblock" />
- <menu_item_check.on_check
- function="Profile.CheckItem"
- parameter="is_blocked" />
- <menu_item_check.on_enable
- function="Profile.EnableItem"
- parameter="can_block" />
- </menu_item_check>
+ <menu_item_call
+ label="Block"
+ name="block">
+ <menu_item_call.on_click
+ function="Profile.BlockUnblock"/>
+ <menu_item_call.on_visible
+ function="Profile.EnableBlock" />
+ </menu_item_call>
+ <menu_item_call
+ label="Unblock"
+ name="unblock">
+ <menu_item_call.on_click
+ function="Profile.BlockUnblock"/>
+ <menu_item_call.on_visible
+ function="Profile.EnableUnblock" />
+ </menu_item_call>
<menu_item_call
label="Kick"
layout="topleft"