From 4bef4f94c0ec89ef7b14bc267f52ba00a6dcdc2b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Aug 2023 00:44:07 +0300 Subject: SL-18049 Part 3; Better indication when voice is muted --- indra/newview/llstatusbar.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 0a87b14e17..a9ec4ffbb4 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -66,6 +66,7 @@ #include "llviewermenu.h" // for gMenuBarView #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" +#include "llvoiceclient.h" #include "lluictrlfactory.h" #include "lltoolmgr.h" @@ -190,6 +191,16 @@ BOOL LLStatusBar::postBuild() LLHints::getInstance()->registerHintTarget("linden_balance", getChild("balance_bg")->getHandle()); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); + gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLStatusBar::onVoiceChanged, this, _2)); + + if (gSavedSettings.getBOOL("EnableVoiceChat") && !LLVoiceClient::isMutedVoiceInstance()) + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); + } + else + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); + } // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; @@ -640,6 +651,19 @@ void LLStatusBar::onVolumeChanged(const LLSD& newvalue) refresh(); } +void LLStatusBar::onVoiceChanged(const LLSD& newvalue) +{ + if (newvalue.asBoolean() && !LLVoiceClient::isMutedVoiceInstance()) + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); + } + else + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); + } + refresh(); +} + void LLStatusBar::onUpdateFilterTerm() { LLWString searchValue = utf8str_to_wstring( mFilterEdit->getValue() ); -- cgit v1.2.3 From a16babdf7d96fbbe345d9e0c5df178e48539751c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Aug 2023 18:17:50 +0300 Subject: SL-18049 Part 4; Adjustments and fixes --- indra/newview/llstatusbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index a9ec4ffbb4..0145380712 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -193,7 +193,7 @@ BOOL LLStatusBar::postBuild() gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLStatusBar::onVoiceChanged, this, _2)); - if (gSavedSettings.getBOOL("EnableVoiceChat") && !LLVoiceClient::isMutedVoiceInstance()) + if (gSavedSettings.getBOOL("EnableVoiceChat")) { mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); } @@ -653,7 +653,7 @@ void LLStatusBar::onVolumeChanged(const LLSD& newvalue) void LLStatusBar::onVoiceChanged(const LLSD& newvalue) { - if (newvalue.asBoolean() && !LLVoiceClient::isMutedVoiceInstance()) + if (newvalue.asBoolean()) { mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); } -- cgit v1.2.3 From 724b6a8c64dab8bb3586b3273e51d7502ac44749 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Aug 2023 19:47:22 +0300 Subject: SL-18049 Part 5; Tweak new icon visibility --- indra/newview/llstatusbar.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 0145380712..836a4327bf 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -66,7 +66,6 @@ #include "llviewermenu.h" // for gMenuBarView #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" -#include "llvoiceclient.h" #include "lluictrlfactory.h" #include "lltoolmgr.h" @@ -193,12 +192,9 @@ BOOL LLStatusBar::postBuild() gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLStatusBar::onVoiceChanged, this, _2)); - if (gSavedSettings.getBOOL("EnableVoiceChat")) - { - mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); - } - else + if (!gSavedSettings.getBOOL("EnableVoiceChat") && LLAppViewer::instance()->isSecondInstance()) { + // Indicate that second instance started without sound mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); } @@ -655,12 +651,9 @@ void LLStatusBar::onVoiceChanged(const LLSD& newvalue) { if (newvalue.asBoolean()) { + // Second instance starts with "VoiceMute_Off" icon, fix it mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); } - else - { - mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); - } refresh(); } -- cgit v1.2.3