summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index fc036cb354..e77c93b5f8 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<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::onCommitMusicEnabled()
+{
+ LLCheckBoxCtrl *music_enabled_ctrl = getChild<LLCheckBoxCtrl>("music_enabled");
+ bool enabled = music_enabled_ctrl->get();
+ gSavedSettings.setBOOL("AudioStreamingMusic", enabled);
}
void LLFloaterPreference::refresh()
@@ -1424,17 +1427,16 @@ 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<LLCheckBoxCtrl>("media_enabled");
- media_enabled_ctrl->set(enabled);
- media_enabled_ctrl->setTentative(!(video_enabled == music_enabled == media_enabled));
- getChild<LLCheckBoxCtrl>("autoplay_enabled")->setEnabled(enabled);
+ getChild<LLCheckBoxCtrl>("voice_call_friends_only_check")->setCommitCallback(boost::bind(&showFriendsOnlyWarning, _1, _2));
+ getChild<LLCheckBoxCtrl>("media_enabled")->set(media_enabled);
+ getChild<LLCheckBoxCtrl>("autoplay_enabled")->setEnabled(media_enabled);
+ }
+ if (hasChild("music_enabled"))
+ {
+ getChild<LLCheckBoxCtrl>("music_enabled")->set(gSavedSettings.getBOOL("AudioStreamingMusic"));
}
apply();
@@ -1485,6 +1487,14 @@ void LLPanelPreference::saveSettings()
}
}
+void LLPanelPreference::showFriendsOnlyWarning(LLUICtrl* checkbox, const LLSD& value)
+{
+ if (checkbox && checkbox->getValue())
+ {
+ LLNotificationsUtil::add("FriendsAndGroupsOnly");
+ }
+}
+
void LLPanelPreference::cancel()
{
for (control_values_map_t::iterator iter = mSavedValues.begin();