diff options
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r-- | indra/newview/llfloatertools.cpp | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 3aef15a35c..3c3dfb760e 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -86,6 +86,7 @@ #include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llviewerwindow.h" +#include "llvovolume.h" #include "lluictrlfactory.h" // Globals @@ -1079,21 +1080,45 @@ void LLFloaterTools::getMediaState() } bool editable = (first_object->permModify() || selectedMediaEditable()); - + + // Check modify permissions and whether any selected objects are in + // the process of being fetched. If they are, then we're not editable + if (editable) + { + LLObjectSelection::iterator iter = selected_objects->begin(); + LLObjectSelection::iterator end = selected_objects->end(); + for ( ; iter != end; ++iter) + { + LLSelectNode* node = *iter; + LLVOVolume* object = dynamic_cast<LLVOVolume*>(node->getObject()); + if (NULL != object) + { + if (!object->permModify() || object->isMediaDataBeingFetched()) + { + editable = false; + break; + } + } + } + } + // Media settings - U8 has_media = (U8)0; - struct media_functor : public LLSelectedTEGetFunctor<U8> + bool bool_has_media = false; + struct media_functor : public LLSelectedTEGetFunctor<bool> { - U8 get(LLViewerObject* object, S32 face) + bool get(LLViewerObject* object, S32 face) { - return (object->getTE(face)->getMediaTexGen()); + LLTextureEntry *te = object->getTE(face); + if (te) + { + return te->hasMedia(); + } + return false; } } func; // check if all faces have media(or, all dont have media) - LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, has_media ); - bool bool_has_media = (has_media & LLTextureEntry::MF_HAS_MEDIA); - + LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, bool_has_media ); const LLMediaEntry default_media_data; |