make drop add media if not there, navigate if already there

meow-7.2.2
Rick Pasetto 2009-11-05 17:51:04 -08:00
parent 8c44fac93f
commit 4f0731d722
1 changed files with 21 additions and 6 deletions

View File

@ -831,12 +831,27 @@ BOOL LLViewerWindow::handleDrop( LLWindow *window, LLCoordGL pos, MASK mask, st
LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject()));
if (obj)
{
LLSD media_data;
/// XXX home URL too?
media_data[LLMediaEntry::CURRENT_URL_KEY] = url;
media_data[LLMediaEntry::AUTO_PLAY_KEY] = true;
obj->syncMediaData(object_face, media_data, true, true);
obj->sendMediaDataUpdate();
LLTextureEntry *te = obj->getTE(object_face);
if (te)
{
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 ?!?
obj->getMediaImpl(object_face)->navigateReload();
obj->sendMediaDataUpdate();
}
else {
// just navigate to the URL
obj->getMediaImpl(object_face)->navigateTo(url);
}
}
}
}
// Always handled as far as the OS is concerned.