summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandaudio.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-01-21 15:32:43 +0000
committerAimee Linden <aimee@lindenlab.com>2010-01-21 15:32:43 +0000
commitbf1219eb59a9dbaebd3e2052963ded76bfcb0b21 (patch)
tree863a4c03c8d6a2d0a8eb390481cb1d9df706a397 /indra/newview/llpanellandaudio.cpp
parent5ca943cd0279d35ffdf584fa0de3b795645f276c (diff)
Fix for bug EXT-4421 (Parcel Voice settings not respected)
Turns out the UI controls weren't hooked up to anything and so not showing that the parcel was actually voice enabled. Fixed by restoring the same functionality for these controls as in previous viewers, i.e. they now reflect the state of the current parcel, but are disabled when voice is disabled on the region. Reviewed by Lynx.
Diffstat (limited to 'indra/newview/llpanellandaudio.cpp')
-rw-r--r--indra/newview/llpanellandaudio.cpp62
1 files changed, 32 insertions, 30 deletions
diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp
index 920fca66f2..6a4c909759 100644
--- a/indra/newview/llpanellandaudio.cpp
+++ b/indra/newview/llpanellandaudio.cpp
@@ -37,6 +37,7 @@
// viewer includes
#include "llmimetypes.h"
#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
#include "lluictrlfactory.h"
// library includes
@@ -83,8 +84,14 @@ BOOL LLPanelLandAudio::postBuild()
mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local");
childSetCommitCallback("check sound local", onCommitAny, this);
- mRadioVoiceChat = getChild<LLRadioGroup>("parcel_voice_channel");
- childSetCommitCallback("parcel_voice_channel", onCommitAny, this);
+ mCheckParcelEnableVoice = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel");
+ childSetCommitCallback("parcel_enable_voice_channel", onCommitAny, this);
+
+ // This one is always disabled so no need for a commit callback
+ mCheckEstateDisabledVoice = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_is_estate_disabled");
+
+ mCheckParcelVoiceLocal = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_local");
+ childSetCommitCallback("parcel_enable_voice_channel_local", onCommitAny, this);
mMusicURLEdit = getChild<LLLineEditor>("music_url");
childSetCommitCallback("music_url", onCommitAny, this);
@@ -118,19 +125,33 @@ void LLPanelLandAudio::refresh()
mMusicUrlCheck->set( parcel->getObscureMusic() );
mMusicUrlCheck->setEnabled( can_change_media );
- if(parcel->getParcelFlagAllowVoice())
+ bool allow_voice = parcel->getParcelFlagAllowVoice();
+
+ LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
+ if (region && region->isVoiceEnabled())
{
- if(parcel->getParcelFlagUseEstateVoiceChannel())
- mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate);
- else
- mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate);
+ mCheckEstateDisabledVoice->setVisible(false);
+
+ mCheckParcelEnableVoice->setVisible(true);
+ mCheckParcelEnableVoice->setEnabled( can_change_media );
+ mCheckParcelEnableVoice->set(allow_voice);
+
+ mCheckParcelVoiceLocal->setEnabled( can_change_media && allow_voice );
}
else
{
- mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable);
+ // Voice disabled at estate level, overrides parcel settings
+ // Replace the parcel voice checkbox with a disabled one
+ // labelled with an explanatory message
+ mCheckEstateDisabledVoice->setVisible(true);
+
+ mCheckParcelEnableVoice->setVisible(false);
+ mCheckParcelEnableVoice->setEnabled(false);
+ mCheckParcelVoiceLocal->setEnabled(false);
}
- mRadioVoiceChat->setEnabled( can_change_media );
+ mCheckParcelEnableVoice->set(allow_voice);
+ mCheckParcelVoiceLocal->set(!parcel->getParcelFlagUseEstateVoiceChannel());
mMusicURLEdit->setText(parcel->getMusicURL());
mMusicURLEdit->setEnabled( can_change_media );
@@ -149,30 +170,11 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
// Extract data from UI
BOOL sound_local = self->mCheckSoundLocal->get();
- int voice_setting = self->mRadioVoiceChat->getSelectedIndex();
std::string music_url = self->mMusicURLEdit->getText();
U8 obscure_music = self->mMusicUrlCheck->get();
-
- BOOL voice_enabled;
- BOOL voice_estate_chan;
-
- switch(voice_setting)
- {
- default:
- case kRadioVoiceChatEstate:
- voice_enabled = TRUE;
- voice_estate_chan = TRUE;
- break;
- case kRadioVoiceChatPrivate:
- voice_enabled = TRUE;
- voice_estate_chan = FALSE;
- break;
- case kRadioVoiceChatDisable:
- voice_enabled = FALSE;
- voice_estate_chan = FALSE;
- break;
- }
+ BOOL voice_enabled = self->mCheckParcelEnableVoice->get();
+ BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get();
// Remove leading/trailing whitespace (common when copying/pasting)
LLStringUtil::trim(music_url);