From c1b985201f90652d3e8d2910efb90376a8bf3bff Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 27 May 2010 04:57:07 -0700 Subject: Workaround for not being able to set parcel voice settings on OpenSim --- linden/indra/newview/llpanellandmedia.cpp | 42 +++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp index b8886c9..bebd69e 100644 --- a/linden/indra/newview/llpanellandmedia.cpp +++ b/linden/indra/newview/llpanellandmedia.cpp @@ -55,6 +55,8 @@ #include "lltexturectrl.h" #include "roles_constants.h" +#include "hippoGridManager.h" + //--------------------------------------------------------------------------- // LLPanelLandMedia //--------------------------------------------------------------------------- @@ -185,11 +187,34 @@ void LLPanelLandMedia::refresh() llwarns << "Couldn't get selected region." << llendl; } - if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all + // We need to do this differently for OpenSim because it doesn't include + // REGION_FLAGS_ALLOW_VOICE in the "RegionInfo" message as of 0.6.9 PF -- MC + bool allow_voice = parcel->getParcelFlagAllowVoice(); + if (gHippoGridManager->getConnectedGrid()->isSecondLife()) { - bool allow_voice = parcel->getParcelFlagAllowVoice(); - - mCheckEnableVoiceChatIsEstateDisabled->setVisible(false); + if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all + { + mCheckEnableVoiceChatIsEstateDisabled->setVisible(false); + + mCheckEnableVoiceChat->setVisible(true); + mCheckEnableVoiceChat->setEnabled( can_change_media ); + mCheckEnableVoiceChat->set(allow_voice); + + mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); + } + else // disabled at region level + { + mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled + mCheckEnableVoiceChat->setVisible(false); + mCheckEnableVoiceChat->setEnabled(false); + mCheckEnableVoiceChat->set(false); + + mCheckEnableVoiceChatParcel->setEnabled(false); + } + } + else + { + mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); mCheckEnableVoiceChat->setVisible(true); mCheckEnableVoiceChat->setEnabled( can_change_media ); @@ -197,15 +222,6 @@ void LLPanelLandMedia::refresh() mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); } - else // disabled at region level - { - mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled - mCheckEnableVoiceChat->setVisible(false); - mCheckEnableVoiceChat->setEnabled(false); - mCheckEnableVoiceChat->set(false); - - mCheckEnableVoiceChatParcel->setEnabled(false); - } mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel()); -- cgit v1.1