summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-02-13 01:38:24 +0000
committerCho <cho@lindenlab.com>2013-02-13 01:38:24 +0000
commitd818252528aa68a387dc237d1c5a74d366c5a120 (patch)
tree9af7902d0dd64695331659f5525bf3a9d548f521 /indra/newview
parentd4e4a618fb4506b635f4da1ddbc20601ee84e001 (diff)
CHUI-740 FIX Incorrect option shown in group Moderator tools "Toggle mute this participant"
Added new LLFloaterIMContainer::visibleContextMenuItem() connected to "Avatar.VisibleItem"
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp21
-rw-r--r--indra/newview/llfloaterimcontainer.h5
-rw-r--r--indra/newview/skins/default/xui/en/menu_conversation.xml6
3 files changed, 26 insertions, 6 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 30ea9f10c0..52e153a15e 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -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);
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index a28dba3b98..265ae8df4c 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -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);
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index cbd2343a3c..fd5c86b3ca 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -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"