summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvolumepulldown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelvolumepulldown.cpp')
-rw-r--r--indra/newview/llpanelvolumepulldown.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index 6f11e76a72..09038ac95a 100644
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -50,7 +50,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 +90,23 @@ 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<LLCheckBoxCtrl>("enable_music")->get();
- bool media_enabled = getChild<LLCheckBoxCtrl>("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<LLCheckBoxCtrl>("enable_music")->get();
+ bool media_enabled = getChild<LLCheckBoxCtrl>("enable_media")->get();
- getChild<LLCheckBoxCtrl>("media_auto_play_combo")->setEnabled(music_enabled || media_enabled);
- }
+ getChild<LLCheckBoxCtrl>("media_auto_play_combo")->setEnabled(music_enabled || media_enabled);
+ }
+ }
}
void LLPanelVolumePulldown::onClickSetSounds()