summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvolumepulldown.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-06-21 15:49:53 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-06-21 15:49:53 +0100
commit9d7b353cbb5c12cd74559a8f3a7365312f95d4d0 (patch)
treeb35c3e3eb0c9c93cea2c01248a3943d5c1277fa7 /indra/newview/llpanelvolumepulldown.cpp
parent8abfd8da4fb222382437f4b547567fabc6f75cf8 (diff)
parentdc07de2f4a4c49d1877bf743b6f0d209392f6eb6 (diff)
merge
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()
{