diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanellandmedia.cpp | 292 |
1 files changed, 197 insertions, 95 deletions
diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp index bebd69e..a8e7c4a 100644 --- a/linden/indra/newview/llpanellandmedia.cpp +++ b/linden/indra/newview/llpanellandmedia.cpp | |||
@@ -39,6 +39,8 @@ | |||
39 | #include "llmimetypes.h" | 39 | #include "llmimetypes.h" |
40 | #include "llviewerparcelmgr.h" | 40 | #include "llviewerparcelmgr.h" |
41 | #include "llviewerregion.h" | 41 | #include "llviewerregion.h" |
42 | #include "llviewermedia.h" | ||
43 | #include "llviewerparcelmedia.h" | ||
42 | #include "lluictrlfactory.h" | 44 | #include "lluictrlfactory.h" |
43 | 45 | ||
44 | // library includes | 46 | // library includes |
@@ -54,6 +56,7 @@ | |||
54 | #include "llsdutil.h" | 56 | #include "llsdutil.h" |
55 | #include "lltexturectrl.h" | 57 | #include "lltexturectrl.h" |
56 | #include "roles_constants.h" | 58 | #include "roles_constants.h" |
59 | #include "llscrolllistctrl.h" | ||
57 | 60 | ||
58 | #include "hippoGridManager.h" | 61 | #include "hippoGridManager.h" |
59 | 62 | ||
@@ -62,15 +65,8 @@ | |||
62 | //--------------------------------------------------------------------------- | 65 | //--------------------------------------------------------------------------- |
63 | 66 | ||
64 | LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) | 67 | LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) |
65 | : LLPanel(std::string("land_media_panel")), | 68 | : LLPanel(), |
66 | |||
67 | mParcel(parcel), | 69 | mParcel(parcel), |
68 | mCheckSoundLocal(NULL), | ||
69 | mSoundHelpButton(NULL), | ||
70 | mCheckEnableVoiceChat(NULL), | ||
71 | mCheckEnableVoiceChatIsEstateDisabled(NULL), | ||
72 | mCheckEnableVoiceChatParcel(NULL), | ||
73 | mMusicURLEdit(NULL), | ||
74 | mMediaURLEdit(NULL), | 70 | mMediaURLEdit(NULL), |
75 | mMediaDescEdit(NULL), | 71 | mMediaDescEdit(NULL), |
76 | mMediaTypeCombo(NULL), | 72 | mMediaTypeCombo(NULL), |
@@ -81,8 +77,7 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) | |||
81 | mMediaTextureCtrl(NULL), | 77 | mMediaTextureCtrl(NULL), |
82 | mMediaAutoScaleCheck(NULL), | 78 | mMediaAutoScaleCheck(NULL), |
83 | mMediaLoopCheck(NULL), | 79 | mMediaLoopCheck(NULL), |
84 | mMediaUrlCheck(NULL), | 80 | mMediaUrlCheck(NULL) |
85 | mMusicUrlCheck(NULL) | ||
86 | { | 81 | { |
87 | } | 82 | } |
88 | 83 | ||
@@ -90,34 +85,10 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) | |||
90 | // virtual | 85 | // virtual |
91 | LLPanelLandMedia::~LLPanelLandMedia() | 86 | LLPanelLandMedia::~LLPanelLandMedia() |
92 | { | 87 | { |
93 | // close LLFloaterURLEntry? | ||
94 | } | ||
95 | |||
96 | |||
97 | // static | ||
98 | void LLPanelLandMedia::onClickSoundHelp(void*) | ||
99 | { | ||
100 | LLNotifications::instance().add("ClickSoundHelpLand"); | ||
101 | } | 88 | } |
102 | 89 | ||
103 | |||
104 | BOOL LLPanelLandMedia::postBuild() | 90 | BOOL LLPanelLandMedia::postBuild() |
105 | { | 91 | { |
106 | mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local"); | ||
107 | childSetCommitCallback("check sound local", onCommitAny, this); | ||
108 | |||
109 | mSoundHelpButton = getChild<LLButton>("?"); | ||
110 | mSoundHelpButton->setClickedCallback(onClickSoundHelp, this); | ||
111 | |||
112 | mCheckEnableVoiceChat = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel"); | ||
113 | childSetCommitCallback("parcel_enable_voice_channel", onCommitAny, this); | ||
114 | mCheckEnableVoiceChatIsEstateDisabled = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_is_estate_disabled"); | ||
115 | childSetCommitCallback("parcel_enable_voice_channel_is_estate_disabled", onCommitAny, this); | ||
116 | mCheckEnableVoiceChatParcel = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_parcel"); | ||
117 | childSetCommitCallback("parcel_enable_voice_channel_parcel", onCommitAny, this); | ||
118 | |||
119 | mMusicURLEdit = getChild<LLLineEditor>("music_url"); | ||
120 | childSetCommitCallback("music_url", onCommitAny, this); | ||
121 | 92 | ||
122 | mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); | 93 | mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); |
123 | mMediaTextureCtrl->setCommitCallback( onCommitAny ); | 94 | mMediaTextureCtrl->setCommitCallback( onCommitAny ); |
@@ -130,16 +101,13 @@ BOOL LLPanelLandMedia::postBuild() | |||
130 | childSetCommitCallback("media_auto_scale", onCommitAny, this); | 101 | childSetCommitCallback("media_auto_scale", onCommitAny, this); |
131 | 102 | ||
132 | mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); | 103 | mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); |
133 | childSetCommitCallback("media_loop", onCommitAny, this); | 104 | childSetCommitCallback("media_loop", onCommitAny, this ); |
134 | 105 | ||
135 | mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url"); | 106 | mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url"); |
136 | childSetCommitCallback("hide_media_url", onCommitAny, this); | 107 | childSetCommitCallback("hide_media_url", onCommitAny, this ); |
137 | |||
138 | mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url"); | ||
139 | childSetCommitCallback("hide_music_url", onCommitAny, this); | ||
140 | 108 | ||
141 | mMediaURLEdit = getChild<LLLineEditor>("media_url"); | 109 | mMediaURLEdit = getChild<LLLineEditor>("media_url"); |
142 | childSetCommitCallback("media_url", onCommitAny, this); | 110 | childSetCommitCallback("media_url", onCommitAny, this ); |
143 | 111 | ||
144 | mMediaDescEdit = getChild<LLLineEditor>("url_description"); | 112 | mMediaDescEdit = getChild<LLLineEditor>("url_description"); |
145 | childSetCommitCallback("url_description", onCommitAny, this); | 113 | childSetCommitCallback("url_description", onCommitAny, this); |
@@ -148,15 +116,41 @@ BOOL LLPanelLandMedia::postBuild() | |||
148 | childSetCommitCallback("media type", onCommitType, this); | 116 | childSetCommitCallback("media type", onCommitType, this); |
149 | populateMIMECombo(); | 117 | populateMIMECombo(); |
150 | 118 | ||
119 | mMediaResetCtrl = getChild<LLSpinCtrl>("media_reset_time"); | ||
120 | childSetCommitCallback("media_reset_time", onCommitAny, this); | ||
121 | mMediaResetCtrlLabel = getChild<LLTextBox>("media_reset"); | ||
122 | |||
151 | mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); | 123 | mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); |
152 | childSetCommitCallback("media_size_width", onCommitAny, this); | 124 | childSetCommitCallback("media_size_width", onCommitAny, this); |
153 | mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); | 125 | mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); |
154 | childSetCommitCallback("media_size_height", onCommitAny, this); | 126 | childSetCommitCallback("media_size_height", onCommitAny, this); |
155 | mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); | 127 | mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); |
156 | 128 | ||
129 | mMediaNavigateAllowCheck = getChild<LLCheckBoxCtrl>("check navigate allow"); | ||
130 | childSetCommitCallback("check navigate allow", onCommitAny, this); | ||
131 | mMediaURLFilterCheck = getChild<LLCheckBoxCtrl>("check navigate filter"); | ||
132 | childSetCommitCallback("check navigate filter", onCommitAny, this); | ||
133 | |||
157 | mSetURLButton = getChild<LLButton>("set_media_url"); | 134 | mSetURLButton = getChild<LLButton>("set_media_url"); |
158 | childSetAction("set_media_url", onSetBtn, this); | 135 | childSetAction("set_media_url", onSetBtn, this); |
159 | 136 | ||
137 | mResetURLButton = getChild<LLButton>("reset_media_url"); | ||
138 | childSetAction("reset_media_url", onResetBtn, this); | ||
139 | |||
140 | mURLFilterList = getChild<LLScrollListCtrl>("filter_list"); | ||
141 | |||
142 | mMediaURLFilterDomainEdit = getChild<LLLineEditor>("navigate_filter_domain"); | ||
143 | |||
144 | mMediaURLFilterAddButton = getChild<LLButton>("add_navigate_filter"); | ||
145 | childSetAction("add_navigate_filter", onClickAddURLFilter, this); | ||
146 | |||
147 | mMediaURLFilterRemoveButton = getChild<LLButton>("remove_navigate_filter"); | ||
148 | childSetAction("remove_navigate_filter", onClickRemoveURLFilter, this); | ||
149 | |||
150 | mRadioNavigateControl = getChild<LLRadioGroup>("radio_navigate_allow"); | ||
151 | childSetCommitCallback("radio_navigate_allow", onCommitAny, this); | ||
152 | |||
153 | |||
160 | return TRUE; | 154 | return TRUE; |
161 | } | 155 | } |
162 | 156 | ||
@@ -177,8 +171,8 @@ void LLPanelLandMedia::refresh() | |||
177 | // Display options | 171 | // Display options |
178 | BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA); | 172 | BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA); |
179 | 173 | ||
180 | mCheckSoundLocal->set( parcel->getSoundLocal() ); | 174 | //imprudence fixme mCheckSoundLocal->set( parcel->getSoundLocal() ); |
181 | mCheckSoundLocal->setEnabled( can_change_media ); | 175 | //imprudence fixme mCheckSoundLocal->setEnabled( can_change_media ); |
182 | 176 | ||
183 | LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); | 177 | LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); |
184 | if (!region) | 178 | if (!region) |
@@ -194,42 +188,43 @@ void LLPanelLandMedia::refresh() | |||
194 | { | 188 | { |
195 | if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all | 189 | if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all |
196 | { | 190 | { |
197 | mCheckEnableVoiceChatIsEstateDisabled->setVisible(false); | 191 | //imprudence fixme mCheckEnableVoiceChatIsEstateDisabled->setVisible(false); |
198 | 192 | ||
199 | mCheckEnableVoiceChat->setVisible(true); | 193 | //imprudence fixme mCheckEnableVoiceChat->setVisible(true); |
200 | mCheckEnableVoiceChat->setEnabled( can_change_media ); | 194 | //imprudence fixme mCheckEnableVoiceChat->setEnabled( can_change_media ); |
201 | mCheckEnableVoiceChat->set(allow_voice); | 195 | //imprudence fixme mCheckEnableVoiceChat->set(allow_voice); |
202 | 196 | ||
203 | mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); | 197 | //imprudence fixme mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); |
204 | } | 198 | } |
205 | else // disabled at region level | 199 | else // disabled at region level |
206 | { | 200 | { |
207 | mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled | 201 | //imprudence fixme mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled |
208 | mCheckEnableVoiceChat->setVisible(false); | 202 | //imprudence fixme mCheckEnableVoiceChat->setVisible(false); |
209 | mCheckEnableVoiceChat->setEnabled(false); | 203 | //imprudence fixme mCheckEnableVoiceChat->setEnabled(false); |
210 | mCheckEnableVoiceChat->set(false); | 204 | //imprudence fixme mCheckEnableVoiceChat->set(false); |
211 | 205 | ||
212 | mCheckEnableVoiceChatParcel->setEnabled(false); | 206 | //imprudence fixme mCheckEnableVoiceChatParcel->setEnabled(false); |
213 | } | 207 | } |
214 | } | 208 | } |
215 | else | 209 | else |
216 | { | 210 | { |
217 | mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); | 211 | //imprudence fixme mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); |
218 | 212 | ||
219 | mCheckEnableVoiceChat->setVisible(true); | 213 | //imprudence fixme mCheckEnableVoiceChat->setVisible(true); |
220 | mCheckEnableVoiceChat->setEnabled( can_change_media ); | 214 | //imprudence fixme mCheckEnableVoiceChat->setEnabled( can_change_media ); |
221 | mCheckEnableVoiceChat->set(allow_voice); | 215 | //imprudence fixme mCheckEnableVoiceChat->set(allow_voice); |
222 | 216 | ||
223 | mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); | 217 | //imprudence fixme mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); |
224 | } | 218 | } |
225 | 219 | ||
226 | mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel()); | 220 | //imprudence fixme mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel()); |
221 | |||
222 | //imprudence fixme mMusicURLEdit->setText(parcel->getMusicURL()); | ||
223 | //imprudence fixme mMusicURLEdit->setEnabled( can_change_media ); | ||
224 | |||
227 | 225 | ||
228 | mMusicURLEdit->setText(parcel->getMusicURL()); | ||
229 | mMusicURLEdit->setEnabled( can_change_media ); | ||
230 | 226 | ||
231 | mMediaURLEdit->setText(parcel->getMediaURL()); | 227 | childSetText("current_url", parcel->getMediaCurrentURL()); |
232 | mMediaURLEdit->setEnabled( FALSE ); | ||
233 | 228 | ||
234 | mMediaDescEdit->setText(parcel->getMediaDesc()); | 229 | mMediaDescEdit->setText(parcel->getMediaDesc()); |
235 | mMediaDescEdit->setEnabled( can_change_media ); | 230 | mMediaDescEdit->setEnabled( can_change_media ); |
@@ -246,15 +241,11 @@ void LLPanelLandMedia::refresh() | |||
246 | mMediaUrlCheck->set( parcel->getObscureMedia() ); | 241 | mMediaUrlCheck->set( parcel->getObscureMedia() ); |
247 | mMediaUrlCheck->setEnabled( can_change_media ); | 242 | mMediaUrlCheck->setEnabled( can_change_media ); |
248 | 243 | ||
249 | mMusicUrlCheck->set( parcel->getObscureMusic() ); | ||
250 | mMusicUrlCheck->setEnabled( can_change_media ); | ||
251 | |||
252 | // don't display urls if you're not able to change it | 244 | // don't display urls if you're not able to change it |
253 | // much requested change in forums so people can't 'steal' urls | 245 | // much requested change in forums so people can't 'steal' urls |
254 | // NOTE: bug#2009 means this is still vunerable - however, bug | 246 | // NOTE: bug#2009 means this is still vunerable - however, bug |
255 | // should be closed since this bug opens up major security issues elsewhere. | 247 | // should be closed since this bug opens up major security issues elsewhere. |
256 | bool obscure_media = ! can_change_media && parcel->getObscureMedia(); | 248 | bool obscure_media = ! can_change_media && parcel->getObscureMedia(); |
257 | bool obscure_music = ! can_change_media && parcel->getObscureMusic(); | ||
258 | 249 | ||
259 | // Special code to disable asterixes for html type | 250 | // Special code to disable asterixes for html type |
260 | if(mime_type == "text/html") | 251 | if(mime_type == "text/html") |
@@ -264,7 +255,6 @@ void LLPanelLandMedia::refresh() | |||
264 | mMediaUrlCheck->setEnabled( false ); | 255 | mMediaUrlCheck->setEnabled( false ); |
265 | } | 256 | } |
266 | 257 | ||
267 | mMusicURLEdit->setDrawAsterixes( obscure_music ); | ||
268 | mMediaURLEdit->setDrawAsterixes( obscure_media ); | 258 | mMediaURLEdit->setDrawAsterixes( obscure_media ); |
269 | 259 | ||
270 | mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () ); | 260 | mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () ); |
@@ -278,6 +268,10 @@ void LLPanelLandMedia::refresh() | |||
278 | else | 268 | else |
279 | mMediaLoopCheck->set( false ); | 269 | mMediaLoopCheck->set( false ); |
280 | mMediaLoopCheck->setEnabled ( can_change_media && allow_looping ); | 270 | mMediaLoopCheck->setEnabled ( can_change_media && allow_looping ); |
271 | |||
272 | mMediaResetCtrl->set( parcel->getMediaURLTimeout() ); | ||
273 | mMediaResetCtrl->setEnabled( can_change_media ); | ||
274 | mMediaResetCtrlLabel->setEnabled( can_change_media ); | ||
281 | 275 | ||
282 | // disallow media size change for mime types that don't allow it | 276 | // disallow media size change for mime types that don't allow it |
283 | bool allow_resize = LLMIMETypes::findAllowResize( mime_type ); | 277 | bool allow_resize = LLMIMETypes::findAllowResize( mime_type ); |
@@ -301,28 +295,45 @@ void LLPanelLandMedia::refresh() | |||
301 | mMediaTextureCtrl->setEnabled( can_change_media ); | 295 | mMediaTextureCtrl->setEnabled( can_change_media ); |
302 | 296 | ||
303 | mSetURLButton->setEnabled( can_change_media ); | 297 | mSetURLButton->setEnabled( can_change_media ); |
298 | mResetURLButton->setEnabled( can_change_media ); | ||
304 | 299 | ||
305 | #if 0 | 300 | mMediaURLFilterCheck->set( parcel->getMediaURLFilterEnable() ); |
306 | // there is a media url and a media texture selected | 301 | mMediaURLFilterCheck->setEnabled( can_change_media ); |
307 | if ( ( ! ( std::string ( parcel->getMediaURL() ).empty () ) ) && ( ! ( parcel->getMediaID ().isNull () ) ) ) | ||
308 | { | ||
309 | // turn on transport controls if allowed for this parcel | ||
310 | mMediaStopButton->setEnabled ( editable ); | ||
311 | mMediaStartButton->setEnabled ( editable ); | ||
312 | } | ||
313 | else | ||
314 | { | ||
315 | // no media url or no media texture | ||
316 | mMediaStopButton->setEnabled ( FALSE ); | ||
317 | mMediaStartButton->setEnabled ( FALSE ); | ||
318 | }; | ||
319 | #endif | ||
320 | 302 | ||
321 | LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get(); | 303 | LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get(); |
322 | if (floater_url_entry) | 304 | if (floater_url_entry) |
323 | { | 305 | { |
324 | floater_url_entry->updateFromLandMediaPanel(); | 306 | floater_url_entry->updateFromLandMediaPanel(); |
325 | } | 307 | } |
308 | |||
309 | // This radial control is really just an inverse mapping to the boolean allow_navigate value. | ||
310 | // It is set as a radial merely for user readability. | ||
311 | mRadioNavigateControl->setSelectedIndex(! parcel->getMediaAllowNavigate()); | ||
312 | mRadioNavigateControl->setEnabled( can_change_media ); | ||
313 | |||
314 | mMediaURLFilterDomainEdit->setEnabled( can_change_media ); | ||
315 | mMediaURLFilterAddButton->setEnabled( can_change_media ); | ||
316 | mMediaURLFilterRemoveButton->setEnabled( can_change_media ); | ||
317 | |||
318 | if (mURLFilterList) | ||
319 | { | ||
320 | mURLFilterList->setEnabled( can_change_media ); | ||
321 | |||
322 | mURLFilterList->deleteAllItems(); | ||
323 | |||
324 | LLSD list = parcel->getMediaURLFilterList(); | ||
325 | |||
326 | for (LLSD::array_iterator i = list.beginArray(); i != list.endArray(); ++i) | ||
327 | { | ||
328 | std::string domain = (*i).asString(); | ||
329 | |||
330 | LLSD element; | ||
331 | element["id"] = domain; | ||
332 | element["columns"][0]["value"] = domain; | ||
333 | |||
334 | mURLFilterList->addElement(element); | ||
335 | } | ||
336 | } | ||
326 | } | 337 | } |
327 | } | 338 | } |
328 | 339 | ||
@@ -364,12 +375,19 @@ void LLPanelLandMedia::setMediaType(const std::string& mime_type) | |||
364 | void LLPanelLandMedia::setMediaURL(const std::string& media_url) | 375 | void LLPanelLandMedia::setMediaURL(const std::string& media_url) |
365 | { | 376 | { |
366 | mMediaURLEdit->setText(media_url); | 377 | mMediaURLEdit->setText(media_url); |
378 | LLParcel *parcel = mParcel->getParcel(); | ||
379 | if(parcel) | ||
380 | parcel->setMediaCurrentURL(media_url); | ||
381 | // LLViewerMedia::navigateHome(); | ||
382 | |||
383 | |||
367 | mMediaURLEdit->onCommit(); | 384 | mMediaURLEdit->onCommit(); |
385 | // LLViewerParcelMedia::sendMediaNavigateMessage(media_url); | ||
386 | childSetText("current_url", media_url); | ||
368 | } | 387 | } |
369 | |||
370 | std::string LLPanelLandMedia::getMediaURL() | 388 | std::string LLPanelLandMedia::getMediaURL() |
371 | { | 389 | { |
372 | return mMediaURLEdit->getText(); | 390 | return mMediaURLEdit->getText(); |
373 | } | 391 | } |
374 | 392 | ||
375 | // static | 393 | // static |
@@ -398,33 +416,26 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) | |||
398 | } | 416 | } |
399 | 417 | ||
400 | // Extract data from UI | 418 | // Extract data from UI |
401 | BOOL sound_local = self->mCheckSoundLocal->get(); | ||
402 | std::string music_url = self->mMusicURLEdit->getText(); | ||
403 | std::string media_url = self->mMediaURLEdit->getText(); | 419 | std::string media_url = self->mMediaURLEdit->getText(); |
404 | std::string media_desc = self->mMediaDescEdit->getText(); | 420 | std::string media_desc = self->mMediaDescEdit->getText(); |
405 | std::string mime_type = self->childGetText("mime_type"); | 421 | std::string mime_type = self->childGetText("mime_type"); |
406 | U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); | 422 | U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); |
407 | U8 media_loop = self->mMediaLoopCheck->get(); | 423 | U8 media_loop = self->mMediaLoopCheck->get(); |
408 | U8 obscure_media = self->mMediaUrlCheck->get(); | 424 | U8 obscure_media = self->mMediaUrlCheck->get(); |
409 | U8 obscure_music = self->mMusicUrlCheck->get(); | 425 | F32 media_reset_time = (F32)self->mMediaResetCtrl->get(); |
410 | S32 media_width = (S32)self->mMediaWidthCtrl->get(); | 426 | S32 media_width = (S32)self->mMediaWidthCtrl->get(); |
411 | S32 media_height = (S32)self->mMediaHeightCtrl->get(); | 427 | S32 media_height = (S32)self->mMediaHeightCtrl->get(); |
412 | LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); | 428 | LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); |
429 | U8 navigate_allow = ! self->mRadioNavigateControl->getSelectedIndex(); | ||
430 | U8 navigate_filter = self->mMediaURLFilterCheck->get(); | ||
413 | 431 | ||
414 | BOOL voice_enabled = self->mCheckEnableVoiceChat->get(); | ||
415 | BOOL voice_estate_chan = ! self->mCheckEnableVoiceChatParcel->get(); | ||
416 | 432 | ||
417 | self->childSetText("mime_type", mime_type); | 433 | self->childSetText("mime_type", mime_type); |
418 | 434 | ||
419 | // Remove leading/trailing whitespace (common when copying/pasting) | 435 | // Remove leading/trailing whitespace (common when copying/pasting) |
420 | LLStringUtil::trim(music_url); | ||
421 | LLStringUtil::trim(media_url); | 436 | LLStringUtil::trim(media_url); |
422 | 437 | ||
423 | // Push data into current parcel | 438 | // Push data into current parcel |
424 | parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled); | ||
425 | parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); | ||
426 | parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); | ||
427 | parcel->setMusicURL(music_url); | ||
428 | parcel->setMediaURL(media_url); | 439 | parcel->setMediaURL(media_url); |
429 | parcel->setMediaType(mime_type); | 440 | parcel->setMediaType(mime_type); |
430 | parcel->setMediaDesc(media_desc); | 441 | parcel->setMediaDesc(media_desc); |
@@ -434,7 +445,10 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) | |||
434 | parcel->setMediaAutoScale ( media_auto_scale ); | 445 | parcel->setMediaAutoScale ( media_auto_scale ); |
435 | parcel->setMediaLoop ( media_loop ); | 446 | parcel->setMediaLoop ( media_loop ); |
436 | parcel->setObscureMedia( obscure_media ); | 447 | parcel->setObscureMedia( obscure_media ); |
437 | parcel->setObscureMusic( obscure_music ); | 448 | parcel->setMediaURLFilterEnable(navigate_filter); |
449 | parcel->setMediaAllowNavigate(navigate_allow); | ||
450 | parcel->setMediaURLTimeout(media_reset_time); | ||
451 | |||
438 | 452 | ||
439 | // Send current parcel data upstream to server | 453 | // Send current parcel data upstream to server |
440 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); | 454 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); |
@@ -453,3 +467,91 @@ void LLPanelLandMedia::onSetBtn(void *userdata) | |||
453 | parent_floater->addDependentFloater(self->mURLEntryFloater.get()); | 467 | parent_floater->addDependentFloater(self->mURLEntryFloater.get()); |
454 | } | 468 | } |
455 | } | 469 | } |
470 | |||
471 | // static | ||
472 | void LLPanelLandMedia::onResetBtn(void *userdata) | ||
473 | { | ||
474 | LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; | ||
475 | LLParcel* parcel = self->mParcel->getParcel(); | ||
476 | // LLViewerMedia::navigateHome(); | ||
477 | self->refresh(); | ||
478 | self->childSetText("current_url", parcel->getMediaURL()); | ||
479 | // LLViewerParcelMedia::sendMediaNavigateMessage(parcel->getMediaURL()); | ||
480 | |||
481 | } | ||
482 | // static | ||
483 | void LLPanelLandMedia::onClickAddURLFilter(void *userdata) | ||
484 | { | ||
485 | LLPanelLandMedia *panelp = (LLPanelLandMedia *)userdata; | ||
486 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
487 | |||
488 | LLSD list = parcel->getMediaURLFilterList(); | ||
489 | |||
490 | std::string domain = panelp->mMediaURLFilterDomainEdit->getText(); | ||
491 | LLStringUtil::trim(domain); | ||
492 | |||
493 | BOOL add = TRUE; | ||
494 | if (domain == "") | ||
495 | { | ||
496 | add = FALSE; | ||
497 | } | ||
498 | |||
499 | // check for dupes | ||
500 | for(S32 i = 0; i < list.size(); i++) | ||
501 | { | ||
502 | if (list[i].asString() == domain) | ||
503 | { | ||
504 | add = FALSE; | ||
505 | break; | ||
506 | } | ||
507 | } | ||
508 | |||
509 | if (add) | ||
510 | { | ||
511 | list.append(domain); | ||
512 | parcel->setMediaURLFilterList(list); | ||
513 | |||
514 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); | ||
515 | |||
516 | panelp->mMediaURLFilterDomainEdit->setText(std::string("")); | ||
517 | |||
518 | panelp->refresh(); | ||
519 | } | ||
520 | |||
521 | } | ||
522 | |||
523 | // static | ||
524 | void LLPanelLandMedia::onClickRemoveURLFilter(void *data) | ||
525 | { | ||
526 | LLPanelLandMedia* panelp = (LLPanelLandMedia*)data; | ||
527 | if (panelp && panelp->mURLFilterList) | ||
528 | { | ||
529 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
530 | if (parcel) | ||
531 | { | ||
532 | LLSD list = parcel->getMediaURLFilterList(); | ||
533 | |||
534 | std::vector<LLScrollListItem*> domains = panelp->mURLFilterList->getAllSelected(); | ||
535 | for (std::vector<LLScrollListItem*>::iterator iter = domains.begin(); iter != domains.end(); iter++) | ||
536 | { | ||
537 | LLScrollListItem* item = *iter; | ||
538 | const std::string domain = item->getValue().asString(); | ||
539 | |||
540 | for(S32 i = 0; i < list.size(); i++) | ||
541 | { | ||
542 | if (list[i].asString() == domain) | ||
543 | { | ||
544 | list.erase(i); | ||
545 | break; | ||
546 | } | ||
547 | } | ||
548 | } | ||
549 | |||
550 | parcel->setMediaURLFilterList(list); | ||
551 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); | ||
552 | |||
553 | panelp->refresh(); | ||
554 | } | ||
555 | } | ||
556 | |||
557 | } | ||