CHUI-740 FIX Incorrect option shown in group Moderator tools "Toggle mute this participant"

Added new LLFloaterIMContainer::visibleContextMenuItem() connected to "Avatar.VisibleItem"
meow-7.2.2
Cho 2013-02-13 01:38:24 +00:00
parent d4e4a618fb
commit d818252528
3 changed files with 26 additions and 6 deletions

View File

@ -68,8 +68,9 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param
mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2));
mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2));
mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMContainer::checkContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMContainer::enableContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMContainer::checkContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMContainer::enableContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.VisibleItem", boost::bind(&LLFloaterIMContainer::visibleContextMenuItem, this, _2));
mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMContainer::doToSelected, this, _2));
mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&LLFloaterIMContainer::doToSelectedGroup, this, _2));
@ -1290,6 +1291,22 @@ bool LLFloaterIMContainer::checkContextMenuItem(const std::string& item, uuid_ve
return false;
}
bool LLFloaterIMContainer::visibleContextMenuItem(const LLSD& userdata)
{
const std::string& item = userdata.asString();
if ("show_mute" == item)
{
return !isMuted(getCurSelectedViewModelItem()->getUUID());
}
else if ("show_unmute" == item)
{
return isMuted(getCurSelectedViewModelItem()->getUUID());
}
return true;
}
void LLFloaterIMContainer::showConversation(const LLUUID& session_id)
{
setVisibleAndFrontmost(false);

View File

@ -140,8 +140,9 @@ private:
const LLConversationItem * getCurSelectedViewModelItem();
void getParticipantUUIDs(uuid_vec_t& selected_uuids);
void doToSelected(const LLSD& userdata);
bool checkContextMenuItem(const LLSD& userdata);
bool enableContextMenuItem(const LLSD& userdata);
bool checkContextMenuItem(const LLSD& userdata);
bool enableContextMenuItem(const LLSD& userdata);
bool visibleContextMenuItem(const LLSD& userdata);
void doToSelectedConversation(const std::string& command, uuid_vec_t& selectedIDS);
void doToSelectedGroup(const LLSD& userdata);

View File

@ -167,14 +167,16 @@
layout="topleft"
name="ModerateVoiceMuteSelected">
<on_click function="Avatar.DoToSelected" parameter="selected" />
<on_visible function="Avatar.EnableItem" parameter="can_mute" />
<on_enable function="Avatar.EnableItem" parameter="can_mute" />
<on_visible function="Avatar.VisibleItem" parameter="show_mute" />
</menu_item_call>
<menu_item_call
label="Unmute this participant"
layout="topleft"
name="ModerateVoiceUnMuteSelected">
<on_click function="Avatar.DoToSelected" parameter="selected" />
<on_visible function="Avatar.EnableItem" parameter="can_unmute" />
<on_enable function="Avatar.EnableItem" parameter="can_unmute" />
<on_visible function="Avatar.VisibleItem" parameter="show_unmute" />
</menu_item_call>
<menu_item_call
label="Mute everyone"