@@ -324,6 +324,38 @@ void LLFloaterScriptSearch::onSearchBoxCommit()
324324 }
325325}
326326
327+ // / ---------------------------------------------------------------------------
328+
329+ class LLScriptMovedObserver : public LLInventoryObserver
330+ {
331+ public:
332+ LLScriptMovedObserver (LLPreviewLSL *floater) : mPreview (floater) { gInventory .addObserver (this ); }
333+ virtual ~LLScriptMovedObserver () { gInventory .removeObserver (this ); }
334+ virtual void changed (U32 mask);
335+
336+ private:
337+ LLPreviewLSL *mPreview ;
338+ };
339+
340+ void LLScriptMovedObserver::changed (U32 mask)
341+ {
342+ const std::set<LLUUID> &mChangedItemIDs = gInventory .getChangedIDs ();
343+ std::set<LLUUID>::const_iterator it;
344+
345+ const LLUUID &item_id = mPreview ->getScriptID ();
346+
347+ for (it = mChangedItemIDs .begin (); it != mChangedItemIDs .end (); it++)
348+ {
349+ if (*it == item_id)
350+ {
351+ if ((mask & (LLInventoryObserver::STRUCTURE)) != 0 )
352+ {
353+ mPreview ->setDirty ();
354+ }
355+ }
356+ }
357+ }
358+
327359// / ---------------------------------------------------------------------------
328360// / LLScriptEdCore
329361// / ---------------------------------------------------------------------------
@@ -1554,6 +1586,14 @@ LLPreviewLSL::LLPreviewLSL(const LLSD& key )
15541586 mPendingUploads(0 )
15551587{
15561588 mFactoryMap [" script panel" ] = LLCallbackMap (LLPreviewLSL::createScriptEdPanel, this );
1589+
1590+ mItemObserver = new LLScriptMovedObserver (this );
1591+ }
1592+
1593+ LLPreviewLSL::~LLPreviewLSL ()
1594+ {
1595+ delete mItemObserver ;
1596+ mItemObserver = NULL ;
15571597}
15581598
15591599// virtual
@@ -1584,7 +1624,12 @@ void LLPreviewLSL::draw()
15841624 setTitle (LLTrans::getString (" ScriptWasDeleted" ));
15851625 mScriptEd ->setItemRemoved (TRUE );
15861626 }
1587-
1627+ if (mDirty )
1628+ {
1629+ std::string item_path = get_category_path (item->getParentUUID ());
1630+ getChild<LLUICtrl>(" path_txt" )->setValue (item_path);
1631+ getChild<LLUICtrl>(" path_txt" )->setToolTip (item_path);
1632+ }
15881633 LLPreview::draw ();
15891634}
15901635// virtual
@@ -1870,7 +1915,8 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) :
18701915 mPendingUploads(0 ),
18711916 mIsModifiable(FALSE ),
18721917 mIsNew(false ),
1873- mIsSaving(FALSE )
1918+ mIsSaving(FALSE ),
1919+ mObjectName(" " )
18741920{
18751921 mFactoryMap [" script ed panel" ] = LLCallbackMap (LLLiveLSLEditor::createScriptEdPanel, this );
18761922}
@@ -2007,6 +2053,7 @@ void LLLiveLSLEditor::loadAsset()
20072053 }
20082054
20092055 refreshFromItem ();
2056+ getChild<LLUICtrl>(" obj_name" )->setValue (mObjectName );
20102057 // This is commented out, because we don't completely
20112058 // handle script exports yet.
20122059 /*
0 commit comments