From e7e974d6c9e8b548fe2542f767c99dc27bc7cf8f Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Tue, 23 Nov 2010 20:08:50 +0200
Subject: [PATCH] STORM-378 FIXED Added playing snapshot animation and sound
 when snapshot floater is open or refreshed and a snapshot is actually taken.
 Removed animation upon saving and sending a snapshot.

---
 indra/newview/llfloaterpostcard.cpp |  4 +---
 indra/newview/llfloatersnapshot.cpp | 11 ++++-------
 indra/newview/llviewermenufile.cpp  |  2 --
 3 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp
index e8e9f769128..220d33016a7 100644
--- a/indra/newview/llfloaterpostcard.cpp
+++ b/indra/newview/llfloaterpostcard.cpp
@@ -361,9 +361,7 @@ void LLFloaterPostcard::sendPostcard()
 	{
 		gAssetStorage->storeAssetData(mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)this, FALSE);
 	}
-	
-	// give user feedback of the event
-	gViewerWindow->playSnapshotAnimAndSound();
+
 	LLUploadDialog::modalUploadDialog(getString("upload_message"));
 
 	// don't destroy the window until the upload is done
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 51ee38bd653..d55272c5589 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1004,7 +1004,6 @@ void LLSnapshotLivePreview::saveTexture()
 				    LLFloaterPerms::getEveryonePerms(),
 				    "Snapshot : " + pos_string,
 				    callback, expected_upload_cost, userdata);
-		gViewerWindow->playSnapshotAnimAndSound();
 	}
 	else
 	{
@@ -1026,10 +1025,6 @@ BOOL LLSnapshotLivePreview::saveLocal()
 	mDataSize = 0;
 	updateSnapshot(FALSE, FALSE);
 
-	if(success)
-	{
-		gViewerWindow->playSnapshotAnimAndSound();
-	}
 	return success;
 }
 
@@ -1049,8 +1044,6 @@ void LLSnapshotLivePreview::saveWeb()
 
 	LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(),
 		boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4));
-
-	gViewerWindow->playSnapshotAnimAndSound();
 }
 
 void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z)
@@ -1540,6 +1533,8 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data)
 	if (previewp && view)
 	{
 		previewp->updateSnapshot(TRUE);
+
+		gViewerWindow->playSnapshotAnimAndSound();
 	}
 }
 
@@ -2209,6 +2204,8 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
 	gSnapshotFloaterView->setEnabled(TRUE);
 	gSnapshotFloaterView->setVisible(TRUE);
 	gSnapshotFloaterView->adjustToFitScreen(this, FALSE);
+
+	gViewerWindow->playSnapshotAnimAndSound();
 }
 
 void LLFloaterSnapshot::onClose(bool app_quitting)
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 237aa39e6e6..048691696bb 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -404,8 +404,6 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
 									   gSavedSettings.getBOOL("RenderUIInSnapshot"),
 									   FALSE))
 		{
-			gViewerWindow->playSnapshotAnimAndSound();
-			
 			LLPointer<LLImageFormatted> formatted;
 			switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat")))
 			{
-- 
GitLab