summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvolumepulldown.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2018-06-21 15:31:21 -0400
committerOz Linden <oz@lindenlab.com>2018-06-21 15:31:21 -0400
commit3cdce9bf24ebac1c48b30955910a8f6b36797cb5 (patch)
tree5f731c4237dfe544e475c7d5f119aa2c6e8edcb8 /indra/newview/llpanelvolumepulldown.cpp
parentc0e00cc61750d2b1bba3ada6622023df4725b1a4 (diff)
parentdc07de2f4a4c49d1877bf743b6f0d209392f6eb6 (diff)
merge changes for 5.1.6-release
Diffstat (limited to 'indra/newview/llpanelvolumepulldown.cpp')
-rw-r--r--indra/newview/llpanelvolumepulldown.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index 6595da235c..6792137350 100644
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -35,6 +35,7 @@
// Linden libs
#include "llbutton.h"
+#include "llcheckboxctrl.h"
#include "lltabcontainer.h"
#include "llfloaterreg.h"
#include "llfloaterpreference.h"
@@ -52,17 +53,15 @@ LLPanelVolumePulldown::LLPanelVolumePulldown()
{
mHoverTimer.stop();
- mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
+ 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.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2));
buildFromFile( "panel_volume_pulldown.xml");
}
BOOL LLPanelVolumePulldown::postBuild()
{
- // set the initial volume-slider's position to reflect reality
- LLSliderCtrl* volslider = getChild<LLSliderCtrl>( "mastervolume" );
- volslider->setValue(gSavedSettings.getF32("AudioLevelMaster"));
-
return LLPanel::postBuild();
}
@@ -130,6 +129,28 @@ void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data)
control->set(LLSD(FALSE));
}
+void LLPanelVolumePulldown::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl)
+{
+ 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<LLCheckBoxCtrl>("enable_music")->get();
+ bool media_enabled = getChild<LLCheckBoxCtrl>("enable_media")->get();
+
+ getChild<LLCheckBoxCtrl>("media_auto_play_btn")->setEnabled(music_enabled || media_enabled);
+ }
+}
+
+void LLPanelVolumePulldown::onClickSetSounds()
+{
+ // Disable Enable gesture sounds checkbox if the master sound is disabled
+ // or if sound effects are disabled.
+ getChild<LLCheckBoxCtrl>("gesture_audio_play_btn")->setEnabled(!gSavedSettings.getBOOL("MuteSounds"));
+}
+
//virtual
void LLPanelVolumePulldown::draw()
{