From af83fe79d8d074d3056e6dff86dcf14d8e71c885 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 25 Jan 2010 10:04:56 -0800 Subject: "Fix" confusion over media settings Review #89 This implements the changes Sam wanted in order to reduce the confusion over media enabled-ness, in particular: - "Media Enabled" pref now only controls "AudioStreamingMedia" - No more "tentative" state - New "Music Enabled" pref - First run dialog controls Media and Music (Sam, this is a change from your request...I think it works better) - Put a reflection of the "Media Enabled" checkbox in the Nearby Media Floater - Get rid of the "AudioStreamingVideo" setting altogether (whatever used it, it should now obey "AudioStreamingMedia"). --- indra/newview/app_settings/settings.xml | 11 -------- indra/newview/llfloaterpreference.cpp | 29 +++++++++++----------- indra/newview/llfloaterpreference.h | 1 + indra/newview/llviewermedia.cpp | 2 -- indra/newview/llviewerparcelmedia.cpp | 2 +- indra/newview/llviewertexture.cpp | 1 - .../default/xui/en/panel_preferences_privacy.xml | 20 ++++++++++++--- .../default/xui/en/panel_preferences_setup.xml | 2 +- 8 files changed, 34 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c29a3a0035..e607c3ad15 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -298,17 +298,6 @@ Value 1 - AudioStreamingVideo - - Comment - Enable streaming video - Persist - 1 - Type - Boolean - Value - 1 - AuditTexture Comment diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index fc036cb354..eeda3f133c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -327,6 +327,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) 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.MusicEnabled", boost::bind(&LLFloaterPreference::onCommitMusicEnabled, 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)); @@ -1001,12 +1002,14 @@ void LLFloaterPreference::onCommitMediaEnabled() { LLCheckBoxCtrl *media_enabled_ctrl = getChild("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("autoplay_enabled")->setEnabled(enabled); +} + +void LLFloaterPreference::onCommitMusicEnabled() +{ + LLCheckBoxCtrl *music_enabled_ctrl = getChild("music_enabled"); + bool enabled = music_enabled_ctrl->get(); + gSavedSettings.setBOOL("AudioStreamingMusic", enabled); } void LLFloaterPreference::refresh() @@ -1424,17 +1427,15 @@ BOOL LLPanelPreference::postBuild() } //////////////////////PanelPrivacy /////////////////// - if(hasChild("media_enabled")) + 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("media_enabled"); - media_enabled_ctrl->set(enabled); - media_enabled_ctrl->setTentative(!(video_enabled == music_enabled == media_enabled)); - getChild("autoplay_enabled")->setEnabled(enabled); + getChild("media_enabled")->set(media_enabled); + getChild("autoplay_enabled")->setEnabled(media_enabled); + } + if (hasChild("music_enabled")) + { + getChild("music_enabled")->set(gSavedSettings.getBOOL("AudioStreamingMusic")); } apply(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 6f382620ee..4ec2d277a8 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -134,6 +134,7 @@ public: void onCommitAutoDetectAspect(); void onCommitParcelMediaAutoPlayEnable(); void onCommitMediaEnabled(); + void onCommitMusicEnabled(); void applyResolution(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d712446d83..98d8780b34 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -940,7 +940,6 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo { // user has elected to automatically play media. gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); @@ -961,7 +960,6 @@ bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& respo { gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); } return false; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index e87dbe5c07..c4fc2e5cab 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -179,7 +179,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel) if (!parcel) return; - if (!gSavedSettings.getBOOL("AudioStreamingMedia") || !gSavedSettings.getBOOL("AudioStreamingVideo")) + if (!gSavedSettings.getBOOL("AudioStreamingMedia")) return; std::string media_url = parcel->getMediaURL(); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3f42cba561..b80dc7d902 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2777,7 +2777,6 @@ void LLViewerMediaTexture::updateClass() #if 0 //force to play media. gSavedSettings.setBOOL("AudioStreamingMedia", true) ; - gSavedSettings.setBOOL("AudioStreamingVideo", true) ; #endif for(media_map_t::iterator iter = sMediaMap.begin() ; iter != sMediaMap.end(); ) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index a8e24366f2..0aaeb6114e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -78,19 +78,19 @@ top_pad="10" width="350" /> - + + +