From a26573fefe2a3599c1c920722dec519c9481dc64 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 3 Aug 2023 20:40:40 +0300 Subject: SL-18049 Part 1; Allow voice to be enabled in second instance --- indra/newview/llpanelvolumepulldown.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'indra/newview/llpanelvolumepulldown.cpp') diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp index 6f11e76a72..17975a6e6d 100644 --- a/indra/newview/llpanelvolumepulldown.cpp +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -40,6 +40,7 @@ #include "llfloaterreg.h" #include "llfloaterpreference.h" #include "llsliderctrl.h" +#include "llvoicevivox.h" ///---------------------------------------------------------------------------- /// Class LLPanelVolumePulldown @@ -50,7 +51,7 @@ LLPanelVolumePulldown::LLPanelVolumePulldown() { mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2)); mCommitCallbackRegistrar.add("Vol.SetSounds", boost::bind(&LLPanelVolumePulldown::onClickSetSounds, this)); - mCommitCallbackRegistrar.add("Vol.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelVolumePulldown::updateMediaAutoPlayCheckbox, this, _1)); + mCommitCallbackRegistrar.add("Vol.updateCheckbox", boost::bind(&LLPanelVolumePulldown::updateCheckbox, this, _1, _2)); mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2)); buildFromFile( "panel_volume_pulldown.xml"); } @@ -90,19 +91,27 @@ void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data) control->set(LLSD(FALSE)); } -void LLPanelVolumePulldown::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) +void LLPanelVolumePulldown::updateCheckbox(LLUICtrl* ctrl, const LLSD& user_data) { - std::string name = ctrl->getName(); + std::string control_name = user_data.asString(); + if (control_name == "MediaAutoPlay") + { + std::string name = ctrl->getName(); - // Disable "Allow Media to auto play" only when both - // "Streaming Music" and "Media" are unchecked. STORM-513. - if ((name == "enable_music") || (name == "enable_media")) - { - bool music_enabled = getChild("enable_music")->get(); - bool media_enabled = getChild("enable_media")->get(); + // Disable "Allow Media to auto play" only when both + // "Streaming Music" and "Media" are unchecked. STORM-513. + if ((name == "enable_music") || (name == "enable_media")) + { + bool music_enabled = getChild("enable_music")->get(); + bool media_enabled = getChild("enable_media")->get(); - getChild("media_auto_play_combo")->setEnabled(music_enabled || media_enabled); - } + getChild("media_auto_play_combo")->setEnabled(music_enabled || media_enabled); + } + } + else if (control_name == "VoiceChat") + { + LLVivoxVoiceClient::unmuteVoiceInstance(); + } } void LLPanelVolumePulldown::onClickSetSounds() -- 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/llpanelvolumepulldown.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llpanelvolumepulldown.cpp') diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp index 17975a6e6d..09038ac95a 100644 --- a/indra/newview/llpanelvolumepulldown.cpp +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -40,7 +40,6 @@ #include "llfloaterreg.h" #include "llfloaterpreference.h" #include "llsliderctrl.h" -#include "llvoicevivox.h" ///---------------------------------------------------------------------------- /// Class LLPanelVolumePulldown @@ -108,10 +107,6 @@ void LLPanelVolumePulldown::updateCheckbox(LLUICtrl* ctrl, const LLSD& user_data getChild("media_auto_play_combo")->setEnabled(music_enabled || media_enabled); } } - else if (control_name == "VoiceChat") - { - LLVivoxVoiceClient::unmuteVoiceInstance(); - } } void LLPanelVolumePulldown::onClickSetSounds() -- cgit v1.2.3