diff options
author | paul_productengine <none@none> | 2011-01-27 18:03:00 +0200 |
---|---|---|
committer | paul_productengine <none@none> | 2011-01-27 18:03:00 +0200 |
commit | c07c6cf8f4979a3374a09cec12e92df619ffd501 (patch) | |
tree | 3b0bd4d38e8e656c9ea06b517d355712ff5a590c /indra/newview/llfloaterpreference.cpp | |
parent | 3eba59e963d87f54e1b33b0a34de3fe37e67ebe1 (diff) |
STORM-513 FIXED "Allow media to auto - play" check-box is enable after Media check-box was unchecked
- Disabling "Allow Media to auto play" check box only when both "Streaming Music" and "Media" are unchecked
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 8c9dfe435a..724096b443 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1539,6 +1539,7 @@ LLPanelPreference::LLPanelPreference() : LLPanel() { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); + mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); } //virtual @@ -1700,6 +1701,21 @@ void LLPanelPreference::setControlFalse(const LLSD& user_data) control->set(LLSD(FALSE)); } +void LLPanelPreference::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); + } +} + static LLRegisterPanelClassWrapper<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics"); BOOL LLPanelPreferenceGraphics::postBuild() |