diff options
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llinventorybridge.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 18 | ||||
| -rw-r--r-- | indra/newview/llpreviewscript.h | 4 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 3 | 
5 files changed, 30 insertions, 7 deletions
| diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f4bf38f65d..8d130c08e5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1933,13 +1933,15 @@ BOOL LLItemBridge::removeItem()  	}  	// move it to the trash -	LLPreview::hide(mUUID, TRUE);  	LLInventoryModel* model = getInventoryModel();  	if(!model) return FALSE;  	const LLUUID& trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);  	LLViewerInventoryItem* item = getItem();  	if (!item) return FALSE; - +	if (item->getType() != LLAssetType::AT_LSL_TEXT) +	{ +		LLPreview::hide(mUUID, TRUE); +	}  	// Already in trash  	if (model->isObjectDescendentOf(mUUID, trash_id)) return FALSE; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 5230e8dff9..503fa28a33 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1395,7 +1395,11 @@ void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool f  		}  		// From purgeObject() -		LLPreview::hide(object_id); +		LLViewerInventoryItem *item = getItem(object_id); +		if (item && (item->getType() != LLAssetType::AT_LSL_TEXT)) +		{ +			LLPreview::hide(object_id, TRUE); +		}  		deleteObject(object_id, fix_broken_links, do_notify_observers);  	}  } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 5b1b356597..f28ffce602 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -375,7 +375,8 @@ LLScriptEdCore::LLScriptEdCore(  	mLiveFile(NULL),  	mLive(live),  	mContainer(container), -	mHasScriptData(FALSE) +	mHasScriptData(FALSE), +	mScriptRemoved(FALSE)  {  	setFollowsAll();  	setBorderVisible(FALSE); @@ -666,7 +667,7 @@ bool LLScriptEdCore::hasChanged()  void LLScriptEdCore::draw()  {  	BOOL script_changed	= hasChanged(); -	getChildView("Save_btn")->setEnabled(script_changed); +	getChildView("Save_btn")->setEnabled(script_changed && !mScriptRemoved);  	if( mEditor->hasFocus() )  	{ @@ -840,7 +841,7 @@ void LLScriptEdCore::addHelpItemToHistory(const std::string& help_string)  BOOL LLScriptEdCore::canClose()  { -	if(mForceClose || !hasChanged()) +	if(mForceClose || !hasChanged() || mScriptRemoved)  	{  		return TRUE;  	} @@ -1511,6 +1512,17 @@ BOOL LLPreviewLSL::postBuild()  	return LLPreview::postBuild();  } +void LLPreviewLSL::draw() +{ +	const LLInventoryItem* item = getItem(); +	if(!item) +	{ +		setTitle(LLTrans::getString("ScriptWasDeleted")); +		mScriptEd->setItemRemoved(TRUE); +	} + +	LLPreview::draw(); +}  // virtual  void LLPreviewLSL::callbackLSLCompileSucceeded()  { diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index a8c6a6eeeb..6b31125641 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -119,6 +119,8 @@ public:  	void 			setScriptName(const std::string& name){mScriptName = name;}; +	void 			setItemRemoved(bool script_removed){mScriptRemoved = script_removed;}; +  private:  	void		onBtnHelp();  	void		onBtnDynamicHelp(); @@ -163,6 +165,7 @@ private:  	BOOL			mHasScriptData;  	LLLiveLSLFile*	mLiveFile;  	LLUUID			mAssociatedExperience; +	BOOL			mScriptRemoved;  	LLScriptEdContainer* mContainer; // parent view @@ -198,6 +201,7 @@ public:  	/*virtual*/ BOOL postBuild();  protected: +	virtual void draw();  	virtual BOOL canClose();  	void closeIfNeeded(); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b19c6756bc..ac92e6fa9f 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2566,7 +2566,8 @@ This feature is currently in Beta. Please add your name to this [http://goo.gl/f  	<string name="SaveComplete">Save complete.</string>  	<string name="UploadFailed">File upload failed: </string>  	<string name="ObjectOutOfRange">Script (object out of range)</string> - +	<string name="ScriptWasDeleted">Script (deleted from inventory)</string> +	  	<!-- god tools -->  	<string name="GodToolsObjectOwnedBy">Object [OBJECT] owned by [OWNER]</string> | 
