From f1a6e776b41f15ffc0ed4cf245136143bcd1a852 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Mon, 25 Nov 2019 22:52:07 +0200
Subject: [PATCH] SL-12097, SL-12098, SL-12099 UI update for Texture, Animation
 and Sound upload fees

---
 indra/newview/llfloaterbvhpreview.cpp         |  9 +++++----
 indra/newview/llfloaterimagepreview.cpp       |  4 ++--
 indra/newview/llfloaternamedesc.cpp           |  7 +++++++
 indra/newview/llviewerassetupload.cpp         |  9 +++++++--
 indra/newview/llviewerassetupload.h           |  2 +-
 .../xui/en/floater_animation_anim_preview.xml | 19 ++++++++++++++++---
 .../xui/en/floater_animation_bvh_preview.xml  | 15 ++++++++++++++-
 .../default/xui/en/floater_image_preview.xml  | 15 ++++++++++++++-
 .../default/xui/en/floater_sound_preview.xml  | 19 ++++++++++++++++---
 .../newview/skins/default/xui/en/strings.xml  |  2 ++
 10 files changed, 84 insertions(+), 17 deletions(-)

diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index 1f54b5f8383..131d9b077bd 100644
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -68,7 +68,8 @@
 const S32 PREVIEW_BORDER_WIDTH = 2;
 const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
 const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
-const S32 PREF_BUTTON_HEIGHT = 16;
+const S32 PREVIEW_VPAD = 35;
+const S32 PREF_BUTTON_HEIGHT = 16 + 35;
 const S32 PREVIEW_TEXTURE_HEIGHT = 300;
 
 const F32 PREVIEW_CAMERA_DISTANCE = 4.f;
@@ -203,7 +204,7 @@ BOOL LLFloaterBvhPreview::postBuild()
 	setDefaultBtn();
 
 	mPreviewRect.set(PREVIEW_HPAD, 
-		PREVIEW_TEXTURE_HEIGHT,
+		PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD,
 		getRect().getWidth() - PREVIEW_HPAD, 
 		PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);
@@ -403,13 +404,13 @@ void LLFloaterBvhPreview::draw()
 		gGL.begin( LLRender::QUADS );
 		{
 			gGL.texCoord2f(0.f, 1.f);
-			gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
+			gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
 			gGL.texCoord2f(0.f, 0.f);
 			gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 			gGL.texCoord2f(1.f, 0.f);
 			gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
 			gGL.texCoord2f(1.f, 1.f);
-			gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT);
+			gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
 		}
 		gGL.end();
 
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index d4b0fa85ab7..696f748613e 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -63,8 +63,8 @@
 const S32 PREVIEW_BORDER_WIDTH = 2;
 const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
 const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
-const S32 PREVIEW_VPAD = -24;	// yuk, hard coded
-const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
+const S32 PREVIEW_VPAD = -24 + 35;	// yuk, hard coded
+const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16 + 35;
 const S32 PREVIEW_TEXTURE_HEIGHT = 320;
 
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index 89e93102dd5..87a741bb7bc 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -47,6 +47,7 @@
 #include "lluictrlfactory.h"
 #include "llstring.h"
 #include "llpermissions.h"
+#include "lltrans.h"
 
 // linden includes
 #include "llassetstorage.h"
@@ -125,6 +126,12 @@ BOOL LLFloaterNameDesc::postBuild()
 
 	S32 expected_upload_cost = getExpectedUploadCost();
 	getChild<LLUICtrl>("ok_btn")->setLabelArg("[AMOUNT]", llformat("%d", expected_upload_cost));
+
+	LLTextBox* info_text = getChild<LLTextBox>("info_text");
+	if (info_text)
+	{
+		info_text->setValue(LLTrans::getString("UploadFeeInfo"));
+	}
 	
 	setDefaultBtn("ok_btn");
 	
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 4cbb88d4f17..51c8f4ab794 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -309,11 +309,11 @@ std::string LLResourceUploadInfo::getDisplayName() const
 bool LLResourceUploadInfo::findAssetTypeOfExtension(const std::string& exten, LLAssetType::EType& asset_type)
 {
 	U32 codec;
-	return findAssetTypeAndCodecOfExtension(exten, asset_type, codec);
+	return findAssetTypeAndCodecOfExtension(exten, asset_type, codec, false);
 }
 
 // static
-bool LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(const std::string& exten, LLAssetType::EType& asset_type, U32& codec)
+bool LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(const std::string& exten, LLAssetType::EType& asset_type, U32& codec, bool bulk_upload)
 {
 	bool succ = false;
 
@@ -333,6 +333,11 @@ bool LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(const std::string& e
 		asset_type = LLAssetType::AT_ANIMATION; 
 		succ = true;
 	}
+	else if (!bulk_upload && (exten == "bvh"))
+	{
+		asset_type = LLAssetType::AT_ANIMATION;
+		succ = true;
+	}
 
 	return succ;
 }
diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h
index 6301359021b..08b03e30597 100644
--- a/indra/newview/llviewerassetupload.h
+++ b/indra/newview/llviewerassetupload.h
@@ -88,7 +88,7 @@ class LLResourceUploadInfo
     LLAssetID           getAssetId() const { return mAssetId; }
 
 	static bool			findAssetTypeOfExtension(const std::string& exten, LLAssetType::EType& asset_type);
-	static bool			findAssetTypeAndCodecOfExtension(const std::string& exten, LLAssetType::EType& asset_type, U32& codec);
+	static bool			findAssetTypeAndCodecOfExtension(const std::string& exten, LLAssetType::EType& asset_type, U32& codec, bool bulk_upload = true);
 
 protected:
     LLResourceUploadInfo(
diff --git a/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
index b5538a511c1..c4ffba33fd4 100644
--- a/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_animation_anim_preview.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- height="190"
+ height="180"
  layout="topleft"
  name="Anim Preview"
  help_topic="animation_anim_preview"
@@ -60,9 +60,9 @@
      height="22"
      label="Upload (L$[AMOUNT])"
      layout="topleft"
-     left="45"
+     left="35"
      name="ok_btn"
-     top_pad="60"
+     top_pad="15"
      width="150" />
     <button
      follows="right|bottom"
@@ -73,4 +73,17 @@
      name="cancel_btn"
      left_pad="5"
      width="90" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="35"
+     layout="topleft"
+     left="10"
+     mouse_opaque="false"
+     skip_link_underline="true"
+     name="info_text"
+     word_wrap="true"
+     top_pad="10"
+     width="270"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
index cb6b2f6ebcd..0c62bfe3040 100644
--- a/indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_animation_bvh_preview.xml
@@ -2,7 +2,7 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- height="610"
+ height="645"
  layout="topleft"
  name="Animation Preview"
  help_topic="animation_preview"
@@ -570,4 +570,17 @@ We recommend BVH files exported from Poser 4.
      name="cancel_btn"
      left="142"
      width="128" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="35"
+     layout="topleft"
+     left="10"
+     mouse_opaque="false"
+     skip_link_underline="true"
+     name="info_text"
+     word_wrap="true"
+     top_pad="10"
+     width="270"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml
index 44d2c14cc8d..3daff1a132f 100644
--- a/indra/newview/skins/default/xui/en/floater_image_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml
@@ -2,7 +2,7 @@
 <floater
  legacy_header_height="18"
  can_minimize="false"
- height="460"
+ height="495"
  layout="topleft"
  name="Image Preview"
  help_topic="image_preview"
@@ -148,4 +148,17 @@ Try saving image as 24 bit Targa (.tga).
      name="ok_btn"
      top_delta="0"
      width="125" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="35"
+     layout="topleft"
+     left="10"
+     mouse_opaque="false"
+     skip_link_underline="true"
+     name="info_text"
+     word_wrap="true"
+     top_pad="10"
+     width="270"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_sound_preview.xml b/indra/newview/skins/default/xui/en/floater_sound_preview.xml
index af791466b6b..3889b975a91 100644
--- a/indra/newview/skins/default/xui/en/floater_sound_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_sound_preview.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
  legacy_header_height="18"
- height="190"
+ height="180"
  layout="topleft"
  name="Sound Preview"
  help_topic="sound_preview"
@@ -60,9 +60,9 @@
      height="22"
      label="Upload (L$[AMOUNT])"
      layout="topleft"
-     left="45"
+     left="35"
      name="ok_btn"
-     top_pad="60"
+     top_pad="15"
      width="150" />
     <button
      follows="right|bottom"
@@ -73,4 +73,17 @@
      name="cancel_btn"
      left_pad="5"
      width="90" />
+    <text
+     type="string"
+     length="1"
+     follows="left|top"
+     height="35"
+     layout="topleft"
+     left="10"
+     mouse_opaque="false"
+     skip_link_underline="true"
+     name="info_text"
+     word_wrap="true"
+     top_pad="10"
+     width="270"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 942fb925b54..543edccad85 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2365,6 +2365,8 @@ If you continue to receive this message, please contact Second Life support for
 	<string name="MarketplaceNoStock">out of stock</string>
 	<string name="MarketplaceUpdating">updating...</string>
 
+	<string name="UploadFeeInfo">Fee is based on your subscription level. Higher levels are charged lower fees. [https://secondlife.com/my/account/membership.php? Learn more]</string>
+
 	<string name="Open landmarks">Open landmarks</string>
   <string name="Unconstrained">Unconstrained</string>
 
-- 
GitLab