summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2010-01-15 12:05:24 -0800
committerRick Pasetto <rick@lindenlab.com>2010-01-15 12:05:24 -0800
commit3a707a1a69c44ccdbb819664d404ccc8d9716c28 (patch)
tree6e7315a2611b36ffe193d3dc5a69298f9d920d2f /indra/newview/llfloaterpreference.cpp
parent0e62cc934caf205d416ab5cd633522958a96e056 (diff)
parent315c381d804ccad4039e193ebd0cdc1b8d2ddec1 (diff)
Automated merge with ssh://rick@hg.lindenlab.com/viewer/viewer-2-0/
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 87ee7b8498..fc036cb354 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -326,6 +326,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::onUpdateSliderText,this, _1,_2));
mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this));
mCommitCallbackRegistrar.add("Pref.ParcelMediaAutoPlayEnable", boost::bind(&LLFloaterPreference::onCommitParcelMediaAutoPlayEnable, this));
+ mCommitCallbackRegistrar.add("Pref.MediaEnabled", boost::bind(&LLFloaterPreference::onCommitMediaEnabled, this));
mCommitCallbackRegistrar.add("Pref.onSelectAspectRatio", boost::bind(&LLFloaterPreference::onKeystrokeAspectRatio, this));
mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2));
mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2));
@@ -994,16 +995,18 @@ void LLFloaterPreference::onCommitParcelMediaAutoPlayEnable()
gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, autoplay);
lldebugs << "autoplay now = " << int(autoplay) << llendl;
+}
- if (autoplay)
- {
- // autoplay toggle has gone from FALSE to TRUE; ensure that
- // the media system is thus actually turned on too.
- gSavedSettings.setBOOL("AudioStreamingVideo", TRUE);
- gSavedSettings.setBOOL("AudioStreamingMusic", TRUE);
- gSavedSettings.setBOOL("AudioStreamingMedia", TRUE);
- llinfos << "autoplay turned on, turned all media subsystems on" << llendl;
- }
+void LLFloaterPreference::onCommitMediaEnabled()
+{
+ LLCheckBoxCtrl *media_enabled_ctrl = getChild<LLCheckBoxCtrl>("media_enabled");
+ bool enabled = media_enabled_ctrl->get();
+ gSavedSettings.setBOOL("AudioStreamingVideo", enabled);
+ gSavedSettings.setBOOL("AudioStreamingMusic", enabled);
+ gSavedSettings.setBOOL("AudioStreamingMedia", enabled);
+ media_enabled_ctrl->setTentative(false);
+ // Update enabled state of the "autoplay" checkbox
+ getChild<LLCheckBoxCtrl>("autoplay_enabled")->setEnabled(enabled);
}
void LLFloaterPreference::refresh()
@@ -1420,6 +1423,20 @@ BOOL LLPanelPreference::postBuild()
refresh();
}
+ //////////////////////PanelPrivacy ///////////////////
+ if(hasChild("media_enabled"))
+ {
+ bool video_enabled = gSavedSettings.getBOOL("AudioStreamingVideo");
+ bool music_enabled = gSavedSettings.getBOOL("AudioStreamingMusic");
+ bool media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia");
+ bool enabled = video_enabled || music_enabled || media_enabled;
+
+ LLCheckBoxCtrl *media_enabled_ctrl = getChild<LLCheckBoxCtrl>("media_enabled");
+ media_enabled_ctrl->set(enabled);
+ media_enabled_ctrl->setTentative(!(video_enabled == music_enabled == media_enabled));
+ getChild<LLCheckBoxCtrl>("autoplay_enabled")->setEnabled(enabled);
+ }
+
apply();
return true;
}