meow-7.2.2
Palmer 2010-02-12 15:56:25 -08:00
commit 9aae3a31c8
1 changed files with 48 additions and 33 deletions

View File

@ -856,56 +856,71 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject()));
if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty())
if (obj && !obj->getRegion()->getCapability("ObjectMedia").empty())
{
LLTextureEntry *te = obj->getTE(object_face);
if (te)
{
if (drop)
{
if (! te->hasMedia())
// object does NOT have media already
if ( ! te->hasMedia() )
{
// Create new media entry
LLSD media_data;
// XXX Should we really do Home URL too?
media_data[LLMediaEntry::HOME_URL_KEY] = url;
media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
media_data[LLMediaEntry::AUTO_PLAY_KEY] = true;
obj->syncMediaData(object_face, media_data, true, true);
// XXX This shouldn't be necessary, should it ?!?
if (obj->getMediaImpl(object_face))
obj->getMediaImpl(object_face)->navigateReload();
obj->sendMediaDataUpdate();
result = LLWindowCallbacks::DND_COPY;
}
else {
// Check the whitelist
if (te->getMediaData()->checkCandidateUrl(url))
// we are allowed to modify the object
if ( obj->permModify() )
{
// just navigate to the URL
// Create new media entry
LLSD media_data;
// XXX Should we really do Home URL too?
media_data[LLMediaEntry::HOME_URL_KEY] = url;
media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
media_data[LLMediaEntry::AUTO_PLAY_KEY] = true;
obj->syncMediaData(object_face, media_data, true, true);
// XXX This shouldn't be necessary, should it ?!?
if (obj->getMediaImpl(object_face))
obj->getMediaImpl(object_face)->navigateReload();
obj->sendMediaDataUpdate();
result = LLWindowCallbacks::DND_COPY;
}
}
else
// object HAS media already
{
// URL passes the whitelist
if (te->getMediaData()->checkCandidateUrl( url ) )
{
// we are allowed to modify the object or we have navigate permissions
// NOTE: Design states you you can change the URL if you have media
// navigate permissions even if you do not have prim modify rights
if ( obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT ) )
{
obj->getMediaImpl(object_face)->navigateTo(url);
// just navigate to the URL
if (obj->getMediaImpl(object_face))
{
obj->getMediaImpl(object_face)->navigateTo(url);
}
else
{
// This is very strange. Navigation should
// happen via the Impl, but we don't have one.
// This sends it to the server, which /should/
// trigger us getting it. Hopefully.
LLSD media_data;
media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
obj->syncMediaData(object_face, media_data, true, true);
obj->sendMediaDataUpdate();
}
result = LLWindowCallbacks::DND_LINK;
}
else {
// This is very strange. Navigation should
// happen via the Impl, but we don't have one.
// This sends it to the server, which /should/
// trigger us getting it. Hopefully.
LLSD media_data;
media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
obj->syncMediaData(object_face, media_data, true, true);
obj->sendMediaDataUpdate();
}
result = LLWindowCallbacks::DND_LINK;
}
}
LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);
mDragHoveredObject = NULL;
}
else {
else
{
// Check the whitelist, if there's media (otherwise just show it)
if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url))
{