summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandaudio.cpp
diff options
context:
space:
mode:
authorsimon@lindenlab.com <simon@lindenlab.com>2011-06-20 09:28:10 -0700
committersimon@lindenlab.com <simon@lindenlab.com>2011-06-20 09:28:10 -0700
commitc0c0a2b9a5f41fc06619330a81c34955a39ddfe2 (patch)
treefd193e82ce7d2d679b4fe4d6652f9e2a64f50d32 /indra/newview/llpanellandaudio.cpp
parent9a02a4a1ea9634e96222cf79599d853dbef33268 (diff)
ER-944: Add feature to control user sounds on a parcel. Added new checkboxes
to the About Land / Sound tab. Reviewed by Kelly.
Diffstat (limited to 'indra/newview/llpanellandaudio.cpp')
-rw-r--r--indra/newview/llpanellandaudio.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp
index f9730d9b71..e7bdc51b4a 100644
--- a/indra/newview/llpanellandaudio.cpp
+++ b/indra/newview/llpanellandaudio.cpp
@@ -91,6 +91,12 @@ BOOL LLPanelLandAudio::postBuild()
mMusicURLEdit = getChild<LLLineEditor>("music_url");
childSetCommitCallback("music_url", onCommitAny, this);
+ mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check");
+ childSetCommitCallback("all av sound check", onCommitAny, this);
+
+ mCheckAVSoundGroup = getChild<LLCheckBoxCtrl>("group av sound check");
+ childSetCommitCallback("group av sound check", onCommitAny, this);
+
return TRUE;
}
@@ -144,6 +150,13 @@ void LLPanelLandAudio::refresh()
mMusicURLEdit->setText(parcel->getMusicURL());
mMusicURLEdit->setEnabled( can_change_media );
+
+ BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData();
+ mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds());
+ mCheckAVSoundAny->setEnabled(can_change_av_sounds);
+
+ mCheckAVSoundGroup->set(parcel->getAllowGroupAVSounds() || parcel->getAllowAnyAVSounds()); // On if "Everyone" is on
+ mCheckAVSoundGroup->setEnabled(can_change_av_sounds && !parcel->getAllowAnyAVSounds()); // Enabled if "Everyone" is off
}
}
// static
@@ -164,6 +177,13 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
BOOL voice_enabled = self->mCheckParcelEnableVoice->get();
BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get();
+ BOOL any_av_sound = self->mCheckAVSoundAny->get();
+ BOOL group_av_sound = TRUE; // If set to "Everyone" then group is checked as well
+ if (!any_av_sound)
+ { // If "Everyone" is off, use the value from the checkbox
+ group_av_sound = self->mCheckAVSoundGroup->get();
+ }
+
// Remove leading/trailing whitespace (common when copying/pasting)
LLStringUtil::trim(music_url);
@@ -172,6 +192,8 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local);
parcel->setMusicURL(music_url);
+ parcel->setAllowAnyAVSounds(any_av_sound);
+ parcel->setAllowGroupAVSounds(group_av_sound);
// Send current parcel data upstream to server
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );