From e04752c165900e652f4b8a8a62c1f351967847d7 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 8 Jan 2010 11:53:03 -0800 Subject: EXT-3874 Lindens can (appear to) be blocked from avatar info popup --- indra/newview/llinspectavatar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinspectavatar.cpp') diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 72994a4371..6cb3431419 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -520,7 +520,10 @@ void LLInspectAvatar::updateVolumeSlider() bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); LLUICtrl* mute_btn = getChild("mute_btn"); - mute_btn->setEnabled( voice_enabled ); + + bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + + mute_btn->setEnabled( voice_enabled && !is_linden); mute_btn->setValue( is_muted ); LLUICtrl* volume_slider = getChild("volume_slider"); -- cgit v1.2.3 From ecf6e997ff0b081c41d7b3685c875f2f181ef55f Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 8 Jan 2010 16:15:15 -0800 Subject: EXT-3874 Lindens can (appear to) be blocked from avatar info popup --- indra/newview/llinspectavatar.cpp | 75 +++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 31 deletions(-) (limited to 'indra/newview/llinspectavatar.cpp') diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 6cb3431419..5f9d479b3e 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -403,7 +403,8 @@ void LLInspectAvatar::updateModeratorPanel() { bool enable_moderator_panel = false; - if (LLVoiceChannel::getCurrentVoiceChannel()) + if (LLVoiceChannel::getCurrentVoiceChannel() && + mAvatarID != gAgent.getID()) { LLUUID session_id = LLVoiceChannel::getCurrentVoiceChannel()->getSessionID(); @@ -514,45 +515,57 @@ void LLInspectAvatar::toggleSelectedVoice(bool enabled) void LLInspectAvatar::updateVolumeSlider() { - // By convention, we only display and toggle voice mutes, not all mutes - bool is_muted = LLMuteList::getInstance()-> - isMuted(mAvatarID, LLMute::flagVoiceChat); - bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); - - LLUICtrl* mute_btn = getChild("mute_btn"); - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); - - mute_btn->setEnabled( voice_enabled && !is_linden); - mute_btn->setValue( is_muted ); + bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); - LLUICtrl* volume_slider = getChild("volume_slider"); - volume_slider->setEnabled( voice_enabled && !is_muted ); - const F32 DEFAULT_VOLUME = 0.5f; - F32 volume; - if (is_muted) + // Do not display volume slider and mute button if it + // is ourself or we are not in a voice channel together + if (!voice_enabled || (mAvatarID == gAgent.getID())) { - // it's clearer to display their volume as zero - volume = 0.f; + getChild("mute_btn")->setVisible(false); + getChild("volume_slider")->setVisible(false); } - else if (!voice_enabled) - { - // use nominal value rather than 0 - volume = DEFAULT_VOLUME; - } - else + + else { - // actual volume - volume = gVoiceClient->getUserVolume(mAvatarID); + getChild("mute_btn")->setVisible(true); + getChild("volume_slider")->setVisible(true); + + // By convention, we only display and toggle voice mutes, not all mutes + bool is_muted = LLMuteList::getInstance()-> + isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLUICtrl* mute_btn = getChild("mute_btn"); - // *HACK: Voice client doesn't have any data until user actually - // says something. - if (volume == 0.f) + bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + + mute_btn->setEnabled( !is_linden); + mute_btn->setValue( is_muted ); + + LLUICtrl* volume_slider = getChild("volume_slider"); + volume_slider->setEnabled( !is_muted ); + const F32 DEFAULT_VOLUME = 0.5f; + F32 volume; + if (is_muted) + { + // it's clearer to display their volume as zero + volume = 0.f; + } + else { - volume = DEFAULT_VOLUME; + // actual volume + volume = gVoiceClient->getUserVolume(mAvatarID); + + // *HACK: Voice client doesn't have any data until user actually + // says something. + if (volume == 0.f) + { + volume = DEFAULT_VOLUME; + } } + volume_slider->setValue( (F64)volume ); } - volume_slider->setValue( (F64)volume ); + } void LLInspectAvatar::onClickMuteVolume() -- cgit v1.2.3 From a2c08d8e86a46fe37006a8086c56866445e57bf3 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 16:59:28 +0000 Subject: EXT-3429: Don't display inspect slider when inappropriate. The avatar inspector has a volume slider and mute button. We make these widgets invisible when it does not makes sense to interact with them. That is, when the inspector is for your own avatar, or when voice is not active. --- indra/newview/llinspectavatar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinspectavatar.cpp') diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 72994a4371..a2b3a54f51 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -278,7 +278,7 @@ void LLInspectAvatar::onOpen(const LLSD& data) getChild("gear_self_btn")->setVisible(self); getChild("gear_btn")->setVisible(!self); - + // Position the inspector relative to the mouse cursor // Similar to how tooltips are positioned // See LLToolTipMgr::createToolTip @@ -518,13 +518,17 @@ void LLInspectAvatar::updateVolumeSlider() bool is_muted = LLMuteList::getInstance()-> isMuted(mAvatarID, LLMute::flagVoiceChat); bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); + bool is_self = (mAvatarID == gAgent.getID()); LLUICtrl* mute_btn = getChild("mute_btn"); mute_btn->setEnabled( voice_enabled ); mute_btn->setValue( is_muted ); + mute_btn->setVisible( voice_enabled && !is_self ); LLUICtrl* volume_slider = getChild("volume_slider"); volume_slider->setEnabled( voice_enabled && !is_muted ); + volume_slider->setVisible( voice_enabled && !is_self ); + const F32 DEFAULT_VOLUME = 0.5f; F32 volume; if (is_muted) -- cgit v1.2.3 From fb9a20802f3386bee82a8bd9a479f209374fa9a4 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 11 Jan 2010 14:18:43 -0800 Subject: Better resolution of merge conflict --- indra/newview/llinspectavatar.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llinspectavatar.cpp') diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 22451998c6..8f4fba244d 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -534,7 +534,6 @@ void LLInspectAvatar::updateVolumeSlider() // By convention, we only display and toggle voice mutes, not all mutes bool is_muted = LLMuteList::getInstance()-> isMuted(mAvatarID, LLMute::flagVoiceChat); - bool is_self = (mAvatarID == gAgent.getID()); LLUICtrl* mute_btn = getChild("mute_btn"); @@ -542,11 +541,9 @@ void LLInspectAvatar::updateVolumeSlider() mute_btn->setEnabled( !is_linden); mute_btn->setValue( is_muted ); - mute_btn->setVisible( voice_enabled && !is_self ); LLUICtrl* volume_slider = getChild("volume_slider"); volume_slider->setEnabled( !is_muted ); - volume_slider->setVisible( voice_enabled && !is_self ); const F32 DEFAULT_VOLUME = 0.5f; F32 volume; -- cgit v1.2.3