aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanellandmedia.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llpanellandmedia.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llpanellandmedia.cpp')
-rw-r--r--linden/indra/newview/llpanellandmedia.cpp109
1 files changed, 68 insertions, 41 deletions
diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp
index d6787f8..b8886c9 100644
--- a/linden/indra/newview/llpanellandmedia.cpp
+++ b/linden/indra/newview/llpanellandmedia.cpp
@@ -18,7 +18,8 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
@@ -37,6 +38,7 @@
37// viewer includes 38// viewer includes
38#include "llmimetypes.h" 39#include "llmimetypes.h"
39#include "llviewerparcelmgr.h" 40#include "llviewerparcelmgr.h"
41#include "llviewerregion.h"
40#include "lluictrlfactory.h" 42#include "lluictrlfactory.h"
41 43
42// library includes 44// library includes
@@ -53,20 +55,32 @@
53#include "lltexturectrl.h" 55#include "lltexturectrl.h"
54#include "roles_constants.h" 56#include "roles_constants.h"
55 57
56// Values for the parcel voice settings radio group
57enum
58{
59 kRadioVoiceChatEstate = 0,
60 kRadioVoiceChatPrivate = 1,
61 kRadioVoiceChatDisable = 2
62};
63
64//--------------------------------------------------------------------------- 58//---------------------------------------------------------------------------
65// LLPanelLandMedia 59// LLPanelLandMedia
66//--------------------------------------------------------------------------- 60//---------------------------------------------------------------------------
67 61
68LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) 62LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel)
69: LLPanel(std::string("land_media_panel")), mParcel(parcel) 63: LLPanel(std::string("land_media_panel")),
64
65 mParcel(parcel),
66 mCheckSoundLocal(NULL),
67 mSoundHelpButton(NULL),
68 mCheckEnableVoiceChat(NULL),
69 mCheckEnableVoiceChatIsEstateDisabled(NULL),
70 mCheckEnableVoiceChatParcel(NULL),
71 mMusicURLEdit(NULL),
72 mMediaURLEdit(NULL),
73 mMediaDescEdit(NULL),
74 mMediaTypeCombo(NULL),
75 mSetURLButton(NULL),
76 mMediaHeightCtrl(NULL),
77 mMediaWidthCtrl(NULL),
78 mMediaSizeCtrlLabel(NULL),
79 mMediaTextureCtrl(NULL),
80 mMediaAutoScaleCheck(NULL),
81 mMediaLoopCheck(NULL),
82 mMediaUrlCheck(NULL),
83 mMusicUrlCheck(NULL)
70{ 84{
71} 85}
72 86
@@ -78,13 +92,27 @@ LLPanelLandMedia::~LLPanelLandMedia()
78} 92}
79 93
80 94
95// static
96void LLPanelLandMedia::onClickSoundHelp(void*)
97{
98 LLNotifications::instance().add("ClickSoundHelpLand");
99}
100
101
81BOOL LLPanelLandMedia::postBuild() 102BOOL LLPanelLandMedia::postBuild()
82{ 103{
83 mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local"); 104 mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local");
84 childSetCommitCallback("check sound local", onCommitAny, this); 105 childSetCommitCallback("check sound local", onCommitAny, this);
85 106
86 mRadioVoiceChat = getChild<LLRadioGroup>("parcel_voice_channel"); 107 mSoundHelpButton = getChild<LLButton>("?");
87 childSetCommitCallback("parcel_voice_channel", onCommitAny, this); 108 mSoundHelpButton->setClickedCallback(onClickSoundHelp, this);
109
110 mCheckEnableVoiceChat = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel");
111 childSetCommitCallback("parcel_enable_voice_channel", onCommitAny, this);
112 mCheckEnableVoiceChatIsEstateDisabled = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_is_estate_disabled");
113 childSetCommitCallback("parcel_enable_voice_channel_is_estate_disabled", onCommitAny, this);
114 mCheckEnableVoiceChatParcel = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_parcel");
115 childSetCommitCallback("parcel_enable_voice_channel_parcel", onCommitAny, this);
88 116
89 mMusicURLEdit = getChild<LLLineEditor>("music_url"); 117 mMusicURLEdit = getChild<LLLineEditor>("music_url");
90 childSetCommitCallback("music_url", onCommitAny, this); 118 childSetCommitCallback("music_url", onCommitAny, this);
@@ -150,19 +178,36 @@ void LLPanelLandMedia::refresh()
150 mCheckSoundLocal->set( parcel->getSoundLocal() ); 178 mCheckSoundLocal->set( parcel->getSoundLocal() );
151 mCheckSoundLocal->setEnabled( can_change_media ); 179 mCheckSoundLocal->setEnabled( can_change_media );
152 180
153 if(parcel->getParcelFlagAllowVoice()) 181 LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
182 if (!region)
154 { 183 {
155 if(parcel->getParcelFlagUseEstateVoiceChannel()) 184 // never seen this happen, but log it
156 mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate); 185 llwarns << "Couldn't get selected region." << llendl;
157 else
158 mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate);
159 } 186 }
160 else 187
188 if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all
161 { 189 {
162 mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable); 190 bool allow_voice = parcel->getParcelFlagAllowVoice();
191
192 mCheckEnableVoiceChatIsEstateDisabled->setVisible(false);
193
194 mCheckEnableVoiceChat->setVisible(true);
195 mCheckEnableVoiceChat->setEnabled( can_change_media );
196 mCheckEnableVoiceChat->set(allow_voice);
197
198 mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice );
199 }
200 else // disabled at region level
201 {
202 mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled
203 mCheckEnableVoiceChat->setVisible(false);
204 mCheckEnableVoiceChat->setEnabled(false);
205 mCheckEnableVoiceChat->set(false);
206
207 mCheckEnableVoiceChatParcel->setEnabled(false);
163 } 208 }
164 209
165 mRadioVoiceChat->setEnabled( can_change_media ); 210 mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel());
166 211
167 mMusicURLEdit->setText(parcel->getMusicURL()); 212 mMusicURLEdit->setText(parcel->getMusicURL());
168 mMusicURLEdit->setEnabled( can_change_media ); 213 mMusicURLEdit->setEnabled( can_change_media );
@@ -338,7 +383,6 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata)
338 383
339 // Extract data from UI 384 // Extract data from UI
340 BOOL sound_local = self->mCheckSoundLocal->get(); 385 BOOL sound_local = self->mCheckSoundLocal->get();
341 int voice_setting = self->mRadioVoiceChat->getSelectedIndex();
342 std::string music_url = self->mMusicURLEdit->getText(); 386 std::string music_url = self->mMusicURLEdit->getText();
343 std::string media_url = self->mMediaURLEdit->getText(); 387 std::string media_url = self->mMediaURLEdit->getText();
344 std::string media_desc = self->mMediaDescEdit->getText(); 388 std::string media_desc = self->mMediaDescEdit->getText();
@@ -351,27 +395,10 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata)
351 S32 media_height = (S32)self->mMediaHeightCtrl->get(); 395 S32 media_height = (S32)self->mMediaHeightCtrl->get();
352 LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); 396 LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID();
353 397
354 self->childSetText("mime_type", mime_type); 398 BOOL voice_enabled = self->mCheckEnableVoiceChat->get();
355 399 BOOL voice_estate_chan = ! self->mCheckEnableVoiceChatParcel->get();
356 BOOL voice_enabled;
357 BOOL voice_estate_chan;
358 400
359 switch(voice_setting) 401 self->childSetText("mime_type", mime_type);
360 {
361 default:
362 case kRadioVoiceChatEstate:
363 voice_enabled = TRUE;
364 voice_estate_chan = TRUE;
365 break;
366 case kRadioVoiceChatPrivate:
367 voice_enabled = TRUE;
368 voice_estate_chan = FALSE;
369 break;
370 case kRadioVoiceChatDisable:
371 voice_enabled = FALSE;
372 voice_estate_chan = FALSE;
373 break;
374 }
375 402
376 // Remove leading/trailing whitespace (common when copying/pasting) 403 // Remove leading/trailing whitespace (common when copying/pasting)
377 LLStringUtil::trim(music_url); 404 LLStringUtil::trim(music_url);