Skip to content
Snippets Groups Projects
Commit bf1219eb authored by Aimee Linden's avatar Aimee Linden
Browse files

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.
parent 5ca943cd
Branches
Tags
No related merge requests found
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
// viewer includes // viewer includes
#include "llmimetypes.h" #include "llmimetypes.h"
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
// library includes // library includes
...@@ -83,8 +84,14 @@ BOOL LLPanelLandAudio::postBuild() ...@@ -83,8 +84,14 @@ BOOL LLPanelLandAudio::postBuild()
mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local"); mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local");
childSetCommitCallback("check sound local", onCommitAny, this); childSetCommitCallback("check sound local", onCommitAny, this);
mRadioVoiceChat = getChild<LLRadioGroup>("parcel_voice_channel"); mCheckParcelEnableVoice = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel");
childSetCommitCallback("parcel_voice_channel", onCommitAny, this); 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"); mMusicURLEdit = getChild<LLLineEditor>("music_url");
childSetCommitCallback("music_url", onCommitAny, this); childSetCommitCallback("music_url", onCommitAny, this);
...@@ -118,19 +125,33 @@ void LLPanelLandAudio::refresh() ...@@ -118,19 +125,33 @@ void LLPanelLandAudio::refresh()
mMusicUrlCheck->set( parcel->getObscureMusic() ); mMusicUrlCheck->set( parcel->getObscureMusic() );
mMusicUrlCheck->setEnabled( can_change_media ); 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()) mCheckEstateDisabledVoice->setVisible(false);
mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate);
else mCheckParcelEnableVoice->setVisible(true);
mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate); mCheckParcelEnableVoice->setEnabled( can_change_media );
mCheckParcelEnableVoice->set(allow_voice);
mCheckParcelVoiceLocal->setEnabled( can_change_media && allow_voice );
} }
else 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->setText(parcel->getMusicURL());
mMusicURLEdit->setEnabled( can_change_media ); mMusicURLEdit->setEnabled( can_change_media );
...@@ -149,30 +170,11 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) ...@@ -149,30 +170,11 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
// Extract data from UI // Extract data from UI
BOOL sound_local = self->mCheckSoundLocal->get(); BOOL sound_local = self->mCheckSoundLocal->get();
int voice_setting = self->mRadioVoiceChat->getSelectedIndex();
std::string music_url = self->mMusicURLEdit->getText(); std::string music_url = self->mMusicURLEdit->getText();
U8 obscure_music = self->mMusicUrlCheck->get(); U8 obscure_music = self->mMusicUrlCheck->get();
BOOL voice_enabled = self->mCheckParcelEnableVoice->get();
BOOL voice_enabled; BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get();
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;
}
// Remove leading/trailing whitespace (common when copying/pasting) // Remove leading/trailing whitespace (common when copying/pasting)
LLStringUtil::trim(music_url); LLStringUtil::trim(music_url);
......
...@@ -52,7 +52,9 @@ class LLPanelLandAudio ...@@ -52,7 +52,9 @@ class LLPanelLandAudio
private: private:
LLCheckBoxCtrl* mCheckSoundLocal; LLCheckBoxCtrl* mCheckSoundLocal;
LLRadioGroup* mRadioVoiceChat; LLCheckBoxCtrl* mCheckParcelEnableVoice;
LLCheckBoxCtrl* mCheckEstateDisabledVoice;
LLCheckBoxCtrl* mCheckParcelVoiceLocal;
LLLineEditor* mMusicURLEdit; LLLineEditor* mMusicURLEdit;
LLCheckBoxCtrl* mMusicUrlCheck; LLCheckBoxCtrl* mMusicUrlCheck;
......
...@@ -1871,13 +1871,14 @@ Only large parcels can be listed in search. ...@@ -1871,13 +1871,14 @@ Only large parcels can be listed in search.
layout="topleft" layout="topleft"
left="110" left="110"
name="parcel_enable_voice_channel_is_estate_disabled" name="parcel_enable_voice_channel_is_estate_disabled"
top_delta="0"
width="300" /> width="300" />
<check_box <check_box
height="16" height="16"
label="Restrict Voice to this parcel" label="Restrict Voice to this parcel"
layout="topleft" layout="topleft"
left="110" left="110"
name="parcel_enable_voice_channel_parcel" name="parcel_enable_voice_channel_local"
width="300" /> width="300" />
</panel> </panel>
<panel <panel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment