diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanellandmedia.cpp | 301 | ||||
-rw-r--r-- | linden/indra/newview/llpanellandmedia.h | 20 |
2 files changed, 132 insertions, 189 deletions
diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp index db68c42..11f491c 100644 --- a/linden/indra/newview/llpanellandmedia.cpp +++ b/linden/indra/newview/llpanellandmedia.cpp | |||
@@ -39,8 +39,6 @@ | |||
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" | ||
44 | #include "lluictrlfactory.h" | 42 | #include "lluictrlfactory.h" |
45 | 43 | ||
46 | // library includes | 44 | // library includes |
@@ -56,7 +54,6 @@ | |||
56 | #include "llsdutil.h" | 54 | #include "llsdutil.h" |
57 | #include "lltexturectrl.h" | 55 | #include "lltexturectrl.h" |
58 | #include "roles_constants.h" | 56 | #include "roles_constants.h" |
59 | #include "llscrolllistctrl.h" | ||
60 | 57 | ||
61 | #include "hippoGridManager.h" | 58 | #include "hippoGridManager.h" |
62 | 59 | ||
@@ -65,8 +62,15 @@ | |||
65 | //--------------------------------------------------------------------------- | 62 | //--------------------------------------------------------------------------- |
66 | 63 | ||
67 | LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) | 64 | LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) |
68 | : LLPanel(), | 65 | : LLPanel(std::string("land_media_panel")), |
66 | |||
69 | mParcel(parcel), | 67 | mParcel(parcel), |
68 | mCheckSoundLocal(NULL), | ||
69 | mSoundHelpButton(NULL), | ||
70 | mCheckEnableVoiceChat(NULL), | ||
71 | mCheckEnableVoiceChatIsEstateDisabled(NULL), | ||
72 | mCheckEnableVoiceChatParcel(NULL), | ||
73 | mMusicURLEdit(NULL), | ||
70 | mMediaURLEdit(NULL), | 74 | mMediaURLEdit(NULL), |
71 | mMediaDescEdit(NULL), | 75 | mMediaDescEdit(NULL), |
72 | mMediaTypeCombo(NULL), | 76 | mMediaTypeCombo(NULL), |
@@ -77,7 +81,8 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) | |||
77 | mMediaTextureCtrl(NULL), | 81 | mMediaTextureCtrl(NULL), |
78 | mMediaAutoScaleCheck(NULL), | 82 | mMediaAutoScaleCheck(NULL), |
79 | mMediaLoopCheck(NULL), | 83 | mMediaLoopCheck(NULL), |
80 | mMediaUrlCheck(NULL) | 84 | mMediaUrlCheck(NULL), |
85 | mMusicUrlCheck(NULL) | ||
81 | { | 86 | { |
82 | } | 87 | } |
83 | 88 | ||
@@ -85,10 +90,34 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) | |||
85 | // virtual | 90 | // virtual |
86 | LLPanelLandMedia::~LLPanelLandMedia() | 91 | LLPanelLandMedia::~LLPanelLandMedia() |
87 | { | 92 | { |
93 | // close LLFloaterURLEntry? | ||
94 | } | ||
95 | |||
96 | |||
97 | // static | ||
98 | void LLPanelLandMedia::onClickSoundHelp(void*) | ||
99 | { | ||
100 | LLNotifications::instance().add("ClickSoundHelpLand"); | ||
88 | } | 101 | } |
89 | 102 | ||
103 | |||
90 | BOOL LLPanelLandMedia::postBuild() | 104 | BOOL LLPanelLandMedia::postBuild() |
91 | { | 105 | { |
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); | ||
92 | 121 | ||
93 | mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); | 122 | mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); |
94 | mMediaTextureCtrl->setCommitCallback( onCommitAny ); | 123 | mMediaTextureCtrl->setCommitCallback( onCommitAny ); |
@@ -101,13 +130,16 @@ BOOL LLPanelLandMedia::postBuild() | |||
101 | childSetCommitCallback("media_auto_scale", onCommitAny, this); | 130 | childSetCommitCallback("media_auto_scale", onCommitAny, this); |
102 | 131 | ||
103 | mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); | 132 | mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); |
104 | childSetCommitCallback("media_loop", onCommitAny, this ); | 133 | childSetCommitCallback("media_loop", onCommitAny, this); |
105 | 134 | ||
106 | mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url"); | 135 | mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url"); |
107 | childSetCommitCallback("hide_media_url", onCommitAny, this ); | 136 | childSetCommitCallback("hide_media_url", onCommitAny, this); |
137 | |||
138 | mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url"); | ||
139 | childSetCommitCallback("hide_music_url", onCommitAny, this); | ||
108 | 140 | ||
109 | mMediaURLEdit = getChild<LLLineEditor>("media_url"); | 141 | mMediaURLEdit = getChild<LLLineEditor>("media_url"); |
110 | childSetCommitCallback("media_url", onCommitAny, this ); | 142 | childSetCommitCallback("media_url", onCommitAny, this); |
111 | 143 | ||
112 | mMediaDescEdit = getChild<LLLineEditor>("url_description"); | 144 | mMediaDescEdit = getChild<LLLineEditor>("url_description"); |
113 | childSetCommitCallback("url_description", onCommitAny, this); | 145 | childSetCommitCallback("url_description", onCommitAny, this); |
@@ -116,41 +148,15 @@ BOOL LLPanelLandMedia::postBuild() | |||
116 | childSetCommitCallback("media type", onCommitType, this); | 148 | childSetCommitCallback("media type", onCommitType, this); |
117 | populateMIMECombo(); | 149 | populateMIMECombo(); |
118 | 150 | ||
119 | mMediaResetCtrl = getChild<LLSpinCtrl>("media_reset_time"); | ||
120 | childSetCommitCallback("media_reset_time", onCommitAny, this); | ||
121 | mMediaResetCtrlLabel = getChild<LLTextBox>("media_reset"); | ||
122 | |||
123 | mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); | 151 | mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); |
124 | childSetCommitCallback("media_size_width", onCommitAny, this); | 152 | childSetCommitCallback("media_size_width", onCommitAny, this); |
125 | mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); | 153 | mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); |
126 | childSetCommitCallback("media_size_height", onCommitAny, this); | 154 | childSetCommitCallback("media_size_height", onCommitAny, this); |
127 | mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); | 155 | mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); |
128 | 156 | ||
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 | |||
134 | mSetURLButton = getChild<LLButton>("set_media_url"); | 157 | mSetURLButton = getChild<LLButton>("set_media_url"); |
135 | childSetAction("set_media_url", onSetBtn, this); | 158 | childSetAction("set_media_url", onSetBtn, this); |
136 | 159 | ||
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 | |||
154 | return TRUE; | 160 | return TRUE; |
155 | } | 161 | } |
156 | 162 | ||
@@ -171,9 +177,59 @@ void LLPanelLandMedia::refresh() | |||
171 | // Display options | 177 | // Display options |
172 | BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA); | 178 | BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA); |
173 | 179 | ||
174 | mCheckSoundLocal->set( parcel->getSoundLocal() ); | 180 | mCheckSoundLocal->set( parcel->getSoundLocal() ); |
181 | mCheckSoundLocal->setEnabled( can_change_media ); | ||
182 | |||
183 | LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); | ||
184 | if (!region) | ||
185 | { | ||
186 | // never seen this happen, but log it | ||
187 | llwarns << "Couldn't get selected region." << llendl; | ||
188 | } | ||
189 | |||
190 | // We need to do this differently for OpenSim because it doesn't include | ||
191 | // REGION_FLAGS_ALLOW_VOICE in the "RegionInfo" message as of 0.6.9 PF -- MC | ||
192 | bool allow_voice = parcel->getParcelFlagAllowVoice(); | ||
193 | if (gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
194 | { | ||
195 | if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all | ||
196 | { | ||
197 | mCheckEnableVoiceChatIsEstateDisabled->setVisible(false); | ||
198 | |||
199 | mCheckEnableVoiceChat->setVisible(true); | ||
200 | mCheckEnableVoiceChat->setEnabled( can_change_media ); | ||
201 | mCheckEnableVoiceChat->set(allow_voice); | ||
202 | |||
203 | mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); | ||
204 | } | ||
205 | else // disabled at region level | ||
206 | { | ||
207 | mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled | ||
208 | mCheckEnableVoiceChat->setVisible(false); | ||
209 | mCheckEnableVoiceChat->setEnabled(false); | ||
210 | mCheckEnableVoiceChat->set(false); | ||
211 | |||
212 | mCheckEnableVoiceChatParcel->setEnabled(false); | ||
213 | } | ||
214 | } | ||
215 | else | ||
216 | { | ||
217 | mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); | ||
218 | |||
219 | mCheckEnableVoiceChat->setVisible(true); | ||
220 | mCheckEnableVoiceChat->setEnabled( can_change_media ); | ||
221 | mCheckEnableVoiceChat->set(allow_voice); | ||
222 | |||
223 | mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); | ||
224 | } | ||
225 | |||
226 | mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel()); | ||
227 | |||
228 | mMusicURLEdit->setText(parcel->getMusicURL()); | ||
229 | mMusicURLEdit->setEnabled( can_change_media ); | ||
175 | 230 | ||
176 | childSetText("current_url", parcel->getMediaCurrentURL()); | 231 | mMediaURLEdit->setText(parcel->getMediaURL()); |
232 | mMediaURLEdit->setEnabled( FALSE ); | ||
177 | 233 | ||
178 | mMediaDescEdit->setText(parcel->getMediaDesc()); | 234 | mMediaDescEdit->setText(parcel->getMediaDesc()); |
179 | mMediaDescEdit->setEnabled( can_change_media ); | 235 | mMediaDescEdit->setEnabled( can_change_media ); |
@@ -190,11 +246,15 @@ void LLPanelLandMedia::refresh() | |||
190 | mMediaUrlCheck->set( parcel->getObscureMedia() ); | 246 | mMediaUrlCheck->set( parcel->getObscureMedia() ); |
191 | mMediaUrlCheck->setEnabled( can_change_media ); | 247 | mMediaUrlCheck->setEnabled( can_change_media ); |
192 | 248 | ||
249 | mMusicUrlCheck->set( parcel->getObscureMusic() ); | ||
250 | mMusicUrlCheck->setEnabled( can_change_media ); | ||
251 | |||
193 | // don't display urls if you're not able to change it | 252 | // don't display urls if you're not able to change it |
194 | // much requested change in forums so people can't 'steal' urls | 253 | // much requested change in forums so people can't 'steal' urls |
195 | // NOTE: bug#2009 means this is still vunerable - however, bug | 254 | // NOTE: bug#2009 means this is still vunerable - however, bug |
196 | // should be closed since this bug opens up major security issues elsewhere. | 255 | // should be closed since this bug opens up major security issues elsewhere. |
197 | bool obscure_media = ! can_change_media && parcel->getObscureMedia(); | 256 | bool obscure_media = ! can_change_media && parcel->getObscureMedia(); |
257 | bool obscure_music = ! can_change_media && parcel->getObscureMusic(); | ||
198 | 258 | ||
199 | // Special code to disable asterixes for html type | 259 | // Special code to disable asterixes for html type |
200 | if(mime_type == "text/html") | 260 | if(mime_type == "text/html") |
@@ -204,6 +264,7 @@ void LLPanelLandMedia::refresh() | |||
204 | mMediaUrlCheck->setEnabled( false ); | 264 | mMediaUrlCheck->setEnabled( false ); |
205 | } | 265 | } |
206 | 266 | ||
267 | mMusicURLEdit->setDrawAsterixes( obscure_music ); | ||
207 | mMediaURLEdit->setDrawAsterixes( obscure_media ); | 268 | mMediaURLEdit->setDrawAsterixes( obscure_media ); |
208 | 269 | ||
209 | mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () ); | 270 | mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () ); |
@@ -217,10 +278,6 @@ void LLPanelLandMedia::refresh() | |||
217 | else | 278 | else |
218 | mMediaLoopCheck->set( false ); | 279 | mMediaLoopCheck->set( false ); |
219 | mMediaLoopCheck->setEnabled ( can_change_media && allow_looping ); | 280 | mMediaLoopCheck->setEnabled ( can_change_media && allow_looping ); |
220 | |||
221 | mMediaResetCtrl->set( parcel->getMediaURLTimeout() ); | ||
222 | mMediaResetCtrl->setEnabled( can_change_media ); | ||
223 | mMediaResetCtrlLabel->setEnabled( can_change_media ); | ||
224 | 281 | ||
225 | // disallow media size change for mime types that don't allow it | 282 | // disallow media size change for mime types that don't allow it |
226 | bool allow_resize = LLMIMETypes::findAllowResize( mime_type ); | 283 | bool allow_resize = LLMIMETypes::findAllowResize( mime_type ); |
@@ -244,45 +301,28 @@ void LLPanelLandMedia::refresh() | |||
244 | mMediaTextureCtrl->setEnabled( can_change_media ); | 301 | mMediaTextureCtrl->setEnabled( can_change_media ); |
245 | 302 | ||
246 | mSetURLButton->setEnabled( can_change_media ); | 303 | mSetURLButton->setEnabled( can_change_media ); |
247 | mResetURLButton->setEnabled( can_change_media ); | ||
248 | 304 | ||
249 | mMediaURLFilterCheck->set( parcel->getMediaURLFilterEnable() ); | 305 | #if 0 |
250 | mMediaURLFilterCheck->setEnabled( can_change_media ); | 306 | // there is a media url and a media texture selected |
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 | ||
251 | 320 | ||
252 | LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get(); | 321 | LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get(); |
253 | if (floater_url_entry) | 322 | if (floater_url_entry) |
254 | { | 323 | { |
255 | floater_url_entry->updateFromLandMediaPanel(); | 324 | floater_url_entry->updateFromLandMediaPanel(); |
256 | } | 325 | } |
257 | |||
258 | // This radial control is really just an inverse mapping to the boolean allow_navigate value. | ||
259 | // It is set as a radial merely for user readability. | ||
260 | mRadioNavigateControl->setSelectedIndex(! parcel->getMediaAllowNavigate()); | ||
261 | mRadioNavigateControl->setEnabled( can_change_media ); | ||
262 | |||
263 | mMediaURLFilterDomainEdit->setEnabled( can_change_media ); | ||
264 | mMediaURLFilterAddButton->setEnabled( can_change_media ); | ||
265 | mMediaURLFilterRemoveButton->setEnabled( can_change_media ); | ||
266 | |||
267 | if (mURLFilterList) | ||
268 | { | ||
269 | mURLFilterList->setEnabled( can_change_media ); | ||
270 | |||
271 | mURLFilterList->deleteAllItems(); | ||
272 | |||
273 | LLSD list = parcel->getMediaURLFilterList(); | ||
274 | |||
275 | for (LLSD::array_iterator i = list.beginArray(); i != list.endArray(); ++i) | ||
276 | { | ||
277 | std::string domain = (*i).asString(); | ||
278 | |||
279 | LLSD element; | ||
280 | element["id"] = domain; | ||
281 | element["columns"][0]["value"] = domain; | ||
282 | |||
283 | mURLFilterList->addElement(element); | ||
284 | } | ||
285 | } | ||
286 | } | 326 | } |
287 | } | 327 | } |
288 | 328 | ||
@@ -318,6 +358,7 @@ void LLPanelLandMedia::setMediaType(const std::string& mime_type) | |||
318 | 358 | ||
319 | std::string media_key = LLMIMETypes::widgetType(mime_type); | 359 | std::string media_key = LLMIMETypes::widgetType(mime_type); |
320 | mMediaTypeCombo->setValue(media_key); | 360 | mMediaTypeCombo->setValue(media_key); |
361 | |||
321 | childSetText("mime_type", mime_type); | 362 | childSetText("mime_type", mime_type); |
322 | } | 363 | } |
323 | 364 | ||
@@ -329,14 +370,14 @@ void LLPanelLandMedia::setMediaURL(const std::string& media_url) | |||
329 | parcel->setMediaCurrentURL(media_url); | 370 | parcel->setMediaCurrentURL(media_url); |
330 | // LLViewerMedia::navigateHome(); | 371 | // LLViewerMedia::navigateHome(); |
331 | 372 | ||
332 | |||
333 | mMediaURLEdit->onCommit(); | 373 | mMediaURLEdit->onCommit(); |
334 | // LLViewerParcelMedia::sendMediaNavigateMessage(media_url); | 374 | // // LLViewerParcelMedia::sendMediaNavigateMessage(media_url); |
335 | childSetText("current_url", media_url); | 375 | // childSetText("current_url", media_url); |
336 | } | 376 | } |
377 | |||
337 | std::string LLPanelLandMedia::getMediaURL() | 378 | std::string LLPanelLandMedia::getMediaURL() |
338 | { | 379 | { |
339 | return mMediaURLEdit->getText(); | 380 | return mMediaURLEdit->getText(); |
340 | } | 381 | } |
341 | 382 | ||
342 | // static | 383 | // static |
@@ -365,26 +406,33 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) | |||
365 | } | 406 | } |
366 | 407 | ||
367 | // Extract data from UI | 408 | // Extract data from UI |
409 | BOOL sound_local = self->mCheckSoundLocal->get(); | ||
410 | std::string music_url = self->mMusicURLEdit->getText(); | ||
368 | std::string media_url = self->mMediaURLEdit->getText(); | 411 | std::string media_url = self->mMediaURLEdit->getText(); |
369 | std::string media_desc = self->mMediaDescEdit->getText(); | 412 | std::string media_desc = self->mMediaDescEdit->getText(); |
370 | std::string mime_type = self->childGetText("mime_type"); | 413 | std::string mime_type = self->childGetText("mime_type"); |
371 | U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); | 414 | U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); |
372 | U8 media_loop = self->mMediaLoopCheck->get(); | 415 | U8 media_loop = self->mMediaLoopCheck->get(); |
373 | U8 obscure_media = self->mMediaUrlCheck->get(); | 416 | U8 obscure_media = self->mMediaUrlCheck->get(); |
374 | F32 media_reset_time = (F32)self->mMediaResetCtrl->get(); | 417 | U8 obscure_music = self->mMusicUrlCheck->get(); |
375 | S32 media_width = (S32)self->mMediaWidthCtrl->get(); | 418 | S32 media_width = (S32)self->mMediaWidthCtrl->get(); |
376 | S32 media_height = (S32)self->mMediaHeightCtrl->get(); | 419 | S32 media_height = (S32)self->mMediaHeightCtrl->get(); |
377 | LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); | 420 | LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); |
378 | U8 navigate_allow = ! self->mRadioNavigateControl->getSelectedIndex(); | ||
379 | U8 navigate_filter = self->mMediaURLFilterCheck->get(); | ||
380 | 421 | ||
422 | BOOL voice_enabled = self->mCheckEnableVoiceChat->get(); | ||
423 | BOOL voice_estate_chan = ! self->mCheckEnableVoiceChatParcel->get(); | ||
381 | 424 | ||
382 | self->childSetText("mime_type", mime_type); | 425 | self->childSetText("mime_type", mime_type); |
383 | 426 | ||
384 | // Remove leading/trailing whitespace (common when copying/pasting) | 427 | // Remove leading/trailing whitespace (common when copying/pasting) |
428 | LLStringUtil::trim(music_url); | ||
385 | LLStringUtil::trim(media_url); | 429 | LLStringUtil::trim(media_url); |
386 | 430 | ||
387 | // Push data into current parcel | 431 | // Push data into current parcel |
432 | parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled); | ||
433 | parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); | ||
434 | parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); | ||
435 | parcel->setMusicURL(music_url); | ||
388 | parcel->setMediaURL(media_url); | 436 | parcel->setMediaURL(media_url); |
389 | parcel->setMediaType(mime_type); | 437 | parcel->setMediaType(mime_type); |
390 | parcel->setMediaDesc(media_desc); | 438 | parcel->setMediaDesc(media_desc); |
@@ -394,10 +442,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) | |||
394 | parcel->setMediaAutoScale ( media_auto_scale ); | 442 | parcel->setMediaAutoScale ( media_auto_scale ); |
395 | parcel->setMediaLoop ( media_loop ); | 443 | parcel->setMediaLoop ( media_loop ); |
396 | parcel->setObscureMedia( obscure_media ); | 444 | parcel->setObscureMedia( obscure_media ); |
397 | parcel->setMediaURLFilterEnable(navigate_filter); | 445 | parcel->setObscureMusic( obscure_music ); |
398 | parcel->setMediaAllowNavigate(navigate_allow); | ||
399 | parcel->setMediaURLTimeout(media_reset_time); | ||
400 | |||
401 | 446 | ||
402 | // Send current parcel data upstream to server | 447 | // Send current parcel data upstream to server |
403 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); | 448 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); |
@@ -415,92 +460,4 @@ void LLPanelLandMedia::onSetBtn(void *userdata) | |||
415 | { | 460 | { |
416 | parent_floater->addDependentFloater(self->mURLEntryFloater.get()); | 461 | parent_floater->addDependentFloater(self->mURLEntryFloater.get()); |
417 | } | 462 | } |
418 | } | 463 | } \ No newline at end of file |
419 | |||
420 | // static | ||
421 | void LLPanelLandMedia::onResetBtn(void *userdata) | ||
422 | { | ||
423 | LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; | ||
424 | LLParcel* parcel = self->mParcel->getParcel(); | ||
425 | // LLViewerMedia::navigateHome(); | ||
426 | self->refresh(); | ||
427 | self->childSetText("current_url", parcel->getMediaURL()); | ||
428 | // LLViewerParcelMedia::sendMediaNavigateMessage(parcel->getMediaURL()); | ||
429 | |||
430 | } | ||
431 | // static | ||
432 | void LLPanelLandMedia::onClickAddURLFilter(void *userdata) | ||
433 | { | ||
434 | LLPanelLandMedia *panelp = (LLPanelLandMedia *)userdata; | ||
435 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
436 | |||
437 | LLSD list = parcel->getMediaURLFilterList(); | ||
438 | |||
439 | std::string domain = panelp->mMediaURLFilterDomainEdit->getText(); | ||
440 | LLStringUtil::trim(domain); | ||
441 | |||
442 | BOOL add = TRUE; | ||
443 | if (domain == "") | ||
444 | { | ||
445 | add = FALSE; | ||
446 | } | ||
447 | |||
448 | // check for dupes | ||
449 | for(S32 i = 0; i < list.size(); i++) | ||
450 | { | ||
451 | if (list[i].asString() == domain) | ||
452 | { | ||
453 | add = FALSE; | ||
454 | break; | ||
455 | } | ||
456 | } | ||
457 | |||
458 | if (add) | ||
459 | { | ||
460 | list.append(domain); | ||
461 | parcel->setMediaURLFilterList(list); | ||
462 | |||
463 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); | ||
464 | |||
465 | panelp->mMediaURLFilterDomainEdit->setText(std::string("")); | ||
466 | |||
467 | panelp->refresh(); | ||
468 | } | ||
469 | |||
470 | } | ||
471 | |||
472 | // static | ||
473 | void LLPanelLandMedia::onClickRemoveURLFilter(void *data) | ||
474 | { | ||
475 | LLPanelLandMedia* panelp = (LLPanelLandMedia*)data; | ||
476 | if (panelp && panelp->mURLFilterList) | ||
477 | { | ||
478 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
479 | if (parcel) | ||
480 | { | ||
481 | LLSD list = parcel->getMediaURLFilterList(); | ||
482 | |||
483 | std::vector<LLScrollListItem*> domains = panelp->mURLFilterList->getAllSelected(); | ||
484 | for (std::vector<LLScrollListItem*>::iterator iter = domains.begin(); iter != domains.end(); iter++) | ||
485 | { | ||
486 | LLScrollListItem* item = *iter; | ||
487 | const std::string domain = item->getValue().asString(); | ||
488 | |||
489 | for(S32 i = 0; i < list.size(); i++) | ||
490 | { | ||
491 | if (list[i].asString() == domain) | ||
492 | { | ||
493 | list.erase(i); | ||
494 | break; | ||
495 | } | ||
496 | } | ||
497 | } | ||
498 | |||
499 | parcel->setMediaURLFilterList(list); | ||
500 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); | ||
501 | |||
502 | panelp->refresh(); | ||
503 | } | ||
504 | } | ||
505 | |||
506 | } | ||
diff --git a/linden/indra/newview/llpanellandmedia.h b/linden/indra/newview/llpanellandmedia.h index d63f0f6..845b953 100644 --- a/linden/indra/newview/llpanellandmedia.h +++ b/linden/indra/newview/llpanellandmedia.h | |||
@@ -56,10 +56,8 @@ private: | |||
56 | static void onCommitAny(LLUICtrl* ctrl, void *userdata); | 56 | static void onCommitAny(LLUICtrl* ctrl, void *userdata); |
57 | static void onCommitType(LLUICtrl* ctrl, void *userdata); | 57 | static void onCommitType(LLUICtrl* ctrl, void *userdata); |
58 | static void onSetBtn(void* userdata); | 58 | static void onSetBtn(void* userdata); |
59 | static void onResetBtn(void* userdata); | 59 | static void onClickSoundHelp(void*); |
60 | static void onClickAddURLFilter(void *userdata); | 60 | |
61 | static void onClickRemoveURLFilter(void *userdata); | ||
62 | |||
63 | private: | 61 | private: |
64 | LLCheckBoxCtrl* mCheckSoundLocal; | 62 | LLCheckBoxCtrl* mCheckSoundLocal; |
65 | LLButton* mSoundHelpButton; | 63 | LLButton* mSoundHelpButton; |
@@ -71,11 +69,8 @@ private: | |||
71 | LLLineEditor* mMediaDescEdit; | 69 | LLLineEditor* mMediaDescEdit; |
72 | LLComboBox* mMediaTypeCombo; | 70 | LLComboBox* mMediaTypeCombo; |
73 | LLButton* mSetURLButton; | 71 | LLButton* mSetURLButton; |
74 | LLButton* mResetURLButton; | ||
75 | LLSpinCtrl* mMediaResetCtrl; | ||
76 | LLSpinCtrl* mMediaHeightCtrl; | 72 | LLSpinCtrl* mMediaHeightCtrl; |
77 | LLSpinCtrl* mMediaWidthCtrl; | 73 | LLSpinCtrl* mMediaWidthCtrl; |
78 | LLTextBox* mMediaResetCtrlLabel; | ||
79 | LLTextBox* mMediaSizeCtrlLabel; | 74 | LLTextBox* mMediaSizeCtrlLabel; |
80 | LLTextureCtrl* mMediaTextureCtrl; | 75 | LLTextureCtrl* mMediaTextureCtrl; |
81 | LLCheckBoxCtrl* mMediaAutoScaleCheck; | 76 | LLCheckBoxCtrl* mMediaAutoScaleCheck; |
@@ -83,17 +78,8 @@ private: | |||
83 | LLCheckBoxCtrl* mMediaUrlCheck; | 78 | LLCheckBoxCtrl* mMediaUrlCheck; |
84 | LLCheckBoxCtrl* mMusicUrlCheck; | 79 | LLCheckBoxCtrl* mMusicUrlCheck; |
85 | LLHandle<LLFloater> mURLEntryFloater; | 80 | LLHandle<LLFloater> mURLEntryFloater; |
86 | LLCheckBoxCtrl* mMediaNavigateAllowCheck; | ||
87 | LLCheckBoxCtrl* mMediaURLFilterCheck; | ||
88 | LLLineEditor* mMediaURLFilterDomainEdit; | ||
89 | LLButton* mMediaURLFilterAddButton; | ||
90 | LLButton* mMediaURLFilterRemoveButton; | ||
91 | LLScrollListCtrl* mURLFilterList; | ||
92 | LLRadioGroup* mRadioNavigateControl; | ||
93 | |||
94 | 81 | ||
95 | |||
96 | LLSafeHandle<LLParcelSelection>& mParcel; | 82 | LLSafeHandle<LLParcelSelection>& mParcel; |
97 | }; | 83 | }; |
98 | 84 | ||
99 | #endif | 85 | #endif \ No newline at end of file |